From b44489da5fe642cd2c6a4b4d24376bd56609c3c7 Mon Sep 17 00:00:00 2001 From: Glen Johnson Date: Fri, 29 Sep 2023 13:29:33 -0600 Subject: [PATCH] FIx ansible-lint/sanity test errors --- .github/workflows/ansible-test.yml | 2 +- .gitignore | 1 + dev/docker-compose.yml | 4 ++-- .../conjur-identity-setup/conjur_role_playbook.yml | 2 +- roles/conjur_host_identity/tests/test.sh | 4 ++-- .../tests/test_cases/bad-ssl-config/playbook.yml | 2 +- .../tests/test_cases/cleanup-conjur-identity/playbook.yml | 4 ++-- .../test_cases/configure-conjur-identity/playbook.yml | 2 +- .../test_cases/misconfig-conjur-identity/playbook.yml | 2 +- .../tests/test_cases/not-conjurized/playbook.yml | 2 +- tests/sanity/ignore-2.10.txt | 6 ------ tests/sanity/ignore-2.11.txt | 6 ------ tests/sanity/ignore-2.12.txt | 6 ------ tests/sanity/ignore-2.13.txt | 8 -------- tests/sanity/ignore-2.14.txt | 8 -------- tests/sanity/ignore-2.15.txt | 8 -------- tests/sanity/ignore-2.9.txt | 4 ---- 17 files changed, 13 insertions(+), 58 deletions(-) diff --git a/.github/workflows/ansible-test.yml b/.github/workflows/ansible-test.yml index aa74f4de..091efc31 100644 --- a/.github/workflows/ansible-test.yml +++ b/.github/workflows/ansible-test.yml @@ -74,7 +74,7 @@ jobs: # The docker container has all the pinned dependencies that are required. # Explicitly specify the version of Python we want to test - name: Run sanity tests - run: ansible-test sanity --docker -v --color --python ${{ matrix.python }} + run: ansible-test sanity --docker -v --color --python ${{ matrix.python }} --exclude dev/ --exclude ci/ --exclude secrets.yml working-directory: ./ansible_collections/cyberark/conjur ### diff --git a/.gitignore b/.gitignore index c7b55786..abf17ead 100644 --- a/.gitignore +++ b/.gitignore @@ -21,6 +21,7 @@ reports *.js *.html output/ +importer_result.json # Pycache directories and files **/__pycache__/ diff --git a/dev/docker-compose.yml b/dev/docker-compose.yml index d1c05723..87cf1128 100644 --- a/dev/docker-compose.yml +++ b/dev/docker-compose.yml @@ -25,8 +25,8 @@ services: volumes: - .:/cyberark/dev - /cyberark/dev/conjur-intro/ - - ../roles/conjur_host_identity:/roles/cyberark.conjur.conjur-host-identity/ - - ../roles/conjur_host_identity/tests:/cyberark/tests/conjur-host-identity/ + - ../roles/conjur_host_identity:/roles/cyberark.conjur.conjur_host_identity/ + - ../roles/conjur_host_identity/tests:/cyberark/tests/conjur_host_identity/ - ../plugins:/root/.ansible/plugins - ../tests/conjur_variable:/cyberark/tests/conjur_variable - /var/run/docker.sock:/var/run/docker.sock diff --git a/dev/playbooks/conjur-identity-setup/conjur_role_playbook.yml b/dev/playbooks/conjur-identity-setup/conjur_role_playbook.yml index f1c89ddc..29eabb85 100644 --- a/dev/playbooks/conjur-identity-setup/conjur_role_playbook.yml +++ b/dev/playbooks/conjur-identity-setup/conjur_role_playbook.yml @@ -2,7 +2,7 @@ - name: Configuring conjur identity on remote hosts hosts: testapp roles: - - role: "cyberark.conjur.conjur-host-identity" + - role: "cyberark.conjur.conjur_host_identity" conjur_account: "{{lookup('env', 'CONJUR_ACCOUNT')}}" conjur_appliance_url: "{{lookup('env', 'CONJUR_APPLIANCE_URL')}}" conjur_host_factory_token: "{{lookup('env', 'HFTOKEN')}}" diff --git a/roles/conjur_host_identity/tests/test.sh b/roles/conjur_host_identity/tests/test.sh index 1f7e2814..61d3e7f6 100755 --- a/roles/conjur_host_identity/tests/test.sh +++ b/roles/conjur_host_identity/tests/test.sh @@ -20,7 +20,7 @@ function run_test_case { docker exec -e HFTOKEN="$(hf_token)" \ "$(ansible_cid)" bash -ec " - cd /cyberark/tests/conjur-host-identity + cd /cyberark/tests/conjur_host_identity # You can add -vvvvv here for debugging ansible-playbook test_cases/$test_case/playbook.yml @@ -28,7 +28,7 @@ function run_test_case { if [ -d "test_cases/${test_case}/tests/" ]; then docker exec "$(ansible_cid)" bash -ec " - cd /cyberark/tests/conjur-host-identity + cd /cyberark/tests/conjur_host_identity py.test --junitxml=./junit/${test_case} --connection docker -v test_cases/${test_case}/tests/test_default.py " fi diff --git a/roles/conjur_host_identity/tests/test_cases/bad-ssl-config/playbook.yml b/roles/conjur_host_identity/tests/test_cases/bad-ssl-config/playbook.yml index 2d1282c4..570a47f6 100644 --- a/roles/conjur_host_identity/tests/test_cases/bad-ssl-config/playbook.yml +++ b/roles/conjur_host_identity/tests/test_cases/bad-ssl-config/playbook.yml @@ -5,7 +5,7 @@ - name: Attempt to configure Conjur identity block: - import_role: - name: "cyberark.conjur.conjur-host-identity" + name: "cyberark.conjur.conjur_host_identity" vars: conjur_account: cucumber conjur_appliance_url: "https://conjur-proxy-nginx" diff --git a/roles/conjur_host_identity/tests/test_cases/cleanup-conjur-identity/playbook.yml b/roles/conjur_host_identity/tests/test_cases/cleanup-conjur-identity/playbook.yml index ec472992..718e2717 100644 --- a/roles/conjur_host_identity/tests/test_cases/cleanup-conjur-identity/playbook.yml +++ b/roles/conjur_host_identity/tests/test_cases/cleanup-conjur-identity/playbook.yml @@ -2,7 +2,7 @@ - name: Configuring Conjur identity on remote hosts hosts: testapp roles: - - role: "cyberark.conjur.conjur-host-identity" + - role: "cyberark.conjur.conjur_host_identity" conjur_account: "{{lookup('env', 'CONJUR_ACCOUNT')}}" conjur_appliance_url: "{{lookup('env', 'CONJUR_APPLIANCE_URL')}}" conjur_host_factory_token: "{{lookup('env', 'HFTOKEN')}}" @@ -13,5 +13,5 @@ - name: Revoke Conjur identity from remote hosts hosts: testapp roles: - - role: "cyberark.conjur.conjur-host-identity" + - role: "cyberark.conjur.conjur_host_identity" state: absent diff --git a/roles/conjur_host_identity/tests/test_cases/configure-conjur-identity/playbook.yml b/roles/conjur_host_identity/tests/test_cases/configure-conjur-identity/playbook.yml index 7309d21b..44fa6e2e 100644 --- a/roles/conjur_host_identity/tests/test_cases/configure-conjur-identity/playbook.yml +++ b/roles/conjur_host_identity/tests/test_cases/configure-conjur-identity/playbook.yml @@ -2,7 +2,7 @@ - name: Configuring Conjur identity on remote hosts hosts: testapp roles: - - role: "cyberark.conjur.conjur-host-identity" + - role: "cyberark.conjur.conjur_host_identity" conjur_account: "{{lookup('env', 'CONJUR_ACCOUNT')}}" conjur_appliance_url: "{{lookup('env', 'CONJUR_APPLIANCE_URL')}}" conjur_host_factory_token: "{{lookup('env', 'HFTOKEN')}}" diff --git a/roles/conjur_host_identity/tests/test_cases/misconfig-conjur-identity/playbook.yml b/roles/conjur_host_identity/tests/test_cases/misconfig-conjur-identity/playbook.yml index 96f31c7d..d09af37c 100644 --- a/roles/conjur_host_identity/tests/test_cases/misconfig-conjur-identity/playbook.yml +++ b/roles/conjur_host_identity/tests/test_cases/misconfig-conjur-identity/playbook.yml @@ -5,7 +5,7 @@ - name: Attempt to configure Conjur identity block: - import_role: - name: "cyberark.conjur.conjur-host-identity" + name: "cyberark.conjur.conjur_host_identity" vars: conjur_account: cucumber # conjur_appliance_url: "https://conjur-proxy-nginx" diff --git a/roles/conjur_host_identity/tests/test_cases/not-conjurized/playbook.yml b/roles/conjur_host_identity/tests/test_cases/not-conjurized/playbook.yml index 9175cfbb..658beee5 100644 --- a/roles/conjur_host_identity/tests/test_cases/not-conjurized/playbook.yml +++ b/roles/conjur_host_identity/tests/test_cases/not-conjurized/playbook.yml @@ -13,7 +13,7 @@ - name: Attempt to configure Conjur identity block: - import_role: - name: "cyberark.conjur.conjur-host-identity" + name: "cyberark.conjur.conjur_host_identity" vars: conjur_account: "{{lookup('env', 'CONJUR_ACCOUNT')}}" conjur_appliance_url: "{{lookup('env', 'CONJUR_APPLIANCE_URL')}}" diff --git a/tests/sanity/ignore-2.10.txt b/tests/sanity/ignore-2.10.txt index a81ded00..adfba63e 100644 --- a/tests/sanity/ignore-2.10.txt +++ b/tests/sanity/ignore-2.10.txt @@ -1,9 +1,3 @@ -dev/start.sh shebang Jenkinsfile shebang tests/conjur_variable/policy/root.yml yamllint:unparsable-with-libyaml roles/conjur_host_identity/tests/policy/root.yml yamllint:unparsable-with-libyaml # File loaded by summon utility (in Jenkinsfile), not via Python -ci/build_release shebang -ci/publish_to_galaxy shebang -ci/test.sh shebang -secrets.yml yamllint:unparsable-with-libyaml # File loaded by Conjur server, not via Python -dev/policy/root.yml yamllint:unparsable-with-libyaml \ No newline at end of file diff --git a/tests/sanity/ignore-2.11.txt b/tests/sanity/ignore-2.11.txt index b643480a..adfba63e 100644 --- a/tests/sanity/ignore-2.11.txt +++ b/tests/sanity/ignore-2.11.txt @@ -1,9 +1,3 @@ Jenkinsfile shebang -dev/start.sh shebang tests/conjur_variable/policy/root.yml yamllint:unparsable-with-libyaml roles/conjur_host_identity/tests/policy/root.yml yamllint:unparsable-with-libyaml # File loaded by summon utility (in Jenkinsfile), not via Python -ci/build_release shebang -ci/publish_to_galaxy shebang -ci/test.sh shebang -secrets.yml yamllint:unparsable-with-libyaml # File loaded by Conjur server, not via Python -dev/policy/root.yml yamllint:unparsable-with-libyaml \ No newline at end of file diff --git a/tests/sanity/ignore-2.12.txt b/tests/sanity/ignore-2.12.txt index 6615526d..c5b63bd7 100644 --- a/tests/sanity/ignore-2.12.txt +++ b/tests/sanity/ignore-2.12.txt @@ -1,9 +1,3 @@ Jenkinsfile shebang -dev/start.sh shebang tests/conjur_variable/policy/root.yml yamllint:unparsable-with-libyaml # File loaded by Conjur server, not via Python roles/conjur_host_identity/tests/policy/root.yml yamllint:unparsable-with-libyaml # File loaded by Conjur server, not via Python -ci/build_release shebang -ci/publish_to_galaxy shebang -ci/test.sh shebang -secrets.yml yamllint:unparsable-with-libyaml # File loaded by Summon utility (in Jenkinsfile), not via Python -dev/policy/root.yml yamllint:unparsable-with-libyaml \ No newline at end of file diff --git a/tests/sanity/ignore-2.13.txt b/tests/sanity/ignore-2.13.txt index e456a5ff..4144f5b4 100644 --- a/tests/sanity/ignore-2.13.txt +++ b/tests/sanity/ignore-2.13.txt @@ -1,10 +1,2 @@ -ci/build_release shebang -ci/publish_to_galaxy shebang -ci/test.sh shebang -dev/policy/root.yml yamllint:unparsable-with-libyaml -dev/start.sh shebang -dev/stop.sh shebang -dev/util.sh shebang Jenkinsfile shebang plugins/lookup/conjur_variable.py validate-modules:version-added-must-be-major-or-minor -secrets.yml yamllint:unparsable-with-libyaml diff --git a/tests/sanity/ignore-2.14.txt b/tests/sanity/ignore-2.14.txt index e456a5ff..4144f5b4 100644 --- a/tests/sanity/ignore-2.14.txt +++ b/tests/sanity/ignore-2.14.txt @@ -1,10 +1,2 @@ -ci/build_release shebang -ci/publish_to_galaxy shebang -ci/test.sh shebang -dev/policy/root.yml yamllint:unparsable-with-libyaml -dev/start.sh shebang -dev/stop.sh shebang -dev/util.sh shebang Jenkinsfile shebang plugins/lookup/conjur_variable.py validate-modules:version-added-must-be-major-or-minor -secrets.yml yamllint:unparsable-with-libyaml diff --git a/tests/sanity/ignore-2.15.txt b/tests/sanity/ignore-2.15.txt index e456a5ff..4144f5b4 100644 --- a/tests/sanity/ignore-2.15.txt +++ b/tests/sanity/ignore-2.15.txt @@ -1,10 +1,2 @@ -ci/build_release shebang -ci/publish_to_galaxy shebang -ci/test.sh shebang -dev/policy/root.yml yamllint:unparsable-with-libyaml -dev/start.sh shebang -dev/stop.sh shebang -dev/util.sh shebang Jenkinsfile shebang plugins/lookup/conjur_variable.py validate-modules:version-added-must-be-major-or-minor -secrets.yml yamllint:unparsable-with-libyaml diff --git a/tests/sanity/ignore-2.9.txt b/tests/sanity/ignore-2.9.txt index 1ee255c7..e3a0cf63 100644 --- a/tests/sanity/ignore-2.9.txt +++ b/tests/sanity/ignore-2.9.txt @@ -1,7 +1,3 @@ Jenkinsfile shebang -dev/start.sh shebang tests/conjur_variable/test.sh shebang roles/conjur_host_identity/tests/test.sh shebang -ci/build_release shebang -ci/publish_to_galaxy shebang -ci/test.sh shebang \ No newline at end of file