def test_v3_user_md5_aes(self): snmp_client = snmpclient.SNMPv3Client( self.agent_ip, self.agent_port, self.user_md5_aes.name, auth_key=self.user_md5_aes.auth_key, priv_key=self.user_md5_aes.priv_key, priv_proto=self.user_md5_aes.priv.lower()) self._service_check(snmp_client)
def test_wrong_auth_key(self): snmp_client = snmpclient.SNMPv3Client(self.agent_ip, self.agent_port, self.user_md5.name, auth_key='wront_auth_key') mib_name = 'agentVersion' result, time_used = snmp_client.get(mib_name) self.assertFalse(result)
def test_not_exists_user(self): snmp_client = snmpclient.SNMPv3Client(self.agent_ip, self.agent_port, 'user-not-exists', auth_key='test1234') mib_name = 'agentVersion' result, time_used = snmp_client.get(mib_name) self.assertFalse(result)
def test_wrong_priv_key(self): snmp_client = snmpclient.SNMPv3Client(self.agent_ip, self.agent_port, self.user_md5_aes.name, auth_key='test1234', priv_key='wrong_priv_key', priv_proto='aes') mib_name = 'agentVersion' result, time_used = snmp_client.get(mib_name) self.assertFalse(result)
def test_v3_user_sha(self): snmp_client = snmpclient.SNMPv3Client( self.agent_ip, self.agent_port, self.user_sha.name, auth_key=self.user_sha.auth_key, auth_proto=self.user_sha.auth.lower()) self._service_check(snmp_client)
def test_v3_user_md5(self): snmp_client = snmpclient.SNMPv3Client(self.agent_ip, self.agent_port, self.user_md5.name, auth_key=self.user_md5.auth_key) self._service_check(snmp_client)