blob: 3f0cdba1fe41e9e9be09da2df0e2f46fe12d0a12 [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
Ievgeniia Zadorozhna35739b22025-03-28 20:15:59 +010049 # prepare scenario
50 kexec "cp -v ${scenario} ${task_scn}"
51 default_az=$(kubectl exec toolset --stdin -n qa-space -- bash -c "openstack compute service list --service nova-compute -c Zone -f value | uniq | head -n 1")
Alex2c8b8802022-10-20 14:07:15 -050052 declare $(kubectl exec toolset --stdin -n qa-space -- bash -c "cat /artifacts/cmp-check/cvp.manifest")
53 echo "# Updating network UUID to ${fixed_net_left_id}"
54 kexec "sed -i \"s/fixed-net-id/${fixed_net_left_id}/g\" ${task_scn}"
Ievgeniia Zadorozhna35739b22025-03-28 20:15:59 +010055 echo "# Updating AZ name to ${default_az}"
56 kexec "sed -i \"s/default-az-name/${default_az}/g\" ${task_scn}"
Alex2c8b8802022-10-20 14:07:15 -050057 echo "# Updating concurrency to ${concurrency}"
58 kexec "sed -i \"s/concurrent-threads/${concurrency}/g\" ${task_scn}"
59 echo "# Updating running times to ${run_times}"
60 kexec "sed -i \"s/run-times-number/${run_times}/g\" ${task_scn}"
61 # run
62 kexec "rally env use ${uuid}; rally task start ${task_scn}"
63 # generate report
64 echo "# Generating report"
pkazlenka4690e832024-10-24 13:28:37 +020065 fname="$MY_CLIENTSHORTNAME-mos-openstack-perf-$(get_timestamp).html"
Alex2c8b8802022-10-20 14:07:15 -050066 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}
67 kubectl cp qa-space/rally:/rally/${fname} $MY_PROJFOLDER/reports/${fname}
pkazlenka4690e832024-10-24 13:28:37 +020068 update_latest_report_to "$MY_PROJFOLDER/reports/${fname}"
Alex2c8b8802022-10-20 14:07:15 -050069fi