forked from Mirrors/btrfs-progs
btrfs-progs: tests: enhance mkfs option injection
Add support for TEST_ARGS_MKFS to allow injection of eg. checksum command for the all tests. Use like $ make TEST_ARGS_MKFS='--csum=xxhash' TEST_ENABLE_OVERRIDE=true test-mkfs This affects all mkfs.btrfs commands that are run by run_check and other helpers, IOW this affects all tests, not just mkfs specific ones. Signed-off-by: David Sterba <dsterba@suse.com>master
parent
698e3baad6
commit
f24ba8126e
|
@ -126,6 +126,9 @@ the root helper).
|
||||||
* `TEST_ARGS_CHECK` -- user-defined arguments to `btrfs check`, before the
|
* `TEST_ARGS_CHECK` -- user-defined arguments to `btrfs check`, before the
|
||||||
test-specific arguments
|
test-specific arguments
|
||||||
|
|
||||||
|
* `TEST_ARGS_MKFS` -- user-defined arguments to `mkfs.btrfs`, before the
|
||||||
|
test-specific arguments
|
||||||
|
|
||||||
Multiple values can be separated by `,`.
|
Multiple values can be separated by `,`.
|
||||||
|
|
||||||
### Permissions
|
### Permissions
|
||||||
|
|
10
tests/common
10
tests/common
|
@ -91,11 +91,19 @@ _get_spec_ins()
|
||||||
echo -n 4
|
echo -n 4
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
if [[ $2 =~ /mkfs.btrfs$ ]]; then
|
||||||
|
echo -n 3
|
||||||
|
return
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
if [[ $1 =~ /btrfs$ ]]; then
|
if [[ $1 =~ /btrfs$ ]]; then
|
||||||
echo -n 3
|
echo -n 3
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
if [[ $1 =~ /mkfs.btrfs$ ]]; then
|
||||||
|
echo -n 2
|
||||||
|
return
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
echo -n 2
|
echo -n 2
|
||||||
}
|
}
|
||||||
|
@ -113,6 +121,7 @@ _cmd_spec()
|
||||||
fi
|
fi
|
||||||
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" ;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
@ -713,6 +722,7 @@ init_env()
|
||||||
if [ "$TEST_ENABLE_OVERRIDE" = 'true' -a -n "$RESULTS" ]; then
|
if [ "$TEST_ENABLE_OVERRIDE" = 'true' -a -n "$RESULTS" ]; then
|
||||||
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"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
init_env
|
init_env
|
||||||
|
|
Loading…
Reference in New Issue