def test_snmp_bulkwalk_res(sess_args): if sess_args['version'] == 1: with pytest.raises(EasySNMPError): snmp_bulkwalk('system', **sess_args) else: res = snmp_bulkwalk('system', **sess_args) assert len(res) >= 7 assert res[0].oid == 'sysDescr' assert res[0].oid_index == '0' assert platform.version() in res[0].value assert res[0].snmp_type == 'OCTETSTR' assert res[3].oid == 'sysContact' assert res[3].oid_index == '0' assert res[3].value == 'G. S. Marzot <*****@*****.**>' assert res[3].snmp_type == 'OCTETSTR' assert res[4].oid == 'sysName' assert res[4].oid_index == '0' assert res[4].value == platform.node() assert res[4].snmp_type == 'OCTETSTR' assert res[5].oid == 'sysLocation' assert res[5].oid_index == '0' assert res[5].value == 'my original location' assert res[5].snmp_type == 'OCTETSTR'
def test_snmp_bulkwalk_res(sess_args): if sess_args["version"] == 1: with pytest.raises(EasySNMPError): snmp_bulkwalk("system", **sess_args) else: res = snmp_bulkwalk("system", **sess_args) assert len(res) >= 7 assert res[0].oid == "sysDescr" assert res[0].oid_index == "0" assert platform.version() in res[0].value assert res[0].snmp_type == "OCTETSTR" assert res[3].oid == "sysContact" assert res[3].oid_index == "0" assert res[3].value == "G. S. Marzot <*****@*****.**>" assert res[3].snmp_type == "OCTETSTR" assert res[4].oid == "sysName" assert res[4].oid_index == "0" assert res[4].value == platform.node() assert res[4].snmp_type == "OCTETSTR" assert res[5].oid == "sysLocation" assert res[5].oid_index == "0" assert res[5].value == "my original location" assert res[5].snmp_type == "OCTETSTR"
def test_snmp_bulkwalk(sess_args): res = snmp_bulkwalk('system', **sess_args) assert len(res) >= 7 assert platform.version() in res[0].value assert res[3].value == 'G. S. Marzot <*****@*****.**>' assert res[4].value == platform.node() assert res[5].value == 'my original location'
def test_snmp_bulkwalk_unknown(sess_args): with pytest.raises(EasySNMPUnknownObjectIDError): snmp_bulkwalk('systemo', **sess_args)