-
Notifications
You must be signed in to change notification settings - Fork 21
/
run.sh
executable file
·61 lines (50 loc) · 1.17 KB
/
run.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/bash
#
# run.sh
#
if [ "$EUID" -ne 0 ]; then
echo "Please run this script with sudo."
exit
fi
set -o errexit
set -o nounset
set -o pipefail
export COMNETSEMU_AUTOTEST_MODE=1
PYTHON="python3"
usage() {
echo "Usage: $0 [options]"
echo ""
echo "Options:"
echo "-a Run additional examples."
}
run_examples() {
echo "*** Running basic functional examples of the emulator."
$PYTHON ./dockerhost.py
$PYTHON ./dockerindocker.py
echo "- Run ./dockerhost_manage_appcontainer.py"
$PYTHON ./dockerhost_manage_appcontainer.py
pushd "$PWD"
cd ./echo_server/
echo "- Run ./echo_server."
if [[ "$(docker images -q echo_server:latest 2>/dev/null)" == "" ]]; then
bash ./build_docker_images.sh
fi
$PYTHON ./topology.py
popd
}
run_additional_examples() {
echo "*** Run additional examples."
echo "- Run ./mininet_demystify."
bash ./mininet_demystify/run.sh
bash ./mininet_demystify/clean.sh
}
if [[ "$#" -eq 0 ]]; then
run_examples
elif [[ $1 == "-a" ]]; then
run_examples
run_additional_examples
else
echo "ERROR: Unknown option."
usage
fi
export COMNETSEMU_AUTOTEST_MODE=0