@@ -25,6 +25,7 @@ Describe "alpha.86 reconfigureAction.persisted semisync gates"
2525 ADDON_ROOT=" ${SHELLSPEC_CWD:? } /addons/mariadb"
2626 HELPERS_TPL=" ${ADDON_ROOT} /templates/_helpers.tpl"
2727 CMPD_SEMISYNC=" ${ADDON_ROOT} /templates/cmpd-replication.yaml"
28+ CMPD_ENTRYPOINT=" ${ADDON_ROOT} /scripts/replication-entrypoint.sh"
2829 CMPD_STANDALONE=" ${ADDON_ROOT} /templates/cmpd.yaml"
2930 CMPD_REPLICATION=" ${ADDON_ROOT} /templates/cmpd-replication.yaml"
3031 CMPD_GALERA=" ${ADDON_ROOT} /templates/cmpd-galera.yaml"
@@ -52,7 +53,7 @@ Describe "alpha.86 reconfigureAction.persisted semisync gates"
5253 /^[[:space:]]*start_mariadbd_process\(\) \{/ { in_func = 1; print; next }
5354 in_func && /^[[:space:]]*\}[[:space:]]*$/ { print; exit }
5455 in_func { print }
55- ' " ${CMPD_SEMISYNC } "
56+ ' " ${CMPD_ENTRYPOINT } "
5657 }
5758
5859 extract_init_syncer_command_body () {
@@ -82,33 +83,33 @@ Describe "alpha.86 reconfigureAction.persisted semisync gates"
8283 awk '
8384 /chown -R mysql:mysql / { in_block = 1 }
8485 in_block { print }
85- /^[[:space:]]+ rm -f .* .replication-ready/ { in_block = 0 }
86- ' " ${CMPD_SEMISYNC } "
86+ /^[[:space:]]* rm -f .* .replication-ready/ { in_block = 0 }
87+ ' " ${CMPD_ENTRYPOINT } "
8788 }
8889
8990 It " main container re-applies chgrp 1000 on runtime-overrides.d AFTER chown -R"
9091 When call main_container_bash_script
9192 The status should be success
9293 The output should include " chown -R mysql:mysql"
93- The output should include " chgrp 1000 {{ .Values.dataMountPath }} /runtime-overrides.d"
94+ The output should include ' chgrp 1000 ${DATA_DIR} /runtime-overrides.d'
9495 End
9596
9697 It " main container re-applies chmod 0770 (g+rwx) on runtime-overrides.d AFTER chown -R"
9798 When call main_container_bash_script
9899 The status should be success
99- The output should include " chmod 0770 {{ .Values.dataMountPath }} /runtime-overrides.d"
100+ The output should include ' chmod 0770 ${DATA_DIR} /runtime-overrides.d'
100101 End
101102
102103 It " main container re-applies chgrp 1000 on runtime-overrides.cnf loader AFTER chown -R"
103104 When call main_container_bash_script
104105 The status should be success
105- The output should include " chgrp 1000 {{ .Values.dataMountPath }} /runtime-overrides.cnf"
106+ The output should include ' chgrp 1000 ${DATA_DIR} /runtime-overrides.cnf'
106107 End
107108
108109 It " main container re-applies chmod 0660 on runtime-overrides.cnf loader AFTER chown -R"
109110 When call main_container_bash_script
110111 The status should be success
111- The output should include " chmod 0660 {{ .Values.dataMountPath }} /runtime-overrides.cnf"
112+ The output should include ' chmod 0660 ${DATA_DIR} /runtime-overrides.cnf'
112113 End
113114
114115 It " main container always overwrites loader to canonical content (recovers from corruption; Jack 07:03 B2 follow-up)"
@@ -129,10 +130,10 @@ Describe "alpha.86 reconfigureAction.persisted semisync gates"
129130 # AFTER-chown-R chgrp is what protects the kbagent permission
130131 # contract.
131132 When run sh -c '
132- chown_line=$(grep -n "chown -R mysql:mysql" "' ${CMPD_SEMISYNC } ' " | head -1 | cut -d: -f1)
133+ chown_line=$(grep -n "chown -R mysql:mysql" "' ${CMPD_ENTRYPOINT } ' " | head -1 | cut -d: -f1)
133134 # Find all chgrp 1000 lines for the runtime-overrides dir and
134135 # take the LAST one (assumed to be the main container re-fixup).
135- chgrp_line=$(grep -n "chgrp 1000 {{ \.Values\.dataMountPath }} /runtime-overrides\.d" "' ${CMPD_SEMISYNC } ' " | tail -1 | cut -d: -f1)
136+ chgrp_line=$(grep -n "chgrp 1000 \${DATA_DIR} /runtime-overrides\.d" "' ${CMPD_ENTRYPOINT } ' " | tail -1 | cut -d: -f1)
136137 if [ -n "${chown_line}" ] && [ -n "${chgrp_line}" ] && [ "${chgrp_line}" -gt "${chown_line}" ]; then
137138 echo "OK"
138139 else
@@ -189,7 +190,7 @@ Describe "alpha.86 reconfigureAction.persisted semisync gates"
189190 It " start_mariadbd_process function body includes the --defaults-extra-file flag"
190191 When call extract_start_mariadbd_function_body
191192 The status should be success
192- The output should include " --defaults-extra-file={{ .Values.dataMountPath }} /runtime-overrides.cnf"
193+ The output should include ' --defaults-extra-file=${DATA_DIR} /runtime-overrides.cnf'
193194 End
194195
195196 It " the --defaults-extra-file flag appears immediately after the mariadbd command (positional first arg)"
@@ -209,16 +210,16 @@ Describe "alpha.86 reconfigureAction.persisted semisync gates"
209210 }
210211 exit
211212 }
212- " "' ${CMPD_SEMISYNC } ' "
213+ " "' ${CMPD_ENTRYPOINT } ' "
213214 '
214215 The status should be success
215216 The output should equal " OK"
216217 End
217218
218219 It " the --defaults-extra-file flag precedes --server-id in source order"
219220 When run sh -c '
220- defaults_line=$(grep -n "defaults-extra-file=" "' ${CMPD_SEMISYNC } ' " | head -1 | cut -d: -f1)
221- server_id_line=$(grep -n -- "--server-id=" "' ${CMPD_SEMISYNC } ' " | head -1 | cut -d: -f1)
221+ defaults_line=$(grep -n "defaults-extra-file=" "' ${CMPD_ENTRYPOINT } ' " | head -1 | cut -d: -f1)
222+ server_id_line=$(grep -n -- "--server-id=" "' ${CMPD_ENTRYPOINT } ' " | head -1 | cut -d: -f1)
222223 if [ -n "${defaults_line}" ] && [ -n "${server_id_line}" ] && [ "${defaults_line}" -lt "${server_id_line}" ]; then
223224 echo "OK"
224225 else
0 commit comments