From 45ef6bdd40a42fed5d4febaf944d9d73f72d5a20 Mon Sep 17 00:00:00 2001 From: Sloane Hertel Date: Wed, 7 Feb 2018 14:24:40 -0500 Subject: [PATCH] Roll boto3_conn tests into ec2_asg (#35854) * Roll boto3_conn tests into ec2_asg. --- test/integration/targets/boto3_conn/aliases | 1 - .../targets/boto3_conn/tasks/main.yml | 50 ------------------- .../integration/targets/ec2_asg/meta/main.yml | 2 - .../targets/ec2_asg/tasks/main.yml | 48 ++++++++++++++++++ 4 files changed, 48 insertions(+), 53 deletions(-) delete mode 100644 test/integration/targets/boto3_conn/aliases delete mode 100644 test/integration/targets/boto3_conn/tasks/main.yml delete mode 100644 test/integration/targets/ec2_asg/meta/main.yml diff --git a/test/integration/targets/boto3_conn/aliases b/test/integration/targets/boto3_conn/aliases deleted file mode 100644 index 4ef4b2067d0..00000000000 --- a/test/integration/targets/boto3_conn/aliases +++ /dev/null @@ -1 +0,0 @@ -cloud/aws diff --git a/test/integration/targets/boto3_conn/tasks/main.yml b/test/integration/targets/boto3_conn/tasks/main.yml deleted file mode 100644 index d53973cedbf..00000000000 --- a/test/integration/targets/boto3_conn/tasks/main.yml +++ /dev/null @@ -1,50 +0,0 @@ ---- -# tasks file for test_ec2_asg - -- name: Test incomplete credentials with ec2_asg - - block: - - # ============================================================ - - - name: test invalid profile - ec2_asg: - name: "{{ resource_prefix }}-asg" - region: "{{ aws_region }}" - profile: notavalidprofile - ignore_errors: yes - register: result - - - name: - assert: - that: - - "'The config profile (notavalidprofile) could not be found' in result.msg" - - - name: test partial credentials - ec2_asg: - name: "{{ resource_prefix }}-asg" - region: "{{ aws_region }}" - aws_access_key: "{{ aws_access_key }}" - ignore_errors: yes - register: result - - - name: - assert: - that: - - "'Partial credentials found in explicit, missing: aws_secret_access_key' in result.msg" - - - name: test without specifying region - ec2_asg: - name: "{{ resource_prefix }}-asg" - aws_access_key: "{{ aws_access_key }}" - aws_secret_key: "{{ aws_secret_key }}" - security_token: "{{ security_token }}" - ignore_errors: yes - register: result - - - name: - assert: - that: - - result.msg == 'The ec2_asg module requires a region and none was found in configuration, environment variables or module parameters' - - # ============================================================ diff --git a/test/integration/targets/ec2_asg/meta/main.yml b/test/integration/targets/ec2_asg/meta/main.yml deleted file mode 100644 index 79dc5650f4e..00000000000 --- a/test/integration/targets/ec2_asg/meta/main.yml +++ /dev/null @@ -1,2 +0,0 @@ -dependencies: - - boto3_conn diff --git a/test/integration/targets/ec2_asg/tasks/main.yml b/test/integration/targets/ec2_asg/tasks/main.yml index c6ed7236e29..9b742a7712f 100644 --- a/test/integration/targets/ec2_asg/tasks/main.yml +++ b/test/integration/targets/ec2_asg/tasks/main.yml @@ -1,6 +1,54 @@ --- # tasks file for test_ec2_asg +- name: Test incomplete credentials with ec2_asg + + block: + + # ============================================================ + + - name: test invalid profile + ec2_asg: + name: "{{ resource_prefix }}-asg" + region: "{{ aws_region }}" + profile: notavalidprofile + ignore_errors: yes + register: result + + - name: + assert: + that: + - "'The config profile (notavalidprofile) could not be found' in result.msg" + + - name: test partial credentials + ec2_asg: + name: "{{ resource_prefix }}-asg" + region: "{{ aws_region }}" + aws_access_key: "{{ aws_access_key }}" + ignore_errors: yes + register: result + + - name: + assert: + that: + - "'Partial credentials found in explicit, missing: aws_secret_access_key' in result.msg" + + - name: test without specifying region + ec2_asg: + name: "{{ resource_prefix }}-asg" + aws_access_key: "{{ aws_access_key }}" + aws_secret_key: "{{ aws_secret_key }}" + security_token: "{{ security_token }}" + ignore_errors: yes + register: result + + - name: + assert: + that: + - result.msg == 'The ec2_asg module requires a region and none was found in configuration, environment variables or module parameters' + + # ============================================================ + - name: Test incomplete arguments with ec2_asg block: