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
This commit is contained in:
Paul Neumann
2018-07-09 15:15:31 +02:00
committed by Nathaniel Case
parent dbb58b34c3
commit dfb2b3fdd5
7 changed files with 62 additions and 0 deletions

View File

@@ -77,3 +77,13 @@ class TestIosFactsModule(TestIosModule):
self.assertIsNone(
result['ansible_facts']['ansible_net_interfaces']['Tunnel1110']['macaddress']
)
def test_ios_facts_filesystems_info(self):
set_module_args(dict(gather_subset='hardware'))
result = self.execute_module()
self.assertEqual(
result['ansible_facts']['ansible_net_filesystems_info']['bootflash:']['spacetotal_kb'], 7712692.0
)
self.assertEqual(
result['ansible_facts']['ansible_net_filesystems_info']['bootflash:']['spacefree_kb'], 6453180.0
)