def test_method(self): mod = SMI.get_module("IF-MIB") node = mod.get_node("ifXEntry") rel = node.get_related() # gets AUGMENTS node if rel and rel.name == "ifEntry": return self.passed("got correct relation") else: return self.failed("failed to get proper augmentation!")
def test_method(self): mod = SMI.get_module("IF-MIB") node = mod.get_node("ifXEntry") rel = node.get_related() # gets AUGMENTS node if rel and rel.name == "ifEntry": return self.passed("got correct relation") else: return self.failed("failed to get proper augmentation!")
def test_method(self): m = SMI.get_module("TUBS-IBR-TEST-MIB") t = m.get_type("OctalValue") self.info(t) if t is None: return self.abort("The tested module returned no Type") self.assert_equal(t.name, "OctalValue") return self.passed("got specified type")
def test_method(self): m = SMI.get_module("TUBS-IBR-TEST-MIB") t = m.get_type("OctalValue") self.info(t) if t is None: return self.abort("The tested module returned no Type") self.assert_equal(t.name, "OctalValue") return self.passed("got specified type")
def test_method(self): m = SMI.get_module("IF-MIB") got = 0 for notif in m.get_notifications(): self.verboseinfo(notif) got = 1 if got: return self.passed("got notifications") else: return self.failed("no notifications!")
def test_method(self): m = SMI.get_module("XXX ") # XXX what module has capabilities? got = 0 for cap in m.get_capabilities(): self.verboseinfo(cap) got = 1 if got: return self.passed("got capabilities") else: return self.failed("no capabilities!")
def test_method(self): m = SMI.get_module("IF-MIB") got = 0 for grp in m.get_groups(): self.verboseinfo(grp) got = 1 if got: return self.passed("got groups") else: return self.failed("no groups!")
def test_method(self): m = SMI.get_module("IF-MIB") got = 0 for comp in m.get_compliances(): self.verboseinfo(comp) got = 1 if got: return self.passed("got compliances") else: return self.failed("no compliances!")
def test_method(self): m = SMI.get_module("IF-MIB") got = 0 for notif in m.get_notifications(): self.verboseinfo(notif) got = 1 if got: return self.passed("got notifications") else: return self.failed("no notifications!")
def test_method(self): m = SMI.get_module("TCP-MIB") got = 0 for col in m.get_columns(): self.verboseinfo(col.name) got = 1 if got: return self.passed("got columns") else: return self.failed("no columns!")
def test_method(self): m = SMI.get_module("TCP-MIB") got = 0 for row in m.get_rows(): self.verboseinfo(row.name) got = 1 if got: return self.passed("got rows") else: return self.failed("no rows!")
def test_method(self): m = SMI.get_module("TCP-MIB") got = 0 for table in m.get_tables(): self.verboseinfo(table.name) got = 1 if got: return self.passed("got tables") else: return self.failed("no tables!")
def test_method(self): m = SMI.get_module("TCP-MIB") got = 0 for scalar in m.get_scalars(): self.verboseinfo(scalar.name) got = 1 if got: return self.passed("got scalars") else: return self.failed("no scalars!")
def test_method(self): got = 0 m = SMI.get_module("SNMPv2-SMI") for mac in m.get_macros(): self.info(mac) got = 1 if got: return self.passed("got macros") else: return self.failed("no macros returned")
def test_method(self): m = SMI.get_module("TCP-MIB") got = 0 for col in m.get_columns(): self.verboseinfo(col.name) got = 1 if got: return self.passed("got columns") else: return self.failed("no columns!")
def test_method(self): m = SMI.get_module("XXX ") # XXX what module has capabilities? got = 0 for cap in m.get_capabilities(): self.verboseinfo(cap) got = 1 if got: return self.passed("got capabilities") else: return self.failed("no capabilities!")
def test_method(self): m = SMI.get_module("TCP-MIB") got = 0 for table in m.get_tables(): self.verboseinfo(table.name) got = 1 if got: return self.passed("got tables") else: return self.failed("no tables!")
def test_method(self): m = SMI.get_module("TCP-MIB") got = 0 for row in m.get_rows(): self.verboseinfo(row.name) got = 1 if got: return self.passed("got rows") else: return self.failed("no rows!")
def test_method(self): m = SMI.get_module("TCP-MIB") got = 0 for scalar in m.get_scalars(): self.verboseinfo(scalar.name) got = 1 if got: return self.passed("got scalars") else: return self.failed("no scalars!")
def test_method(self): got = 0 m = SMI.get_module("SNMPv2-SMI") for mac in m.get_macros(): self.info(mac) got = 1 if got: return self.passed("got macros") else: return self.failed("no macros returned")
def test_method(self): m = SMI.get_module("IF-MIB") got = 0 for comp in m.get_compliances(): self.verboseinfo(comp) got = 1 if got: return self.passed("got compliances") else: return self.failed("no compliances!")
def test_method(self): m = SMI.get_module("IF-MIB") got = 0 for grp in m.get_groups(): self.verboseinfo(grp) got = 1 if got: return self.passed("got groups") else: return self.failed("no groups!")
def test_method(self): got = 0 mod = SMI.get_module("TCP-MIB") scalars = list(mod.get_scalars()) table = mod.get_tables().next() for child in table.get_children(): self.verboseinfo(child) got += 1 if got: self.config.testtable = table self.config.testchild = child return self.passed("got %d children" % (got, )) else: return self.failed("no children!")
def test_method(self): got = 0 mod = SMI.get_module("TCP-MIB") scalars = list(mod.get_scalars()) table = mod.get_tables().next() for child in table.get_children(): self.verboseinfo(child) got += 1 if got: self.config.testtable = table self.config.testchild = child return self.passed("got %d children" % (got,)) else: return self.failed("no children!")
def test_method(self): map(SMI.load_module, MIBS) m = SMI.get_module(MIBS[0]) self.assert_true(m.name == MIBS[0]) self.config.testModule = m return self.passed()
def test_method(self): got = 0 mod = SMI.get_module("TCP-MIB") nodes = list(mod.get_nodes(SMI.SMI_NODEKIND_ANY)) self.assert_true(len(nodes) > 1) return self.passed("got nodes")
def test_method(self): m = SMI.get_module("SNMPv2-SMI") mac = m.get_macro("NOTIFICATION-TYPE") self.verboseinfo(mac) self.assert_equal(mac.name, "NOTIFICATION-TYPE") return self.passed("Got macro.")
def test_method(self): got = 0 mod = SMI.get_module("TCP-MIB") nodes = list(mod.get_nodes(SMI.SMI_NODEKIND_ANY)) self.assert_true(len(nodes) > 1) return self.passed("got nodes")
def test_method(self): m = SMI.get_module("SNMPv2-SMI") mac = m.get_macro("NOTIFICATION-TYPE") self.verboseinfo(mac) self.assert_equal(mac.name, "NOTIFICATION-TYPE") return self.passed("Got macro.")
def test_method(self): map(SMI.load_module, MIBS) m = SMI.get_module(MIBS[0]) self.assert_true(m.name == MIBS[0]) self.config.testModule = m return self.passed()
def test_method(self): m = SMI.get_module(MIBS[0]) m2 = SMI.get_module("SNMPv2-SMI") self.assert_true(m.is_imported(m2, "Integer32")) self.assert_false(m.is_imported(m2, "Counter64")) return self.passed("All is_imported assertions passed.")
mods = list(SMI.get_modules()) mod = mods[-1] print mod print "getScalars test" scalars = list(mod.get_scalars()) scalar = scalars[1] print scalar print "getRows test" rows = list(mod.get_rows(SMI.SMI_STATUS_CURRENT)) print " types test:" tcmib = SMI.get_module("SNMPv2-TC") smi_types = tcmib.get_types() for smi_type in smi_types: print "Type: ", smi_type, smi_type.snmptype print print "index test: get an Index object of a row" rtpmib = SMI.get_module("RTP-MIB") rtpsess = rtpmib.get_node("rtpSessionInverseEntry") rtpsess_index = rtpsess.get_index() for ind in rtpsess_index: print rtpmib.get_node(ind.name).value print "augments test: should see base conceptual row index." snmpmib = SMI.get_module("SNMP-COMMUNITY-MIB")
def test_method(self): m = SMI.get_module(MIBS[0]) m2 = SMI.get_module("SNMPv2-SMI") self.assert_true(m.is_imported(m2, "Integer32")) self.assert_false(m.is_imported(m2, "Counter64")) return self.passed("All is_imported assertions passed.")