summaryrefslogtreecommitdiff
path: root/test/integration/targets/ios_facts
diff options
context:
space:
mode:
authorPaul Neumann <paul104x@yahoo.de>2018-07-09 15:15:31 +0200
committerNathaniel Case <this.is@nathanielca.se>2018-07-09 09:15:31 -0400
commitdfb2b3fdd552a5157aecffb55f1663f1896be7d2 (patch)
treeff50ef9257b45a624b43e565be41d3dd165cf006 /test/integration/targets/ios_facts
parentdbb58b34c3b5cb286a9c43ea2fdb902971c1e903 (diff)
downloadansible-dfb2b3fdd552a5157aecffb55f1663f1896be7d2.tar.gz
ios_facts: Report space of file systems (#41850)
* ios_facts: Report file system space Parse total and free space from dir output. For this, add a hash filesystems_info containing the keys spacetotal_kb and spacefree_kb. * ios_facts: Add unit test for file system space reporting * ios_facts: Add integration test for file system space reporting
Diffstat (limited to 'test/integration/targets/ios_facts')
-rw-r--r--test/integration/targets/ios_facts/tests/cli/all_facts.yaml4
-rw-r--r--test/integration/targets/ios_facts/tests/cli/default_facts.yaml4
-rw-r--r--test/integration/targets/ios_facts/tests/cli/not_hardware.yaml1
3 files changed, 9 insertions, 0 deletions
diff --git a/test/integration/targets/ios_facts/tests/cli/all_facts.yaml b/test/integration/targets/ios_facts/tests/cli/all_facts.yaml
index 2596f76a8f..5f2a754487 100644
--- a/test/integration/targets/ios_facts/tests/cli/all_facts.yaml
+++ b/test/integration/targets/ios_facts/tests/cli/all_facts.yaml
@@ -28,4 +28,8 @@
- "result.ansible_facts.ansible_net_memfree_mb > 1"
- "result.ansible_facts.ansible_net_memtotal_mb > 1"
+- assert:
+ that: "{{ item.value.spacetotal_kb }} > {{ item.value.spacefree_kb }}"
+ loop: "{{ lookup('dict', result.ansible_facts.ansible_net_filesystems_info, wantlist=True) }}"
+
- debug: msg="END cli/all_facts.yaml on connection={{ ansible_connection }}"
diff --git a/test/integration/targets/ios_facts/tests/cli/default_facts.yaml b/test/integration/targets/ios_facts/tests/cli/default_facts.yaml
index 3efffb87d7..11cb9e518f 100644
--- a/test/integration/targets/ios_facts/tests/cli/default_facts.yaml
+++ b/test/integration/targets/ios_facts/tests/cli/default_facts.yaml
@@ -28,4 +28,8 @@
# ... and not present
- "result.ansible_facts.ansible_net_config is not defined" # config
+- assert:
+ that: "{{ item.value.spacetotal_kb }} > {{ item.value.spacefree_kb }}"
+ loop: "{{ lookup('dict', result.ansible_facts.ansible_net_filesystems_info, wantlist=True) }}"
+
- debug: msg="END cli/default.yaml on connection={{ ansible_connection }}"
diff --git a/test/integration/targets/ios_facts/tests/cli/not_hardware.yaml b/test/integration/targets/ios_facts/tests/cli/not_hardware.yaml
index b811198894..da46f2cd90 100644
--- a/test/integration/targets/ios_facts/tests/cli/not_hardware.yaml
+++ b/test/integration/targets/ios_facts/tests/cli/not_hardware.yaml
@@ -26,5 +26,6 @@
- "result.ansible_facts.ansible_net_interfaces | length > 1" # more than one interface returned
# ... and not present
- "result.ansible_facts.ansible_net_filesystems is not defined"
+ - "result.ansible_facts.ansible_net_filesystems_info is not defined"
- debug: msg="END cli/not_hardware_facts.yaml on connection={{ ansible_connection }}"