blob: 26c6fdcfe05ab85ff3b4d5beb2264d91b034d5d5 (
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
|
#!/bin/bash
set -e
sshpass -p root ssh root@10.1.0.50 \
"mkdir -p /etc/yardstick; rm -rf /etc/yardstick/admin.conf"
sshpass -p root ssh root@10.1.0.50 \
kubectl config set-cluster yardstick --server=127.0.0.1:8080 --insecure-skip-tls-verify=true --kubeconfig=/etc/yardstick/admin.conf
sshpass -p root ssh root@10.1.0.50 \
kubectl config set-context yardstick --cluster=yardstick --kubeconfig=/etc/yardstick/admin.conf
sshpass -p root ssh root@10.1.0.50 \
kubectl config use-context yardstick --kubeconfig=/etc/yardstick/admin.conf
if [ ! -n "$redirect" ]; then
redirect="/dev/stdout"
fi
if [ ! -n "$DOCKER_TAG" ]; then
DOCKER_TAG='latest'
fi
if [ ! -n "$NODE_NAME" ]; then
NODE_NAME='arm-virutal03'
fi
if [ ! -n "$DEPLOY_SCENARIO" ]; then
DEPLOY_SCENARIO='k8-nosdn-lb-noha_daily'
fi
if [ ! -n "$YARDSTICK_DB_BACKEND" ]; then
YARDSTICK_DB_BACKEND='-i 104.197.68.199:8086'
fi
# Pull the image with correct tag
DOCKER_REPO='opnfv/yardstick'
if [ "$(uname -m)" = 'aarch64' ]; then
DOCKER_REPO="${DOCKER_REPO}_$(uname -m)"
fi
echo "Yardstick: Pulling image ${DOCKER_REPO}:${DOCKER_TAG}"
sshpass -p root ssh root@10.1.0.50 \
docker pull ${DOCKER_REPO}:$DOCKER_TAG >$redirect
if [ ! -n "$BRANCH" ]; then
BRANCH=master
fi
opts="--name=yardstick --privileged=true --net=host -d -it "
envs="-e YARDSTICK_BRANCH=${BRANCH} -e BRANCH=${BRANCH} \
-e NODE_NAME=${NODE_NAME} \
-e DEPLOY_SCENARIO=${DEPLOY_SCENARIO}"
rc_file_vol="-v /etc/yardstick/admin.conf:/etc/yardstick/admin.conf"
cacert_file_vol=""
map_log_dir=""
sshkey=""
YARDSTICK_SCENARIO_SUITE_NAME="opnfv_k8-nosdn-lb-noha_daily.yaml"
# map log directory
branch=${BRANCH##*/}
#branch="master"
dir_result="${HOME}/opnfv/yardstick/results/${branch}"
mkdir -p ${dir_result}
sudo rm -rf ${dir_result}/*
map_log_dir="-v ${dir_result}:/tmp/yardstick"
# Run docker
cmd="docker rm -f yardstick || true"
sshpass -p root ssh root@10.1.0.50 \
${cmd}
cmd="sudo docker run ${opts} ${envs} ${rc_file_vol} ${cacert_file_vol} ${map_log_dir} ${sshkey} ${DOCKER_REPO}:${DOCKER_TAG} /bin/bash"
echo "Yardstick: Running docker cmd: ${cmd}"
sshpass -p root ssh root@10.1.0.50 \
${cmd}
cmd='sudo docker exec yardstick sed -i.bak "/# execute tests/i\sed -i.bak \"s/openretriever\\\/yardstick/openretriever\\\/yardstick_aarch64/g\" \
$\{YARDSTICK_REPO_DIR\}/tests/opnfv/test_cases/opnfv_yardstick_tc080.yaml" /usr/local/bin/exec_tests.sh'
sshpass -p root ssh root@10.1.0.50 \
${cmd}
echo "Yardstick: run tests: ${YARDSTICK_SCENARIO_SUITE_NAME}"
cmd="sudo docker exec yardstick exec_tests.sh ${YARDSTICK_DB_BACKEND} ${YARDSTICK_SCENARIO_SUITE_NAME}"
sshpass -p root ssh root@10.1.0.50 \
${cmd}
cmd="docker rm -f yardstick"
sshpass -p root ssh root@10.1.0.50 \
${cmd}
echo "Yardstick: done!"
|