Beispiel #1
0
 def test_getent(self):
     '''
     Tests the list of information for all users
     '''
     ret = [{
         'shell': '/usr/bin/false',
         'name': '_amavisd',
         'gid': 83,
         'groups': ['TEST_GROUP'],
         'home': '/var/virusmails',
         'fullname': 'AMaViS Daemon',
         'uid': 83
     }, {
         'shell': '/usr/bin/false',
         'name': '_appleevents',
         'gid': 55,
         'groups': ['TEST_GROUP'],
         'home': '/var/empty',
         'fullname': 'AppleEvents Daemon',
         'uid': 55
     }, {
         'shell': '/usr/bin/false',
         'name': '_appowner',
         'gid': 87,
         'groups': ['TEST_GROUP'],
         'home': '/var/empty',
         'fullname': 'Application Owner',
         'uid': 87
     }]
     self.assertEqual(mac_user.getent(), ret)
Beispiel #2
0
 def test_getent(self):
     '''
     Tests the list of information for all users
     '''
     with patch('pwd.getpwall', MagicMock(return_value=self.mock_pwall)), \
             patch('salt.modules.mac_user.list_groups',
                   MagicMock(return_value=['TEST_GROUP'])):
         ret = [{
             'shell': '/usr/bin/false',
             'name': '_amavisd',
             'gid': 83,
             'groups': ['TEST_GROUP'],
             'home': '/var/virusmails',
             'fullname': 'AMaViS Daemon',
             'uid': 83
         }, {
             'shell': '/usr/bin/false',
             'name': '_appleevents',
             'gid': 55,
             'groups': ['TEST_GROUP'],
             'home': '/var/empty',
             'fullname': 'AppleEvents Daemon',
             'uid': 55
         }, {
             'shell': '/usr/bin/false',
             'name': '_appowner',
             'gid': 87,
             'groups': ['TEST_GROUP'],
             'home': '/var/empty',
             'fullname': 'Application Owner',
             'uid': 87
         }]
         self.assertEqual(mac_user.getent(), ret)
 def test_getent(self):
     '''
     Tests the list of information for all users
     '''
     ret = [{'shell': '/usr/bin/false', 'name': '_amavisd', 'gid': 83,
             'groups': ['TEST_GROUP'], 'home': '/var/virusmails',
             'fullname': 'AMaViS Daemon', 'uid': 83},
            {'shell': '/usr/bin/false', 'name': '_appleevents', 'gid': 55,
             'groups': ['TEST_GROUP'], 'home': '/var/empty',
             'fullname': 'AppleEvents Daemon', 'uid': 55},
            {'shell': '/usr/bin/false', 'name': '_appowner', 'gid': 87,
             'groups': ['TEST_GROUP'], 'home': '/var/empty',
             'fullname': 'Application Owner', 'uid': 87}]
     self.assertEqual(mac_user.getent(), ret)
 def test_getent(self):
     """
     Tests the list of information for all users
     """
     with patch("pwd.getpwall",
                MagicMock(return_value=self.mock_pwall)), patch(
                    "salt.modules.mac_user.list_groups",
                    MagicMock(return_value=["TEST_GROUP"])):
         ret = [
             {
                 "shell": "/usr/bin/false",
                 "name": "_amavisd",
                 "gid": 83,
                 "groups": ["TEST_GROUP"],
                 "home": "/var/virusmails",
                 "fullname": "AMaViS Daemon",
                 "uid": 83,
             },
             {
                 "shell": "/usr/bin/false",
                 "name": "_appleevents",
                 "gid": 55,
                 "groups": ["TEST_GROUP"],
                 "home": "/var/empty",
                 "fullname": "AppleEvents Daemon",
                 "uid": 55,
             },
             {
                 "shell": "/usr/bin/false",
                 "name": "_appowner",
                 "gid": 87,
                 "groups": ["TEST_GROUP"],
                 "home": "/var/empty",
                 "fullname": "Application Owner",
                 "uid": 87,
             },
         ]
         self.assertEqual(mac_user.getent(), ret)