From 73e69966f14f8c6a5769ba7678c214e53619ab51 Mon Sep 17 00:00:00 2001 From: Pavel Boldin Date: Sun, 27 Sep 2015 07:13:12 +0300 Subject: [PATCH] workload: fix and rename benchmark script Benchmark script uploaded by the custom_image is installing a benchmark and should be named accordingly. Also, fix the size of the read benchmark. Change-Id: Id75db4b06acfa04145feb3bf07ea6a9c91b03d9f Closes-Bug: #1502838 --- rally-jobs/extra/install_benchmark.sh | 24 +++++++++++++++++++ rally-jobs/rally-neutron.yaml | 4 ++-- .../plugins/openstack/scenarios/vm/vmtasks.py | 2 +- 3 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 rally-jobs/extra/install_benchmark.sh diff --git a/rally-jobs/extra/install_benchmark.sh b/rally-jobs/extra/install_benchmark.sh new file mode 100644 index 00000000..51c998be --- /dev/null +++ b/rally-jobs/extra/install_benchmark.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +set -e + +main() { + cat > ~/dd_test.sh <<'EOF' +#!/bin/sh +time_seconds(){ (time -p $1 ) 2>&1 |awk '/real/{print $2}'; } +file=/tmp/test.img +c=1000 #1GB +write_seq_1gb=$(time_seconds "dd if=/dev/zero of=$file bs=1M count=$c") +read_seq_1gb=$(time_seconds "dd if=$file of=/dev/null bs=1M count=$c") +[ -f $file ] && rm $file + +echo "{ + \"write_seq_1gb\": $write_seq_1gb, + \"read_seq_1gb\": $read_seq_1gb + }" +EOF + + chmod a+x ~/dd_test.sh +} + +main diff --git a/rally-jobs/rally-neutron.yaml b/rally-jobs/rally-neutron.yaml index 112d084c..ef64592b 100644 --- a/rally-jobs/rally-neutron.yaml +++ b/rally-jobs/rally-neutron.yaml @@ -603,8 +603,8 @@ context: image_command_customizer: command: - local_path: "/home/jenkins/.rally/extra/script_benchmark.sh" - remote_path: "./script_benchmark.sh" + local_path: "/home/jenkins/.rally/extra/install_benchmark.sh" + remote_path: "./install_benchmark.sh" flavor: name: "m1.tiny" image: diff --git a/rally/plugins/openstack/scenarios/vm/vmtasks.py b/rally/plugins/openstack/scenarios/vm/vmtasks.py index 0c50e412..2a76779b 100644 --- a/rally/plugins/openstack/scenarios/vm/vmtasks.py +++ b/rally/plugins/openstack/scenarios/vm/vmtasks.py @@ -199,7 +199,7 @@ class VMTasks(vm_utils.VMScenario): def boot_runcommand_delete_custom_image(self, **kwargs): """Boot a server from a custom image, run a command that outputs JSON. - Example Script in rally-jobs/extra/script_benchmark.sh + Example Script in rally-jobs/extra/install_benchmark.sh """ return self.boot_runcommand_delete(