diff --git a/tests/integration/targets/lookup_rabbitmq/aliases b/tests/integration/targets/lookup_rabbitmq/aliases deleted file mode 100644 index ea7b5233dc..0000000000 --- a/tests/integration/targets/lookup_rabbitmq/aliases +++ /dev/null @@ -1,7 +0,0 @@ -destructive -shippable/posix/group1 -skip/aix -skip/osx -skip/freebsd -skip/rhel -skip/python2.6 # lookups are controller only, and we no longer support Python 2.6 on the controller diff --git a/tests/integration/targets/lookup_rabbitmq/meta/main.yml b/tests/integration/targets/lookup_rabbitmq/meta/main.yml deleted file mode 100644 index 05ab59000b..0000000000 --- a/tests/integration/targets/lookup_rabbitmq/meta/main.yml +++ /dev/null @@ -1,2 +0,0 @@ -dependencies: - - setup_rabbitmq diff --git a/tests/integration/targets/lookup_rabbitmq/tasks/main.yml b/tests/integration/targets/lookup_rabbitmq/tasks/main.yml deleted file mode 100644 index 740f899805..0000000000 --- a/tests/integration/targets/lookup_rabbitmq/tasks/main.yml +++ /dev/null @@ -1,5 +0,0 @@ -# Rabbitmq lookup -- include: ubuntu.yml - when: - - ansible_distribution == 'Ubuntu' - - ansible_distribution_release != 'trusty' diff --git a/tests/integration/targets/lookup_rabbitmq/tasks/ubuntu.yml b/tests/integration/targets/lookup_rabbitmq/tasks/ubuntu.yml deleted file mode 100644 index 3b007edecc..0000000000 --- a/tests/integration/targets/lookup_rabbitmq/tasks/ubuntu.yml +++ /dev/null @@ -1,138 +0,0 @@ -- name: Test failure without pika installed - set_fact: - rabbit_missing_pika: "{{ lookup('rabbitmq', url='amqp://guest:guest@192.168.250.1:5672/%2F', queue='hello', count=3) }}" - ignore_errors: yes - register: rabbitmq_missing_pika_error - -- assert: - that: - - "'pika python package is required' in rabbitmq_missing_pika_error.msg" - -- name: Install pika and requests - pip: - name: pika<1.0.0,requests - state: latest - -- name: Test that giving an incorrect amqp protocol in URL will error - set_fact: - rabbitmq_test_protocol: "{{ lookup('rabbitmq', url='zzzamqp://guest:guest@192.168.250.1:5672/%2F', queue='hello', count=3) }}" - ignore_errors: yes - register: rabbitmq_protocol_error - -- assert: - that: - - "rabbitmq_protocol_error is failed" - - "'URL malformed' in rabbitmq_protocol_error.msg" - -- name: Test that giving an incorrect IP address in URL will error - set_fact: - rabbitmq_test_protocol: "{{ lookup('rabbitmq', url='amqp://guest:guest@xxxxx192.112312368.250.1:5672/%2F', queue='hello', count=3) }}" - ignore_errors: yes - register: rabbitmq_ip_error - -- assert: - that: - - "rabbitmq_ip_error is failed" - - "'Connection issue' in rabbitmq_ip_error.msg" - -- name: Test missing parameters will error - set_fact: - rabbitmq_test_protocol: "{{ lookup('rabbitmq') }}" - ignore_errors: yes - register: rabbitmq_params_error - -- assert: - that: - - "rabbitmq_params_error is failed" - - "'URL is required for rabbitmq lookup.' in rabbitmq_params_error.msg" - -- name: Test missing queue will error - set_fact: - rabbitmq_queue_protocol: "{{ lookup('rabbitmq', url='amqp://guest:guest@192.168.250.1:5672/%2F') }}" - ignore_errors: yes - register: rabbitmq_queue_error - -- assert: - that: - - "rabbitmq_queue_error is failed" - - "'Queue is required for rabbitmq lookup' in rabbitmq_queue_error.msg" - -- name: Enables the rabbitmq_management plugin - rabbitmq_plugin: - names: rabbitmq_management - state: enabled - -- name: Setup test queue - rabbitmq_queue: - name: hello - -- name: Post test message to the exchange (string) - uri: - url: http://localhost:15672/api/exchanges/%2f/amq.default/publish - method: POST - body: '{"properties":{},"routing_key":"hello","payload":"ansible-test","payload_encoding":"string"}' - user: guest - password: guest - force_basic_auth: yes - return_content: yes - headers: - Content-Type: "application/json" - register: post_data - - -- name: Post test message to the exchange (json) - uri: - url: http://localhost:15672/api/exchanges/%2f/amq.default/publish - method: POST - body: '{"properties":{"content_type": "application/json"},"routing_key":"hello","payload":"{\"key\": \"value\" }","payload_encoding":"string"}' - user: guest - password: guest - force_basic_auth: yes - return_content: yes - headers: - Content-Type: "application/json" - register: post_data_json - -- name: Test retrieve messages - set_fact: - rabbitmq_msg: "{{ lookup('rabbitmq', url='amqp://guest:guest@localhost:5672/%2f/hello', queue='hello') }}" - ignore_errors: yes - register: rabbitmq_msg_error - -- name: Ensure two messages received - assert: - that: - - "rabbitmq_msg_error is not failed" - - rabbitmq_msg | length == 2 - -- name: Ensure first message is a string - assert: - that: - - rabbitmq_msg[0].msg == "ansible-test" - -- name: Ensure second message is json - assert: - that: - - rabbitmq_msg[1].json.key == "value" - -- name: Test missing vhost - set_fact: - rabbitmq_msg: "{{ lookup('rabbitmq', url='amqp://guest:guest@localhost:5672/missing/', queue='hello') }}" - ignore_errors: yes - register: rabbitmq_vhost_error - -- assert: - that: - - "rabbitmq_vhost_error is failed" - - "'NOT_ALLOWED' in rabbitmq_vhost_error.msg" - -# Tidy up -- name: Uninstall pika and requests - pip: - name: pika,requests - state: absent - -- name: Disable the rabbitmq_management plugin - rabbitmq_plugin: - names: rabbitmq_management - state: disabled diff --git a/tests/integration/targets/setup_rabbitmq/meta/main.yml b/tests/integration/targets/setup_rabbitmq/meta/main.yml deleted file mode 100644 index af05db79d4..0000000000 --- a/tests/integration/targets/setup_rabbitmq/meta/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -dependencies: - - setup_tls diff --git a/tests/integration/targets/setup_rabbitmq/tasks/main.yml b/tests/integration/targets/setup_rabbitmq/tasks/main.yml deleted file mode 100644 index 4f35f16f62..0000000000 --- a/tests/integration/targets/setup_rabbitmq/tasks/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -- include: ubuntu.yml - when: ansible_distribution == 'Ubuntu' diff --git a/tests/integration/targets/setup_rabbitmq/tasks/ubuntu.yml b/tests/integration/targets/setup_rabbitmq/tasks/ubuntu.yml deleted file mode 100644 index 6d7a3ef0d9..0000000000 --- a/tests/integration/targets/setup_rabbitmq/tasks/ubuntu.yml +++ /dev/null @@ -1,63 +0,0 @@ ---- -# https://www.rabbitmq.com/install-debian.html#apt-pinning -- name: Pin erlang version that rabbitmq supports - copy: - dest: /etc/apt/preferences.d/erlang - content: | - Package: erlang* - Pin: version 1:20.3.8.18-1 - Pin-Priority: 1000 - - Package: esl-erlang - Pin: version 1:20.3.6 - Pin-Priority: 1000 - -- name: Install https transport for apt - apt: - name: apt-transport-https - state: latest - force: yes - -- name: Add RabbitMQ release signing key - apt_key: - url: https://ansible-ci-files.s3.amazonaws.com/test/integration/targets/setup_rabbitmq/rabbitmq-release-signing-key.asc - state: present - -- name: Add RabbitMQ Erlang repository - apt_repository: - repo: "deb https://dl.bintray.com/rabbitmq-erlang/debian {{ ansible_distribution_release }} erlang-20.x" - filename: 'rabbitmq-erlang' - state: present - update_cache: yes - -# Required by the rabbitmq modules that uses the management API -- name: Install requests - pip: - name: requests - -- name: Install RabbitMQ Server - apt: - deb: https://s3.amazonaws.com/ansible-ci-files/test/integration/targets/setup_rabbitmq/rabbitmq-server_3.7.14-1_all.deb - -- name: Install RabbitMQ TLS dependencies - apt: - name: "{{ item }}" - state: latest - loop: - - erlang-asn1 - - erlang-crypto - - erlang-public-key - - erlang-ssl - -- name: Ensure TLS config - copy: - src: rabbitmq.conf - dest: /etc/rabbitmq/rabbitmq.conf - -- name: Start RabbitMQ service - service: - name: rabbitmq-server - state: started - -- name: Enable management - command: rabbitmq-plugins enable --online rabbitmq_management