From cc4651ddc4fb522df24e2e936868bac25ae1aab5 Mon Sep 17 00:00:00 2001 From: Hu Shuai Date: Tue, 16 Aug 2022 14:38:16 +0800 Subject: [PATCH] Add TEST_SW_RAID option This can config software RAID for worker nodes. Signed-off-by: Hu Shuai --- common.sh | 3 +++ config_example.sh | 4 ++++ utils.sh | 11 +++++++++++ 3 files changed, 18 insertions(+) diff --git a/common.sh b/common.sh index cef7d3063..f0578f6c7 100644 --- a/common.sh +++ b/common.sh @@ -379,3 +379,6 @@ export TEST_CUSTOM_MAO=${TEST_CUSTOM_MAO:-false} # Set to configure bootstrap VM baremetal network with static IP # (Currently this just expects a non-empty value, the IP is fixed to .9) export ENABLE_BOOTSTRAP_STATIC_IP=${ENABLE_BOOTSTRAP_STATIC_IP:-} + +# Defaults the variable to disable testing software RAID +export TEST_SW_RAID=${TEST_SW_RAID:-false} diff --git a/config_example.sh b/config_example.sh index 6cdab827e..ffce52295 100755 --- a/config_example.sh +++ b/config_example.sh @@ -608,3 +608,7 @@ set -x # cpu and ip stack. # This config variable is used only by the agent based installer and is required. # export AGENT_E2E_TEST_SCENARIO=HA_IPV4 + +# TEST_SW_RAID - +# Enable testing of software RAID +# export TEST_SW_RAID=true diff --git a/utils.sh b/utils.sh index 93a148870..0fe60df11 100755 --- a/utils.sh +++ b/utils.sh @@ -108,6 +108,17 @@ function create_cluster() { mkdir -p ${assets_dir}/openshift generate_assets + if [[ "$TEST_SW_RAID" == "true" ]] && [[ "$NUM_WORKERS" -gt 0 ]]; then + for n in $(seq "$NUM_MASTERS" $(expr "$NUM_WORKERS" + "$NUM_MASTERS" - 1)); + do + sed -i "/status/i \\ + raid: \n\ + softwareRAIDVolumes: \n\ + - level: \"1\" \ +" ${assets_dir}/openshift/99_openshift-cluster-api_hosts-$n.yaml + done + fi + if [ -z "${NTP_SERVERS}" ]; then export NTP_SERVERS="$PROVISIONING_HOST_EXTERNAL_IP"