From 4a6468aec49271dd0a6741483dd5008549c59327 Mon Sep 17 00:00:00 2001 From: "nmordech@redhat.com" Date: Tue, 5 Mar 2024 09:29:54 +0000 Subject: [PATCH] test/osd/safe-to-destroy.sh: Add checks for the test 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 --- src/test/osd/safe-to-destroy.sh | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/src/test/osd/safe-to-destroy.sh b/src/test/osd/safe-to-destroy.sh index 08afc8e8d8c..fcc1d4b8b02 100755 --- a/src/test/osd/safe-to-destroy.sh +++ b/src/test/osd/safe-to-destroy.sh @@ -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 -- 2.47.3