def dummy_user_expired_password(): ipa_admin.user_add( 'dummy', 'Dummy', 'User', 'Dummy User', user_password='******', login_shell='/bin/bash', ) # Don't change the password: it will be expired yield ipa_admin.user_del('dummy')
def make_user(ipa_testing_config): created_users = [] def _make_user(name): now = datetime.datetime.utcnow().replace(microsecond=0) password = f'{name}_password' ipa_admin.user_add( name, name.title(), 'User', f'{name.title()} User', mail="*****@*****.**", user_password=password, login_shell='/bin/bash', fascreationtime=f"{now.isoformat()}Z", ) ipa = untouched_ipa_client(app) ipa.change_password(name, password, password) created_users.append(name) yield _make_user for username in created_users: ipa_admin.user_del(username)
def make_user(ipa_testing_config): created_users = [] def _make_user(name): now = datetime.datetime.utcnow().replace(microsecond=0) password = f'{name}_password' ipa_admin.user_add( a_uid=name, o_givenname=name.title(), o_sn='User', o_cn=f'{name.title()} User', o_mail=f"{name}@example.com", o_userpassword=password, o_loginshell='/bin/bash', fascreationtime=f"{now.isoformat()}Z", ) ipa = untouched_ipa_client(app) ipa.change_password(name, password, password) created_users.append(name) yield _make_user for name in created_users: ipa_admin.user_del(name)