From 623629aee3fb7a342328a5ecb5a0e49d11bcaf21 Mon Sep 17 00:00:00 2001 From: Rafael Guterres Jeffman Date: Wed, 12 Feb 2025 19:57:42 -0300 Subject: [PATCH] test reorg --- .../azure/templates/prepare_environment.yaml | 23 ++++++++++++-- infra/azure/templates/run_tests.yml | 30 +++---------------- infra/scenarios/run_test_scenario.sh | 3 ++ 3 files changed, 28 insertions(+), 28 deletions(-) diff --git a/infra/azure/templates/prepare_environment.yaml b/infra/azure/templates/prepare_environment.yaml index f9df9acde..a798d0f74 100644 --- a/infra/azure/templates/prepare_environment.yaml +++ b/infra/azure/templates/prepare_environment.yaml @@ -28,5 +28,24 @@ steps: retryCountOnTaskFailure: 5 displayName: Install Ansible collections - # - script: infra/image/start.sh ${{ parameters.distro }}-server - # displayName: Setup target container for ${{ parameters.distro }} + # Deployment of IPA servers/clients is done through the collection + - script: | + git fetch --unshallow + utils/build-galaxy-release.sh -i + retryCountOnTaskFailure: 5 + displayName: Build Galaxy release - Temp + + - script: cat infra/scenarios/ipa-ad-trust.yml + displayName: Show configuration - Debug + + - script: | + infra/scenarios/start-scenario -D infra/scenarios/ipa-ad-trust.yml + # workaround for 'sudo' + podman exec addc chmod u+r /etc/shadow + podman exec server chmod u+r /etc/shadow + podman exec cli01 chmod u+r /etc/shadow + # Deploy nodes + ansible-playbook -i ansible-freeipa-scenario/inventory.yml ansible-freeipa-scenario/playbooks/deploy_*.yml ||: + ansible-playbook -i ansible-freeipa-scenario/inventory.yml ansible-freeipa-scenario/playbooks/install-cluster.yml || exit 1 + ansible-playbook -i ansible-freeipa-scenario/inventory.yml ansible-freeipa-scenario/playbooks/config_*.yml ||: + displayName: Prepare testing scenario diff --git a/infra/azure/templates/run_tests.yml b/infra/azure/templates/run_tests.yml index e353c6d1a..36e6e32ec 100644 --- a/infra/azure/templates/run_tests.yml +++ b/infra/azure/templates/run_tests.yml @@ -53,41 +53,19 @@ jobs: env: SKIP_GIT_TEST: ${{ parameters.skip_git_test }} - # Deployment of IPA servers/clients is done through the collection - script: | - git fetch --unshallow - utils/build-galaxy-release.sh -i - retryCountOnTaskFailure: 5 - displayName: Build Galaxy release - - - script: cat infra/scenarios/ipa-ad-trust.yml - displayName: Debug - Show configuration - - - script: | - # [ "${{ parameters.test_galaxy }}" == "True" ] && cd ~/.ansible/collections/ansible_collections/freeipa/ansible_freeipa - # - infra/scenarios/start-scenario -D infra/scenarios/ipa-ad-trust.yml - # Give a chance for containers to be up - sleep 5 - # workaround for 'sudo' - podman exec addc chmod u+r /etc/shadow - podman exec server chmod u+r /etc/shadow - podman exec cli01 chmod u+r /etc/shadow - # Deploy nodes - ansible-playbook -i ansible-freeipa-scenario/inventory.yml ansible-freeipa-scenario/playbooks/deploy_*.yml ||: - ansible-playbook -i ansible-freeipa-scenario/inventory.yml ansible-freeipa-scenario/playbooks/install-cluster.yml || exit 1 - ansible-playbook -i ansible-freeipa-scenario/inventory.yml ansible-freeipa-scenario/playbooks/config_*.yml ||: # Run tests - infra/scenarios/run_test_scenario.sh -k + infra/scenarios/run_test_scenario.sh -k -vvv displayName: Run playbook tests env: SKIP_GIT_TEST: ${{ parameters.skip_git_test }} - ${{ if not(parameters.test_galaxy) }}: + ${{ if not(parameters.test_galaxy) }}: ANSIBLE_ROLES_PATH: "${PWD}/roles" ANSIBLE_LIBRARY: "${PWD}/plugins" ANSIBLE_MODULE_UTILS: "${PWD}/plugins/module_utils" + ${{ if parameters.test_galaxy }}: + ANSIBLE_COLLECTIONS_PATH="${HOME}/.ansible/collections/ansible_collections" IPA_DISABLED_MODULES: ${{ variables.ipa_disabled_modules }} IPA_DISABLED_TESTS: ${{ variables.ipa_disabled_tests }} IPA_ENABLED_MODULES: ${{ variables.ipa_enabled_modules }} IPA_ENABLED_TESTS: ${{ variables.ipa_enabled_tests }} - # IPA_VERBOSITY: "-vvv" diff --git a/infra/scenarios/run_test_scenario.sh b/infra/scenarios/run_test_scenario.sh index 8c59cc3f6..c2c0db4cd 100755 --- a/infra/scenarios/run_test_scenario.sh +++ b/infra/scenarios/run_test_scenario.sh @@ -173,3 +173,6 @@ then echo "Shutting down environment" infra/scenarios/stop-scenario fi + +# Return error code +[ "${error:-"NO"}" == "YES" ]