Exemple #1
0
 def test_get_auth_traps_enabled(self):
     '''
     Test - Determine whether the host is configured to send authentication traps.
     '''
     mock_value = MagicMock(return_value={'vdata': 1})
     with patch.dict(win_snmp.__salt__, {'reg.read_value': mock_value}):
         self.assertTrue(win_snmp.get_auth_traps_enabled())
Exemple #2
0
 def test_get_auth_traps_enabled(self):
     """
     Test - Determine whether the host is configured to send authentication traps.
     """
     mock_value = MagicMock(return_value={"vdata": 1})
     with patch.dict(win_snmp.__utils__, {"reg.read_value": mock_value}):
         self.assertTrue(win_snmp.get_auth_traps_enabled())
Exemple #3
0
 def test_get_auth_traps_enabled(self):
     '''
     Test - Determine whether the host is configured to send authentication traps.
     '''
     mock_value = MagicMock(return_value={'vdata': 1})
     with patch.dict(win_snmp.__salt__, {'reg.read_value': mock_value}):
         self.assertTrue(win_snmp.get_auth_traps_enabled())
Exemple #4
0
        '''
        self.assertIsInstance(win_snmp.get_agent_service_types(), list)

    def test_get_permission_types(self):
        """
        Test - Get the permission types that can be configured for communities.
        '''
        self.assertIsInstance(win_snmp.get_permission_types(), list)

    def test_get_auth_traps_enabled(self):
        """
        Test - Determine whether the host is configured to send authentication traps.
        '''
        mock_value = MagicMock(return_value={'vdata': 1})
        with patch.dict(win_snmp.__utils__, {'reg.read_value': mock_value}):
            self.assertTrue(win_snmp.get_auth_traps_enabled())

    def test_set_auth_traps_enabled(self):
        """
        Test - Manage the sending of authentication traps.
        """
        mock_value = MagicMock(return_value=True)
        kwargs = {'status': True}
        with patch.dict(win_snmp.__utils__, {'reg.set_value': mock_value}), \
                patch('salt.modules.win_snmp.get_auth_traps_enabled',
                      MagicMock(return_value=True)):
            self.assertTrue(win_snmp.set_auth_traps_enabled(**kwargs))

    def test_get_community_names(self):
        """
        Test - Get the current accepted SNMP community names and their permissions.