From 166a2362378b1ff93e43f483f354c428fd6cef9e Mon Sep 17 00:00:00 2001 From: Ilya Dryomov Date: Sat, 9 Mar 2024 22:53:44 +0100 Subject: [PATCH] qa/workunits/rbd: switch rbd-mirror workunits to bash By making use of here strings in commit ea3a567f7f03 ("qa/workunits: make wait_for_status_in_pool_dir() reentrant") we grew a dependency on bash. Signed-off-by: Ilya Dryomov --- qa/workunits/rbd/compare_mirror_image_alternate_primary.sh | 2 +- qa/workunits/rbd/compare_mirror_images.sh | 2 +- qa/workunits/rbd/rbd_mirror.sh | 4 +++- qa/workunits/rbd/rbd_mirror_bootstrap.sh | 4 +++- qa/workunits/rbd/rbd_mirror_fsx_compare.sh | 4 +++- qa/workunits/rbd/rbd_mirror_fsx_prepare.sh | 4 +++- qa/workunits/rbd/rbd_mirror_ha.sh | 4 +++- qa/workunits/rbd/rbd_mirror_helpers.sh | 2 +- qa/workunits/rbd/rbd_mirror_stress.sh | 4 +++- 9 files changed, 21 insertions(+), 9 deletions(-) diff --git a/qa/workunits/rbd/compare_mirror_image_alternate_primary.sh b/qa/workunits/rbd/compare_mirror_image_alternate_primary.sh index 338f43f1e530d..78a3902303882 100755 --- a/qa/workunits/rbd/compare_mirror_image_alternate_primary.sh +++ b/qa/workunits/rbd/compare_mirror_image_alternate_primary.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -ex diff --git a/qa/workunits/rbd/compare_mirror_images.sh b/qa/workunits/rbd/compare_mirror_images.sh index 1b3cc300de988..342a1ebc4e7b2 100755 --- a/qa/workunits/rbd/compare_mirror_images.sh +++ b/qa/workunits/rbd/compare_mirror_images.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -ex diff --git a/qa/workunits/rbd/rbd_mirror.sh b/qa/workunits/rbd/rbd_mirror.sh index bc3237dfc0898..1cda355039eb8 100755 --- a/qa/workunits/rbd/rbd_mirror.sh +++ b/qa/workunits/rbd/rbd_mirror.sh @@ -1,4 +1,4 @@ -#!/bin/sh -ex +#!/usr/bin/env bash # # rbd_mirror.sh - test rbd-mirror daemon in snapshot or journal mirroring mode # @@ -13,6 +13,8 @@ # socket, temporary files, and launches rbd-mirror daemon. # +set -ex + if [ "${#}" -gt 0 ]; then echo "unnecessary arguments: ${@}" exit 100 diff --git a/qa/workunits/rbd/rbd_mirror_bootstrap.sh b/qa/workunits/rbd/rbd_mirror_bootstrap.sh index 6ef06f2b82cbb..f4c1070bc95ba 100755 --- a/qa/workunits/rbd/rbd_mirror_bootstrap.sh +++ b/qa/workunits/rbd/rbd_mirror_bootstrap.sh @@ -1,8 +1,10 @@ -#!/bin/sh -ex +#!/usr/bin/env bash # # rbd_mirror_bootstrap.sh - test peer bootstrap create/import # +set -ex + RBD_MIRROR_MANUAL_PEERS=1 RBD_MIRROR_INSTANCES=${RBD_MIRROR_INSTANCES:-1} . $(dirname $0)/rbd_mirror_helpers.sh diff --git a/qa/workunits/rbd/rbd_mirror_fsx_compare.sh b/qa/workunits/rbd/rbd_mirror_fsx_compare.sh index 0ba3c97d7519f..79c36546d4fb0 100755 --- a/qa/workunits/rbd/rbd_mirror_fsx_compare.sh +++ b/qa/workunits/rbd/rbd_mirror_fsx_compare.sh @@ -1,10 +1,12 @@ -#!/bin/sh -ex +#!/usr/bin/env bash # # rbd_mirror_fsx_compare.sh - test rbd-mirror daemon under FSX workload # # The script is used to compare FSX-generated images between two clusters. # +set -ex + . $(dirname $0)/rbd_mirror_helpers.sh trap 'cleanup $?' INT TERM EXIT diff --git a/qa/workunits/rbd/rbd_mirror_fsx_prepare.sh b/qa/workunits/rbd/rbd_mirror_fsx_prepare.sh index d988987ba42a8..6daadbbb45013 100755 --- a/qa/workunits/rbd/rbd_mirror_fsx_prepare.sh +++ b/qa/workunits/rbd/rbd_mirror_fsx_prepare.sh @@ -1,10 +1,12 @@ -#!/bin/sh -ex +#!/usr/bin/env bash # # rbd_mirror_fsx_prepare.sh - test rbd-mirror daemon under FSX workload # # The script is used to compare FSX-generated images between two clusters. # +set -ex + . $(dirname $0)/rbd_mirror_helpers.sh setup diff --git a/qa/workunits/rbd/rbd_mirror_ha.sh b/qa/workunits/rbd/rbd_mirror_ha.sh index 37739a83da024..1e43712a63152 100755 --- a/qa/workunits/rbd/rbd_mirror_ha.sh +++ b/qa/workunits/rbd/rbd_mirror_ha.sh @@ -1,8 +1,10 @@ -#!/bin/sh -ex +#!/usr/bin/env bash # # rbd_mirror_ha.sh - test rbd-mirror daemons in HA mode # +set -ex + RBD_MIRROR_INSTANCES=${RBD_MIRROR_INSTANCES:-7} . $(dirname $0)/rbd_mirror_helpers.sh diff --git a/qa/workunits/rbd/rbd_mirror_helpers.sh b/qa/workunits/rbd/rbd_mirror_helpers.sh index d7b4abc4d8f26..b6e1fa87de2a2 100755 --- a/qa/workunits/rbd/rbd_mirror_helpers.sh +++ b/qa/workunits/rbd/rbd_mirror_helpers.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/env bash # # rbd_mirror_helpers.sh - shared rbd-mirror daemon helper functions # diff --git a/qa/workunits/rbd/rbd_mirror_stress.sh b/qa/workunits/rbd/rbd_mirror_stress.sh index 5426f495db10c..baf0c9f1a8f8f 100755 --- a/qa/workunits/rbd/rbd_mirror_stress.sh +++ b/qa/workunits/rbd/rbd_mirror_stress.sh @@ -1,4 +1,4 @@ -#!/bin/sh -ex +#!/usr/bin/env bash # # rbd_mirror_stress.sh - stress test rbd-mirror daemon # @@ -8,6 +8,8 @@ # tool during the many image test # +set -ex + IMAGE_COUNT=50 export LOCKDEP=0 -- 2.39.5