Skip to content
Snippets Groups Projects
Commit 7425531c authored by Husaam Mehdi's avatar Husaam Mehdi
Browse files

ethmngr: use bbfdm object instead of bbfdm.ethmngr in test

parent 171cf63d
Branches
No related tags found
1 merge request!32ethmngr: use bbfdm object instead of bbfdm.ethmngr in test
Pipeline #204351 passed
...@@ -23,25 +23,25 @@ if sock.exists(): ...@@ -23,25 +23,25 @@ if sock.exists():
else: else:
assert ubus.connect() assert ubus.connect()
out = ubus.call('bbfdm.ethmngr', 'add', {"path":"Device.Ethernet.RMONStats."}) out = ubus.call('bbfdm', 'add', {"path":"Device.Ethernet.RMONStats."})
inst = out[0]["results"][0]["data"] inst = out[0]["results"][0]["data"]
assert int(inst) > 0, "Fail to add RMONStats instance" assert int(inst) > 0, "Fail to add RMONStats instance"
out = ubus.call('bbfdm.ethmngr', 'set', {"path":"Device.Ethernet.RMONStats."+inst+".Enable","value":"1"}) out = ubus.call('bbfdm', 'set', {"path":"Device.Ethernet.RMONStats."+inst+".Enable","value":"1"})
assert int(out[0]["results"][0]["data"]) == 1, "Failed to enable RMONStats instance" assert int(out[0]["results"][0]["data"]) == 1, "Failed to enable RMONStats instance"
out = ubus.call('bbfdm.ethmngr', 'set', {"path":"Device.Ethernet.RMONStats."+inst+".Interface","value":"Device.Ethernet.Interface.5"}) out = ubus.call('bbfdm', 'set', {"path":"Device.Ethernet.RMONStats."+inst+".Interface","value":"Device.Ethernet.Interface.5"})
assert int(out[0]["results"][0]["data"]) == 1, "Failed to set interface of RMONStats instance" assert int(out[0]["results"][0]["data"]) == 1, "Failed to set interface of RMONStats instance"
# test rmonstats # test rmonstats
for i in rmon_stats: for i in rmon_stats:
out = ubus.call('bbfdm.ethmngr', 'get', {"path":"Device.Ethernet.RMONStats."+inst+"."+i}) out = ubus.call('bbfdm', 'get', {"path":"Device.Ethernet.RMONStats."+inst+"."+i})
print(out) print(out)
assert str(out[0][i]) != "", "Fail at RMONSTAT " + i assert str(out[0][i]) != "", "Fail at RMONSTAT " + i
# test ifstats # test ifstats
for i in if_stats: for i in if_stats:
out = ubus.call('bbfdm.ethmngr', 'get', {"path":"Device.Ethernet.Interface.5.Stats."+i}) out = ubus.call('bbfdm', 'get', {"path":"Device.Ethernet.Interface.5.Stats."+i})
print(out) print(out)
assert str(out[0][i]) != "", "Fail at IFSTAT " + i assert str(out[0][i]) != "", "Fail at IFSTAT " + i
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment