]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
test/osd/safe-to-destroy.sh: Add checks for the test 55949/head
authornmordech@redhat.com <nmordech@redhat.com>
Tue, 5 Mar 2024 09:29:54 +0000 (09:29 +0000)
committernmordech@redhat.com <nmordech@redhat.com>
Wed, 13 Mar 2024 06:27:54 +0000 (06:27 +0000)
The test script is not detecting the build env vars and not checking
return code from start osds\mon\mgr.

This will add those checks to prevent false results from the test.

Signed-off-by: Nitzan Mordechai <nmordech@redhat.com>
src/test/osd/safe-to-destroy.sh

index 08afc8e8d8c204a0362a7151535fc1ca50dd7290..fcc1d4b8b026cfbd20eecbad93f5df01b189d674 100755 (executable)
@@ -1,5 +1,5 @@
 #!/usr/bin/env bash
-
+source $(dirname $0)/../detect-build-env-vars.sh
 source $CEPH_ROOT/qa/standalone/ceph-helpers.sh
 
 set -e
@@ -25,13 +25,12 @@ function run() {
 function TEST_safe_to_destroy() {
     local dir=$1
 
-    run_mon $dir a
-    run_mgr $dir x
-    run_osd $dir 0
-    run_osd $dir 1
-    run_osd $dir 2
-    run_osd $dir 3
-
+    run_mon $dir a || return 1
+    run_mgr $dir x || return 1
+    run_osd $dir 0 || return 1
+    run_osd $dir 1 || return 1
+    run_osd $dir 2 || return 1
+    run_osd $dir 3 || return 1
     flush_pg_stats
 
     ceph osd safe-to-destroy 0
@@ -64,12 +63,12 @@ function TEST_safe_to_destroy() {
 function TEST_ok_to_stop() {
     local dir=$1
 
-    run_mon $dir a
-    run_mgr $dir x
-    run_osd $dir 0
-    run_osd $dir 1
-    run_osd $dir 2
-    run_osd $dir 3
+    run_mon $dir a || return 1
+    run_mgr $dir x || return 1
+    run_osd $dir 0 || return 1
+    run_osd $dir 1 || return 1
+    run_osd $dir 2 || return 1
+    run_osd $dir 3 || return 1
 
     ceph osd pool create foo 128
     ceph osd pool set foo size 3