-
Notifications
You must be signed in to change notification settings - Fork 6
/
run_test.sh
executable file
·120 lines (104 loc) · 2.66 KB
/
run_test.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
AVAILABLE_TESTS="install|test_code_quality|test_ptf_bmv2|test_ptf_tofino|test_core|test_ui|test_ui_tofino|dpdk_install|test_core_dpdk|cleanup|all"
if [[ ! "$1" =~ $AVAILABLE_TESTS ]]
then
echo "Usage: $0 [ ${AVAILABLE_TESTS//|/ | } ]"
exit 1
fi
source tests/ci_tests.sh
if [[ "$1" == "install" ]]
then
set -e
job_prepare
job_install
printf "${GREEN} [SUCCESS] Succeeded installing p4sta ci test environment \n${NC}"
exit 0
fi
if [[ "$1" == "test_code_quality" ]]
then
set -e
job_code_quality
printf "${GREEN} [SUCCESS] Succeeded test_code_quality \n${NC}"
exit 0
fi
if [[ "$1" == "test_ptf_bmv2" ]]
then
set -e
job_ptf_bmv2
printf "${GREEN} [SUCCESS] Succeeded test_ptf_bmv2 \n${NC}"
exit 0
fi
if [[ "$1" == "test_ptf_tofino" ]]
then
set -e
job_ptf_tofino
printf "${GREEN} [SUCCESS] Succeeded test_ptf_tofino \n${NC}"
exit 0
fi
if [[ "$1" == "test_core" ]]
then
set -e
job_test_core
printf "${GREEN} [SUCCESS] Succeeded test_core \n${NC}"
exit 0
fi
if [[ "$1" == "test_ui" ]]
then
set -e
job_test_django_bmv2
printf "${GREEN} [SUCCESS] Succeeded test_ui \n${NC}"
exit 0
fi
if [[ "$1" == "test_ui_tofino" ]]
then
set -e
job_test_django_tofino
printf "${GREEN} [SUCCESS] Succeeded test_ui_tofino \n${NC}"
exit 0
fi
if [[ "$1" == "dpdk_install" ]]
then
set -e
job_dpdk_install
printf "${GREEN} [SUCCESS] Succeeded dpdk_install \n${NC}"
exit 0
fi
if [[ "$1" == "test_core_dpdk" ]]
then
set -e
job_test_core_dpdk
printf "${GREEN} [SUCCESS] Succeeded test_core_dpdk \n${NC}"
exit 0
fi
if [[ "$1" == "cleanup" ]]
then
set -e
job_cleanup
printf "${GREEN} [SUCCESS] Succeeded job_cleanup \n${NC}"
exit 0
fi
if [[ "$1" == "all" ]]
then
set -e
job_prepare
job_install
printf "${GREEN} [SUCCESS] Succeeded installing p4sta ci test environment \n${NC}"
job_code_quality
printf "${GREEN} [SUCCESS] Succeeded test_code_quality \n${NC}"
job_ptf_bmv2
printf "${GREEN} [SUCCESS] Succeeded test_ptf_bmv2 \n${NC}"
job_ptf_tofino
printf "${GREEN} [SUCCESS] Succeeded test_ptf_tofino \n${NC}"
job_test_core
printf "${GREEN} [SUCCESS] Succeeded test_core \n${NC}"
job_test_django_bmv2
printf "${GREEN} [SUCCESS] Succeeded test_ui \n${NC}"
job_test_django_tofino
printf "${GREEN} [SUCCESS] Succeeded test_ui_tofino \n${NC}"
job_dpdk_install
printf "${GREEN} [SUCCESS] Succeeded dpdk_install \n${NC}"
job_test_core_dpdk
printf "${GREEN} [SUCCESS] Succeeded test_core_dpdk \n${NC}"
job_cleanup
printf "${GREEN} [SUCCESS] Succeeded in all Test Jobs \n${NC}"
exit 0
fi