From 512755cc9cce40d3406800d4877ed757c15e1cf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gon=C3=A9ri=20Le=20Bouder?= Date: Tue, 13 Jul 2021 15:23:49 +0200 Subject: [PATCH] test: don't test ancient boto versions These tests were a source of problems and are pointless now we only support `boto3 >= 1.13.0` and `botocore >= 1.16.0` --- .../targets/cloudformation_stack_set/runme.sh | 3 -- .../targets/efs/playbooks/version_fail.yml | 32 ------------ tests/integration/targets/efs/runme.sh | 8 --- .../elb_application_lb/tasks/full_test.yml | 5 -- .../targets/elb_application_lb/tasks/main.yml | 29 ----------- .../tasks/test_multiple_actions_fail.yml | 50 ------------------- .../elb_target/playbooks/version_fail.yml | 41 --------------- tests/integration/targets/elb_target/runme.sh | 7 --- 8 files changed, 175 deletions(-) delete mode 100644 tests/integration/targets/efs/playbooks/version_fail.yml delete mode 100644 tests/integration/targets/elb_application_lb/tasks/test_multiple_actions_fail.yml delete mode 100644 tests/integration/targets/elb_target/playbooks/version_fail.yml diff --git a/tests/integration/targets/cloudformation_stack_set/runme.sh b/tests/integration/targets/cloudformation_stack_set/runme.sh index d499c679b26..45694953885 100755 --- a/tests/integration/targets/cloudformation_stack_set/runme.sh +++ b/tests/integration/targets/cloudformation_stack_set/runme.sh @@ -1,8 +1,5 @@ #!/usr/bin/env bash set -eux - # Run full test suite -source virtualenv.sh -pip install 'botocore>1.10.26' boto3 ansible-playbook -i ../../inventory -v playbooks/full_test.yml "$@" diff --git a/tests/integration/targets/efs/playbooks/version_fail.yml b/tests/integration/targets/efs/playbooks/version_fail.yml deleted file mode 100644 index 6d73b75867e..00000000000 --- a/tests/integration/targets/efs/playbooks/version_fail.yml +++ /dev/null @@ -1,32 +0,0 @@ -- hosts: localhost - connection: local - environment: "{{ ansible_test.environment }}" - vars: - resource_prefix: 'ansible-testing' - - tasks: - - name: 'efs graceful failure tests' - collections: - - amazon.aws - module_defaults: - group/aws: - aws_access_key: '{{ aws_access_key }}' - aws_secret_key: '{{ aws_secret_key }}' - security_token: '{{ security_token | default(omit) }}' - region: '{{ aws_region }}' - block: - - - name: create efs with provisioned_throughput options (fails gracefully) - efs: - state: present - name: "{{ resource_prefix }}-efs" - throughput_mode: 'provisioned' - provisioned_throughput_in_mibps: 8.0 - register: efs_provisioned_throughput_creation - ignore_errors: yes - - - name: check that graceful error message is returned when creation with throughput_mode and old botocore - assert: - that: - - efs_provisioned_throughput_creation.failed - - 'efs_provisioned_throughput_creation.msg == "throughput_mode parameter requires botocore >= 1.10.57"' diff --git a/tests/integration/targets/efs/runme.sh b/tests/integration/targets/efs/runme.sh index e4f214b8e85..1d305582c30 100755 --- a/tests/integration/targets/efs/runme.sh +++ b/tests/integration/targets/efs/runme.sh @@ -4,12 +4,4 @@ set -eux export ANSIBLE_ROLES_PATH=../ -# Test graceful failure for older versions of botocore -source virtualenv.sh -pip install 'botocore<1.10.57' boto3 -ansible-playbook -i ../../inventory -v playbooks/version_fail.yml "$@" - -# Run full test suite -source virtualenv.sh -pip install 'botocore>=1.10.57' boto3 ansible-playbook -i ../../inventory -v playbooks/full_test.yml "$@" diff --git a/tests/integration/targets/elb_application_lb/tasks/full_test.yml b/tests/integration/targets/elb_application_lb/tasks/full_test.yml index bf68f93aefa..e260d0f7f5c 100644 --- a/tests/integration/targets/elb_application_lb/tasks/full_test.yml +++ b/tests/integration/targets/elb_application_lb/tasks/full_test.yml @@ -91,11 +91,6 @@ state: present register: tg - # Run tests for graceful failure with an old version of botocore - - include_tasks: test_multiple_actions_fail.yml - vars: - ansible_python_interpreter: "{{ virtualenv_interpreter }}" - # Run main tests - include_tasks: test_alb_bad_listener_options.yml - include_tasks: test_alb_ip_address_type_options.yml diff --git a/tests/integration/targets/elb_application_lb/tasks/main.yml b/tests/integration/targets/elb_application_lb/tasks/main.yml index 5bf26c54fd5..93362e38e0f 100644 --- a/tests/integration/targets/elb_application_lb/tasks/main.yml +++ b/tests/integration/targets/elb_application_lb/tasks/main.yml @@ -8,33 +8,4 @@ security_token: '{{ security_token | default(omit) }}' region: '{{ aws_region }}' block: - - # Prepare a virtual environment for multiple_actions_fail.yml - - set_fact: - virtualenv: "{{ remote_tmp_dir }}/virtualenv" - virtualenv_command: "{{ ansible_python_interpreter }} -m virtualenv" - - - set_fact: - virtualenv_interpreter: "{{ virtualenv }}/bin/python" - - - pip: - name: virtualenv - - - pip: - name: - - 'botocore<1.10.30' - - boto3 - - boto - - coverage<5 - - cryptography - virtualenv: "{{ virtualenv }}" - virtualenv_command: "{{ virtualenv_command }}" - virtualenv_site_packages: no - - include_tasks: full_test.yml - - always: - - - file: - path: "{{ virtualenv }}" - state: absent diff --git a/tests/integration/targets/elb_application_lb/tasks/test_multiple_actions_fail.yml b/tests/integration/targets/elb_application_lb/tasks/test_multiple_actions_fail.yml deleted file mode 100644 index 2e0d0700825..00000000000 --- a/tests/integration/targets/elb_application_lb/tasks/test_multiple_actions_fail.yml +++ /dev/null @@ -1,50 +0,0 @@ -- block: - - - name: register dummy OIDC config - set_fact: - AuthenticateOidcActionConfig: - AuthorizationEndpoint: "https://www.example.com/auth" - ClientId: "eeeeeeeeeeeeeeeeeeeeeeeeee" - ClientSecret: "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee" - Issuer: "https://www.example.com/issuer" - OnUnauthenticatedRequest: "authenticate" - Scope: "openid" - SessionCookieName: "AWSELBAuthSessionCookie" - SessionTimeout: 604800 - TokenEndpoint: "https://www.example.com/token" - UserInfoEndpoint: "https://www.example.com/userinfo" - - - name: create ALB with multiple DefaultActions - elb_application_lb: - name: "{{ alb_name }}" - subnets: "{{ alb_subnets }}" - security_groups: "{{ sec_group.group_id }}" - state: present - listeners: - - Protocol: HTTP - Port: 80 - DefaultActions: - - Type: forward - TargetGroupName: "{{ tg_name }}" - Order: 2 - - Type: authenticate-oidc - AuthenticateOidcConfig: "{{ AuthenticateOidcActionConfig }}" - Order: 1 - register: alb - ignore_errors: yes - - - name: check for a graceful failure message - assert: - that: - - alb.failed - - 'alb.msg == "installed version of botocore does not support multiple actions, please upgrade botocore to version 1.10.30 or higher"' - - always: - # Cleanup - - name: destroy ALB if created - elb_application_lb: - name: '{{ alb_name }}' - state: absent - wait: true - wait_timeout: 600 - ignore_errors: true diff --git a/tests/integration/targets/elb_target/playbooks/version_fail.yml b/tests/integration/targets/elb_target/playbooks/version_fail.yml deleted file mode 100644 index 9149f593048..00000000000 --- a/tests/integration/targets/elb_target/playbooks/version_fail.yml +++ /dev/null @@ -1,41 +0,0 @@ -- hosts: localhost - connection: local - environment: "{{ ansible_test.environment }}" - - tasks: - - name: set up aws connection info - module_defaults: - group/aws: - aws_access_key: "{{ aws_access_key }}" - aws_secret_key: "{{ aws_secret_key }}" - security_token: "{{ security_token | default(omit) }}" - region: "{{ aws_region }}" - block: - - name: set up testing target group (type=ip) - elb_target_group: - state: present - #name: "{{ unique_id }}-tg" - name: "ansible-test-{{ resource_prefix | regex_search('([0-9]+)$') }}-tg" - health_check_port: 80 - protocol: http - port: 80 - vpc_id: 'vpc-abcd1234' - target_type: ip - tags: - Description: "Created by {{ resource_prefix }}" - register: elb_target_group_type_ip - ignore_errors: yes - - - name: check that setting up target group with type=ip fails with friendly message - assert: - that: - - elb_target_group_type_ip is failed - - "'msg' in elb_target_group_type_ip" - - # In the off-chance that this went (partially) through when it shouldn't... - always: - - name: Remove testing target group (type=ip) - elb_target_group: - state: absent - #name: "{{ unique_id }}-tg" - name: "ansible-test-{{ resource_prefix | regex_search('([0-9]+)$') }}-tg" diff --git a/tests/integration/targets/elb_target/runme.sh b/tests/integration/targets/elb_target/runme.sh index fe0850e46c9..09d73e04278 100755 --- a/tests/integration/targets/elb_target/runme.sh +++ b/tests/integration/targets/elb_target/runme.sh @@ -2,12 +2,5 @@ set -eux -# Test graceful failure for older versions of botocore -source virtualenv.sh -pip install 'botocore<=1.7.1' boto3 -ansible-playbook -i ../../inventory -v playbooks/version_fail.yml "$@" - # Run full test suite -source virtualenv.sh -pip install 'botocore' 'boto3>=1.16.57' ansible-playbook -i ../../inventory -v playbooks/full_test.yml "$@"