btrfs-progs: tests: enhance convert option injection

Add support for TEST_ARGS_CONVERT to allow injection of eg. checksum
command for the all tests. Use like

 $ make TEST_ARGS_CONVERT='--csum=xxhash' TEST_ENABLE_OVERRIDE=true test-convert

This affects all btrfs-convert commands that are run by run_check and
other helpers, IOW this affects all tests, not just convert specific ones.

Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
David Sterba 2019-11-05 20:14:56 +01:00
parent f24ba8126e
commit 8041a1c229
2 changed files with 13 additions and 0 deletions

View File

@ -129,6 +129,9 @@ the root helper).
* `TEST_ARGS_MKFS` -- user-defined arguments to `mkfs.btrfs`, before the * `TEST_ARGS_MKFS` -- user-defined arguments to `mkfs.btrfs`, before the
test-specific arguments test-specific arguments
* `TEST_ARGS_CONVERT` -- user-defined arguments to `btrfs-convert`, before the
test-specific arguments
Multiple values can be separated by `,`. Multiple values can be separated by `,`.
### Permissions ### Permissions

View File

@ -95,6 +95,10 @@ _get_spec_ins()
echo -n 3 echo -n 3
return return
fi fi
if [[ $2 =~ /btrfs-convert$ ]]; then
echo -n 3
return
fi
else else
if [[ $1 =~ /btrfs$ ]]; then if [[ $1 =~ /btrfs$ ]]; then
echo -n 3 echo -n 3
@ -104,6 +108,10 @@ _get_spec_ins()
echo -n 2 echo -n 2
return return
fi fi
if [[ $1 =~ /btrfs-convert$ ]]; then
echo -n 2
return
fi
fi fi
echo -n 2 echo -n 2
} }
@ -122,6 +130,7 @@ _cmd_spec()
case "$1" in case "$1" in
check) echo -n "$TEST_ARGS_CHECK" ;; check) echo -n "$TEST_ARGS_CHECK" ;;
*/mkfs.btrfs) echo -n "$TEST_ARGS_MKFS" ;; */mkfs.btrfs) echo -n "$TEST_ARGS_MKFS" ;;
*/btrfs-convert) echo -n "$TEST_ARGS_CONVERT" ;;
esac esac
fi fi
} }
@ -723,6 +732,7 @@ init_env()
echo "INCLUDE common.local" >> "$RESULTS" echo "INCLUDE common.local" >> "$RESULTS"
echo " check: $TEST_ARGS_CHECK" >> "$RESULTS" echo " check: $TEST_ARGS_CHECK" >> "$RESULTS"
echo " mkfs: $TEST_ARGS_MKFS" >> "$RESULTS" echo " mkfs: $TEST_ARGS_MKFS" >> "$RESULTS"
echo " convert: $TEST_ARGS_CONVERT" >> "$RESULTS"
fi fi
} }
init_env init_env