mirror of https://github.com/ansible/ansible.git
Remove incidental_setup_ec2 test target (#72523)
parent
0ed7bfc694
commit
09ad4baf5b
@ -1 +0,0 @@
|
|||||||
hidden
|
|
@ -1,2 +0,0 @@
|
|||||||
---
|
|
||||||
resource_prefix: 'ansible-testing-'
|
|
@ -1,119 +0,0 @@
|
|||||||
---
|
|
||||||
|
|
||||||
# ============================================================
|
|
||||||
- name: test with no parameters
|
|
||||||
action: "{{module_name}}"
|
|
||||||
register: result
|
|
||||||
ignore_errors: true
|
|
||||||
|
|
||||||
- name: assert failure when called with no parameters
|
|
||||||
assert:
|
|
||||||
that:
|
|
||||||
- 'result.failed'
|
|
||||||
- 'result.msg == "missing required arguments: name"'
|
|
||||||
|
|
||||||
# ============================================================
|
|
||||||
- name: test with only name
|
|
||||||
action: "{{module_name}} name={{ec2_key_name}}"
|
|
||||||
register: result
|
|
||||||
ignore_errors: true
|
|
||||||
|
|
||||||
- name: assert failure when called with only 'name'
|
|
||||||
assert:
|
|
||||||
that:
|
|
||||||
- 'result.failed'
|
|
||||||
- 'result.msg == "Either region or ec2_url must be specified"'
|
|
||||||
|
|
||||||
# ============================================================
|
|
||||||
- name: test invalid region parameter
|
|
||||||
action: "{{module_name}} name='{{ec2_key_name}}' region='asdf querty 1234'"
|
|
||||||
register: result
|
|
||||||
ignore_errors: true
|
|
||||||
|
|
||||||
- name: assert invalid region parameter
|
|
||||||
assert:
|
|
||||||
that:
|
|
||||||
- 'result.failed'
|
|
||||||
- 'result.msg.startswith("value of region must be one of:")'
|
|
||||||
|
|
||||||
# ============================================================
|
|
||||||
- name: test valid region parameter
|
|
||||||
action: "{{module_name}} name='{{ec2_key_name}}' region='{{ec2_region}}'"
|
|
||||||
register: result
|
|
||||||
ignore_errors: true
|
|
||||||
|
|
||||||
- name: assert valid region parameter
|
|
||||||
assert:
|
|
||||||
that:
|
|
||||||
- 'result.failed'
|
|
||||||
- 'result.msg.startswith("No handler was ready to authenticate.")'
|
|
||||||
|
|
||||||
# ============================================================
|
|
||||||
- name: test environment variable EC2_REGION
|
|
||||||
action: "{{module_name}} name='{{ec2_key_name}}'"
|
|
||||||
environment:
|
|
||||||
EC2_REGION: '{{ec2_region}}'
|
|
||||||
register: result
|
|
||||||
ignore_errors: true
|
|
||||||
|
|
||||||
- name: assert environment variable EC2_REGION
|
|
||||||
assert:
|
|
||||||
that:
|
|
||||||
- 'result.failed'
|
|
||||||
- 'result.msg.startswith("No handler was ready to authenticate.")'
|
|
||||||
|
|
||||||
# ============================================================
|
|
||||||
- name: test invalid ec2_url parameter
|
|
||||||
action: "{{module_name}} name='{{ec2_key_name}}'"
|
|
||||||
environment:
|
|
||||||
EC2_URL: bogus.example.com
|
|
||||||
register: result
|
|
||||||
ignore_errors: true
|
|
||||||
|
|
||||||
- name: assert invalid ec2_url parameter
|
|
||||||
assert:
|
|
||||||
that:
|
|
||||||
- 'result.failed'
|
|
||||||
- 'result.msg.startswith("No handler was ready to authenticate.")'
|
|
||||||
|
|
||||||
# ============================================================
|
|
||||||
- name: test valid ec2_url parameter
|
|
||||||
action: "{{module_name}} name='{{ec2_key_name}}'"
|
|
||||||
environment:
|
|
||||||
EC2_URL: '{{ec2_url}}'
|
|
||||||
register: result
|
|
||||||
ignore_errors: true
|
|
||||||
|
|
||||||
- name: assert valid ec2_url parameter
|
|
||||||
assert:
|
|
||||||
that:
|
|
||||||
- 'result.failed'
|
|
||||||
- 'result.msg.startswith("No handler was ready to authenticate.")'
|
|
||||||
|
|
||||||
# ============================================================
|
|
||||||
- name: test credentials from environment
|
|
||||||
action: "{{module_name}} name='{{ec2_key_name}}'"
|
|
||||||
environment:
|
|
||||||
EC2_REGION: '{{ec2_region}}'
|
|
||||||
EC2_ACCESS_KEY: bogus_access_key
|
|
||||||
EC2_SECRET_KEY: bogus_secret_key
|
|
||||||
register: result
|
|
||||||
ignore_errors: true
|
|
||||||
|
|
||||||
- name: assert ec2_key with valid ec2_url
|
|
||||||
assert:
|
|
||||||
that:
|
|
||||||
- 'result.failed'
|
|
||||||
- '"EC2ResponseError: 401 Unauthorized" in result.msg'
|
|
||||||
|
|
||||||
# ============================================================
|
|
||||||
- name: test credential parameters
|
|
||||||
action: "{{module_name}} name='{{ec2_key_name}}' ec2_region='{{ec2_region}}' ec2_access_key=bogus_access_key ec2_secret_key=bogus_secret_key"
|
|
||||||
register: result
|
|
||||||
ignore_errors: true
|
|
||||||
|
|
||||||
- name: assert credential parameters
|
|
||||||
assert:
|
|
||||||
that:
|
|
||||||
- 'result.failed'
|
|
||||||
- '"EC2ResponseError: 401 Unauthorized" in result.msg'
|
|
@ -1,3 +0,0 @@
|
|||||||
---
|
|
||||||
ec2_url: ec2.amazonaws.com
|
|
||||||
ec2_region: us-east-1
|
|
Loading…
Reference in New Issue