]> xenbits.xensource.com Git - people/dariof/osstest.git/commitdiff
mg-unixbench-download: make it generic
authorDario Faggioli <dario.faggioli@citrix.com>
Wed, 25 Jun 2014 15:16:02 +0000 (17:16 +0200)
committerDario Faggioli <dario.faggioli@citrix.com>
Thu, 26 Jun 2014 12:43:44 +0000 (14:43 +0200)
so that it can handle the retrieval of different
benchmarks. The name of the benchmark to fetch should
be among the supported one, and is passed as an argument.

XXX This is a stab. As detailed in the cover letter, I
    just wanted to give an idea of how things would look
    like, if we take this path. I personally prefer it
    like this, but let's talk about it.

    Of course, if we decide to go this way, the name
    will be changed from mg-unixbench-download to
    mg-bench-download, and I'll structure the file
    like this from the beginning.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
ap-common
mg-unixbench-download

index 000ca699d5de5a5318d3abf8c49394e6a92b75ae..ff0f2056ebdf09459868a139447fcdc20cfda152 100644 (file)
--- a/ap-common
+++ b/ap-common
@@ -140,3 +140,7 @@ info_linux_tree () {
 # UnixBench. By default we try to grab version 5.1.3
 : ${REMOTEFILE_UNIXBENCH:=http://byte-unixbench.googlecode.com/files/unixbench-5.1.3.tgz}
 : ${LOCALFILE_UNIXBENCH:=unixbench.tgz}
+
+# hackbench. By default, directly from mingo page!
+: ${REMOTEFILE_HACKBENCH:=http://people.redhat.com/mingo/cfs-scheduler/tools/hackbench.c}
+: ${LOCALFILE_HACKBENCH:=hackbench.c}
index 891b0b1d7e0818fd8c02459dea3d48573a224731..c4d5ab3dde5f813f780691d5e9ad26615f6ddcf3 100755 (executable)
@@ -30,5 +30,20 @@ images=`getconfig Images`;
 dstdir="${images}/benchs"
 mkdir -p $dstdir
 
-wget ${REMOTEFILE_UNIXBENCH} -O ${dstdir}/${LOCALFILE_UNIXBENCH} || \
-    fail "failed downloading the benchmark"
+for bench in "$@"; do
+  case $bench in
+    unixbench)
+      bench_url=${REMOTEFILE_UNIXBENCH}
+      bench_dst=${dstdir}/${LOCALFILE_UNIXBENCH}
+      ;;
+    hackbench)
+      bench_url=${REMOTEFILE_HACKBENCH}
+      bench_dst=${dstdir}/${LOCALFILE_HACKBENCH}
+      ;;
+    *)
+      fail "unknown benchmark $bench"
+      ;;
+    esac
+
+    wget ${bench_url} -O ${bench_dst} || fail "failed downloading ${bench}"
+done