Move test_activate_dev to test_setup_dev_and_run and make it
run the function given in argument. test_activate_dev calls
test_setup_dev_and_run and no longer needs to implement device
allocation or destruction.
Signed-off-by: Loic Dachary <ldachary@redhat.com>
}
function test_activate_dev() {
+ test_setup_dev_and_run activate_dev_body
+}
+
+function test_setup_dev_and_run() {
+ local action=$1
if test $(id -u) != 0 ; then
echo "SKIP because not root"
return 0
local newdisk
newdisk=$(create_dev $dir/vdh.disk) || return 1
- activate_dev_body $disk $journal $newdisk
+ $action $disk $journal $newdisk
status=$?
- test $status != 0 && teardown
destroy_dev $dir/vdf.disk $disk
destroy_dev $dir/vdg.disk $journal