Skip to content

Commit bb516fc

Browse files
committed
Add TEST_SW_RAID option
This can config software RAID for worker nodes. Signed-off-by: Hu Shuai <[email protected]>
1 parent aa58158 commit bb516fc

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

common.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,3 +407,5 @@ if [[ ! -z ${AGENT_E2E_TEST_SCENARIO} ]]; then
407407

408408
fi
409409

410+
# Defaults the variable to disable testing software RAID
411+
export TEST_SW_RAID=${TEST_SW_RAID:-false}

config_example.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -629,4 +629,8 @@ set -x
629629
# export AGENT_E2E_TEST_SCENARIO=HA_IPV4
630630

631631
# Uncomment the following line to deploy the MCE operator, and to automatically import the current cluster as the hub cluster
632-
# export AGENT_DEPLOY_MCE=true
632+
# export AGENT_DEPLOY_MCE=true
633+
634+
# TEST_SW_RAID -
635+
# Enable testing of software RAID
636+
# export TEST_SW_RAID=true

utils.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,17 @@ function create_cluster() {
108108
mkdir -p ${assets_dir}/openshift
109109
generate_assets
110110

111+
if [[ "$TEST_SW_RAID" == "true" ]] && [[ "$NUM_WORKERS" -gt 0 ]]; then
112+
for n in $(seq "$NUM_MASTERS" $(expr "$NUM_WORKERS" + "$NUM_MASTERS" - 1));
113+
do
114+
sed -i "/status/i \\
115+
raid: \n\
116+
softwareRAIDVolumes: \n\
117+
- level: \"1\" \
118+
" ${assets_dir}/openshift/99_openshift-cluster-api_hosts-$n.yaml
119+
done
120+
fi
121+
111122
if [ -z "${NTP_SERVERS}" ];
112123
then
113124
export NTP_SERVERS="$PROVISIONING_HOST_EXTERNAL_IP"

0 commit comments

Comments
 (0)