summaryrefslogtreecommitdiff
path: root/test/integration/targets/ansible-galaxy
diff options
context:
space:
mode:
authorJordan Borean <jborean93@gmail.com>2020-02-29 08:59:09 +1000
committerGitHub <noreply@github.com>2020-02-29 08:59:09 +1000
commit26129fcb8056220a9f01ef14a12784a7bb4c4327 (patch)
tree746285e9ea34a7244dd54fc415d7db71d3823bc7 /test/integration/targets/ansible-galaxy
parentd30c57ab22db24f6901166fcc3155667bdd3443f (diff)
downloadansible-26129fcb8056220a9f01ef14a12784a7bb4c4327.tar.gz
ansible-galaxy - optimise some paths and use fake galaxy int tests (#67685)
* ansible-galaxy - optimise some paths and use fake galaxy int tests * Added init, built, and publish tests * Test against both mocked Galaxy and AH server * Finish off writing the install tests * Fix up broken tests * Rename test target and add migrated tests * Use cloud provider for Galaxy implementation * Added blank static config * Use correct alias group * Set release version and fix copy typo * Remove reset step as it is no longer needed * Use sane env var names for test container name
Diffstat (limited to 'test/integration/targets/ansible-galaxy')
-rwxr-xr-xtest/integration/targets/ansible-galaxy/runme.sh95
1 files changed, 1 insertions, 94 deletions
diff --git a/test/integration/targets/ansible-galaxy/runme.sh b/test/integration/targets/ansible-galaxy/runme.sh
index 2f735fb172..3409352b8b 100755
--- a/test/integration/targets/ansible-galaxy/runme.sh
+++ b/test/integration/targets/ansible-galaxy/runme.sh
@@ -151,104 +151,11 @@ rm -rf "${role_testdir}"
#################################
# ansible-galaxy collection tests
#################################
+# TODO: Move these to ansible-galaxy-collection
-f_ansible_galaxy_status \
- "collection init tests to make sure the relative dir logic works"
galaxy_testdir=$(mktemp -d)
pushd "${galaxy_testdir}"
- ansible-galaxy collection init ansible_test.my_collection "$@"
-
- # Test that the collection skeleton was created in the expected directory
- for galaxy_collection_dir in "docs" "plugins" "roles"
- do
- [[ -d "${galaxy_testdir}/ansible_test/my_collection/${galaxy_collection_dir}" ]]
- done
-
-popd # ${galaxy_testdir}
-rm -fr "${galaxy_testdir}"
-
-f_ansible_galaxy_status \
- "collection init tests to make sure the --init-path logic works"
-galaxy_testdir=$(mktemp -d)
-pushd "${galaxy_testdir}"
-
- ansible-galaxy collection init ansible_test.my_collection --init-path "${galaxy_testdir}/test" "$@"
-
- # Test that the collection skeleton was created in the expected directory
- for galaxy_collection_dir in "docs" "plugins" "roles"
- do
- [[ -d "${galaxy_testdir}/test/ansible_test/my_collection/${galaxy_collection_dir}" ]]
- done
-
-popd # ${galaxy_testdir}
-
-f_ansible_galaxy_status \
- "collection build test creating artifact in current directory"
-
-pushd "${galaxy_testdir}/test/ansible_test/my_collection"
-
- ansible-galaxy collection build "$@"
-
- [[ -f "${galaxy_testdir}/test/ansible_test/my_collection/ansible_test-my_collection-1.0.0.tar.gz" ]]
-
-popd # ${galaxy_testdir}/ansible_test/my_collection
-
-f_ansible_galaxy_status \
- "collection build test to make sure we can specify a relative path"
-
-pushd "${galaxy_testdir}"
-
- ansible-galaxy collection build "test/ansible_test/my_collection" "$@"
-
- [[ -f "${galaxy_testdir}/ansible_test-my_collection-1.0.0.tar.gz" ]]
-
- # Make sure --force works
- ansible-galaxy collection build "test/ansible_test/my_collection" --force "$@"
-
- [[ -f "${galaxy_testdir}/ansible_test-my_collection-1.0.0.tar.gz" ]]
-
-f_ansible_galaxy_status \
- "collection install from local tarball test"
-
- ansible-galaxy collection install "ansible_test-my_collection-1.0.0.tar.gz" -p ./install "$@" | tee out.txt
-
- [[ -f "${galaxy_testdir}/install/ansible_collections/ansible_test/my_collection/MANIFEST.json" ]]
- grep "Installing 'ansible_test.my_collection:1.0.0' to .*" out.txt
-
-
-f_ansible_galaxy_status \
- "collection install with existing collection and without --force"
-
- ansible-galaxy collection install "ansible_test-my_collection-1.0.0.tar.gz" -p ./install "$@" | tee out.txt
-
- [[ -f "${galaxy_testdir}/install/ansible_collections/ansible_test/my_collection/MANIFEST.json" ]]
- grep "Skipping 'ansible_test.my_collection' as it is already installed" out.txt
-
-f_ansible_galaxy_status \
- "collection install with existing collection and with --force"
-
- ansible-galaxy collection install "ansible_test-my_collection-1.0.0.tar.gz" -p ./install --force "$@" | tee out.txt
-
- [[ -f "${galaxy_testdir}/install/ansible_collections/ansible_test/my_collection/MANIFEST.json" ]]
- grep "Installing 'ansible_test.my_collection:1.0.0' to .*" out.txt
-
-f_ansible_galaxy_status \
- "ansible-galaxy with a sever list with an undefined URL"
-
- ANSIBLE_GALAXY_SERVER_LIST=undefined ansible-galaxy collection install "ansible_test-my_collection-1.0.0.tar.gz" -p ./install --force "$@" 2>&1 | tee out.txt || echo "expected failure"
-
- grep "No setting was provided for required configuration plugin_type: galaxy_server plugin: undefined setting: url" out.txt
-
-f_ansible_galaxy_status \
- "ansible-galaxy with an empty server list"
-
- ANSIBLE_GALAXY_SERVER_LIST='' ansible-galaxy collection install "ansible_test-my_collection-1.0.0.tar.gz" -p ./install --force "$@" | tee out.txt
-
- [[ -f "${galaxy_testdir}/install/ansible_collections/ansible_test/my_collection/MANIFEST.json" ]]
- grep "Installing 'ansible_test.my_collection:1.0.0' to .*" out.txt
-
-
## ansible-galaxy collection list tests
# Create more collections and put them in various places