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