diff options
Diffstat (limited to 'test/integration/targets/dellos6_facts')
4 files changed, 65 insertions, 0 deletions
diff --git a/test/integration/targets/dellos6_facts/defaults/main.yaml b/test/integration/targets/dellos6_facts/defaults/main.yaml new file mode 100644 index 0000000000..5f709c5aac --- /dev/null +++ b/test/integration/targets/dellos6_facts/defaults/main.yaml @@ -0,0 +1,2 @@ +--- +testcase: "*" diff --git a/test/integration/targets/dellos6_facts/tasks/cli.yaml b/test/integration/targets/dellos6_facts/tasks/cli.yaml new file mode 100644 index 0000000000..d648420ae7 --- /dev/null +++ b/test/integration/targets/dellos6_facts/tasks/cli.yaml @@ -0,0 +1,18 @@ +--- +- 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/dellos6_facts/tasks/main.yaml b/test/integration/targets/dellos6_facts/tasks/main.yaml new file mode 100644 index 0000000000..aea4ecccf1 --- /dev/null +++ b/test/integration/targets/dellos6_facts/tasks/main.yaml @@ -0,0 +1,3 @@ +--- +- { include: cli.yaml, tags: ['cli'] } + diff --git a/test/integration/targets/dellos6_facts/tests/cli/facts.yaml b/test/integration/targets/dellos6_facts/tests/cli/facts.yaml new file mode 100644 index 0000000000..f6b19ddb56 --- /dev/null +++ b/test/integration/targets/dellos6_facts/tests/cli/facts.yaml @@ -0,0 +1,42 @@ +--- +- debug: msg="START cli/facts.yaml" + +- name: test all facts + dellos6_facts: + gather_subset: + - all + provider: "{{ cli }}" + register: result + +- assert: + that: + - "result.changed == false" + - "result.ansible_facts is defined" + +- name: test all facts except hardware + dellos6_facts: + gather_subset: + - "!hardware" + provider: "{{ cli }}" + register: result + +- assert: + that: + - "result.changed == false" + - "result.ansible_facts.ansible_net_memfree_mb is not defined" + +- name: test interface facts + dellos6_facts: + gather_subset: + - interfaces + provider: "{{ cli }}" + register: result + +- assert: + that: + - "result.changed == false" + - "result.ansible_facts.ansible_net_interfaces is defined" + - "result.ansible_facts.ansible_net_memfree_mb is not defined" + + +- debug: msg="END cli/facts.yaml" |