From 282ccce16a5ddee0545eb91bafe2f630b1c737e4 Mon Sep 17 00:00:00 2001 From: Loic Dachary Date: Wed, 1 Apr 2015 14:54:10 +0200 Subject: [PATCH] tests: add test_setup_dev_and_run to ceph-disk.sh 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 --- src/test/ceph-disk.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/test/ceph-disk.sh b/src/test/ceph-disk.sh index fec0e1e2287..efdc43e7f1e 100755 --- a/src/test/ceph-disk.sh +++ b/src/test/ceph-disk.sh @@ -475,6 +475,11 @@ function activate_dev_body() { } 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 @@ -490,9 +495,8 @@ function test_activate_dev() { 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 -- 2.47.3