From: Loic Dachary Date: Wed, 1 Apr 2015 12:54:10 +0000 (+0200) Subject: tests: add test_setup_dev_and_run to ceph-disk.sh X-Git-Tag: v9.0.0~44^2^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=282ccce16a5ddee0545eb91bafe2f630b1c737e4;p=ceph.git 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 --- 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