From 51fe5a4ceb515a913dba7200366cbaeb22b27a5e Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Thu, 13 Oct 2022 12:42:46 -0700 Subject: [PATCH] Add -o mount option argument to run-tests Add a run-tests option that lets us append an option string to all mounts performed during the tests. Signed-off-by: Zach Brown --- tests/run-tests.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/run-tests.sh b/tests/run-tests.sh index a8aa02af..836273d9 100755 --- a/tests/run-tests.sh +++ b/tests/run-tests.sh @@ -58,6 +58,7 @@ $(basename $0) options: -m | Run mkfs on the device before mounting and running | tests. Implies unmounting existing mounts first. -n | The number of devices and mounts to test. + -o | Add option string to all mounts during all tests. -P | Enable trace_printk. -p | Exit script after preparing mounts only, don't run tests. -q | The first mounts will be quorum members. Must be @@ -136,6 +137,12 @@ while true; do T_NR_MOUNTS="$2" shift ;; + -o) + test -n "$2" || die "-o must have option string argument" + # always appending to existing options + T_MNT_OPTIONS+=",$2" + shift + ;; -P) T_TRACE_PRINTK="1" ;; @@ -430,6 +437,7 @@ for i in $(seq 0 $((T_NR_MOUNTS - 1))); do if [ "$i" -lt "$T_QUORUM" ]; then opts="$opts,quorum_slot_nr=$i" fi + opts="${opts}${T_MNT_OPTIONS}" msg "mounting $meta_dev|$data_dev on $dir" cmd mount -t scoutfs $opts "$data_dev" "$dir" &