当前位置: 首页>>代码示例>>Python>>正文


Python UserTracker.make_create_command方法代码示例

本文整理汇总了Python中ipatests.test_xmlrpc.tracker.user_plugin.UserTracker.make_create_command方法的典型用法代码示例。如果您正苦于以下问题:Python UserTracker.make_create_command方法的具体用法?Python UserTracker.make_create_command怎么用?Python UserTracker.make_create_command使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ipatests.test_xmlrpc.tracker.user_plugin.UserTracker的用法示例。


在下文中一共展示了UserTracker.make_create_command方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_add_user_with_singlevalue_addattr

# 需要导入模块: from ipatests.test_xmlrpc.tracker.user_plugin import UserTracker [as 别名]
# 或者: from ipatests.test_xmlrpc.tracker.user_plugin.UserTracker import make_create_command [as 别名]
 def test_add_user_with_singlevalue_addattr(self):
     """ Try to add a user with single-value attribute
         set via option and --addattr """
     user = UserTracker(name=u'user', givenname=u'Test', sn=u'User1',
                        addattr=u'sn=User2')
     command = user.make_create_command()
     with raises_exact(errors.OnlyOneValueAllowed(attr='sn')):
         command()
开发者ID:icute1349,项目名称:freeipa,代码行数:10,代码来源:test_attr.py

示例2: test_create_with_bad_realm_in_principal

# 需要导入模块: from ipatests.test_xmlrpc.tracker.user_plugin import UserTracker [as 别名]
# 或者: from ipatests.test_xmlrpc.tracker.user_plugin.UserTracker import make_create_command [as 别名]
    def test_create_with_bad_realm_in_principal(self):
        """ Try to create user with a bad realm in principal """
        testuser = UserTracker(
            name=u'tuser1', givenname=u'Test', sn=u'Tuser1',
            krbprincipalname=u'[email protected]'
        )

        command = testuser.make_create_command()
        with raises_exact(errors.RealmMismatch()):
            command()
开发者ID:LiptonB,项目名称:freeipa,代码行数:12,代码来源:test_user_plugin.py

示例3: test_create_without_upg

# 需要导入模块: from ipatests.test_xmlrpc.tracker.user_plugin import UserTracker [as 别名]
# 或者: from ipatests.test_xmlrpc.tracker.user_plugin.UserTracker import make_create_command [as 别名]
 def test_create_without_upg(self):
     """ Try to create user without User's Primary GID """
     testuser = UserTracker(
         name=u'tuser1', givenname=u'Test', sn=u'Tuser1',
         noprivate=True
     )
     command = testuser.make_create_command()
     with raises_exact(errors.NotFound(
             reason=u'Default group for new users is not POSIX')):
         command()
开发者ID:LiptonB,项目名称:freeipa,代码行数:12,代码来源:test_user_plugin.py

示例4: test_create_with_too_long_login

# 需要导入模块: from ipatests.test_xmlrpc.tracker.user_plugin import UserTracker [as 别名]
# 或者: from ipatests.test_xmlrpc.tracker.user_plugin.UserTracker import make_create_command [as 别名]
 def test_create_with_too_long_login(self):
     """ Try to create user with too long login string """
     testuser = UserTracker(
         name=invaliduser2, givenname=u'Test', sn=u'User1'
     )
     command = testuser.make_create_command()
     with raises_exact(errors.ValidationError(
             name=u'login',
             error=u'can be at most 255 characters')):
         command()
开发者ID:LiptonB,项目名称:freeipa,代码行数:12,代码来源:test_user_plugin.py

示例5: test_create_with_invalid_login

# 需要导入模块: from ipatests.test_xmlrpc.tracker.user_plugin import UserTracker [as 别名]
# 或者: from ipatests.test_xmlrpc.tracker.user_plugin.UserTracker import make_create_command [as 别名]
 def test_create_with_invalid_login(self):
     """ Try to create user with an invalid login string """
     testuser = UserTracker(
         name=invaliduser1, givenname=u'Test', sn=u'User1'
     )
     command = testuser.make_create_command()
     with raises_exact(errors.ValidationError(
             name=u'login',
             error=u'may only include letters, numbers, _, -, . and $')):
         command()
开发者ID:LiptonB,项目名称:freeipa,代码行数:12,代码来源:test_user_plugin.py

示例6: test_create_with_krb_ticket_policy

# 需要导入模块: from ipatests.test_xmlrpc.tracker.user_plugin import UserTracker [as 别名]
# 或者: from ipatests.test_xmlrpc.tracker.user_plugin.UserTracker import make_create_command [as 别名]
 def test_create_with_krb_ticket_policy(self):
     """ Try to create user with krbmaxticketlife set """
     testuser = UserTracker(
         name=u'tuser1', givenname=u'Test',
         sn=u'Tuser1', setattr=u'krbmaxticketlife=88000'
     )
     command = testuser.make_create_command()
     with raises_exact(errors.ObjectclassViolation(
             info=u'attribute "%s" not allowed' % 'krbmaxticketlife')):
         command()
开发者ID:LiptonB,项目名称:freeipa,代码行数:12,代码来源:test_user_plugin.py

示例7: test_create_with_malformed_principal

# 需要导入模块: from ipatests.test_xmlrpc.tracker.user_plugin import UserTracker [as 别名]
# 或者: from ipatests.test_xmlrpc.tracker.user_plugin.UserTracker import make_create_command [as 别名]
    def test_create_with_malformed_principal(self):
        """ Try to create user with wrongly formed principal """
        testuser = UserTracker(
            name=u'tuser1', givenname=u'Test', sn=u'Tuser1',
            krbprincipalname=u'[email protected]@NOTFOUND.ORG'
        )

        command = testuser.make_create_command()
        with raises_exact(errors.MalformedUserPrincipal(
                principal=u'[email protected]@NOTFOUND.ORG')):
            command()
开发者ID:mrogers950,项目名称:freeipa,代码行数:13,代码来源:test_user_plugin.py

示例8: test_create_with_malformed_principal

# 需要导入模块: from ipatests.test_xmlrpc.tracker.user_plugin import UserTracker [as 别名]
# 或者: from ipatests.test_xmlrpc.tracker.user_plugin.UserTracker import make_create_command [as 别名]
    def test_create_with_malformed_principal(self):
        """ Try to create user with wrongly formed principal """
        testuser = UserTracker(
            name=u'tuser1', givenname=u'Test', sn=u'Tuser1',
            krbprincipalname=u'[email protected]@NOTFOUND.ORG'
        )

        command = testuser.make_create_command()
        with raises_exact(errors.ConversionError(
                name='principal', error="Malformed principal: '{}'".format(
                    testuser.kwargs['krbprincipalname']))):
            command()
开发者ID:LiptonB,项目名称:freeipa,代码行数:14,代码来源:test_user_plugin.py

示例9: test_create_with_ssh_pubkey

# 需要导入模块: from ipatests.test_xmlrpc.tracker.user_plugin import UserTracker [as 别名]
# 或者: from ipatests.test_xmlrpc.tracker.user_plugin.UserTracker import make_create_command [as 别名]
 def test_create_with_ssh_pubkey(self):
     """ Create user with an assigned SSH public key """
     testuser = UserTracker(
         name=u'tuser1', givenname=u'Test',
         sn=u'Tuser1', ipasshpubkey=sshpubkey
     )
     testuser.track_create()
     # fingerprint is expected in the tracker attrs
     testuser.attrs.update(sshpubkeyfp=[sshpubkeyfp])
     command = testuser.make_create_command()
     result = command()
     testuser.check_create(result)
     testuser.delete()
开发者ID:LiptonB,项目名称:freeipa,代码行数:15,代码来源:test_user_plugin.py

示例10: test_create_with_uid_999

# 需要导入模块: from ipatests.test_xmlrpc.tracker.user_plugin import UserTracker [as 别名]
# 或者: from ipatests.test_xmlrpc.tracker.user_plugin.UserTracker import make_create_command [as 别名]
 def test_create_with_uid_999(self):
     """ Check that server return uid and gid 999
     when a new client asks for uid 999 """
     testuser = UserTracker(
         name=u'tuser1', givenname=u'Test', sn=u'Tuser1', uidnumber=999
     )
     testuser.track_create()
     testuser.attrs.update(
         uidnumber=[u'999'],
         gidnumber=[u'999']
     )
     command = testuser.make_create_command()
     result = command()
     testuser.check_create(result)
     testuser.delete()
开发者ID:LiptonB,项目名称:freeipa,代码行数:17,代码来源:test_user_plugin.py

示例11: test_create_with_old_DNA_MAGIC_999

# 需要导入模块: from ipatests.test_xmlrpc.tracker.user_plugin import UserTracker [as 别名]
# 或者: from ipatests.test_xmlrpc.tracker.user_plugin.UserTracker import make_create_command [as 别名]
 def test_create_with_old_DNA_MAGIC_999(self):
     """ Check that server picks suitable uid and gid
     when an old client asks for the magic uid 999 """
     testuser = UserTracker(
         name=u'tuser1', givenname=u'Test', sn=u'Tuser1',
         uidnumber=999, version=u'2.49'
     )
     testuser.track_create()
     testuser.attrs.update(
         uidnumber=[lambda v: int(v) != 999],
         gidnumber=[lambda v: int(v) != 999],
     )
     command = testuser.make_create_command()
     result = command()
     testuser.check_create(result)
     testuser.delete()
开发者ID:LiptonB,项目名称:freeipa,代码行数:18,代码来源:test_user_plugin.py

示例12: test_create_without_upg_with_gid_set

# 需要导入模块: from ipatests.test_xmlrpc.tracker.user_plugin import UserTracker [as 别名]
# 或者: from ipatests.test_xmlrpc.tracker.user_plugin.UserTracker import make_create_command [as 别名]
 def test_create_without_upg_with_gid_set(self):
     """ Create user without User's Primary GID with GID set """
     testuser = UserTracker(
         name=u'tuser1', givenname=u'Test', sn=u'Tuser1',
         noprivate=True, gidnumber=1000
     )
     testuser.track_create()
     del testuser.attrs['mepmanagedentry']
     testuser.attrs.update(gidnumber=[u'1000'])
     testuser.attrs.update(
         description=[],
         objectclass=add_oc(objectclasses.user_base, u'ipantuserattrs')
     )
     command = testuser.make_create_command()
     result = command()
     testuser.check_create(result, [u'description'])
     testuser.delete()
开发者ID:LiptonB,项目名称:freeipa,代码行数:19,代码来源:test_user_plugin.py

示例13: test_create_with_random_passwd

# 需要导入模块: from ipatests.test_xmlrpc.tracker.user_plugin import UserTracker [as 别名]
# 或者: from ipatests.test_xmlrpc.tracker.user_plugin.UserTracker import make_create_command [as 别名]
 def test_create_with_random_passwd(self):
     """ Create user with random password """
     testuser = UserTracker(
         name=u'tuser1', givenname=u'Test', sn=u'Tuser1', random=True
     )
     testuser.track_create()
     testuser.attrs.update(
         randompassword=fuzzy_password,
         has_keytab=True, has_password=True,
         krbextradata=[Fuzzy(type=bytes)],
         krbpasswordexpiration=[fuzzy_dergeneralizedtime],
         krblastpwdchange=[fuzzy_dergeneralizedtime]
     )
     command = testuser.make_create_command()
     result = command()
     testuser.check_create(result)
     testuser.delete()
开发者ID:LiptonB,项目名称:freeipa,代码行数:19,代码来源:test_user_plugin.py


注:本文中的ipatests.test_xmlrpc.tracker.user_plugin.UserTracker.make_create_command方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。