Esempio n. 1
0
 def test_search_for_all_nonposix(self, group):
     """ Perform a search for all non-posix groups """
     command = group.make_command(
         'group_find', **dict(nonposix=True, all=True)
     )
     result = command()
     assert_deepequal(dict(
         summary=u'3 groups matched',
         count=3,
         truncated=False,
         result=[
             {
                 'dn': get_group_dn('ipausers'),
                 'cn': [u'ipausers'],
                 'description': [u'Default group for all users'],
                 'objectclass': fuzzy_set_ci(objectclasses.group),
                 'ipauniqueid': [fuzzy_uuid],
             },
             {
                 'dn': get_group_dn(group.cn),
                 'cn': [group.cn],
                 'description': [u'New desc'],
                 'objectclass': fuzzy_set_ci(objectclasses.group),
                 'ipauniqueid': [fuzzy_uuid],
             },
             {
                 'dn': get_group_dn('trust admins'),
                 'member_user': [u'admin'],
                 'cn': [u'trust admins'],
                 'description': [u'Trusts administrators group'],
                 'objectclass': fuzzy_set_ci(objectclasses.group),
                 'ipauniqueid': [fuzzy_uuid],
             },
         ],
     ), result)
Esempio n. 2
0
 def test_search_for_all_nonposix(self, group):
     """ Perform a search for all non-posix groups """
     command = group.make_command('group_find',
                                  **dict(nonposix=True, all=True))
     result = command()
     assert_deepequal(
         dict(
             summary=u'3 groups matched',
             count=3,
             truncated=False,
             result=[
                 {
                     'dn': get_group_dn('ipausers'),
                     'cn': [u'ipausers'],
                     'description': [u'Default group for all users'],
                     'objectclass': fuzzy_set_ci(objectclasses.group),
                     'ipauniqueid': [fuzzy_uuid],
                 },
                 {
                     'dn': get_group_dn(group.cn),
                     'cn': [group.cn],
                     'description': [u'New desc'],
                     'objectclass': fuzzy_set_ci(objectclasses.group),
                     'ipauniqueid': [fuzzy_uuid],
                 },
                 {
                     'dn': get_group_dn('trust admins'),
                     'member_user': [u'admin'],
                     'cn': [u'trust admins'],
                     'description': [u'Trusts administrators group'],
                     'objectclass': fuzzy_set_ci(objectclasses.group),
                     'ipauniqueid': [fuzzy_uuid],
                 },
             ],
         ), result)
Esempio n. 3
0
 def test_search_for_all_posix(self, group, group2):
     """ Search for all posix groups """
     command = group.make_command('group_find', **dict(posix=True,
                                                       all=True))
     result = command()
     assert_deepequal(
         dict(summary=u'4 groups matched',
              count=4,
              truncated=False,
              result=[
                  {
                      'dn': get_group_dn('admins'),
                      'member_user': [u'admin'],
                      'gidnumber': [fuzzy_digits],
                      'cn': [u'admins'],
                      'description': [u'Account administrators group'],
                      'objectclass': fuzzy_set_ci(objectclasses.posixgroup),
                      'ipauniqueid': [fuzzy_uuid],
                      'ipantsecurityidentifier': [fuzzy_user_or_group_sid],
                  },
                  {
                      'dn':
                      get_group_dn('editors'),
                      'gidnumber': [fuzzy_digits],
                      'cn': [u'editors'],
                      'description':
                      [u'Limited admins who can edit other users'],
                      'objectclass':
                      fuzzy_set_ci(objectclasses.posixgroup),
                      'ipauniqueid': [fuzzy_uuid],
                      'ipantsecurityidentifier': [fuzzy_user_or_group_sid],
                  },
                  {
                      'dn': get_group_dn(group.cn),
                      'cn': [group.cn],
                      'description': [u'Test desc1'],
                      'gidnumber': [fuzzy_digits],
                      'objectclass': fuzzy_set_ci(objectclasses.posixgroup),
                      'ipauniqueid': [fuzzy_uuid],
                      'ipantsecurityidentifier': [fuzzy_user_or_group_sid],
                  },
                  {
                      'dn': get_group_dn(group2.cn),
                      'cn': [group2.cn],
                      'description': [u'Test desc2'],
                      'gidnumber': [fuzzy_digits],
                      'objectclass': fuzzy_set_ci(objectclasses.posixgroup),
                      'ipauniqueid': [fuzzy_uuid],
                      'ipantsecurityidentifier': [fuzzy_user_or_group_sid],
                  },
              ]), result)
Esempio n. 4
0
 def test_search_for_all_posix(self, group, group2):
     """ Search for all posix groups """
     command = group.make_command(
         'group_find', **dict(posix=True, all=True)
     )
     result = command()
     assert_deepequal(dict(
         summary=u'4 groups matched',
         count=4,
         truncated=False,
         result=[
             {
                 'dn': get_group_dn('admins'),
                 'member_user': [u'admin'],
                 'gidnumber': [fuzzy_digits],
                 'cn': [u'admins'],
                 'description': [u'Account administrators group'],
                 'objectclass': fuzzy_set_ci(add_oc(
                     objectclasses.posixgroup, u'ipantgroupattrs')),
                 'ipauniqueid': [fuzzy_uuid],
             },
             {
                 'dn': get_group_dn('editors'),
                 'gidnumber': [fuzzy_digits],
                 'cn': [u'editors'],
                 'description':
                     [u'Limited admins who can edit other users'],
                 'objectclass': fuzzy_set_ci(add_oc(
                     objectclasses.posixgroup, u'ipantgroupattrs')),
                 'ipauniqueid': [fuzzy_uuid],
             },
             {
                 'dn': get_group_dn(group.cn),
                 'cn': [group.cn],
                 'description': [u'Test desc1'],
                 'gidnumber': [fuzzy_digits],
                 'objectclass': fuzzy_set_ci(add_oc(
                     objectclasses.posixgroup, u'ipantgroupattrs')),
                 'ipauniqueid': [fuzzy_uuid],
             },
             {
                 'dn': get_group_dn(group2.cn),
                 'cn': [group2.cn],
                 'description': [u'Test desc2'],
                 'gidnumber': [fuzzy_digits],
                 'objectclass': fuzzy_set_ci(add_oc(
                     objectclasses.posixgroup, u'ipantgroupattrs')),
                 'ipauniqueid': [fuzzy_uuid],
             },
         ]), result)
Esempio n. 5
0
 def test_search_for_all_nonposix_with_criteria(self, group):
     """ Search for all non-posix groups with additional
     criteria filter """
     command = group.make_command(
         'group_find', *[u'users'], **dict(nonposix=True, all=True)
     )
     result = command()
     assert_deepequal(dict(
         summary=u'1 group matched',
         count=1,
         truncated=False,
         result=[
             {
                 'dn': get_group_dn('ipausers'),
                 'cn': [u'ipausers'],
                 'description': [u'Default group for all users'],
                 'objectclass': fuzzy_set_ci(objectclasses.group),
                 'ipauniqueid': [fuzzy_uuid],
             },
         ],
     ), result)
Esempio n. 6
0
 def test_search_for_all_nonposix_with_criteria(self, group):
     """ Search for all non-posix groups with additional
     criteria filter """
     command = group.make_command('group_find', *[u'users'],
                                  **dict(nonposix=True, all=True))
     result = command()
     assert_deepequal(
         dict(
             summary=u'1 group matched',
             count=1,
             truncated=False,
             result=[
                 {
                     'dn': get_group_dn('ipausers'),
                     'cn': [u'ipausers'],
                     'description': [u'Default group for all users'],
                     'objectclass': fuzzy_set_ci(objectclasses.group),
                     'ipauniqueid': [fuzzy_uuid],
                 },
             ],
         ), result)