diff options
author | Ansible Core Team <info@ansible.com> | 2020-03-09 09:40:34 +0000 |
---|---|---|
committer | Ansible Core Team <info@ansible.com> | 2020-03-09 09:40:34 +0000 |
commit | 0aff46f3fdbe407ca10e5133f3debac68d2ac375 (patch) | |
tree | 5ae480b8b60309a5c30ba6838e69d946487db588 /test | |
parent | ad5be6f8fd604ad53c784af148965b20459884af (diff) | |
download | ansible-0aff46f3fdbe407ca10e5133f3debac68d2ac375.tar.gz |
Migrated to cisco.asa
Diffstat (limited to 'test')
42 files changed, 0 insertions, 1825 deletions
diff --git a/test/integration/targets/asa_acl/defaults/main.yaml b/test/integration/targets/asa_acl/defaults/main.yaml deleted file mode 100644 index 9ef5ba5165..0000000000 --- a/test/integration/targets/asa_acl/defaults/main.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -testcase: "*" -test_items: [] diff --git a/test/integration/targets/asa_acl/tasks/cli.yaml b/test/integration/targets/asa_acl/tasks/cli.yaml deleted file mode 100644 index 9a32dbe643..0000000000 --- a/test/integration/targets/asa_acl/tasks/cli.yaml +++ /dev/null @@ -1,16 +0,0 @@ ---- -- name: collect all cli test cases - find: - paths: "{{ role_path }}/tests/cli" - patterns: "{{ testcase }}.yaml" - register: test_cases - - -- name: set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" - -- name: run test case - include: "{{ test_case_to_run }}" - with_items: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run diff --git a/test/integration/targets/asa_acl/tasks/main.yaml b/test/integration/targets/asa_acl/tasks/main.yaml deleted file mode 100644 index 415c99d8b1..0000000000 --- a/test/integration/targets/asa_acl/tasks/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -- { include: cli.yaml, tags: ['cli'] } diff --git a/test/integration/targets/asa_acl/tests/cli/basic.yaml b/test/integration/targets/asa_acl/tests/cli/basic.yaml deleted file mode 100644 index f9b7541691..0000000000 --- a/test/integration/targets/asa_acl/tests/cli/basic.yaml +++ /dev/null @@ -1,41 +0,0 @@ ---- -- debug: msg="START cli/basic.yaml" - -- name: setup - asa_config: - commands: - - clear configure access-list ACL-BASIC - provider: "{{ cli }}" - ignore_errors: yes - -- name: Basic ACL - asa_acl: - provider: "{{ cli }}" - lines: - - access-list ACL-BASIC extended permit tcp any any eq www - - access-list ACL-BASIC extended permit tcp any any eq https - register: result - -- assert: - that: - - "result.changed == true" - -- name: Basic ACL idempotency - asa_acl: - provider: "{{ cli }}" - lines: - - access-list ACL-BASIC extended permit tcp any any eq www - - access-list ACL-BASIC extended permit tcp any any eq https - register: result - -- assert: - that: - - "result.changed == false" - -- name: teardown - asa_config: - commands: - - clear configure access-list ACL-BASIC - provider: "{{ cli }}" - -- debug: msg="END cli/basic.yaml" diff --git a/test/integration/targets/asa_acl/tests/cli/full_name_match.yaml b/test/integration/targets/asa_acl/tests/cli/full_name_match.yaml deleted file mode 100644 index 0761aa53cf..0000000000 --- a/test/integration/targets/asa_acl/tests/cli/full_name_match.yaml +++ /dev/null @@ -1,43 +0,0 @@ ---- -- debug: msg="START cli/full_name_match.yaml" - -- name: setup - asa_config: - commands: - - clear configure access-list ACL-BASIC - - clear configure access-list ACL-BASIC2 - provider: "{{ cli }}" - ignore_errors: yes - -- name: Basic ACL - asa_acl: - provider: "{{ cli }}" - lines: - - access-list ACL-BASIC2 extended permit tcp any any eq www - - access-list ACL-BASIC2 extended permit tcp any any eq https - register: result - -- assert: - that: - - "result.changed == true" - -- name: Should not match for ACL-BASIC2 - asa_acl: - provider: "{{ cli }}" - lines: - - access-list ACL-BASIC extended permit tcp any any eq www - - access-list ACL-BASIC extended permit tcp any any eq https - register: result - -- assert: - that: - - "result.changed == true" - -- name: teardown - asa_config: - commands: - - clear configure access-list ACL-BASIC - - clear configure access-list ACL-BASIC2 - provider: "{{ cli }}" - -- debug: msg="END cli/full_name_match.yaml" diff --git a/test/integration/targets/asa_acl/tests/cli/insert.yaml b/test/integration/targets/asa_acl/tests/cli/insert.yaml deleted file mode 100644 index 4ae7b54492..0000000000 --- a/test/integration/targets/asa_acl/tests/cli/insert.yaml +++ /dev/null @@ -1,51 +0,0 @@ ---- -- debug: msg="START cli/insert.yaml" - -- name: setup - asa_config: - commands: - - clear configure access-list ACL-INSERT - provider: "{{ cli }}" - ignore_errors: yes - -- name: Create ACL - asa_acl: - provider: "{{ cli }}" - lines: - - access-list ACL-INSERT extended permit tcp any any eq www - - access-list ACL-INSERT extended permit tcp any any eq https - register: result - -- name: Insert on first line - asa_acl: - provider: "{{ cli }}" - lines: - - access-list ACL-INSERT extended permit tcp any any eq www - - access-list ACL-INSERT extended permit tcp any any eq https - - access-list ACL-INSERT line 1 extended permit tcp any any eq ssh - register: result - -- name: Show ACL - asa_command: - provider: "{{ cli }}" - commands: "show run access-list ACL-INSERT" - register: result - -- name: Show me - debug: - var: result - -- name: - assert: - that: - - result.stdout_lines[0][0].rstrip() == 'access-list ACL-INSERT extended permit tcp any any eq ssh' - - - -- name: teardown - asa_config: - commands: - - clear configure access-list ACL-INSERT - provider: "{{ cli }}" - -- debug: msg="END cli/insert.yaml" diff --git a/test/integration/targets/asa_command/defaults/main.yaml b/test/integration/targets/asa_command/defaults/main.yaml deleted file mode 100644 index 9ef5ba5165..0000000000 --- a/test/integration/targets/asa_command/defaults/main.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -testcase: "*" -test_items: [] diff --git a/test/integration/targets/asa_command/tasks/cli.yaml b/test/integration/targets/asa_command/tasks/cli.yaml deleted file mode 100644 index d675462dd0..0000000000 --- a/test/integration/targets/asa_command/tasks/cli.yaml +++ /dev/null @@ -1,15 +0,0 @@ ---- -- name: collect all cli test cases - find: - paths: "{{ role_path }}/tests/cli" - patterns: "{{ testcase }}.yaml" - register: test_cases - -- name: set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" - -- name: run test case - include: "{{ test_case_to_run }}" - with_items: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run diff --git a/test/integration/targets/asa_command/tasks/main.yaml b/test/integration/targets/asa_command/tasks/main.yaml deleted file mode 100644 index 415c99d8b1..0000000000 --- a/test/integration/targets/asa_command/tasks/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -- { include: cli.yaml, tags: ['cli'] } diff --git a/test/integration/targets/asa_command/tests/cli/bad_operator.yaml b/test/integration/targets/asa_command/tests/cli/bad_operator.yaml deleted file mode 100644 index bcbe8bb592..0000000000 --- a/test/integration/targets/asa_command/tests/cli/bad_operator.yaml +++ /dev/null @@ -1,20 +0,0 @@ ---- -- debug: msg="START cli/bad_operator.yaml" - -- name: test bad operator - asa_command: - commands: - - show version - - show interfaces GigabitEthernet 0/0 - wait_for: - - result[0] contains 'Description: Foo' - provider: "{{ cli }}" - register: result - ignore_errors: yes - -- assert: - that: - - "result.failed == true" - - "result.msg is defined" - -- debug: msg="END cli/bad_operator.yaml" diff --git a/test/integration/targets/asa_command/tests/cli/contains.yaml b/test/integration/targets/asa_command/tests/cli/contains.yaml deleted file mode 100644 index c08d89c273..0000000000 --- a/test/integration/targets/asa_command/tests/cli/contains.yaml +++ /dev/null @@ -1,20 +0,0 @@ ---- -- debug: msg="START cli/contains.yaml" - -- name: test contains operator - asa_command: - commands: - - show version - - show interface - wait_for: - - "result[0] contains 'Cisco Adaptive Security Appliance Software Version'" - - "result[1] contains 'Hardware'" - provider: "{{ cli }}" - register: result - -- assert: - that: - - "result.changed == false" - - "result.stdout is defined" - -- debug: msg="END cli/contains.yaml" diff --git a/test/integration/targets/asa_command/tests/cli/invalid.yaml b/test/integration/targets/asa_command/tests/cli/invalid.yaml deleted file mode 100644 index 67730968d4..0000000000 --- a/test/integration/targets/asa_command/tests/cli/invalid.yaml +++ /dev/null @@ -1,30 +0,0 @@ ---- -- debug: msg="START cli/invalid.yaml" - -- name: run invalid command - asa_command: - commands: ['show foo'] - provider: "{{ cli }}" - register: result - ignore_errors: yes - -- assert: - that: - - "result.failed" - -- name: run commands that include invalid command - asa_command: - commands: - - show version - - show foo - provider: "{{ cli }}" - register: result - ignore_errors: yes - -- assert: - that: - - "result.failed" -# FIXME bug https://github.com/ansible/ansible-modules-extras/issues/3048 - ignore_errors: true - -- debug: msg="END cli/invalid.yaml" diff --git a/test/integration/targets/asa_command/tests/cli/output.yaml b/test/integration/targets/asa_command/tests/cli/output.yaml deleted file mode 100644 index ccfb75375f..0000000000 --- a/test/integration/targets/asa_command/tests/cli/output.yaml +++ /dev/null @@ -1,29 +0,0 @@ ---- -- debug: msg="START cli/output.yaml" - -- name: get output for single command - asa_command: - commands: ['show version'] - provider: "{{ cli }}" - register: result - -- assert: - that: - - "result.changed == false" - - "result.stdout is defined" - -- name: get output for multiple commands - asa_command: - commands: - - show version - - show interface - provider: "{{ cli }}" - register: result - -- assert: - that: - - "result.changed == false" - - "result.stdout is defined" - - "result.stdout | length == 2" - -- debug: msg="END cli/output.yaml" diff --git a/test/integration/targets/asa_command/tests/cli/timeout.yaml b/test/integration/targets/asa_command/tests/cli/timeout.yaml deleted file mode 100644 index 2387058a86..0000000000 --- a/test/integration/targets/asa_command/tests/cli/timeout.yaml +++ /dev/null @@ -1,19 +0,0 @@ ---- -- debug: msg="START cli/timeout.yaml" - -- name: test bad condition - asa_command: - commands: - - show version - wait_for: - - "result[0] contains bad_value_string" - provider: "{{ cli }}" - register: result - ignore_errors: yes - -- assert: - that: - - "result.failed == true" - - "result.msg is defined" - -- debug: msg="END cli/timeout.yaml" diff --git a/test/integration/targets/asa_config/defaults/main.yaml b/test/integration/targets/asa_config/defaults/main.yaml deleted file mode 100644 index ebf6ffc903..0000000000 --- a/test/integration/targets/asa_config/defaults/main.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -testcase: "*" -test_items: []
\ No newline at end of file diff --git a/test/integration/targets/asa_config/tasks/cli.yaml b/test/integration/targets/asa_config/tasks/cli.yaml deleted file mode 100644 index d675462dd0..0000000000 --- a/test/integration/targets/asa_config/tasks/cli.yaml +++ /dev/null @@ -1,15 +0,0 @@ ---- -- name: collect all cli test cases - find: - paths: "{{ role_path }}/tests/cli" - patterns: "{{ testcase }}.yaml" - register: test_cases - -- name: set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" - -- name: run test case - include: "{{ test_case_to_run }}" - with_items: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run diff --git a/test/integration/targets/asa_config/tasks/main.yaml b/test/integration/targets/asa_config/tasks/main.yaml deleted file mode 100644 index 415c99d8b1..0000000000 --- a/test/integration/targets/asa_config/tasks/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -- { include: cli.yaml, tags: ['cli'] } diff --git a/test/integration/targets/asa_config/templates/basic/config.j2 b/test/integration/targets/asa_config/templates/basic/config.j2 deleted file mode 100644 index 779b731e13..0000000000 --- a/test/integration/targets/asa_config/templates/basic/config.j2 +++ /dev/null @@ -1,3 +0,0 @@ -object-group network OG-ANSIBLE-TEMPLATE - description this is a test - network-object host 192.168.99.12 diff --git a/test/integration/targets/asa_config/templates/defaults/config.j2 b/test/integration/targets/asa_config/templates/defaults/config.j2 deleted file mode 100644 index 762e73dea0..0000000000 --- a/test/integration/targets/asa_config/templates/defaults/config.j2 +++ /dev/null @@ -1,4 +0,0 @@ -object-group network OG-ANSIBLE-TEMPLATE-DEFAULT - description this is a test - network-object 10.0.0.0 255.255.255.0 - network-object 10.1.0.0 255.255.255.0 diff --git a/test/integration/targets/asa_config/tests/cli/backup.yaml b/test/integration/targets/asa_config/tests/cli/backup.yaml deleted file mode 100644 index 39f53d3b5c..0000000000 --- a/test/integration/targets/asa_config/tests/cli/backup.yaml +++ /dev/null @@ -1,53 +0,0 @@ ---- -- debug: msg="START cli/backup.yaml" - -- name: setup - asa_config: - commands: - - no object-group network OG-ANSIBLE-TEMPLATE - provider: "{{ cli }}" - ignore_errors: yes - -- name: collect any backup files - find: - paths: "{{ role_path }}/backup" - pattern: "{{ inventory_hostname_short }}_config*" - register: backup_files - delegate_to: localhost - -- name: delete backup files - file: - path: "{{ item.path }}" - state: absent - with_items: "{{backup_files.files|default([])}}" - -- name: configure device with config - asa_config: - src: basic/config.j2 - backup: yes - provider: "{{ cli }}" - register: result - -- assert: - that: - - "result.changed == true" - - "result.updates is defined" - -- name: collect any backup files - find: - paths: "{{ role_path }}/backup" - pattern: "{{ inventory_hostname_short }}_config*" - register: backup_files - delegate_to: localhost - -- assert: - that: - - "backup_files.files is defined" - -- name: teardown - asa_config: - commands: - - no object-group network OG-ANSIBLE-TEMPLATE - provider: "{{ cli }}" - -- debug: msg="END cli/backup.yaml" diff --git a/test/integration/targets/asa_config/tests/cli/basic.yaml b/test/integration/targets/asa_config/tests/cli/basic.yaml deleted file mode 100644 index 2c7450f3d2..0000000000 --- a/test/integration/targets/asa_config/tests/cli/basic.yaml +++ /dev/null @@ -1,39 +0,0 @@ ---- -- debug: msg="START cli/basic.yaml" - -- name: setup - asa_config: - commands: - - no object-group network OG-ANSIBLE-TEMPLATE - provider: "{{ cli }}" - ignore_errors: yes - -- name: configure device with config - asa_config: - src: basic/config.j2 - provider: "{{ cli }}" - register: result - -- assert: - that: - - "result.changed == true" - - "result.updates is defined" - -- name: check device with config - asa_config: - src: basic/config.j2 - provider: "{{ cli }}" - register: result - -- assert: - that: - - "result.changed == false" - - "result.updates is not defined" - -- name: teardown - asa_config: - commands: - - no object-group network OG-ANSIBLE-TEMPLATE - provider: "{{ cli }}" - -- debug: msg="END cli/basic.yaml" diff --git a/test/integration/targets/asa_config/tests/cli/defaults.yaml b/test/integration/targets/asa_config/tests/cli/defaults.yaml deleted file mode 100644 index 184c2c404b..0000000000 --- a/test/integration/targets/asa_config/tests/cli/defaults.yaml +++ /dev/null @@ -1,45 +0,0 @@ ---- -- debug: msg="START cli/defaults.yaml" - -- name: setup - asa_config: - commands: - - no object-group network OG-ANSIBLE-TEMPLATE-DEFAULT - provider: "{{ cli }}" - ignore_errors: yes - -- name: configure device with defaults included - asa_config: - src: defaults/config.j2 - defaults: yes - provider: "{{ cli }}" - register: result - -- debug: var=result - -- assert: - that: - - "result.changed == true" - - "result.updates is defined" - -- name: check device with defaults included - asa_config: - src: defaults/config.j2 - defaults: yes - provider: "{{ cli }}" - register: result - -- debug: var=result - -- assert: - that: - - "result.changed == false" - - "result.updates is not defined" - -- name: teardown - asa_config: - commands: - - no object-group network OG-ANSIBLE-TEMPLATE-DEFAULT - provider: "{{ cli }}" - -- debug: msg="END cli/defaults.yaml" diff --git a/test/integration/targets/asa_config/tests/cli/force.yaml b/test/integration/targets/asa_config/tests/cli/force.yaml deleted file mode 100644 index c151cb6a0c..0000000000 --- a/test/integration/targets/asa_config/tests/cli/force.yaml +++ /dev/null @@ -1,41 +0,0 @@ ---- -- debug: msg="START cli/force.yaml" - -- name: setup - asa_config: - commands: - - no object-group network OG-ANSIBLE-TEMPLATE-DEFAULT - provider: "{{ cli }}" - ignore_errors: yes - -- name: configure device with config - asa_config: - src: basic/config.j2 - provider: "{{ cli }}" - match: none - register: result - -- assert: - that: - - "result.changed == true" - - "result.updates is defined" - -- name: check device with config - asa_config: - src: basic/config.j2 - provider: "{{ cli }}" - match: none - register: result - -- assert: - that: - - "result.changed == true" - - "result.updates is defined" - -- name: teardown - asa_config: - commands: - - no object-group network OG-ANSIBLE-TEMPLATE-DEFAULT - provider: "{{ cli }}" - -- debug: msg="END cli/force.yaml" diff --git a/test/integration/targets/asa_config/tests/cli/more_system.yaml b/test/integration/targets/asa_config/tests/cli/more_system.yaml deleted file mode 100644 index 62a7b82a25..0000000000 --- a/test/integration/targets/asa_config/tests/cli/more_system.yaml +++ /dev/null @@ -1,47 +0,0 @@ ---- -- debug: msg="START cli/more_system.yaml" - -- name: setup - asa_config: - lines: - - "clear configure tunnel-group 192.0.2.1" - provider: "{{ cli }}" - ignore_errors: yes - - -- name: Prepare tunnel-group - asa_config: - before: tunnel-group 192.0.2.1 type ipsec-l2l - lines: - - "tunnel-group 192.0.2.1 ipsec-attributes" - provider: "{{ cli }}" - -- name: Setup tunnel-group - asa_config: - parents: tunnel-group 192.0.2.1 ipsec-attributes - lines: - - "ikev1 pre-shared-key abc123" - passwords: yes - provider: "{{ cli }}" - -- name: Test idempotency - asa_config: - parents: tunnel-group 192.0.2.1 ipsec-attributes - lines: - - "ikev1 pre-shared-key abc123" - passwords: yes - provider: "{{ cli }}" - register: result - -- assert: - that: - - "result.changed == false" - -- name: teardown - asa_config: - lines: - - "clear configure tunnel-group 192.0.2.1" - provider: "{{ cli }}" - - -- debug: msg="END cli/more_system.yaml" diff --git a/test/integration/targets/asa_config/tests/cli/removal_error.yaml b/test/integration/targets/asa_config/tests/cli/removal_error.yaml deleted file mode 100644 index d931d336d7..0000000000 --- a/test/integration/targets/asa_config/tests/cli/removal_error.yaml +++ /dev/null @@ -1,46 +0,0 @@ ---- -- debug: msg="START cli/removal_error.yaml" - -- name: setup - asa_config: - commands: - - clear configure access-list ANSIBLE-DNS - - no object-group network OGA-GOOGLE-DNS - provider: "{{ cli }}" - ignore_errors: yes - -- name: configure test object-group - asa_config: - parents: object-group network OGA-GOOGLE-DNS - lines: network-object host 8.8.8.8 - provider: "{{ cli }}" - register: result - - -- name: configure test access-list - asa_config: - lines: access-list ANSIBLE-DNS extended permit udp any object-group OGA-GOOGLE-DNS eq domain - provider: "{{ cli }}" - -- name: try to remove object-group (should fail) - asa_config: - commands: - - no object-group network OGA-GOOGLE-DNS - provider: "{{ cli }}" - ignore_errors: yes - register: result - - -- name: Last command should fail - assert: - that: - - "result.failed == true" - -- name: teardown - asa_config: - commands: - - clear configure access-list ANSIBLE-DNS - - no object-group network OGA-GOOGLE-DNS - provider: "{{ cli }}" - -- debug: msg="END cli/removal_error.yaml" diff --git a/test/integration/targets/asa_config/tests/cli/sublevel.yaml b/test/integration/targets/asa_config/tests/cli/sublevel.yaml deleted file mode 100644 index 2435d9f32c..0000000000 --- a/test/integration/targets/asa_config/tests/cli/sublevel.yaml +++ /dev/null @@ -1,40 +0,0 @@ ---- -- debug: msg="START cli/sublevel.yaml" - -- name: setup test - asa_config: - lines: - - 'no object-group network OG-ANSIBLE-SUBLEVEL' - provider: "{{ cli }}" - -- name: configure sub level command - asa_config: - lines: ['network-object host 192.168.10.1'] - parents: ['object-group network OG-ANSIBLE-SUBLEVEL'] - provider: "{{ cli }}" - register: result - -- assert: - that: - - "result.changed == true" - - "'object-group network OG-ANSIBLE-SUBLEVEL' in result.updates" - - "'network-object host 192.168.10.1' in result.updates" - -- name: configure sub level command idempotent check - asa_config: - lines: ['network-object host 192.168.10.1'] - parents: ['object-group network OG-ANSIBLE-SUBLEVEL'] - provider: "{{ cli }}" - register: result - -- assert: - that: - - "result.changed == false" - -- name: teardown - asa_config: - lines: - - 'no object-group network OG-ANSIBLE-SUBLEVEL' - provider: "{{ cli }}" - -- debug: msg="END cli/sublevel.yaml" diff --git a/test/integration/targets/asa_config/tests/cli/sublevel_block.yaml b/test/integration/targets/asa_config/tests/cli/sublevel_block.yaml deleted file mode 100644 index 303eb4abf1..0000000000 --- a/test/integration/targets/asa_config/tests/cli/sublevel_block.yaml +++ /dev/null @@ -1,64 +0,0 @@ ---- -- debug: msg="START cli/sublevel_block.yaml" - -- name: setup - asa_command: - commands: - - show run object-group - provider: "{{ cli }}" - register: object_group - -- name: setup - asa_config: - lines: - - no object-group network OG-ANSIBLE - match: none - provider: "{{ cli }}" - #when: "'object-group network OG-ANSIBLE\n' in {{ object_group.stdout }}" - -- name: configure sub level command using block replace - asa_config: - lines: - - network-object 192.168.10.0 255.255.255.0 - - network-object 192.168.20.0 255.255.255.0 - - network-object 192.168.30.0 255.255.255.0 - - network-object 192.168.40.0 255.255.255.0 - parents: ['object-group network OG-ANSIBLE'] - replace: block - after: ['exit'] - provider: "{{ cli }}" - register: result - -- assert: - that: - - "result.changed == true" - - "'object-group network OG-ANSIBLE' in result.updates" - - "'network-object 192.168.10.0 255.255.255.0' in result.updates" - - "'network-object 192.168.20.0 255.255.255.0' in result.updates" - - "'network-object 192.168.30.0 255.255.255.0' in result.updates" - - "'network-object 192.168.40.0 255.255.255.0' in result.updates" - -- name: check sub level command using block replace - asa_config: - lines: - - network-object 192.168.10.0 255.255.255.0 - - network-object 192.168.20.0 255.255.255.0 - - network-object 192.168.30.0 255.255.255.0 - - network-object 192.168.40.0 255.255.255.0 - parents: ['object-group network OG-ANSIBLE'] - replace: block - after: ['exit'] - provider: "{{ cli }}" - register: result - -- assert: - that: - - "result.changed == false" - -- name: teardown - asa_config: - lines: - - no object-group network OG-ANSIBLE - provider: "{{ cli }}" - -- debug: msg="END cli/sublevel_block.yaml" diff --git a/test/integration/targets/asa_config/tests/cli/sublevel_exact.yaml b/test/integration/targets/asa_config/tests/cli/sublevel_exact.yaml deleted file mode 100644 index c2748caf4c..0000000000 --- a/test/integration/targets/asa_config/tests/cli/sublevel_exact.yaml +++ /dev/null @@ -1,64 +0,0 @@ ---- -- debug: msg="START cli/sublevel_exact.yaml" - -- name: setup - asa_config: - lines: - - network-object 192.168.10.0 255.255.255.0 - - network-object 192.168.20.0 255.255.255.0 - - network-object 192.168.30.0 255.255.255.0 - - network-object 192.168.40.0 255.255.255.0 - - network-object 192.168.50.0 255.255.255.0 - parents: ['object-group network OG-ANSIBLE-EXACT'] - before: ['no object-group network OG-ANSIBLE-EXACT'] - after: ['exit'] - provider: "{{ cli }}" - -- name: configure sub level command using exact match - asa_config: - lines: - - network-object 192.168.10.0 255.255.255.0 - - network-object 192.168.20.0 255.255.255.0 - - network-object 192.168.30.0 255.255.255.0 - - network-object 192.168.40.0 255.255.255.0 - parents: ['object-group network OG-ANSIBLE-EXACT'] - after: ['exit'] - match: exact - provider: "{{ cli }}" - register: result - -- assert: - that: - - "result.changed == true" - - "'object-group network OG-ANSIBLE-EXACT' in result.updates" - - "'network-object 192.168.10.0 255.255.255.0' in result.updates" - - "'network-object 192.168.20.0 255.255.255.0' in result.updates" - - "'network-object 192.168.30.0 255.255.255.0' in result.updates" - - "'network-object 192.168.40.0 255.255.255.0' in result.updates" - - "'network-object 192.168.50.0 255.255.255.0' not in result.updates" - -- name: check sub level command using exact match - asa_config: - lines: - - network-object 192.168.10.0 255.255.255.0 - - network-object 192.168.20.0 255.255.255.0 - - network-object 192.168.30.0 255.255.255.0 - - network-object 192.168.40.0 255.255.255.0 - - network-object 192.168.50.0 255.255.255.0 - parents: ['object-group network OG-ANSIBLE-EXACT'] - after: ['exit'] - match: exact - provider: "{{ cli }}" - register: result - -- assert: - that: - - "result.changed == false" - -- name: teardown - asa_config: - lines: - - no object-group network OG-ANSIBLE-EXACT - provider: "{{ cli }}" - -- debug: msg="END cli/sublevel_exact.yaml" diff --git a/test/integration/targets/asa_config/tests/cli/sublevel_strict.yaml b/test/integration/targets/asa_config/tests/cli/sublevel_strict.yaml deleted file mode 100644 index 44ea7f8c2a..0000000000 --- a/test/integration/targets/asa_config/tests/cli/sublevel_strict.yaml +++ /dev/null @@ -1,61 +0,0 @@ ---- -- debug: msg="START cli/sublevel_strict.yaml" - -- name: setup - asa_config: - lines: - - network-object 192.168.10.0 255.255.255.0 - - network-object 192.168.20.0 255.255.255.0 - - network-object 192.168.30.0 255.255.255.0 - - network-object 192.168.40.0 255.255.255.0 - - network-object 192.168.50.0 255.255.255.0 - parents: ['object-group network OG-ANSIBLE-STRICT'] - before: ['no object-group network OG-ANSIBLE-STRICT'] - after: ['exit'] - provider: "{{ cli }}" - -- name: configure sub level command using strict match - asa_config: - lines: - - network-object 192.168.10.0 255.255.255.0 - - network-object 192.168.20.0 255.255.255.0 - - network-object 192.168.30.0 255.255.255.0 - - network-object 192.168.40.0 255.255.255.0 - parents: ['object-group network OG-ANSIBLE-STRICT'] - match: strict - provider: "{{ cli }}" - register: result - -- assert: - that: - - "result.changed == false" - -- name: check sub level command using strict match - asa_config: - lines: - - network-object 192.168.10.0 255.255.255.0 - - network-object 192.168.30.0 255.255.255.0 - - network-object 192.168.30.0 255.255.255.0 - parents: ['object-group network OG-ANSIBLE-STRICT'] - after: ['exit'] - match: strict - provider: "{{ cli }}" - register: result - -- assert: - that: - - "result.changed == true" - - "'object-group network OG-ANSIBLE-STRICT' in result.updates" - - "'network-object 192.168.10.0 255.255.255.0' not in result.updates" - - "'network-object 192.168.30.0 255.255.255.0' in result.updates" - - "'network-object 192.168.30.0 255.255.255.0' in result.updates" - - "'network-object 192.168.40.0 255.255.255.0' not in result.updates" - - "'network-object 192.168.50.0 255.255.255.0' not in result.updates" - -- name: teardown - asa_config: - lines: - - no object-group network OG-ANSIBLE-STRICT - provider: "{{ cli }}" - -- debug: msg="END cli/sublevel_strict.yaml" diff --git a/test/integration/targets/asa_config/tests/cli/sublevel_strict_mul_parents.yaml b/test/integration/targets/asa_config/tests/cli/sublevel_strict_mul_parents.yaml deleted file mode 100644 index 7ded013219..0000000000 --- a/test/integration/targets/asa_config/tests/cli/sublevel_strict_mul_parents.yaml +++ /dev/null @@ -1,66 +0,0 @@ ---- -- debug: msg="START cli/sublevel_strict_mul_parents.yaml on connection={{ ansible_connection }}" - -- name: setup - asa_config: - lines: - - class-map c1 - - match default-inspection-traffic - - policy-map p1 - - class c1 - before: ['no policy-map p1', 'no class-map c1'] - match: none - -- name: configure sub level command using strict match - asa_config: - lines: - - inspect ftp - - inspect tftp - parents: ['policy-map p1', 'class c1'] - match: strict - register: result - -- assert: - that: - - "result.changed == true" - - "'inspect ftp' in result.updates" - - "'inspect tftp' in result.updates" - -- name: change sub level command order and config with strict match - asa_config: - lines: - - inspect tftp - - inspect ftp - parents: ['policy-map p1', 'class c1'] - match: strict - register: result - -- assert: - that: - - "result.changed == true" - - "'inspect ftp' in result.updates" - - "'inspect tftp' in result.updates" - -- name: Config sub level command with strict match (Idempotency) - asa_config: - lines: -#ASA does not change order of class action if reconfigured -#so we have to use old order for Idempotency - - inspect ftp - - inspect tftp - parents: ['policy-map p1', 'class c1'] - match: strict - register: result - -- assert: - that: - - "result.changed == false" - -- name: teardown - asa_config: - lines: - - no policy-map p1 - - no class-map c1 - match: strict - -- debug: msg="END cli/sublevel_strict_mul_parents.yaml on connection={{ ansible_connection }}" diff --git a/test/integration/targets/asa_config/tests/cli/toplevel.yaml b/test/integration/targets/asa_config/tests/cli/toplevel.yaml deleted file mode 100644 index c590bc781b..0000000000 --- a/test/integration/targets/asa_config/tests/cli/toplevel.yaml +++ /dev/null @@ -1,35 +0,0 @@ ---- -- debug: msg="START cli/toplevel.yaml" - -- name: setup - asa_config: - lines: ['hostname firewall'] - provider: "{{ cli }}" - -- name: configure top level command - asa_config: - lines: ['hostname foo'] - provider: "{{ cli }}" - register: result - -- assert: - that: - - "result.changed == true" - - "'hostname foo' in result.updates" - -- name: configure top level command idempotent check - asa_config: - lines: ['hostname foo'] - provider: "{{ cli }}" - register: result - -- assert: - that: - - "result.changed == false" - -- name: teardown - asa_config: - lines: ['hostname {{ inventory_hostname_short }}'] - provider: "{{ cli }}" - -- debug: msg="END cli/toplevel.yaml" diff --git a/test/integration/targets/asa_config/tests/cli/toplevel_after.yaml b/test/integration/targets/asa_config/tests/cli/toplevel_after.yaml deleted file mode 100644 index 3bf0a35170..0000000000 --- a/test/integration/targets/asa_config/tests/cli/toplevel_after.yaml +++ /dev/null @@ -1,42 +0,0 @@ ---- -- debug: msg="START cli/toplevel_after.yaml" - -- name: setup - asa_config: - lines: - - "snmp-server contact ansible" - - "hostname firewall" - provider: "{{ cli }}" - -- name: configure top level command with before - asa_config: - lines: ['hostname foo'] - after: ['snmp-server contact bar'] - provider: "{{ cli }}" - register: result - -- assert: - that: - - "result.changed == true" - - "'hostname foo' in result.updates" - - "'snmp-server contact bar' in result.updates" - -- name: configure top level command with before idempotent check - asa_config: - lines: ['hostname foo'] - after: ['snmp-server contact foo'] - provider: "{{ cli }}" - register: result - -- assert: - that: - - "result.changed == false" - -- name: teardown - asa_config: - lines: - - "no snmp-server contact" - - "hostname {{ inventory_hostname_short }}" - provider: "{{ cli }}" - -- debug: msg="END cli/toplevel_after.yaml" diff --git a/test/integration/targets/asa_config/tests/cli/toplevel_before.yaml b/test/integration/targets/asa_config/tests/cli/toplevel_before.yaml deleted file mode 100644 index 4624e0df98..0000000000 --- a/test/integration/targets/asa_config/tests/cli/toplevel_before.yaml +++ /dev/null @@ -1,42 +0,0 @@ ---- -- debug: msg="START cli/toplevel_before.yaml" - -- name: setup - asa_config: - lines: - - "snmp-server contact ansible" - - "hostname firewall" - provider: "{{ cli }}" - -- name: configure top level command with before - asa_config: - lines: ['hostname foo'] - before: ['snmp-server contact bar'] - provider: "{{ cli }}" - register: result - -- assert: - that: - - "result.changed == true" - - "'hostname foo' in result.updates" - - "'snmp-server contact bar' in result.updates" - -- name: configure top level command with before idempotent check - asa_config: - lines: ['hostname foo'] - before: ['snmp-server contact foo'] - provider: "{{ cli }}" - register: result - -- assert: - that: - - "result.changed == false" - -- name: teardown - asa_config: - lines: - - "no snmp-server contact" - - "hostname {{ inventory_hostname_short }}" - provider: "{{ cli }}" - -- debug: msg="END cli/toplevel_before.yaml" diff --git a/test/integration/targets/asa_config/tests/cli/toplevel_nonidempotent.yaml b/test/integration/targets/asa_config/tests/cli/toplevel_nonidempotent.yaml deleted file mode 100644 index 314ef44164..0000000000 --- a/test/integration/targets/asa_config/tests/cli/toplevel_nonidempotent.yaml +++ /dev/null @@ -1,38 +0,0 @@ ---- -- debug: msg="START cli/toplevel_nonidempotent.yaml" - -- name: setup - asa_config: - backup: true - # lines: ['hostname firewall'] - provider: "{{ cli }}" - -- name: configure top level command - asa_config: - lines: ['hostname foo'] - provider: "{{ cli }}" - match: strict - register: result - -- assert: - that: - - "result.changed == true" - - "'hostname foo' in result.updates" - -- name: configure top level command idempotent check - asa_config: - lines: ['hostname foo'] - provider: "{{ cli }}" - match: strict - register: result - -- assert: - that: - - "result.changed == true" - -- name: teardown - asa_config: - lines: ['hostname {{ inventory_hostname_short }}'] - provider: "{{ cli }}" - -- debug: msg="END cli/toplevel_nonidempotent.yaml" diff --git a/test/integration/targets/asa_og/defaults/main.yaml b/test/integration/targets/asa_og/defaults/main.yaml deleted file mode 100644 index 5f709c5aac..0000000000 --- a/test/integration/targets/asa_og/defaults/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -testcase: "*" diff --git a/test/integration/targets/asa_og/tasks/cli.yaml b/test/integration/targets/asa_og/tasks/cli.yaml deleted file mode 100644 index 303af40762..0000000000 --- a/test/integration/targets/asa_og/tasks/cli.yaml +++ /dev/null @@ -1,22 +0,0 @@ ---- -- name: collect all cli test cases - find: - paths: "{{ role_path }}/tests/cli" - patterns: "{{ testcase }}.yaml" - register: test_cases - delegate_to: localhost - -- name: set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" - -- name: run test cases (connection=network_cli) - include: "{{ test_case_to_run }}" - with_items: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run - -- name: run test case (connection=local) - include: "{{ test_case_to_run }} ansible_connection=local" - with_first_found: "{{ test_items }}" - loop_control: - loop_var: test_case_to_run diff --git a/test/integration/targets/asa_og/tasks/main.yaml b/test/integration/targets/asa_og/tasks/main.yaml deleted file mode 100644 index 415c99d8b1..0000000000 --- a/test/integration/targets/asa_og/tasks/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -- { include: cli.yaml, tags: ['cli'] } diff --git a/test/integration/targets/asa_og/tests/cli/asa_og.yaml b/test/integration/targets/asa_og/tests/cli/asa_og.yaml deleted file mode 100644 index f34edcbd50..0000000000 --- a/test/integration/targets/asa_og/tests/cli/asa_og.yaml +++ /dev/null @@ -1,541 +0,0 @@ ---- -- name: remove test config if any - asa_config: - lines: - - no object-group network ansible_test_0 - - no object-group network ansible_test_1 - - no object-group network ansible_test_2 - - no object-group service ansible_test_3 tcp-udp - - no object-group service ansible_test_4 - - no object-group service ansible_test_5 - ignore_errors: true - -- block: - - - set_fact: - name: ansible_test_0 - host_ip: - - 8.8.8.8 - - 8.8.4.4 - address: - - 10.0.0.0 255.0.0.0 - - 192.168.0.0 255.255.0.0 - - 172.16.0.0 255.255.0.0 - description: th1s_IS-a_D3scrIPt10n_3xaMple- - group_object: - - aws_commonservices_eu_ie_pci_prv - - aws_commonservices_eu_ie_pci_elb_prv - - - name: STAGE 0 - asa_og: &config - name: "{{ name }}" - group_type: network-object - state: present - host_ip: "{{ host_ip }}" - ip_mask: "{{ address }}" - description: "{{ description }}" - group_object: "{{ group_object }}" - register: result - - - assert: &true - that: - - "result.changed == true" - - - name: idempotence check - asa_og: *config - register: result - - - assert: &false - that: - - "result.changed == false" - - - set_fact: - name: ansible_test_0 - host_ip: - - 8.8.9.9 - address: - - 8.8.8.0 255.255.255.0 - group_object: - - test_network_object_1 - - - name: STAGE 1 - asa_og: &config1 - name: "{{ name }}" - group_type: network-object - state: present - host_ip: "{{ host_ip }}" - ip_mask: "{{ address }}" - group_object: "{{ group_object }}" - register: result - - - assert: *true - - - name: idempotence check - asa_og: *config1 - register: result - - - assert: *false - - - name: STAGE 1/B - asa_og: - name: "{{ name }}" - group_type: network-object - state: present - register: result - - - assert: *false - - - set_fact: - name: ansible_test_1 - host_ip: - - 8.8.9.9 - address: - - 8.8.8.0 255.255.255.0 - group_object: - - test_network_object_1 - - - name: STAGE 2 - asa_og: &config2 - name: "{{ name }}" - group_type: network-object - state: present - register: result - - - assert: *true - - - name: idempotence check - asa_og: *config2 - register: result - - - assert: *false - - - name: STAGE 2b - asa_og: &config2b - name: "{{ name }}" - group_type: network-object - state: present - host_ip: "{{ host_ip }}" - ip_mask: "{{ address }}" - group_object: "{{ group_object }}" - register: result - - - assert: *true - - - name: idempotence check - asa_og: *config2b - register: result - - - assert: *false - - - set_fact: - name: ansible_test_0 - host_ip: - - 8.8.8.8 - - 8.8.4.4 - address: - - 10.0.0.0 255.0.0.0 - - 192.168.0.0 255.255.0.0 - - 172.16.0.0 255.255.0.0 - description: th1s_IS-a_D3scrIPt10n_3xaMple- - group_object: - - aws_commonservices_eu_ie_pci_prv - - aws_commonservices_eu_ie_pci_elb_prv - - - name: STAGE 3 - asa_og: &config3 - name: "{{ name }}" - group_type: network-object - state: absent - host_ip: "{{ host_ip }}" - ip_mask: "{{ address }}" - description: "{{ description }}" - group_object: "{{ group_object }}" - register: result - - - assert: *true - - - name: idempotence check - asa_og: *config3 - register: result - - - assert: *false - - - set_fact: - name: ansible_test_2 - host_ip: - - 8.8.8.8 - - 8.8.4.4 - address: - - 10.0.0.0 255.0.0.0 - - 192.168.0.0 255.255.0.0 - - 172.16.0.0 255.255.0.0 - description: th1s_IS-a_D3scrIPt10n_3xaMple- - group_object: - - aws_commonservices_eu_ie_pci_prv - - aws_commonservices_eu_ie_pci_elb_prv - - - name: STAGE 4 - asa_og: &config4 - name: "{{ name }}" - group_type: network-object - state: replace - host_ip: "{{ host_ip }}" - ip_mask: "{{ address }}" - description: "{{ description }}" - group_object: "{{ group_object }}" - register: result - - - assert: *true - - - name: idempotence check - asa_og: *config4 - register: result - - - assert: *false - - - set_fact: - name: ansible_test_2 - host_ip: - - 8.8.8.8 - address: - - 10.0.0.0 255.0.0.0 - - 1.0.0.0 255.255.0.0 - description: th1s_IS-a_D3scrIPt10n_3xaMple- - group_object: - - aws_commonservices_eu_ie_pci_prv - - - name: STAGE 5 - asa_og: &config5 - name: "{{ name }}" - group_type: network-object - state: replace - host_ip: "{{ host_ip }}" - ip_mask: "{{ address }}" - description: "{{ description }}" - group_object: "{{ group_object }}" - register: result - - - assert: *true - - - name: idempotence check - asa_og: *config5 - register: result - - - assert: *false - - - set_fact: - name: ansible_test_2 - host_ip: - - 9.9.9.9 - - 8.8.8.8 - description: th1s_IS-a_D3scrIPt10n_3xaMple- - group_object: - - test_network_object_1 - - - name: STAGE 6 - asa_og: &config6 - name: "{{ name }}" - group_type: network-object - state: replace - host_ip: "{{ host_ip }}" - ip_mask: "{{ address }}" - description: "{{ description }}" - group_object: "{{ group_object }}" - register: result - - - assert: *true - - - name: idempotence check - asa_og: *config6 - register: result - - - assert: *false - - - set_fact: - name: ansible_test_3 - port_eq: - - www - - '1024' - description: th1s_IS-a_D3scrIPt10n_3xaMple- - port_range: - - '1024 10024' - - - name: STAGE 7 - asa_og: &config7 - name: "{{ name }}" - protocol: tcp-udp - port_eq: "{{ port_eq }}" - port_range: "{{ port_range }}" - group_type: port-object - state: present - description: "{{ description }}" - register: result - - - assert: *true - - - name: idempotence check - asa_og: *config7 - register: result - - - assert: *false - - - set_fact: - name: ansible_test_3 - port_eq: - - talk - - '65535' - description: th1s_IS-a_D3scrIPt10n_3xaMple- - port_range: - - '1 100' - - - name: STAGE 8 - asa_og: &config8 - name: "{{ name }}" - protocol: tcp-udp - port_eq: "{{ port_eq }}" - port_range: "{{ port_range }}" - group_type: port-object - state: present - description: "{{ description }}" - register: result - - - assert: *true - - - name: idempotence check - asa_og: *config8 - register: result - - - assert: *false - - - - name: STAGE 9 - asa_og: &config9 - name: "{{ name }}" - protocol: tcp-udp - port_eq: "{{ port_eq }}" - port_range: "{{ port_range }}" - group_type: port-object - state: absent - description: "{{ description }}" - register: result - - - assert: *true - - - name: idempotence check - asa_og: *config9 - register: result - - - assert: *false - - - set_fact: - name: ansible_test_3 - port_eq: - - talk - - '65535' - description: th1s_IS-a_D3scrIPt10n_3xaMple- - port_range: - - '1 100' - - - name: STAGE 10 - asa_og: &config10 - name: "{{ name }}" - protocol: tcp-udp - port_eq: "{{ port_eq }}" - port_range: "{{ port_range }}" - group_type: port-object - state: replace - description: "{{ description }}" - register: result - - - assert: *true - - - name: idempotence check - asa_og: *config10 - register: result - - - assert: *false - - - set_fact: - name: ansible_test_3 - port_eq: - - talk - - www - - kerberos - description: th1s_ISWhatitIS - port_range: - - '1024 1234' - - - name: STAGE 11 - asa_og: &config11 - name: "{{ name }}" - protocol: tcp-udp - port_eq: "{{ port_eq }}" - port_range: "{{ port_range }}" - group_type: port-object - state: replace - description: "{{ description }}" - register: result - - - assert: *true - - - name: idempotence check - asa_og: *config11 - register: result - - - assert: *false - - - set_fact: - name: ansible_test_4 - service_cfg: - - tcp destination eq 8080 - - tcp destination eq www - description: th1s_ISWhatitIS - - - name: STAGE 12 - asa_og: &config12 - name: "{{ name }}" - service_cfg: "{{ service_cfg }}" - group_type: service-object - state: present - description: "{{ description }}" - register: result - - - assert: *true - - - name: idempotence check - asa_og: *config12 - register: result - - - assert: *false - - - set_fact: - name: ansible_test_4 - service_cfg: - - tcp destination range 1234 5678 - - tcp destination range 5678 6789 - description: th1s_ISWhatitIS - - - name: STAGE 13 - asa_og: &config13 - name: "{{ name }}" - service_cfg: "{{ service_cfg }}" - group_type: service-object - state: present - description: "{{ description }}" - register: result - - - assert: *true - - - name: idempotence check - asa_og: *config13 - register: result - - - assert: *false - - - set_fact: - name: ansible_test_4 - service_cfg: - - tcp destination range 1234 5678 - - tcp destination range 5678 6789 - description: th1s_ISWhatitIS - - - name: STAGE 14 - asa_og: &config14 - name: "{{ name }}" - service_cfg: "{{ service_cfg }}" - group_type: service-object - state: absent - description: "{{ description }}" - register: result - - - assert: *true - - - name: idempotence check - asa_og: *config14 - register: result - - - assert: *false - - - set_fact: - name: ansible_test_5 - service_cfg: - - tcp destination range 1234 5678 - - tcp destination range 5678 6789 - description: th1s_ISWhatitIS - - - name: STAGE 15 - asa_og: &config15 - name: "{{ name }}" - service_cfg: "{{ service_cfg }}" - group_type: service-object - state: replace - description: "{{ description }}" - register: result - - - assert: *true - - - name: idempotence check - asa_og: *config15 - register: result - - - assert: *false - - - set_fact: - name: ansible_test_5 - service_cfg: - - tcp destination range 1234 5678 - - tcp destination range 5678 6789 - - tcp destination eq www - description: th1s_ISWhatitIS - - - name: STAGE 16 - asa_og: &config16 - name: "{{ name }}" - service_cfg: "{{ service_cfg }}" - group_type: service-object - state: replace - description: "{{ description }}" - register: result - - - assert: *true - - - name: idempotence check - asa_og: *config16 - register: result - - - assert: *false - - - set_fact: - name: ansible_test_5 - service_cfg: - - tcp destination eq 8080 - description: th1s_ISWhatitIS - - - name: STAGE 17 - asa_og: &config17 - name: "{{ name }}" - service_cfg: "{{ service_cfg }}" - group_type: service-object - state: replace - description: "{{ description }}" - register: result - - - assert: *true - - - name: idempotence check - asa_og: *config17 - register: result - - - assert: *false - - always: - - name: remove test config if any - asa_config: - lines: - - no object-group network ansible_test_0 - - no object-group network ansible_test_1 - - no object-group network ansible_test_2 - - no object-group service ansible_test_3 tcp-udp - - no object-group service ansible_test_4 - - no object-group service ansible_test_5 - ignore_errors: true diff --git a/test/sanity/ignore.txt b/test/sanity/ignore.txt index ff1e5d18d3..98b919ba29 100644 --- a/test/sanity/ignore.txt +++ b/test/sanity/ignore.txt @@ -86,8 +86,6 @@ lib/ansible/module_utils/gcp_utils.py future-import-boilerplate lib/ansible/module_utils/gcp_utils.py metaclass-boilerplate lib/ansible/module_utils/json_utils.py future-import-boilerplate lib/ansible/module_utils/json_utils.py metaclass-boilerplate -lib/ansible/module_utils/network/asa/asa.py future-import-boilerplate -lib/ansible/module_utils/network/asa/asa.py metaclass-boilerplate lib/ansible/module_utils/network/dellos10/dellos10.py future-import-boilerplate lib/ansible/module_utils/network/dellos10/dellos10.py metaclass-boilerplate lib/ansible/module_utils/network/dellos6/dellos6.py future-import-boilerplate @@ -1516,27 +1514,6 @@ lib/ansible/modules/network/aci/mso_tenant.py validate-modules:doc-required-mism lib/ansible/modules/network/aci/mso_tenant.py validate-modules:parameter-list-no-elements lib/ansible/modules/network/aci/mso_user.py validate-modules:doc-required-mismatch lib/ansible/modules/network/aci/mso_user.py validate-modules:parameter-list-no-elements -lib/ansible/modules/network/asa/asa_acl.py validate-modules:doc-default-does-not-match-spec -lib/ansible/modules/network/asa/asa_acl.py validate-modules:doc-missing-type -lib/ansible/modules/network/asa/asa_acl.py validate-modules:parameter-list-no-elements -lib/ansible/modules/network/asa/asa_acl.py validate-modules:parameter-type-not-in-doc -lib/ansible/modules/network/asa/asa_acl.py validate-modules:undocumented-parameter -lib/ansible/modules/network/asa/asa_acl.py yamllint:unparsable-with-libyaml -lib/ansible/modules/network/asa/asa_command.py validate-modules:doc-default-does-not-match-spec -lib/ansible/modules/network/asa/asa_command.py validate-modules:doc-missing-type -lib/ansible/modules/network/asa/asa_command.py validate-modules:parameter-list-no-elements -lib/ansible/modules/network/asa/asa_command.py validate-modules:parameter-type-not-in-doc -lib/ansible/modules/network/asa/asa_command.py validate-modules:undocumented-parameter -lib/ansible/modules/network/asa/asa_config.py validate-modules:doc-default-does-not-match-spec -lib/ansible/modules/network/asa/asa_config.py validate-modules:doc-missing-type -lib/ansible/modules/network/asa/asa_config.py validate-modules:implied-parameter-type-mismatch -lib/ansible/modules/network/asa/asa_config.py validate-modules:parameter-list-no-elements -lib/ansible/modules/network/asa/asa_config.py validate-modules:parameter-type-not-in-doc -lib/ansible/modules/network/asa/asa_config.py validate-modules:undocumented-parameter -lib/ansible/modules/network/asa/asa_config.py yamllint:unparsable-with-libyaml -lib/ansible/modules/network/asa/asa_og.py validate-modules:doc-missing-type -lib/ansible/modules/network/asa/asa_og.py validate-modules:parameter-list-no-elements -lib/ansible/modules/network/asa/asa_og.py validate-modules:parameter-type-not-in-doc lib/ansible/modules/network/dellos10/dellos10_command.py validate-modules:doc-default-does-not-match-spec lib/ansible/modules/network/dellos10/dellos10_command.py validate-modules:doc-missing-type lib/ansible/modules/network/dellos10/dellos10_command.py validate-modules:doc-required-mismatch @@ -3151,7 +3128,6 @@ lib/ansible/playbook/base.py pylint:blacklisted-name lib/ansible/playbook/collectionsearch.py required-and-default-attributes # https://github.com/ansible/ansible/issues/61460 lib/ansible/playbook/helpers.py pylint:blacklisted-name lib/ansible/playbook/role/__init__.py pylint:blacklisted-name -lib/ansible/plugins/action/asa.py action-plugin-docs # base class for deprecated network platform modules using `connection: local` lib/ansible/plugins/action/bigip.py action-plugin-docs # undocumented action plugin to fix, existed before sanity test was added lib/ansible/plugins/action/bigiq.py action-plugin-docs # undocumented action plugin to fix, existed before sanity test was added lib/ansible/plugins/action/dellos10.py action-plugin-docs # base class for deprecated network platform modules using `connection: local` @@ -3164,8 +3140,6 @@ lib/ansible/plugins/action/normal.py action-plugin-docs # default action plugin lib/ansible/plugins/action/nxos.py action-plugin-docs # base class for deprecated network platform modules using `connection: local` lib/ansible/plugins/action/vyos.py action-plugin-docs # base class for deprecated network platform modules using `connection: local` lib/ansible/plugins/cache/base.py ansible-doc!skip # not a plugin, but a stub for backwards compatibility -lib/ansible/plugins/doc_fragments/asa.py future-import-boilerplate -lib/ansible/plugins/doc_fragments/asa.py metaclass-boilerplate lib/ansible/plugins/doc_fragments/azure.py future-import-boilerplate lib/ansible/plugins/doc_fragments/azure.py metaclass-boilerplate lib/ansible/plugins/doc_fragments/azure_tags.py future-import-boilerplate diff --git a/test/units/modules/network/asa/asa_module.py b/test/units/modules/network/asa/asa_module.py deleted file mode 100644 index 681fa1ff16..0000000000 --- a/test/units/modules/network/asa/asa_module.py +++ /dev/null @@ -1,76 +0,0 @@ -# -*- coding: utf-8 -*- - -# (c) 2019, Ansible by Red Hat, inc -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) - -# Make coding more python3-ish -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -import os -import json - -from units.modules.utils import AnsibleExitJson, AnsibleFailJson, ModuleTestCase - - -fixture_path = os.path.join(os.path.dirname(__file__), 'fixtures') -fixture_data = {} - - -def load_fixture(name): - path = os.path.join(fixture_path, name) - - if path in fixture_data: - return fixture_data[path] - - with open(path) as f: - data = f.read() - - try: - data = json.loads(data) - except Exception: - pass - - fixture_data[path] = data - return data - - -class TestAsaModule(ModuleTestCase): - - def execute_module(self, failed=False, changed=False, commands=None, sort=True, defaults=False): - - self.load_fixtures(commands) - - if failed: - result = self.failed() - self.assertTrue(result['failed'], result) - else: - result = self.changed(changed) - self.assertEqual(result['changed'], changed, result) - - if commands is not None: - if sort: - self.assertEqual(sorted(commands), sorted(result['commands']), result['commands']) - else: - self.assertEqual(commands, result['commands'], result['commands']) - - return result - - def failed(self): - with self.assertRaises(AnsibleFailJson) as exc: - self.module.main() - - result = exc.exception.args[0] - self.assertTrue(result['failed'], result) - return result - - def changed(self, changed=False): - with self.assertRaises(AnsibleExitJson) as exc: - self.module.main() - - result = exc.exception.args[0] - self.assertEqual(result['changed'], changed, result) - return result - - def load_fixtures(self, commands=None): - pass diff --git a/test/units/modules/network/asa/fixtures/asa_og_config.cfg b/test/units/modules/network/asa/fixtures/asa_og_config.cfg deleted file mode 100644 index 27f2212031..0000000000 --- a/test/units/modules/network/asa/fixtures/asa_og_config.cfg +++ /dev/null @@ -1,5 +0,0 @@ -object-group network test_nets -description ansible_test object-group description -network-object host 8.8.8.8 -network-object 192.168.0.0 255.255.0.0 -group-object awx_lon diff --git a/test/units/modules/network/asa/test_asa_og.py b/test/units/modules/network/asa/test_asa_og.py deleted file mode 100644 index 9b3a569fb8..0000000000 --- a/test/units/modules/network/asa/test_asa_og.py +++ /dev/null @@ -1,107 +0,0 @@ -# -*- coding: utf-8 -*- - -# (c) 2019, Ansible by Red Hat, inc -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) - -# Make coding more python3-ish -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -from units.compat.mock import patch -from ansible.modules.network.asa import asa_og -from units.modules.utils import set_module_args -from .asa_module import TestAsaModule, load_fixture - - -class TestAsaOgModule(TestAsaModule): - - module = asa_og - - def setUp(self): - super(TestAsaOgModule, self).setUp() - - self.mock_get_config = patch('ansible.modules.network.asa.asa_og.get_config') - self.get_config = self.mock_get_config.start() - - self.mock_load_config = patch('ansible.modules.network.asa.asa_og.load_config') - self.load_config = self.mock_load_config.start() - - self.mock_get_connection = patch('ansible.module_utils.network.asa.asa.get_connection') - self.get_connection = self.mock_get_connection.start() - - def tearDown(self): - super(TestAsaOgModule, self).tearDown() - self.mock_get_config.stop() - self.mock_load_config.stop() - - def load_fixtures(self, commands=None): - self.get_config.return_value = load_fixture('asa_og_config.cfg').strip() - self.load_config.return_value = dict(diff=None, session='session') - - def test_asa_og_idempotent(self): - set_module_args(dict( - name='test_nets', - group_type='network-object', - host_ip=['8.8.8.8'], - ip_mask=['192.168.0.0 255.255.0.0'], - group_object=['awx_lon'], - description='ansible_test object-group description', - state='present' - )) - commands = [] - self.execute_module(changed=False, commands=commands) - - def test_asa_og_add(self): - set_module_args(dict( - name='test_nets', - group_type='network-object', - host_ip=['8.8.8.8', '8.8.4.4'], - ip_mask=['192.168.0.0 255.255.0.0', '10.0.0.0 255.255.255.0'], - group_object=['awx_lon', 'awx_ams'], - description='ansible_test object-group description', - state='present' - )) - commands = [ - 'object-group network test_nets', - 'network-object host 8.8.4.4', - 'network-object 10.0.0.0 255.255.255.0', - 'group-object awx_ams' - ] - self.execute_module(changed=True, commands=commands) - - def test_asa_og_replace(self): - set_module_args(dict( - name='test_nets', - group_type='network-object', - host_ip=['8.8.4.4'], - ip_mask=['10.0.0.0 255.255.255.0'], - group_object=['awx_ams'], - description='ansible_test custom description', - state='replace' - )) - commands = [ - 'object-group network test_nets', - 'description ansible_test custom description', - 'no network-object host 8.8.8.8', - 'network-object host 8.8.4.4', - 'no network-object 192.168.0.0 255.255.0.0', - 'network-object 10.0.0.0 255.255.255.0', - 'no group-object awx_lon', - 'group-object awx_ams' - ] - self.execute_module(changed=True, commands=commands) - - def test_asa_og_remove(self): - set_module_args(dict( - name='test_nets', - group_type='network-object', - host_ip=['8.8.8.8'], - group_object=['awx_lon'], - state='absent' - )) - commands = [ - 'object-group network test_nets', - 'no network-object host 8.8.8.8', - 'no group-object awx_lon' - ] - self.execute_module(changed=True, commands=commands) |