mirror of
https://github.com/kernelkit/infix.git
synced 2026-07-22 01:13:00 +02:00
Add test to se that it is possible to get all operational data
Unlikley to fail though.
This commit is contained in:
committed by
Tobias Waldekranz
parent
0aeae9d8e8
commit
051658d36a
@@ -1,6 +1,9 @@
|
||||
---
|
||||
- case: meta/wait.py
|
||||
|
||||
- name: Misc tests
|
||||
suite: misc/all.yaml
|
||||
|
||||
- name: ietf-system
|
||||
suite: ietf_system/all.yaml
|
||||
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
---
|
||||
- case: operational_all.py
|
||||
Executable
+16
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
# Test that it is possible to get all operational data
|
||||
|
||||
import infamy
|
||||
import infamy.iface as iface
|
||||
|
||||
with infamy.Test() as test:
|
||||
with test.step("Initialize"):
|
||||
env = infamy.Env(infamy.std_topology("1x1"))
|
||||
target = env.attach("target", "mgmt")
|
||||
|
||||
with test.step("Get all Operational data"):
|
||||
target.get_data(as_xml=True)
|
||||
|
||||
test.succeed()
|
||||
@@ -209,7 +209,7 @@ class Device(object):
|
||||
else:
|
||||
return self.get(xpath).print_dict()
|
||||
|
||||
def get_data(self, xpath, as_xml=False):
|
||||
def get_data(self, xpath=None, as_xml=False):
|
||||
"""RPC <get-data> to fetch operational data"""
|
||||
if(as_xml):
|
||||
return self._get_data(xpath,as_xml)
|
||||
|
||||
Reference in New Issue
Block a user