diff options
author | Ansible Core Team <info@ansible.com> | 2020-03-09 10:40:29 +0100 |
---|---|---|
committer | Matt Martz <matt@sivel.net> | 2020-03-23 17:14:21 +0100 |
commit | 4e488d8435b3b3458de08bb2e4532bfbe6318121 (patch) | |
tree | 05eb51738d05d26c992b439214c3dd7ffd1af538 /test/integration/targets/hg | |
parent | Migrated to community.amazon (diff) | |
download | ansible-4e488d8435b3b3458de08bb2e4532bfbe6318121.tar.xz ansible-4e488d8435b3b3458de08bb2e4532bfbe6318121.zip |
Migrated to community.general
Diffstat (limited to 'test/integration/targets/hg')
-rw-r--r-- | test/integration/targets/hg/aliases | 3 | ||||
-rw-r--r-- | test/integration/targets/hg/meta/main.yml | 2 | ||||
-rw-r--r-- | test/integration/targets/hg/tasks/install.yml | 78 | ||||
-rw-r--r-- | test/integration/targets/hg/tasks/main.yml | 52 | ||||
-rw-r--r-- | test/integration/targets/hg/tasks/run-tests.yml | 86 | ||||
-rw-r--r-- | test/integration/targets/hg/tasks/uninstall.yml | 42 |
6 files changed, 0 insertions, 263 deletions
diff --git a/test/integration/targets/hg/aliases b/test/integration/targets/hg/aliases deleted file mode 100644 index 2f2db5bc12..0000000000 --- a/test/integration/targets/hg/aliases +++ /dev/null @@ -1,3 +0,0 @@ -shippable/posix/group2 -skip/python3 -skip/aix diff --git a/test/integration/targets/hg/meta/main.yml b/test/integration/targets/hg/meta/main.yml deleted file mode 100644 index 07faa21776..0000000000 --- a/test/integration/targets/hg/meta/main.yml +++ /dev/null @@ -1,2 +0,0 @@ -dependencies: - - prepare_tests diff --git a/test/integration/targets/hg/tasks/install.yml b/test/integration/targets/hg/tasks/install.yml deleted file mode 100644 index 4c9e5a41fc..0000000000 --- a/test/integration/targets/hg/tasks/install.yml +++ /dev/null @@ -1,78 +0,0 @@ -- name: get the default python version - command: "{{ ansible_python_interpreter }} -V" - register: default_python_version - -- name: find the default python - command: which python - register: which_python - -- name: find the default pip - command: which pip - register: which_pip - -- name: preserve the default python - command: cp -av "{{ which_python.stdout }}" "{{ which_python.stdout }}.default" - -- name: preserve the default pip - command: cp -av "{{ which_pip.stdout }}" "{{ which_pip.stdout }}.default" - -# using the apt module prevents autoremove from working, so call apt-get via shell instead -- name: install mercurial (apt) - shell: apt-get -y update && apt-get -y install mercurial - when: ansible_pkg_mgr == 'apt' - -- name: install mercurial (dnf) - dnf: - name: mercurial - when: ansible_pkg_mgr == 'dnf' - -- name: install mercurial (yum) - yum: - name: mercurial - when: ansible_pkg_mgr == 'yum' - -- name: install mercurial (pkgng) - package: - name: mercurial - when: ansible_pkg_mgr == 'pkgng' - -- name: preserve the updated python - command: cp -av "{{ which_python.stdout }}" "{{ which_python.stdout }}.updated" - -- name: preserve the updated pip - command: cp -av "{{ which_pip.stdout }}" "{{ which_pip.stdout }}.updated" - -- name: locate mercurial - command: which hg - register: which_hg - -- name: get the mercurial interpreter - command: head -n 1 "{{ which_hg.stdout }}" - register: hg_interpreter - -- name: stat the mercurial interpreter - stat: - path: "{{ hg_interpreter.stdout[2:] }}" - register: stat_hg_interpreter - -- name: bypass the mercurial python interpreter symlink (if needed) - lineinfile: - path: "{{ which_hg.stdout }}" - regexp: "^#!.*$" - line: "#!{{ stat_hg_interpreter.stat.lnk_source }}" - when: stat_hg_interpreter.stat.islnk - -- name: restore the default python - command: cp -av "{{ which_python.stdout }}.default" "{{ which_python.stdout }}" - -- name: restore the default pip - command: cp -av "{{ which_pip.stdout }}.default" "{{ which_pip.stdout }}" - -- name: get the current python version - command: "{{ ansible_python_interpreter }} -V" - register: current_python_version - -- name: verify the python version has not changed - assert: - that: - - default_python_version.stdout == current_python_version.stdout diff --git a/test/integration/targets/hg/tasks/main.yml b/test/integration/targets/hg/tasks/main.yml deleted file mode 100644 index 9ab7171b5a..0000000000 --- a/test/integration/targets/hg/tasks/main.yml +++ /dev/null @@ -1,52 +0,0 @@ -# test code for the hg module -# (c) 2014, James Tanner <tanner.jc@gmail.com> - -# This file is part of Ansible -# -# Ansible is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Ansible is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Ansible. If not, see <http://www.gnu.org/licenses/>. - -- name: determine if mercurial is already installed - command: which hg - register: has_hg - ignore_errors: yes - -- name: warn if the underlying system is not capable of running these tests - debug: - msg: >- - The mercurial client is not able to check out Bitbucket repositories as per the changes mentioned here: - https://bitbucket.org/blog/deprecating-tlsv1-tlsv1-1-2018-12-01 . Therefore these tests are skipped. - when: (ansible_distribution == "Ubuntu" and ansible_distribution_version == "14.04") or ansible_python_version is version("2.7.9", "<") - -- block: - - name: install mercurial - include_tasks: install.yml - when: has_hg is failed - - - name: test mercurial - include_tasks: run-tests.yml - - - name: uninstall mercurial - include_tasks: uninstall.yml - when: has_hg is failed - - # As per the bitbucket changes in https://bitbucket.org/blog/deprecating-tlsv1-tlsv1-1-2018-12-01 , this - # test will fail under certain circumstances, to avoid false positives, we skip these tests under the following - # circumstances: - # - # - The ubuntu 14.04 image used on shippable runs python 2.7.6, so we skip explicitly for this image. - # - When ansible_python_version is not 2.7.9 or higher, mercurial is likely to also run using this same (old) - # python version, which causes issues as per the link above. - when: - - not (ansible_distribution == "Ubuntu" and ansible_distribution_version == "14.04") - - ansible_python_version is version("2.7.9", ">=") diff --git a/test/integration/targets/hg/tasks/run-tests.yml b/test/integration/targets/hg/tasks/run-tests.yml deleted file mode 100644 index 008eb32c50..0000000000 --- a/test/integration/targets/hg/tasks/run-tests.yml +++ /dev/null @@ -1,86 +0,0 @@ -# test code for the hg module -# (c) 2018, Ansible Project - -# This file is part of Ansible -# -# Ansible is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Ansible is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Ansible. If not, see <http://www.gnu.org/licenses/>. - - -- name: set where to extract the repo - set_fact: checkout_dir={{ output_dir }}/epdb - -- name: set what repo to use - set_fact: repo=https://bitbucket.org/rpathsync/epdb - -- name: clean out the output_dir - shell: rm -rf {{ output_dir }}/* - -- name: verify that mercurial is installed so this test can continue - shell: which hg - -- name: initial checkout - hg: repo={{ repo }} dest={{ checkout_dir }} - register: hg_result - -- debug: var=hg_result - -- shell: ls {{ checkout_dir }} - -- name: verify information about the initial clone - assert: - that: - - "'before' in hg_result" - - "'after' in hg_result" - - "not hg_result.before" - - "hg_result.changed" - -- name: repeated checkout - hg: repo={{ repo }} dest={{ checkout_dir }} - register: hg_result2 - -- debug: var=hg_result2 - -- name: check for tags - stat: path={{ checkout_dir }}/.hgtags - register: tags - -- name: check for remotes - stat: path={{ checkout_dir }}/.hg/branch - register: branches - -- debug: var=tags -- debug: var=branches - -- name: assert presence of tags/trunk/branches - assert: - that: - - "tags.stat.isreg" - - "branches.stat.isreg" - -- name: verify on a reclone things are marked unchanged - assert: - that: - - "not hg_result2.changed" - -- name: Checkout non-existent repo clone - hg: repo=https://bitbucket.org/pyro46/pythonscript_1 clone=no update=no - register: hg_result3 - ignore_errors: true - -- name: Verify result of non-existent repo clone - assert: - that: - - hg_result3.msg - - "'abort: HTTP Error 404: Not Found' in hg_result3.msg" - - "not hg_result3.changed" diff --git a/test/integration/targets/hg/tasks/uninstall.yml b/test/integration/targets/hg/tasks/uninstall.yml deleted file mode 100644 index d1bede707d..0000000000 --- a/test/integration/targets/hg/tasks/uninstall.yml +++ /dev/null @@ -1,42 +0,0 @@ -- name: restore the updated python - command: mv "{{ which_python.stdout }}.updated" "{{ which_python.stdout }}" - -- name: restore the updated pip - command: mv "{{ which_pip.stdout }}.updated" "{{ which_pip.stdout }}" - -- name: restore the mercurial python interpreter symlink (if needed) - lineinfile: - path: "{{ which_hg.stdout }}" - regexp: "^#!.*$" - line: "#!{{ stat_hg_interpreter.stat.path }}" - when: stat_hg_interpreter.stat.islnk - -# using the apt module prevents autoremove from working, so call apt-get via shell instead -- name: uninstall packages which were not originally installed (apt) - shell: apt-get -y remove mercurial && apt-get -y autoremove - when: ansible_pkg_mgr == 'apt' - -- name: uninstall packages which were not originally installed (dnf) - dnf: - name: mercurial - state: absent - autoremove: yes - when: ansible_pkg_mgr == 'dnf' - -# the yum module does not have an autoremove parameter -- name: uninstall packages which were not originally installed (yum) - shell: yum -y autoremove mercurial - when: ansible_pkg_mgr == 'yum' - -- name: uninstall packages which were not originally installed (pkgng) - package: - name: mercurial - state: absent - autoremove: yes - when: ansible_pkg_mgr == 'pkgng' - -- name: restore the default python - raw: mv "{{ which_python.stdout }}.default" "{{ which_python.stdout }}" - -- name: restore the default pip - raw: mv "{{ which_pip.stdout }}.default" "{{ which_pip.stdout }}" |