diff options
author | kubi <jean.gaoliang@huawei.com> | 2015-12-14 19:51:45 +0800 |
---|---|---|
committer | liang gao <jean.gaoliang@huawei.com> | 2015-12-26 09:59:18 +0000 |
commit | d09c1cf0ed3a1af45546129ecd8d648ce703f650 (patch) | |
tree | f1f122a7b3ad3c7169644b6f9f5564d536171f46 /yardstick/benchmark/scenarios/compute/unixbench_benchmark.bash | |
parent | 20ff6c8a9b3b073beea7651626f63b4283147d6f (diff) |
add scenario and sample file for Unixbench.
JIRA:YARDSTICK-184
Change-Id: Iedd4a3708e08305b1c8fa7a8e1766ceef03ab8bb
Signed-off-by: kubi <jean.gaoliang@huawei.com>
Diffstat (limited to 'yardstick/benchmark/scenarios/compute/unixbench_benchmark.bash')
-rw-r--r-- | yardstick/benchmark/scenarios/compute/unixbench_benchmark.bash | 46 |
1 files changed, 46 insertions, 0 deletions
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 |