[Fuego] [PATCH 2/7] dbench: update fuego_test for version 4.00

Daniel Sangorrin daniel.sangorrin at toshiba.co.jp
Fri Mar 23 07:21:25 UTC 2018


The script detects if dbench is installed on the target, and
otherwise tries to build it. The reason to use this approach
is that dbench has a somewhat tricky build/runtime dependency
on libpopt.

Signed-off-by: Daniel Sangorrin <daniel.sangorrin at toshiba.co.jp>
---
 engine/tests/Benchmark.dbench/fuego_test.sh | 32 ++++++++++++++++++-----------
 1 file changed, 20 insertions(+), 12 deletions(-)

diff --git a/engine/tests/Benchmark.dbench/fuego_test.sh b/engine/tests/Benchmark.dbench/fuego_test.sh
index 431b682..30c7cf2 100755
--- a/engine/tests/Benchmark.dbench/fuego_test.sh
+++ b/engine/tests/Benchmark.dbench/fuego_test.sh
@@ -1,30 +1,38 @@
-tarball=dbench-3.04.tar.gz
+# gitrepo=https://git.samba.org/sahlberg/dbench.git
+tarball=dbench-4.00.tar.gz
 
 function test_pre_check {
     assert_define BENCHMARK_DBENCH_MOUNT_BLOCKDEV
     assert_define BENCHMARK_DBENCH_MOUNT_POINT
     assert_define BENCHMARK_DBENCH_TIMELIMIT
     assert_define BENCHMARK_DBENCH_NPROCS
+    is_on_target_path dbench PROGRAM_DBENCH
 }
 
 function test_build {
-    patch -N -s -p1 < $TEST_HOME/dbench_startup.patch
-    ./configure --host=$HOST --build=`uname -m`-linux-gnu  CFLAGS="$CFLAGS";
-    make
+    if [ -z "$PROGRAM_DBENCH" ]; then
+        echo "Building dbench, make sure you have libpopt-dev dependencies"
+        ./autogen.sh
+        ./configure --host=$HOST --build=`uname -m`-linux-gnu  CFLAGS="$CFLAGS";
+        make
+    else
+        echo "Skipping build phase, dbench is already on the target"
+    fi
 }
 
 function test_deploy {
-    put dbench client.txt $BOARD_TESTDIR/fuego.$TESTDIR/ 
+    if [ -z "$PROGRAM_DBENCH" ]; then
+        put dbench loadfiles/client.txt $BOARD_TESTDIR/fuego.$TESTDIR/
+    fi
 }
 
 function test_run {
     hd_test_mount_prepare $BENCHMARK_DBENCH_MOUNT_BLOCKDEV $BENCHMARK_DBENCH_MOUNT_POINT
-        
-    report "cd $BOARD_TESTDIR/fuego.$TESTDIR; cp client.txt $BENCHMARK_DBENCH_MOUNT_POINT/fuego.$TESTDIR; pwd; ./dbench -t $BENCHMARK_DBENCH_TIMELIMIT -D $BENCHMARK_DBENCH_MOUNT_POINT/fuego.$TESTDIR -c $BENCHMARK_DBENCH_MOUNT_POINT/fuego.$TESTDIR/client.txt $BENCHMARK_DBENCH_NPROCS; rm $BENCHMARK_DBENCH_MOUNT_POINT/fuego.$TESTDIR/client.txt"
-    
-    sleep 5
-        
+    if [ -z "$PROGRAM_DBENCH" ]; then
+        #report "cd $BOARD_TESTDIR/fuego.$TESTDIR; cp client.txt $BENCHMARK_DBENCH_MOUNT_POINT/fuego.$TESTDIR; pwd; ./dbench -t $BENCHMARK_DBENCH_TIMELIMIT -D $BENCHMARK_DBENCH_MOUNT_POINT/fuego.$TESTDIR -c $BENCHMARK_DBENCH_MOUNT_POINT/fuego.$TESTDIR/client.txt $BENCHMARK_DBENCH_NPROCS; rm $BENCHMARK_DBENCH_MOUNT_POINT/fuego.$TESTDIR/client.txt"
+        report "cd $BOARD_TESTDIR/fuego.$TESTDIR; ./dbench -c ./client.txt -D $BENCHMARK_DBENCH_MOUNT_POINT/fuego.$TESTDIR -t $BENCHMARK_DBENCH_TIMELIMIT $BENCHMARK_DBENCH_EXTRAPARAMS $BENCHMARK_DBENCH_NPROCS"
+    else
+        report "cd $BOARD_TESTDIR/fuego.$TESTDIR; dbench -D $BENCHMARK_DBENCH_MOUNT_POINT/fuego.$TESTDIR -t $BENCHMARK_DBENCH_TIMELIMIT $BENCHMARK_DBENCH_EXTRAPARAMS $BENCHMARK_DBENCH_NPROCS"
+    fi
     hd_test_clean_umount $BENCHMARK_DBENCH_MOUNT_BLOCKDEV $BENCHMARK_DBENCH_MOUNT_POINT
 }
-
-
-- 
2.7.4




More information about the Fuego mailing list