@@ -89,12 +89,14 @@ INITIAL_VALUES_CUSTOM_CLUSTER_OVERWRITE="$REPO_ROOT/test/initial_values_custom_c
8989INITIAL_VALUES_GLOBAL_CUSTOM=" $REPO_ROOT /test/initial_values_global_custom.yaml"
9090INITIAL_VALUES_GLOBAL_OVERWRITE=" $REPO_ROOT /test/initial_values_global_overwrite.yaml"
9191INITIAL_VALUES_SECRET_TEMPLATE_OVERWRITE=" $REPO_ROOT /test/initial_values_secret_template_overwrite.yaml"
92+ INITIAL_ANSIBLE_CFG_OVERWRITE=" $REPO_ROOT /test/initial_ansible_cfg_overwrite"
9293
9394# Set paths for expected resource files
9495EXPECTED_MAKEFILE=" $PATTERNIZER_RESOURCES_DIR /Makefile"
9596EXPECTED_MAKEFILE_COMMON=" $PATTERNIZER_RESOURCES_DIR /Makefile-common"
9697EXPECTED_PATTERN_SH=" $PATTERNIZER_RESOURCES_DIR /pattern.sh"
9798EXPECTED_VALUES_SECRET_TEMPLATE=" $PATTERNIZER_RESOURCES_DIR /values-secret.yaml.template"
99+ EXPECTED_ANSIBLE_CFG=" $PATTERNIZER_RESOURCES_DIR /ansible.cfg"
98100
99101# Check if patternizer binary exists and is executable
100102if [ ! -x " $PATTERNIZER_BINARY " ]; then
@@ -249,6 +251,9 @@ compare_files "$EXPECTED_MAKEFILE" "Makefile" "Makefile has expected content (in
249251# Test 1.5: Check Makefile-common has exact expected content
250252compare_files " $EXPECTED_MAKEFILE_COMMON " " Makefile-common" " Makefile-common has expected content (init without secrets)"
251253
254+ # Test 1.6: Check ansible.cfg has exact expected content
255+ compare_files " $EXPECTED_ANSIBLE_CFG " " ansible.cfg" " ansible.cfg has expected content (init without secrets)"
256+
252257test_pass " === Test 1: Basic initialization PASSED ==="
253258
254259#
@@ -284,6 +289,9 @@ compare_files "$EXPECTED_MAKEFILE" "Makefile" "Makefile has expected content (in
284289# Test 2.6: Check Makefile-common has exact expected content
285290compare_files " $EXPECTED_MAKEFILE_COMMON " " Makefile-common" " Makefile-common has expected content (init with secrets)"
286291
292+ # Test 2.7: Check ansible.cfg has exact expected content
293+ compare_files " $EXPECTED_ANSIBLE_CFG " " ansible.cfg" " ansible.cfg has expected content (init with secrets)"
294+
287295test_pass " === Test 2: Initialization with secrets PASSED ==="
288296
289297#
@@ -322,6 +330,9 @@ compare_files "$EXPECTED_MAKEFILE" "Makefile" "Makefile has expected content (cu
322330# Test 3.6: Check Makefile-common has exact expected content
323331compare_files " $EXPECTED_MAKEFILE_COMMON " " Makefile-common" " Makefile-common has expected content (custom names with secrets)"
324332
333+ # Test 3.7: Check ansible.cfg has exact expected content
334+ compare_files " $EXPECTED_ANSIBLE_CFG " " ansible.cfg" " ansible.cfg has expected content (custom names with secrets)"
335+
325336test_pass " === Test 3: Custom pattern and cluster group names (with secrets) PASSED ==="
326337
327338#
@@ -360,6 +371,10 @@ compare_files "$EXPECTED_MAKEFILE" "Makefile" "Makefile has expected content (se
360371# Test 4.6: Check Makefile-common has exact expected content
361372compare_files " $EXPECTED_MAKEFILE_COMMON " " Makefile-common" " Makefile-common has expected content (sequential execution)"
362373
374+ # Test 4.7: Check ansible.cfg has exact expected content
375+ compare_files " $EXPECTED_ANSIBLE_CFG " " ansible.cfg" " ansible.cfg has expected content (sequential execution)"
376+
377+
363378test_pass " === Test 4: Sequential execution PASSED ==="
364379
365380#
@@ -376,6 +391,7 @@ cp "$INITIAL_MAKEFILE_OVERWRITE" "Makefile"
376391cp " $INITIAL_MAKEFILE_PATTERN_OVERWRITE " " Makefile-common"
377392cp " $INITIAL_PATTERN_SH_OVERWRITE " " pattern.sh"
378393cp " $INITIAL_VALUES_SECRET_TEMPLATE_OVERWRITE " " values-secret.yaml.template"
394+ cp " $INITIAL_ANSIBLE_CFG_OVERWRITE " " ansible.cfg"
379395
380396# Make pattern.sh executable to match real scenarios
381397chmod +x " pattern.sh"
410426# Test 5.6: values-secret.yaml.template should NOT be overwritten
411427compare_files " $INITIAL_VALUES_SECRET_TEMPLATE_OVERWRITE " " values-secret.yaml.template" " values-secret.yaml.template was not overwritten (content preserved)"
412428
429+ # Test 5.7: ansible.cfg SHOULD be overwritten with exact expected content
430+ compare_files " $EXPECTED_ANSIBLE_CFG " " ansible.cfg" " ansible.cfg was overwritten with correct content"
431+
432+
413433test_pass " === Test 5: File overwrite behavior PASSED ==="
414434
415435#
@@ -441,6 +461,8 @@ compare_files "$EXPECTED_MAKEFILE_COMMON" "Makefile-common" "Makefile-common cre
441461
442462compare_files " $EXPECTED_PATTERN_SH " " pattern.sh" " pattern.sh created with correct content"
443463
464+ compare_files " $EXPECTED_ANSIBLE_CFG " " ansible.cfg" " ansible.cfg created with correct content"
465+
444466# Test 6.2: Files that should be preserved
445467compare_files " $INITIAL_MAKEFILE_OVERWRITE " " Makefile" " Existing Makefile preserved in mixed scenario"
446468
484506# Verify pattern.sh and Makefile-common contents
485507compare_files " $EXPECTED_PATTERN_SH " " pattern.sh" " pattern.sh copied during upgrade"
486508compare_files " $EXPECTED_MAKEFILE_COMMON " " Makefile-common" " Makefile-common copied during upgrade"
509+ compare_files " $EXPECTED_ANSIBLE_CFG " " ansible.cfg" " ansible.cfg copied during upgrade"
487510
488511# Verify Makefile first line and content
489512EXPECTED_UPGRADE_MF=$( mktemp)
0 commit comments