diff --git a/.secrets.baseline b/.secrets.baseline new file mode 100644 index 00000000..167966d1 --- /dev/null +++ b/.secrets.baseline @@ -0,0 +1,438 @@ +{ + "exclude": { + "files": "^.secrets.baseline$", + "lines": null + }, + "generated_at": "2024-09-13T14:19:41Z", + "plugins_used": [ + { + "name": "AWSKeyDetector" + }, + { + "name": "ArtifactoryDetector" + }, + { + "name": "AzureStorageKeyDetector" + }, + { + "base64_limit": 4.5, + "name": "Base64HighEntropyString" + }, + { + "name": "BasicAuthDetector" + }, + { + "name": "BoxDetector" + }, + { + "name": "CloudantDetector" + }, + { + "ghe_instance": "github.ibm.com", + "name": "GheDetector" + }, + { + "name": "GitHubTokenDetector" + }, + { + "hex_limit": 3, + "name": "HexHighEntropyString" + }, + { + "name": "IbmCloudIamDetector" + }, + { + "name": "IbmCosHmacDetector" + }, + { + "name": "JwtTokenDetector" + }, + { + "keyword_exclude": null, + "name": "KeywordDetector" + }, + { + "name": "MailchimpDetector" + }, + { + "name": "NpmDetector" + }, + { + "name": "PrivateKeyDetector" + }, + { + "name": "SlackDetector" + }, + { + "name": "SoftlayerDetector" + }, + { + "name": "SquareOAuthDetector" + }, + { + "name": "StripeDetector" + }, + { + "name": "TwilioKeyDetector" + } + ], + "results": { + ".bandit.baseline": [ + { + "hashed_secret": "d7c1edb7f7ad79cc44f0c31e79beef1f93171c29", + "is_secret": false, + "is_verified": false, + "line_number": 200, + "type": "Secret Keyword", + "verified_result": null + } + ], + "docs/source/modules/region_jcl.rst": [ + { + "hashed_secret": "470b68712af0fb06ae601bc2ca03baf81eba508d", + "is_secret": false, + "is_verified": false, + "line_number": 3594, + "type": "Secret Keyword", + "verified_result": null + } + ], + "docs/source/playbooks.rst": [ + { + "hashed_secret": "d2e2ab0f407e4ee3cf2ab87d61c31b25a74085e5", + "is_secret": false, + "is_verified": false, + "line_number": 193, + "type": "Secret Keyword", + "verified_result": null + }, + { + "hashed_secret": "ad9292cc7daefb39a15326b4c3bf466db173a684", + "is_secret": false, + "is_verified": false, + "line_number": 206, + "type": "Secret Keyword", + "verified_result": null + }, + { + "hashed_secret": "470b68712af0fb06ae601bc2ca03baf81eba508d", + "is_secret": false, + "is_verified": false, + "line_number": 221, + "type": "Secret Keyword", + "verified_result": null + } + ], + "plugins/module_utils/cmci.py": [ + { + "hashed_secret": "d7c1edb7f7ad79cc44f0c31e79beef1f93171c29", + "is_secret": false, + "is_verified": false, + "line_number": 36, + "type": "Secret Keyword", + "verified_result": null + } + ], + "plugins/modules/region_jcl.py": [ + { + "hashed_secret": "470b68712af0fb06ae601bc2ca03baf81eba508d", + "is_secret": false, + "is_verified": false, + "line_number": 67, + "type": "Secret Keyword", + "verified_result": null + } + ], + "tests/integration/targets/cics_cmci/playbooks/cics_cmci_http.yml": [ + { + "hashed_secret": "d2e2ab0f407e4ee3cf2ab87d61c31b25a74085e5", + "is_secret": false, + "is_verified": false, + "line_number": 58, + "type": "Secret Keyword", + "verified_result": null + } + ], + "tests/integration/targets/cics_cmci/playbooks/cics_cmci_https.yml": [ + { + "hashed_secret": "d2e2ab0f407e4ee3cf2ab87d61c31b25a74085e5", + "is_secret": false, + "is_verified": false, + "line_number": 54, + "type": "Secret Keyword", + "verified_result": null + } + ], + "tests/integration/targets/cics_cmci/playbooks/cics_cmci_module_defaults_cmci.yml": [ + { + "hashed_secret": "d2e2ab0f407e4ee3cf2ab87d61c31b25a74085e5", + "is_secret": false, + "is_verified": false, + "line_number": 114, + "type": "Secret Keyword", + "verified_result": null + } + ], + "tests/integration/targets/cics_cmci/playbooks/cics_cmci_module_defaults_cmci_group.yml": [ + { + "hashed_secret": "d2e2ab0f407e4ee3cf2ab87d61c31b25a74085e5", + "is_secret": false, + "is_verified": false, + "line_number": 114, + "type": "Secret Keyword", + "verified_result": null + } + ], + "tests/integration/targets/cics_cmci/playbooks/cmci_bas_install.yml": [ + { + "hashed_secret": "d2e2ab0f407e4ee3cf2ab87d61c31b25a74085e5", + "is_secret": false, + "is_verified": false, + "line_number": 63, + "type": "Secret Keyword", + "verified_result": null + } + ], + "tests/integration/targets/cics_cmci/playbooks/cmci_bas_install_error.yml": [ + { + "hashed_secret": "d2e2ab0f407e4ee3cf2ab87d61c31b25a74085e5", + "is_secret": false, + "is_verified": false, + "line_number": 65, + "type": "Secret Keyword", + "verified_result": null + } + ], + "tests/integration/targets/cics_cmci/playbooks/cmci_bas_link.yml": [ + { + "hashed_secret": "d2e2ab0f407e4ee3cf2ab87d61c31b25a74085e5", + "is_secret": false, + "is_verified": false, + "line_number": 57, + "type": "Secret Keyword", + "verified_result": null + } + ], + "tests/integration/targets/cics_cmci/playbooks/cmci_create_pipeline_failure.yml": [ + { + "hashed_secret": "d2e2ab0f407e4ee3cf2ab87d61c31b25a74085e5", + "is_secret": false, + "is_verified": false, + "line_number": 14, + "type": "Secret Keyword", + "verified_result": null + } + ], + "tests/integration/targets/cics_cmci/playbooks/cmci_incorrect_context.yml": [ + { + "hashed_secret": "d2e2ab0f407e4ee3cf2ab87d61c31b25a74085e5", + "is_secret": false, + "is_verified": false, + "line_number": 14, + "type": "Secret Keyword", + "verified_result": null + } + ], + "tests/integration/targets/cics_cmci/playbooks/cmci_incorrect_host.yml": [ + { + "hashed_secret": "d2e2ab0f407e4ee3cf2ab87d61c31b25a74085e5", + "is_secret": false, + "is_verified": false, + "line_number": 14, + "type": "Secret Keyword", + "verified_result": null + } + ], + "tests/integration/targets/cics_cmci/playbooks/cmci_incorrect_port.yml": [ + { + "hashed_secret": "d2e2ab0f407e4ee3cf2ab87d61c31b25a74085e5", + "is_secret": false, + "is_verified": false, + "line_number": 14, + "type": "Secret Keyword", + "verified_result": null + } + ], + "tests/integration/targets/cics_cmci/playbooks/cmci_incorrect_scheme.yml": [ + { + "hashed_secret": "d2e2ab0f407e4ee3cf2ab87d61c31b25a74085e5", + "is_secret": false, + "is_verified": false, + "line_number": 43, + "type": "Secret Keyword", + "verified_result": null + } + ], + "tests/integration/targets/cics_cmci/playbooks/cmci_incorrect_scope.yml": [ + { + "hashed_secret": "d2e2ab0f407e4ee3cf2ab87d61c31b25a74085e5", + "is_secret": false, + "is_verified": false, + "line_number": 14, + "type": "Secret Keyword", + "verified_result": null + } + ], + "tests/integration/targets/cics_cmci/playbooks/cmci_insecure_false.yml": [ + { + "hashed_secret": "d2e2ab0f407e4ee3cf2ab87d61c31b25a74085e5", + "is_secret": false, + "is_verified": false, + "line_number": 14, + "type": "Secret Keyword", + "verified_result": null + } + ], + "tests/integration/targets/cics_cmci/playbooks/cmci_install_bundle_failure.yml": [ + { + "hashed_secret": "d2e2ab0f407e4ee3cf2ab87d61c31b25a74085e5", + "is_secret": false, + "is_verified": false, + "line_number": 34, + "type": "Secret Keyword", + "verified_result": null + } + ], + "tests/integration/targets/cics_cmci/playbooks/cmci_invalid_credentials.yml": [ + { + "hashed_secret": "d2e2ab0f407e4ee3cf2ab87d61c31b25a74085e5", + "is_secret": false, + "is_verified": false, + "line_number": 17, + "type": "Secret Keyword", + "verified_result": null + } + ], + "tests/integration/targets/cics_cmci_missing_requests_library/playbooks/cmci_missing_requests.yml": [ + { + "hashed_secret": "bb21216b09d3be2d9e40beab38ae57af2b11d081", + "is_secret": false, + "is_verified": false, + "line_number": 14, + "type": "Secret Keyword", + "verified_result": null + } + ], + "tests/integration/targets/cics_cmci_missing_xmltodict_library/playbooks/cmci_missing_xmltodict.yml": [ + { + "hashed_secret": "bb21216b09d3be2d9e40beab38ae57af2b11d081", + "is_secret": false, + "is_verified": false, + "line_number": 14, + "type": "Secret Keyword", + "verified_result": null + } + ], + "tests/unit/action/test_region_jcl.py": [ + { + "hashed_secret": "aaa278850583dba8b8e37c82f0cac9add24746c8", + "is_secret": false, + "is_verified": false, + "line_number": 164, + "type": "Secret Keyword", + "verified_result": null + }, + { + "hashed_secret": "32a70e70eeda6ca2f329769250b2259015b1a5e6", + "is_secret": false, + "is_verified": false, + "line_number": 347, + "type": "Secret Keyword", + "verified_result": null + }, + { + "hashed_secret": "6700343a87931b984c55e90a77d9820ab94befa1", + "is_secret": false, + "is_verified": false, + "line_number": 390, + "type": "Secret Keyword", + "verified_result": null + }, + { + "hashed_secret": "6cc40a4c6ebe271198a0bfb98c145e580ff167ba", + "is_secret": false, + "is_verified": false, + "line_number": 401, + "type": "Secret Keyword", + "verified_result": null + } + ], + "tests/unit/helpers/data_set_helper.py": [ + { + "hashed_secret": "7e9b23df7b5f7cf363cb41a3a688c28c334e7365", + "is_secret": false, + "is_verified": false, + "line_number": 445, + "type": "Secret Keyword", + "verified_result": null + }, + { + "hashed_secret": "6cc40a4c6ebe271198a0bfb98c145e580ff167ba", + "is_secret": false, + "is_verified": false, + "line_number": 454, + "type": "Secret Keyword", + "verified_result": null + } + ], + "tests/unit/modules/test_cmci_get.py": [ + { + "hashed_secret": "62cdb7020ff920e5aa642c3d4066950dd1f01f4d", + "is_secret": false, + "is_verified": false, + "line_number": 252, + "type": "Secret Keyword", + "verified_result": null + } + ], + "tests/unit/modules/test_region_jcl.py": [ + { + "hashed_secret": "6700343a87931b984c55e90a77d9820ab94befa1", + "is_secret": false, + "is_verified": false, + "line_number": 600, + "type": "Secret Keyword", + "verified_result": null + }, + { + "hashed_secret": "32a70e70eeda6ca2f329769250b2259015b1a5e6", + "is_secret": false, + "is_verified": false, + "line_number": 611, + "type": "Secret Keyword", + "verified_result": null + }, + { + "hashed_secret": "7e9b23df7b5f7cf363cb41a3a688c28c334e7365", + "is_secret": false, + "is_verified": false, + "line_number": 662, + "type": "Secret Keyword", + "verified_result": null + }, + { + "hashed_secret": "6cc40a4c6ebe271198a0bfb98c145e580ff167ba", + "is_secret": false, + "is_verified": false, + "line_number": 671, + "type": "Secret Keyword", + "verified_result": null + } + ], + "tests/unit/plugin_utils/test_module_action_plugin.py": [ + { + "hashed_secret": "bdef02c7a69df26167b3e7524b64ce59b7da5576", + "is_secret": false, + "is_verified": false, + "line_number": 60, + "type": "Secret Keyword", + "verified_result": null + } + ] + }, + "version": "0.13.1+ibm.62.dss", + "word_list": { + "file": null, + "hash": null + } +} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index a57ebce5..00000000 --- a/.travis.yml +++ /dev/null @@ -1,70 +0,0 @@ -language: python -python: - - "2.7" - - "3.8" - - "3.9" - - "3.10" -env: - - ANSIBLE_VERSION="stable-2.11" - - ANSIBLE_VERSION="stable-2.12" - - ANSIBLE_VERSION="stable-2.13" - - ANSIBLE_VERSION="stable-2.14" - - ANSIBLE_VERSION="stable-2.15" - - ANSIBLE_VERSION="devel" -matrix: - exclude: - # Python 2.7 max ansible version is 2.11 - - python: "2.7" - env: ANSIBLE_VERSION="stable-2.12" - - python: "2.7" - env: ANSIBLE_VERSION="stable-2.13" - - python: "2.7" - env: ANSIBLE_VERSION="stable-2.14" - - python: "2.7" - env: ANSIBLE_VERSION="stable-2.15" - - python: "2.7" - env: ANSIBLE_VERSION="devel" - # Python 3.8 max ansible version is 2.13 - - python: "3.8" - env: ANSIBLE_VERSION="stable-2.14" - - python: "3.8" - env: ANSIBLE_VERSION="stable-2.15" - - python: "3.8" - env: ANSIBLE_VERSION="devel" - # Ansible 2.11 max python version support is 3.9 - - python: "3.10" - env: ANSIBLE_VERSION="stable-2.11" -services: - - docker -before_script: source .travis/get_vault_data.sh -script: | - echo "" - echo "#############################################" - echo "# PYTHON VERSION: ${TRAVIS_PYTHON_VERSION}" - echo "# ANSIBLE VERSION: ${ANSIBLE_VERSION}" - echo "#############################################" - echo "" - ANSIBLE_NO_STABLE="${ANSIBLE_VERSION//stable-/}" - ANSIBLE_NO_DOT="${ANSIBLE_NO_STABLE//./}" - PYTHON_NO_DOT="${TRAVIS_PYTHON_VERSION//./}" - IMAGE_NAME="cics-python-$PYTHON_NO_DOT-ansible-$ANSIBLE_NO_DOT" - - echo "$ARTIFACTORY_TOKEN" | docker login --username $ARTIFACTORY_USER --password-stdin $DOCKER_REGISTRY - docker pull $DOCKER_REGISTRY/$IMAGE_NAME:latest - - bash "$TRAVIS_BUILD_DIR"/.travis/build_env.sh - - docker run --rm -it -v \ - $(pwd):/root/ansible_collections/ibm/ibm_zos_cics \ - -e TRAVIS_PYTHON_VERSION=$TRAVIS_PYTHON_VERSION \ - $DOCKER_REGISTRY/$IMAGE_NAME:latest \ - bash -c "cd /root/ansible_collections/ibm/ibm_zos_cics && bash .travis/build_and_test.sh" - -jobs: - include: - - stage: deploy - script: bash .travis/push_artifactory.sh - python: "3.10" - env: ANSIBLE_VERSION="stable-2.14" - on: - branch: main diff --git a/.travis/build_and_test.sh b/.travis/build_and_test.sh deleted file mode 100755 index 1a946c4f..00000000 --- a/.travis/build_and_test.sh +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/env bash - -set -e - -git config --global --add safe.directory /root/ansible_collections/ibm/ibm_zos_cics - -pip install -r /root/ansible_collections/ibm/ibm_zos_cics/dev-requirements.txt - -# ansible-lint requires python >= 3.9 -if [ "$TRAVIS_PYTHON_VERSION" != "2.7" ] && [ "$TRAVIS_PYTHON_VERSION" != "3.8" ]; then - echo "" - echo "##########################################################" - echo "###################### Ansible-lint ######################" - echo "##########################################################" - echo "" - ansible-lint --profile production -fi - -echo "" -echo "##########################################################" -echo "################## Ansible Sanity Tests ##################" -echo "##########################################################" -echo "" -ansible-test sanity --python "$TRAVIS_PYTHON_VERSION" - -echo "" -echo "##########################################################" -echo "################### Ansible Unit Tests ###################" -echo "##########################################################" -echo "" -ansible-test units --python "$TRAVIS_PYTHON_VERSION" - -echo "" -echo "###########################################################" -echo "################ Ansible Integration Tests ################" -echo "###########################################################" -echo "" -ansible-test integration cics_cmci --python "$TRAVIS_PYTHON_VERSION" - -echo "" -echo "##########################################################" -echo "############## Ansible Missing Module Tests ##############" -echo "##########################################################" -echo "" -pip uninstall xmltodict -y -ansible-test integration cics_cmci_missing_xmltodict_library --python "$TRAVIS_PYTHON_VERSION" - -pip install -r /root/ansible_collections/ibm/ibm_zos_cics/dev-requirements.txt -pip uninstall requests -y -ansible-test integration cics_cmci_missing_requests_library --python "$TRAVIS_PYTHON_VERSION" - -echo "" -echo "###########################################################" -echo "#################### Build Collection #####################" -echo "###########################################################" -echo "" -pip install -r /root/ansible_collections/ibm/ibm_zos_cics/dev-requirements.txt -ansible-galaxy collection build /root/ansible_collections/ibm/ibm_zos_cics --output-path /root/ansible_collections/ibm/ibm_zos_cics --force -ansible-galaxy collection install /root/ansible_collections/ibm/ibm_zos_cics/ibm-ibm_zos_cics-* --force diff --git a/.travis/build_env.sh b/.travis/build_env.sh deleted file mode 100755 index 58badf81..00000000 --- a/.travis/build_env.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env bash - -A="A" -B="B" -star="*" - -TRAVIS_NO_DOT="${TRAVIS_JOB_NUMBER//./D}" - -program_name_1="A$TRAVIS_NO_DOT$A" -program_name_2="A$TRAVIS_NO_DOT$B" -program_filter="A$TRAVIS_NO_DOT$star" - -echo "" -echo "################ Job-Specific Variables ################" -echo "## Program 1 Name: $program_name_1" -echo "## Program 2 Name: $program_name_2" -echo "## Program Filter: $program_filter" -echo "" - -echo "############# Creating cmci-variables.yml #############" -touch "$TRAVIS_BUILD_DIR"/tests/integration/targets/cics_cmci/cmci-variables.yml -{ - echo cmci_host: "$CMCI_HOST" - echo cmci_port: "$CMCI_PORT" - echo cmci_secure_port: "$CMCI_SECURE_PORT" - echo cmci_user: "$CMCI_USER" - echo cmci_password: "$CMCI_PASS" - echo cmci_context: "$CMCI_CONTEXT" - echo cmci_scope: "$CMCI_SCOPE" - echo cmci_scope_region_1: "$CMCI_REGION_1" - echo cmci_scope_region_2: "$CMCI_REGION_2" - echo cmci_program_name_1: "$program_name_1" - echo cmci_program_name_2: "$program_name_2" - echo cmci_program_filter: "$program_filter" -} >>"$TRAVIS_BUILD_DIR"/tests/integration/targets/cics_cmci/cmci-variables.yml diff --git a/.travis/get_vault_data.sh b/.travis/get_vault_data.sh deleted file mode 100755 index 7a3af9ca..00000000 --- a/.travis/get_vault_data.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env bash - -# Wiki page on Vault Integration: -# https://cicswiki.hursley.ibm.com:9443/wiki/CICS_Explorer/artifactory_vault - -VAULT_ONETIME_TOKEN=$(curl -k -s --request POST --data '{"role_id":"'"$VAULT_ROLE_ID"'","secret_id":"'"$VAULT_SECRET_ID"'"}' "$VAULT_URL"/auth/approle/login | jq -r ".auth.client_token") -ARTI=$(curl -k -s --header "X-Vault-Token: $VAULT_ONETIME_TOKEN" "$VAULT_URL"/"$VAULT_PATH"/"artifactory" | jq -r ".data.data") -export "ARTIFACTORY_USER"="$(jq -r ".user" <<<"$ARTI")" -export "ARTIFACTORY_TOKEN"="$(jq -r ".token" <<<"$ARTI")" - -PLEX=$(curl -k -s --header "X-Vault-Token: $VAULT_ONETIME_TOKEN" "$VAULT_URL"/"$VAULT_PATH"/plex2 | jq -r ".data.data") -export "CMCI_USER"="$(jq -r ".username" <<<"$PLEX")" -export "CMCI_PASS"="$(jq -r ".password" <<<"$PLEX")" - -CMCI=$(curl -k -s --header "X-Vault-Token: $VAULT_ONETIME_TOKEN" "$VAULT_URL"/"$VAULT_PATH"/cmci | jq -r ".data.data") -export "CMCI_HOST"="$(jq -r ".url" <<<"$CMCI")" -export "CMCI_PORT"="$(jq -r ".port" <<<"$CMCI")" -export "CMCI_SECURE_PORT"="$(jq -r ".secure_port" <<<"$CMCI")" -export "CMCI_SCOPE"="$(jq -r ".scope" <<<"$CMCI")" -export "CMCI_REGION_1"="$(jq -r ".region_1" <<<"$CMCI")" -export "CMCI_REGION_2"="$(jq -r ".region_2" <<<"$CMCI")" -export "CMCI_CONTEXT"="$(jq -r ".context" <<<"$CMCI")" diff --git a/.travis/push_artifactory.sh b/.travis/push_artifactory.sh deleted file mode 100755 index cb93053a..00000000 --- a/.travis/push_artifactory.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env bash - -set -e - -pip install https://github.com/ansible/ansible/archive/stable-2.14.tar.gz - -ansible-galaxy collection build "$TRAVIS_BUILD_DIR" --force - -file_with_prefix="$(find . -type f -iname "ibm-ibm_zos_cics-*")" -file="${file_with_prefix//.\//}" -no_extension="${file//.tar.gz/}" -no_starting="${no_extension//.\//}" -version_number="${no_starting//ibm-ibm_zos_cics-/}" -TRAVIS_NO_DOT="${TRAVIS_JOB_NUMBER//./D}" - -echo "" -echo "##########################################################" -echo "############# Uploading build to Artifactory #############" -echo "##########################################################" -echo "#" -echo "# File: $file" -echo "# Version: $version_number" -echo "#" -echo "##########################################################" - -curl -ksSf \ - -H "Authorization: Bearer $ARTIFACTORY_TOKEN" -X PUT \ - -T "$TRAVIS_BUILD_DIR"/"$file" \ - "$ARTIFACTORY_URL"/"$version_number"/"$TRAVIS_NO_DOT"/"$file" diff --git a/.whitesource b/.whitesource deleted file mode 100644 index 7d0b5b83..00000000 --- a/.whitesource +++ /dev/null @@ -1,12 +0,0 @@ -{ - "settingsInheritedFrom": "whitesource-config/whitesource-config@master", - "remediateSettings": { - "enableRenovate": true, - "extends": [ - "config:base" - ] - }, - "issueSettings": { - "issueRepoName": "cics-ts-tracking" - } -} diff --git a/tests/integration/targets/cics_cmci/playbooks/cics_cmci_module_defaults_cmci.yml b/tests/integration/targets/cics_cmci/playbooks/cics_cmci_module_defaults_cmci.yml index 94512dcd..dd3a3a48 100644 --- a/tests/integration/targets/cics_cmci/playbooks/cics_cmci_module_defaults_cmci.yml +++ b/tests/integration/targets/cics_cmci/playbooks/cics_cmci_module_defaults_cmci.yml @@ -232,6 +232,10 @@ register: result failed_when: false + - name: Debug result + ansible.builtin.debug: + msg: "{{ result }}" + - name: Assert 4 2.12 when: ansible_version.minor >= 12 ansible.builtin.assert: diff --git a/tests/integration/targets/cics_cmci/playbooks/cmci_incorrect_host.yml b/tests/integration/targets/cics_cmci/playbooks/cmci_incorrect_host.yml index 19e1ab58..616ccaf7 100644 --- a/tests/integration/targets/cics_cmci/playbooks/cmci_incorrect_host.yml +++ b/tests/integration/targets/cics_cmci/playbooks/cmci_incorrect_host.yml @@ -19,9 +19,12 @@ failed_when: false register: result + - name: Debug result + ansible.builtin.debug: + msg: "{{ result }}" + - name: Assert ansible.builtin.assert: that: - result.failed is false - '{{ "Error performing CMCI request: &1 | grep -q 'Package(s) not found'; then -ansible-playbook playbooks/cmci_missing_requests.yml + ansible-playbook playbooks/cmci_missing_requests.yml +else + CURRENT_PKG=$(pip freeze | grep requests=) + pip uninstall requests -y + ansible-playbook playbooks/cmci_missing_requests.yml + pip install "$CURRENT_PKG" fi diff --git a/tests/integration/targets/cics_cmci_missing_xmltodict_library/runme.sh b/tests/integration/targets/cics_cmci_missing_xmltodict_library/runme.sh index fae93081..bb2c0350 100755 --- a/tests/integration/targets/cics_cmci_missing_xmltodict_library/runme.sh +++ b/tests/integration/targets/cics_cmci_missing_xmltodict_library/runme.sh @@ -2,6 +2,12 @@ # (c) Copyright IBM Corp. 2021,2024 # Apache License, Version 2.0 (see https://opensource.org/licenses/Apache-2.0) set -eux # This is important to ensure that return codes from failing tests are propagated + if pip show xmltodict 2>&1 | grep -q 'Package(s) not found'; then -ansible-playbook playbooks/cmci_missing_xmltodict.yml -fi \ No newline at end of file + ansible-playbook playbooks/cmci_missing_xmltodict.yml +else + CURRENT_PKG=$(pip freeze | grep xmltodict=) + pip uninstall xmltodict -y + ansible-playbook playbooks/cmci_missing_xmltodict.yml + pip install "$CURRENT_PKG" +fi diff --git a/tests/integration/targets/cics_missing_zos_core/runme.sh b/tests/integration/targets/cics_missing_zos_core/runme.sh index 296aa97a..a435beb2 100755 --- a/tests/integration/targets/cics_missing_zos_core/runme.sh +++ b/tests/integration/targets/cics_missing_zos_core/runme.sh @@ -10,5 +10,12 @@ ZOS_ENV="$ANSIBLE_COLLECTIONS_PATH/ansible_collections/ibm/ibm_zos_cics/tests/in if [ -z "$(ansible-galaxy collection list ibm.ibm_zos_core)" ]; then -ansible-playbook -i "$INV_PATH" -e "@$VAR_PATH" -e "@$ZOS_ENV" playbooks/missing_core.yml -fi \ No newline at end of file + ansible-playbook -i "$INV_PATH" -e "@$VAR_PATH" -e "@$ZOS_ENV" playbooks/missing_core.yml +else + json_output=$(ansible-galaxy collection list ibm.ibm_zos_core --format json | jq -r) + collection_path=$(echo "$json_output" | jq -r 'keys[0]') + version=$(echo "$json_output" | jq -r .\""$collection_path"\".\"ibm.ibm_zos_core\".\"version\") + rm -r "$collection_path"/ibm/ibm_zos_core + ansible-playbook -i "$INV_PATH" -e "@$VAR_PATH" -e "@$ZOS_ENV" playbooks/missing_core.yml + ansible-galaxy collection install ibm.ibm_zos_core=="$version" -p"$collection_path" +fi diff --git a/tests/integration/targets/cics_utilities/playbooks/failure.yml b/tests/integration/targets/cics_utilities/playbooks/failure.yml index 13262b29..5bcb14b7 100644 --- a/tests/integration/targets/cics_utilities/playbooks/failure.yml +++ b/tests/integration/targets/cics_utilities/playbooks/failure.yml @@ -6,13 +6,17 @@ gather_facts: false environment: "{{ environment_vars }}" vars: - ds_name: "{{ zos_user }}.{{ uniquename }}" + ds_name: "{{ ansible_user | upper }}.TEST.UTIL.A{{ range(100, 999) | random }}B" tasks: # ############################################################################# # ############################## Initial cleanup ############################## # ############################################################################# + - name: Set random ds path for test runs + ansible.builtin.set_fact: + ds_name: "{{ ds_name }}" + - name: Delete data set if it exists ibm.ibm_zos_core.zos_data_set: name: "{{ ds_name }}" @@ -54,7 +58,7 @@ - name: Create PDS data set ibm.ibm_zos_core.zos_data_set: name: "{{ ds_name }}.SDFHSAMP" - type: PDS + type: pds retries: 10 register: created_result until: created_result.failed is false @@ -83,7 +87,7 @@ - name: Create PDS Member ibm.ibm_zos_core.zos_data_set: name: "{{ ds_name }}.SDFHSAMP(DFH0SINX)" - type: MEMBER + type: member retries: 10 register: created_result until: created_result.failed is false @@ -134,9 +138,7 @@ ############################################################################ - name: Write data to the data set to test for STATUS field - ansible.builtin.shell: - args: - executable: /rocket/bin/bash + ansible.builtin.command: cmd: decho 'STATUS = TEST' "{{ ds_name }}.SDFHSAMP(DFH0SINX)" - name: Wait until written @@ -176,9 +178,7 @@ ############################################################################ - name: Write data to the data set to test for no data after STATUS - ansible.builtin.shell: - args: - executable: /rocket/bin/bash + ansible.builtin.command: cmd: decho 'STATUS =' "{{ ds_name }}.SDFHSAMP(DFH0SINX)" register: res @@ -250,7 +250,7 @@ - name: Create SEQ data set ibm.ibm_zos_core.zos_data_set: name: "{{ ds_name }}.SEQ" - type: SEQ + type: seq retries: 10 register: created_result until: created_result.failed is false @@ -277,9 +277,7 @@ msg: "{{ datasets }}" - name: Write data to SEQ data set - ansible.builtin.shell: - args: - executable: /rocket/bin/bash + ansible.builtin.command: cmd: decho 'STATUS = 1.0.0' "{{ ds_name }}.SEQ" - name: Wait until created diff --git a/tests/integration/targets/cics_utilities/playbooks/success.yml b/tests/integration/targets/cics_utilities/playbooks/success.yml index 50570bb9..8d6768a6 100644 --- a/tests/integration/targets/cics_utilities/playbooks/success.yml +++ b/tests/integration/targets/cics_utilities/playbooks/success.yml @@ -7,22 +7,6 @@ environment: "{{ environment_vars }}" tasks: - ############################################################################ - # Get CICS version for dev version - ############################################################################ - - name: Retrieve CICS version information (Dev) - cics_version: - CICS_HLQ: 'ANTZ.CICS.TS.DEV.INTEGRAT' - register: result - - - name: Assert dev - ansible.builtin.assert: - that: - - result is not changed - - result.cics_version == '7.5.0' - - result.rc == 0 - - "'exception' not in result" - ############################################################################ # Get CICS version for 6.1 ############################################################################ diff --git a/tests/integration/targets/cics_utilities/runme.sh b/tests/integration/targets/cics_utilities/runme.sh index 3b90dd77..7a244a20 100755 --- a/tests/integration/targets/cics_utilities/runme.sh +++ b/tests/integration/targets/cics_utilities/runme.sh @@ -5,9 +5,8 @@ set -eux # This is important to ensure that return codes from failing tests are export ANSIBLE_LIBRARY=./library -VAR_PATH="$ANSIBLE_COLLECTIONS_PATH/ansible_collections/ibm/ibm_zos_cics/tests/integration/variables/utilities.yml" INV_PATH="$ANSIBLE_COLLECTIONS_PATH/ansible_collections/ibm/ibm_zos_cics/tests/integration/inventory_zos.yml" ZOS_ENV="$ANSIBLE_COLLECTIONS_PATH/ansible_collections/ibm/ibm_zos_cics/tests/integration/variables/zos.yml" ansible-playbook -i "$INV_PATH" -e "@$ZOS_ENV" playbooks/success.yml -ansible-playbook -i "$INV_PATH" -e "@$VAR_PATH" -e "@$ZOS_ENV" playbooks/failure.yml +ansible-playbook -i "$INV_PATH" -e "@$ZOS_ENV" playbooks/failure.yml diff --git a/tests/integration/variables/template.utilities.yml b/tests/integration/variables/template.utilities.yml deleted file mode 100644 index e784c4e1..00000000 --- a/tests/integration/variables/template.utilities.yml +++ /dev/null @@ -1,2 +0,0 @@ -zos_user: "{{ ansible_user }}" -uniquename: diff --git a/tests/integration/variables/template.zos.yml b/tests/integration/variables/template.zos.yml index 562c6b47..6f78b58f 100644 --- a/tests/integration/variables/template.zos.yml +++ b/tests/integration/variables/template.zos.yml @@ -4,7 +4,6 @@ zoau: "__ZOAU_PATH__" environment_vars: _BPXK_AUTOCVT: "ON" ZOAU_HOME: "{{ zoau }}" - PYTHONPATH: "{{ zoau }}/lib" LIBPATH: "{{ zoau }}/lib:{{ pyz }}/lib:/lib:/usr/lib:." PATH: "{{ zoau }}/bin:{{ pyz }}/bin:/bin:/var/bin" _CEE_RUNOPTS: "FILETAG(AUTOCVT,AUTOTAG) POSIX(ON)" @@ -12,3 +11,5 @@ environment_vars: _TAG_REDIR_IN: "txt" _TAG_REDIR_OUT: "txt" LANG: "C" + TMPDIR: "/u/{{ ansible_user | lower }}/tmp" + \ No newline at end of file