Beispiel #1
0
 def test_validate_snmp_v3_params_validates_private_key_and_raise(self):
     enable_flow = CiscoEnableSnmpFlow(cli_handler=MagicMock(),
                                       logger=MagicMock())
     snmp_v3_parameters = SNMPV3Parameters(ip=self.IP,
                                           snmp_user=self.SNMP_USER,
                                           snmp_password=self.SNMP_PASSWORD,
                                           snmp_private_key="")
     try:
         enable_flow._validate_snmp_v3_params(snmp_v3_parameters)
     except Exception as e:
         self.assertIn(
             "Failed to enable SNMP v3: 'SNMP V3 Private Key' attribute cannot be empty",
             e.args)
Beispiel #2
0
 def test_validate_snmp_v3_params_validates_auth_protocol_and_raise(self):
     enable_flow = CiscoEnableSnmpFlow(cli_handler=MagicMock(),
                                       logger=MagicMock())
     snmp_v3_parameters = SNMPV3Parameters(
         ip=self.IP,
         snmp_user=self.SNMP_USER,
         snmp_password=self.SNMP_PASSWORD,
         snmp_private_key=self.SNMP_PRIVATE_KEY,
         auth_protocol="No Authentication Protocol")
     try:
         enable_flow._validate_snmp_v3_params(snmp_v3_parameters)
     except Exception as e:
         self.assertIn(
             "Failed to enable SNMP v3: 'SNMP V3 Authentication Protocol' attribute cannot be empty"
             " or set to 'No Authentication Protocol'", e.args)