From d09c1cf0ed3a1af45546129ecd8d648ce703f650 Mon Sep 17 00:00:00 2001 From: kubi Date: Mon, 14 Dec 2015 19:51:45 +0800 Subject: add scenario and sample file for Unixbench. JIRA:YARDSTICK-184 Change-Id: Iedd4a3708e08305b1c8fa7a8e1766ceef03ab8bb Signed-off-by: kubi --- .../scenarios/compute/unixbench_benchmark.bash | 46 ++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 yardstick/benchmark/scenarios/compute/unixbench_benchmark.bash (limited to 'yardstick/benchmark/scenarios/compute/unixbench_benchmark.bash') diff --git a/yardstick/benchmark/scenarios/compute/unixbench_benchmark.bash b/yardstick/benchmark/scenarios/compute/unixbench_benchmark.bash new file mode 100644 index 000000000..5a5dbc394 --- /dev/null +++ b/yardstick/benchmark/scenarios/compute/unixbench_benchmark.bash @@ -0,0 +1,46 @@ +#!/bin/bash + +############################################################################## +# Copyright (c) 2015 Huawei Technologies Co.,Ltd and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +set -e + +# Commandline arguments +OPTIONS="$@" +OUTPUT_FILE=/tmp/unixbench-out.log + +# run unixbench test +run_unixbench() +{ + cd /opt/tempT/UnixBench/ + ./Run $OPTIONS > $OUTPUT_FILE +} + +# write the result to stdout in json format +output_json() +{ + single_score=$(awk '/Score/{print $7}' $OUTPUT_FILE | head -1 ) + parallel_score=$(awk '/Score/{print $7}' $OUTPUT_FILE | tail -1 ) + echo -e "{ \ + \"single_score\":\"$single_score\", \ + \"parallel_score\":\"$parallel_score\" \ + }" +} + +# main entry +main() +{ + # run the test + run_unixbench + + # output result + output_json +} + +main -- cgit 1.2.3-korg