From 09a66e9ee8ab5caff467447fde75a6913d95c4a4 Mon Sep 17 00:00:00 2001 From: Vincent Fu Date: Wed, 16 Oct 2019 14:52:07 -0400 Subject: t/readonly: replace shell script with python script The new script better supports automated testing than the previous one. Also get rid of the t/jobs/readonly-?.fio job files. Using jobs files with the --readonly parameter produces the same behavior as when --readonly precedes --rw=XXX on the command line. --- t/readonly.sh | 84 ----------------------------------------------------------- 1 file changed, 84 deletions(-) delete mode 100755 t/readonly.sh (limited to 't/readonly.sh') diff --git a/t/readonly.sh b/t/readonly.sh deleted file mode 100755 index d7094146..00000000 --- a/t/readonly.sh +++ /dev/null @@ -1,84 +0,0 @@ -#!/bin/bash -# -# Do some basic test of the --readonly parameter -# -# DUT should be a device that accepts read, write, and trim operations -# -# Example usage: -# -# DUT=/dev/fioa t/readonly.sh -# -TESTNUM=1 - -# -# The first parameter is the return code -# The second parameter is 0 if the return code should be 0 -# positive if the return code should be positive -# -check () { - echo "********************" - - if [ $2 -gt 0 ]; then - if [ $1 -eq 0 ]; then - echo "Test $TESTNUM failed" - echo "********************" - exit 1 - else - echo "Test $TESTNUM passed" - fi - else - if [ $1 -gt 0 ]; then - echo "Test $TESTNUM failed" - echo "********************" - exit 1 - else - echo "Test $TESTNUM passed" - fi - fi - - echo "********************" - echo - TESTNUM=$((TESTNUM+1)) -} - -./fio --name=test --filename=$DUT --rw=randread --readonly --time_based --runtime=1s &> /dev/null -check $? 0 -./fio --name=test --filename=$DUT --rw=randwrite --readonly --time_based --runtime=1s &> /dev/null -check $? 1 -./fio --name=test --filename=$DUT --rw=randtrim --readonly --time_based --runtime=1s &> /dev/null -check $? 1 - -./fio --name=test --filename=$DUT --readonly --rw=randread --time_based --runtime=1s &> /dev/null -check $? 0 -./fio --name=test --filename=$DUT --readonly --rw=randwrite --time_based --runtime=1s &> /dev/null -check $? 1 -./fio --name=test --filename=$DUT --readonly --rw=randtrim --time_based --runtime=1s &> /dev/null -check $? 1 - -./fio --name=test --filename=$DUT --rw=randread --time_based --runtime=1s &> /dev/null -check $? 0 -./fio --name=test --filename=$DUT --rw=randwrite --time_based --runtime=1s &> /dev/null -check $? 0 -./fio --name=test --filename=$DUT --rw=randtrim --time_based --runtime=1s &> /dev/null -check $? 0 - -./fio t/jobs/readonly-r.fio --readonly &> /dev/null -check $? 0 -./fio t/jobs/readonly-w.fio --readonly &> /dev/null -check $? 1 -./fio t/jobs/readonly-t.fio --readonly &> /dev/null -check $? 1 - -./fio --readonly t/jobs/readonly-r.fio &> /dev/null -check $? 0 -./fio --readonly t/jobs/readonly-w.fio &> /dev/null -check $? 1 -./fio --readonly t/jobs/readonly-t.fio &> /dev/null -check $? 1 - -./fio t/jobs/readonly-r.fio &> /dev/null -check $? 0 -./fio t/jobs/readonly-w.fio &> /dev/null -check $? 0 -./fio t/jobs/readonly-t.fio &> /dev/null -check $? 0 -- cgit v1.2.3