blob: c66b5a05d010e3b4bf532ef86aec584f169c4555 [file] [log] [blame]
Alex2c8b8802022-10-20 14:07:15 -05001#!/bin/bash
2function kexec() {
3 kubectl exec -n qa-space --tty --stdin rally -- bash -c "${1}"
4}
5
6# consts
7concurrency=10
8run_times=200
9
10tenv=mos
11. /opt/si-tests/.sivenv/bin/activate
12cd $MY_PROJFOLDER/tmp
13. $MY_PROJFOLDER/env.sh
14. $MY_PROJFOLDER/envs/${tenv}rc
15# Just in case
16unset TARGET_CLUSTER
17unset TARGET_NAMESPACE
18dryrun=0
19#
20if [ ! -z ${1+x} ]; then
21 echo "# Using Dry-run mode"
22 dryrun=1
23fi
24
25##
26echo "### Checking rally environments"
27status=$(kubectl -n qa-space get pod | grep rally | tr -s " " | cut -d' ' -f3)
28if [ ${status} != "Running" ]; then
29 echo "# 'rally' container is not Running"
30 echo "# Consider creating resources and/or creating environments"
31 exit 1
32fi
33
34###
35uuid=$(kubectl exec -n qa-space --stdin rally -- rally env list | grep openstack | cut -d' ' -f2)
36if [ -z ${uuid} ]; then
37 echo "# Openstack env not found. Please, run 'create-rally-deployments.sh'"
38 kubectl exec -n qa-space --stdin rally -- rally env list
39else
40 echo "# Running Openstack performance tests"
41 if [ ${dryrun} == 1 ]; then
42 scenario=/rally/rally-files/openstack-mos-scn-i1.json
43 else
44 scenario=/rally/rally-files/openstack-mos-scn.json.clean
45 fi
46 task_scn=/artifacts/openstack-scenario.json
47 # prepare scenario
48 kexec "cp -v ${scenario} ${task_scn}"
49 declare $(kubectl exec toolset --stdin -n qa-space -- bash -c "cat /artifacts/cmp-check/cvp.manifest")
50 echo "# Updating network UUID to ${fixed_net_left_id}"
51 kexec "sed -i \"s/fixed-net-id/${fixed_net_left_id}/g\" ${task_scn}"
52 echo "# Updating concurrency to ${concurrency}"
53 kexec "sed -i \"s/concurrent-threads/${concurrency}/g\" ${task_scn}"
54 echo "# Updating running times to ${run_times}"
55 kexec "sed -i \"s/run-times-number/${run_times}/g\" ${task_scn}"
56 # run
57 kexec "rally env use ${uuid}; rally task start ${task_scn}"
58 # generate report
59 echo "# Generating report"
60 fname=$MY_CLIENTSHORTNAME-mos-openstack-perf-latest.html
61 kubectl exec -n qa-space --stdin rally -- rally task report $(kubectl exec -n qa-space --stdin rally -- rally task list | grep openstack | cut -d' ' -f2 | tail -1) --html-static --out ${fname}
62 kubectl cp qa-space/rally:/rally/${fname} $MY_PROJFOLDER/reports/${fname}
63fi