From a28aa38f6cf534d319387c764fad460131ddd2b1 Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Mon, 22 Jun 2020 14:18:51 -0700 Subject: [PATCH] Remove incidental_lookup_rabbitmq test. It is no longer contributing unique code coverage. (cherry picked from commit 26e8c07f329dd436dda6d30efbe7e63b96e23ee8) --- .../incidental_lookup_rabbitmq/aliases | 6 - .../incidental_lookup_rabbitmq/meta/main.yml | 2 - .../incidental_lookup_rabbitmq/tasks/main.yml | 5 - .../tasks/ubuntu.yml | 138 ------------------ 4 files changed, 151 deletions(-) delete mode 100644 test/integration/targets/incidental_lookup_rabbitmq/aliases delete mode 100644 test/integration/targets/incidental_lookup_rabbitmq/meta/main.yml delete mode 100644 test/integration/targets/incidental_lookup_rabbitmq/tasks/main.yml delete mode 100644 test/integration/targets/incidental_lookup_rabbitmq/tasks/ubuntu.yml diff --git a/test/integration/targets/incidental_lookup_rabbitmq/aliases b/test/integration/targets/incidental_lookup_rabbitmq/aliases deleted file mode 100644 index f89752b8331..00000000000 --- a/test/integration/targets/incidental_lookup_rabbitmq/aliases +++ /dev/null @@ -1,6 +0,0 @@ -destructive -shippable/posix/incidental -skip/aix -skip/osx -skip/freebsd -skip/rhel diff --git a/test/integration/targets/incidental_lookup_rabbitmq/meta/main.yml b/test/integration/targets/incidental_lookup_rabbitmq/meta/main.yml deleted file mode 100644 index 33fa97dc9e4..00000000000 --- a/test/integration/targets/incidental_lookup_rabbitmq/meta/main.yml +++ /dev/null @@ -1,2 +0,0 @@ -dependencies: - - incidental_setup_rabbitmq diff --git a/test/integration/targets/incidental_lookup_rabbitmq/tasks/main.yml b/test/integration/targets/incidental_lookup_rabbitmq/tasks/main.yml deleted file mode 100644 index 7c9553c529b..00000000000 --- a/test/integration/targets/incidental_lookup_rabbitmq/tasks/main.yml +++ /dev/null @@ -1,5 +0,0 @@ -# Rabbitmq lookup -- include: ubuntu.yml - when: - - ansible_distribution == 'Ubuntu' - - ansible_distribution_release not in ('trusty', 'focal') diff --git a/test/integration/targets/incidental_lookup_rabbitmq/tasks/ubuntu.yml b/test/integration/targets/incidental_lookup_rabbitmq/tasks/ubuntu.yml deleted file mode 100644 index 3b007edecc9..00000000000 --- a/test/integration/targets/incidental_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