diff options
Diffstat (limited to 'test/integration/targets/git')
10 files changed, 41 insertions, 41 deletions
diff --git a/test/integration/targets/git/tasks/archive.yml b/test/integration/targets/git/tasks/archive.yml index 5e977c3b58..c0d125cbeb 100644 --- a/test/integration/targets/git/tasks/archive.yml +++ b/test/integration/targets/git/tasks/archive.yml @@ -18,7 +18,7 @@ that: (git_archive.results | map(attribute='changed') | unique | list)[0] when: - "ansible_os_family == 'RedHat'" - - ansible_distribution_major_version | version_compare('7', '>=') + - ansible_distribution_major_version is version('7', '>=') - name: ARCHIVE | Check if archive file is created or not stat: @@ -31,7 +31,7 @@ that: (archive_check.results | map(attribute='stat.exists') | unique | list)[0] when: - "ansible_os_family == 'RedHat'" - - ansible_distribution_major_version | version_compare('7', '>=') + - ansible_distribution_major_version is version('7', '>=') - name: ARCHIVE | Clear checkout_dir file: @@ -60,7 +60,7 @@ that: (git_archive.results | map(attribute='changed') | unique | list)[0] when: - "ansible_os_family == 'RedHat'" - - ansible_distribution_major_version | version_compare('7', '>=') + - ansible_distribution_major_version is version('7', '>=') - name: ARCHIVE | Check if archive file is created or not stat: @@ -73,4 +73,4 @@ that: (archive_check.results | map(attribute='stat.exists') | unique | list)[0] when: - "ansible_os_family == 'RedHat'" - - ansible_distribution_major_version | version_compare('7', '>=') + - ansible_distribution_major_version is version('7', '>=') diff --git a/test/integration/targets/git/tasks/change-repo-url.yml b/test/integration/targets/git/tasks/change-repo-url.yml index 6338db65b4..b12fca1f75 100644 --- a/test/integration/targets/git/tasks/change-repo-url.yml +++ b/test/integration/targets/git/tasks/change-repo-url.yml @@ -18,7 +18,7 @@ register: clone2 - assert: - that: "clone2|success" + that: "clone2 is successful" - name: CHANGE-REPO-URL | check url updated shell: git remote show origin | grep Fetch @@ -63,7 +63,7 @@ - name: CHANGE-REPO-URL | check repo not changed assert: that: - - not checkout_same_url|changed + - checkout_same_url is not changed - name: CHANGE-REPO-URL | clone repo with new url to same destination @@ -75,7 +75,7 @@ - name: CHANGE-REPO-URL | check repo changed assert: that: - - checkout_new_url|changed + - checkout_new_url is changed - name: CHANGE-REPO-URL | clone repo with new url in check mode @@ -88,8 +88,8 @@ - name: CHANGE-REPO-URL | check repo reported changed in check mode assert: that: - - checkout_new_url_check_mode | changed - when: git_version.stdout | version_compare(git_version_supporting_ls_remote, '>=') + - checkout_new_url_check_mode is changed + when: git_version.stdout is version(git_version_supporting_ls_remote, '>=') - name: CHANGE-REPO-URL | clone repo with new url after check mode git: @@ -100,7 +100,7 @@ - name: CHANGE-REPO-URL | check repo still changed after check mode assert: that: - - checkout_new_url_after_check_mode|changed + - checkout_new_url_after_check_mode is changed # Test that checkout by branch works when the branch is not in our current repo but the sha is diff --git a/test/integration/targets/git/tasks/checkout-new-tag.yml b/test/integration/targets/git/tasks/checkout-new-tag.yml index d49207d51b..eac73f679b 100644 --- a/test/integration/targets/git/tasks/checkout-new-tag.yml +++ b/test/integration/targets/git/tasks/checkout-new-tag.yml @@ -44,7 +44,7 @@ - name: check new head assert: that: - - not update_new_tag|changed + - update_new_tag is not changed - "'newtag' in listoftags.stdout_lines" diff --git a/test/integration/targets/git/tasks/depth.yml b/test/integration/targets/git/tasks/depth.yml index eb20eafeab..77a0e0cc29 100644 --- a/test/integration/targets/git/tasks/depth.yml +++ b/test/integration/targets/git/tasks/depth.yml @@ -21,7 +21,7 @@ - name: DEPTH | make sure the old commit was not fetched assert: that: 'checkout_early.rc != 0' - when: git_version.stdout | version_compare(git_version_supporting_depth, '>=') + when: git_version.stdout is version(git_version_supporting_depth, '>=') # tests https://github.com/ansible/ansible/issues/14954 - name: DEPTH | fetch repo again with depth=1 @@ -32,8 +32,8 @@ register: checkout2 - assert: - that: "not checkout2|changed" - when: git_version.stdout | version_compare(git_version_supporting_depth, '>=') + that: "checkout2 is not changed" + when: git_version.stdout is version(git_version_supporting_depth, '>=') - name: DEPTH | again try to access earlier commit shell: "git checkout {{git_shallow_head_1.stdout}}" @@ -45,7 +45,7 @@ - name: DEPTH | again make sure the old commit was not fetched assert: that: 'checkout_early.rc != 0' - when: git_version.stdout | version_compare(git_version_supporting_depth, '>=') + when: git_version.stdout is version(git_version_supporting_depth, '>=') # make sure we are still able to fetch other versions - name: DEPTH | Clone same repo with older version @@ -57,7 +57,7 @@ register: cloneold - assert: - that: cloneold | success + that: cloneold is successful - name: DEPTH | try to access earlier commit shell: "git checkout {{git_shallow_head_1.stdout}}" @@ -79,7 +79,7 @@ register: cloneold - assert: - that: cloneold | success + that: cloneold is successful - name: DEPTH | clear checkout_dir file: @@ -107,7 +107,7 @@ - name: DEPTH | ensure the fetch succeeded assert: - that: git_fetch | success + that: git_fetch is successful - name: DEPTH | clear checkout_dir @@ -132,7 +132,7 @@ - name: DEPTH | ensure the fetch succeeded assert: - that: git_fetch | success + that: git_fetch is successful - name: DEPTH | clear checkout_dir file: @@ -165,7 +165,7 @@ assert: that: - "{{ lookup('file', checkout_dir+'/a' )}} == 3" - - git_fetch | changed + - git_fetch is changed - name: DEPTH | clear checkout_dir file: diff --git a/test/integration/targets/git/tasks/gpg-verification.yml b/test/integration/targets/git/tasks/gpg-verification.yml index fb587ed934..863aa32780 100644 --- a/test/integration/targets/git/tasks/gpg-verification.yml +++ b/test/integration/targets/git/tasks/gpg-verification.yml @@ -99,8 +99,8 @@ - name: GPG-VERIFICATION | Check that unsigned lightweight tag verification failed assert: that: - - git_verify|failed - - git_verify.msg|match("Failed to verify GPG signature of commit/tag.+") + - git_verify is failed + - git_verify.msg is match("Failed to verify GPG signature of commit/tag.+") - name: GPG-VERIFICATION | Clone repo and verify a signed commit environment: @@ -125,8 +125,8 @@ - name: GPG-VERIFICATION | Check that unsigned commit verification failed assert: that: - - git_verify|failed - - git_verify.msg|match("Failed to verify GPG signature of commit/tag.+") + - git_verify is failed + - git_verify.msg is match("Failed to verify GPG signature of commit/tag.+") - name: GPG-VERIFICATION | Clone repo and verify a signed annotated tag environment: @@ -151,8 +151,8 @@ - name: GPG-VERIFICATION | Check that unsigned annotated tag verification failed assert: that: - - git_verify|failed - - git_verify.msg|match("Failed to verify GPG signature of commit/tag.+") + - git_verify is failed + - git_verify.msg is match("Failed to verify GPG signature of commit/tag.+") - name: GPG-VERIFICATION | Clone repo and verify a signed branch environment: @@ -177,8 +177,8 @@ - name: GPG-VERIFICATION | Check that unsigned branch verification failed assert: that: - - git_verify|failed - - git_verify.msg|match("Failed to verify GPG signature of commit/tag.+") + - git_verify is failed + - git_verify.msg is match("Failed to verify GPG signature of commit/tag.+") - name: GPG-VERIFICATION | Remove GnuPG verification workdir file: diff --git a/test/integration/targets/git/tasks/localmods.yml b/test/integration/targets/git/tasks/localmods.yml index 3ddf13fa4c..fc2427c741 100644 --- a/test/integration/targets/git/tasks/localmods.yml +++ b/test/integration/targets/git/tasks/localmods.yml @@ -29,7 +29,7 @@ - name: LOCALMODS | check fetch with localmods failed assert: that: - - git_fetch|failed + - git_fetch is failed - name: LOCALMODS | fetch with local mods with force git: @@ -43,7 +43,7 @@ assert: that: - "{{ lookup('file', checkout_dir+'/a' )}} == 2" - - git_fetch_force|changed + - git_fetch_force is changed - name: LOCALMODS | clear checkout_dir file: state=absent path={{ checkout_dir }} @@ -81,7 +81,7 @@ - name: LOCALMODS | check fetch with localmods failed assert: that: - - git_fetch|failed + - git_fetch is failed - name: LOCALMODS | fetch with local mods with force git: @@ -96,7 +96,7 @@ assert: that: - "{{ lookup('file', checkout_dir+'/a' )}} == 2" - - git_fetch_force|changed + - git_fetch_force is changed - name: LOCALMODS | clear checkout_dir file: state=absent path={{ checkout_dir }} diff --git a/test/integration/targets/git/tasks/main.yml b/test/integration/targets/git/tasks/main.yml index e2639d5319..a64fef1ef9 100644 --- a/test/integration/targets/git/tasks/main.yml +++ b/test/integration/targets/git/tasks/main.yml @@ -31,7 +31,7 @@ when: - not gpg_version.stderr - gpg_version.stdout - - git_version.stdout | version_compare("2.1.0", '>=') + - git_version.stdout is version("2.1.0", '>=') - include_tasks: localmods.yml - include_tasks: reset-origin.yml - include_tasks: ambiguous-ref.yml diff --git a/test/integration/targets/git/tasks/missing_hostkey.yml b/test/integration/targets/git/tasks/missing_hostkey.yml index 78d0376967..02d5be3512 100644 --- a/test/integration/targets/git/tasks/missing_hostkey.yml +++ b/test/integration/targets/git/tasks/missing_hostkey.yml @@ -8,7 +8,7 @@ - assert: that: - - git_result | failed + - git_result is failed - name: MISSING-HOSTKEY | checkout git@github.com repo with accept_hostkey (expected pass) git: @@ -22,7 +22,7 @@ - assert: that: - - git_result | changed + - git_result is changed when: github_ssh_private_key is defined - name: MISSING-HOSTKEY | clear checkout_dir @@ -44,5 +44,5 @@ - assert: that: - - git_result | changed + - git_result is changed when: github_ssh_private_key is defined diff --git a/test/integration/targets/git/tasks/no-destination.yml b/test/integration/targets/git/tasks/no-destination.yml index f894f0e78c..1ef7f2fd19 100644 --- a/test/integration/targets/git/tasks/no-destination.yml +++ b/test/integration/targets/git/tasks/no-destination.yml @@ -10,4 +10,4 @@ - assert: that: - - git_result | changed + - git_result is changed diff --git a/test/integration/targets/git/tasks/specific-revision.yml b/test/integration/targets/git/tasks/specific-revision.yml index f4c424af09..53f608bf67 100644 --- a/test/integration/targets/git/tasks/specific-revision.yml +++ b/test/integration/targets/git/tasks/specific-revision.yml @@ -30,7 +30,7 @@ - assert: that: - - git_result | changed + - git_result is changed - name: SPECIFIC-REVISION | check HEAD after update to revision command: git rev-parse HEAD @@ -54,7 +54,7 @@ - assert: that: - - git_result | failed + - git_result is failed # Same as the previous test, but this time we specify which ref # contains the SHA1 @@ -110,8 +110,8 @@ assert: that: - checkout_shallow.rc != 0 - - checkout_shallow | success - when: git_version.stdout | version_compare(git_version_supporting_depth, '>=') + - checkout_shallow is successful + when: git_version.stdout is version(git_version_supporting_depth, '>=') - name: SPECIFIC-REVISION | clear checkout_dir file: |