blob: fa3f00635c5d3d5b19e19fb07abd00205ee51e45 (
plain)
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
|
#!/bin/bash
set -x
#sudo apt-get -y install libpython2.7-dev
#VIRL_VMS="10.30.51.53,10.30.51.51,10.30.51.52"
#IFS=',' read -ra ADDR <<< "${VIRL_VMS}"
#
function ssh_do() {
echo
echo "### " ssh $@
ssh -i priv_key -o StrictHostKeyChecking=no $@
}
#for addr in "${ADDR[@]}"; do
# echo
# echo ${addr}
# echo
#
# ssh_do cisco@${addr} hostname || true
# ssh_do cisco@${addr} "ifconfig -a" || true
# ssh_do cisco@${addr} "lspci -Dnn | grep 0200" || true
# ssh_do cisco@${addr} "free -m" || true
# ssh_do cisco@${addr} "cat /proc/meminfo" || true
# ssh_do cisco@${addr} "dpkg -l vpp\*" || true
# ssh_do cisco@${addr} "lshw -c network" || true
# ssh_do cisco@${addr} "sudo -S sh -c 'echo exec show hardware | vpp_api_test '"
#done
VIRL_SERVER=10.30.51.28
VIRL_USERNAME=jenkins-in
VIRL_PKEY=priv_key
rm -f ${VIRL_PKEY}
cat > ${VIRL_PKEY} <<EOF
-----BEGIN RSA PRIVATE KEY-----
MIIEpQIBAAKCAQEA+IHXq87GcqMR1C47rzx6Cbip5Ghq8pKrbqKrP5Nf41HcYrT6
GOXl9nFWKsMOzIlIn+8y7Il27eZh7csQGApbg8QLiHMtcYEmWNzKZpkqg4nuAPxX
VXwlKgnKX902SrET9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azS
NqHE7hOq3giVfgg+C12hCKMCgYEAtu9dbYcG5owbehxzfRI2/OCRsjz/t1bv1seM
xVMND4XI6xb/apBWAZgZpIFrqrWoIBM3ptfsKipZe91ngBPUnL9s0Dolx452RVAj
yctHB8uRxWYgqDkjsxtzXf1HnZBBkBS8CUzYj+hdfuddoeKLaY3invXLCiV+PpXS
U4KAK9kCgYEAtSv0m5+Fg74BbAiFB6kCh11FYkW94YI6B/E2D/uVTD5dJhyEUFgZ
cWsudXjMki8734WSpMBqBp/J8wG3C9ZS6IpQD+U7UXA+roB7Qr+j4TqtWfM+87Rh
maOpG56uAyR0w5Z9BhwzA3VakibVk9KwDgZ29WtKFzuATLFnOtCS46E=
-----END RSA PRIVATE KEY-----
EOF
chmod 600 priv_key
# Temporarily download VPP packages from nexus.fd.io
rm -f *.deb
wget -q "https://nexus.fd.io/service/local/repositories/fd.io.dev/content/io/fd/vpp/vpp/1.0.0-185~gca0f3b3_amd64/vpp-1.0.0-185~gca0f3b3_amd64.deb" || exit
wget -q "https://nexus.fd.io/service/local/repositories/fd.io.dev/content/io/fd/vpp/vpp-dbg/1.0.0-185~gca0f3b3_amd64/vpp-dbg-1.0.0-185~gca0f3b3_amd64.deb" || exit
wget -q "https://nexus.fd.io/service/local/repositories/fd.io.dev/content/io/fd/vpp/vpp-dev/1.0.0-185~gca0f3b3_amd64/vpp-dev-1.0.0-185~gca0f3b3_amd64.deb" || exit
wget -q "https://nexus.fd.io/service/local/repositories/fd.io.dev/content/io/fd/vpp/vpp-dpdk-dev/1.0.0-185~gca0f3b3_amd64/vpp-dpdk-dev-1.0.0-185~gca0f3b3_amd64.deb" || exit
wget -q "https://nexus.fd.io/service/local/repositories/fd.io.dev/content/io/fd/vpp/vpp-dpdk-dkms/1.0.0-185~gca0f3b3_amd64/vpp-dpdk-dkms-1.0.0-185~gca0f3b3_amd64.deb" || exit
wget -q "https://nexus.fd.io/service/local/repositories/fd.io.dev/content/io/fd/vpp/vpp-lib/1.0.0-185~gca0f3b3_amd64/vpp-lib-1.0.0-185~gca0f3b3_amd64.deb" || exit
VPP_DEBS=(*.deb)
echo ${VPP_DEBS[@]}
VIRL_DIR_LOC="/tmp"
VPP_DEBS_FULL=(${VPP_DEBS[@]})
# Prepend directory location at remote host to deb file list
for index in "${!VPP_DEBS_FULL[@]}"; do
VPP_DEBS_FULL[${index}]=${VIRL_DIR_LOC}/${VPP_DEBS_FULL[${index}]}
done
echo "Updated file names: " ${VPP_DEBS_FULL[@]}
cat ${VIRL_PKEY}
# Copy the files to VIRL host
scp -i ${VIRL_PKEY} -o StrictHostKeyChecking=no *.deb \
${VIRL_USERNAME}@${VIRL_SERVER}:${VIRL_DIR_LOC}/
result=$?
if [ "${result}" -ne "0" ]; then
echo "Failed to copy vpp deb files to virl host"
echo ${result}
exit ${result}
fi
# Start a simulation on VIRL server
echo "Starting simulation on VIRL server"
function stop_virl_simulation {
ssh -i priv_key -o StrictHostKeyChecking=no ${VIRL_USERNAME}@${VIRL_SERVER}\
"/home/jenkins-in/testcase-infra/bin/stop-testcase ${VIRL_SID}"
}
VIRL_SID=$(ssh -i priv_key -o StrictHostKeyChecking=no \
${VIRL_USERNAME}@${VIRL_SERVER} \
"/home/jenkins-in/testcase-infra/bin/start-testcase simple-ring ${VPP_DEBS_FULL[@]}")
retval=$?
if [ "$?" -ne "0" ]; then
echo "VIRL simulation start failed"
exit ${retval}
fi
if [ "x${VIRL_SID}" == "x" ]; then
echo "No VIRL session ID reported."
exit 127
fi
# Upon script exit, cleanup the simulation execution
trap stop_virl_simulation EXIT
echo ${VIRL_SID}
ssh_do ${VIRL_USERNAME}@${VIRL_SERVER} cat /scratch/${VIRL_SID}/topology.yaml
# Download the topology file from virl session
scp -i ${VIRL_PKEY} -o StrictHostKeyChecking=no \
${VIRL_USERNAME}@${VIRL_SERVER}:/scratch/${VIRL_SID}/topology.yaml \
topologies/enabled/topology.yaml
retval=$?
if [ "$?" -ne "0" ]; then
echo "Failed to copy topology file from VIRL simulation"
exit ${retval}
fi
virtualenv env
. env/bin/activate
echo pip install
pip install -r requirements.txt
PYTHONPATH=`pwd` pybot -L TRACE \
-v TOPOLOGY_PATH:topologies/enabled/topology.yaml \
--include vm_env \
--include 3_NODE_SINGLE_LINK_TOPO \
--exclude 3_node_double_link_topoNOT3_node_single_link_topo \
--exclude PERFTEST \
tests/
|