Add user factory function that would be used in tests. This factory would generate (load from JSON) the user with requires a username and returns a new instance of the BaseUser object.
Code usage example:
@pytest.mark.parametrize("user", [user_factory("local-user"), user_factory("ipa-user")], scope="session") # <-------------------------
def test_su_login_with_sc(user, user_shell):
with Authselect(required=False):
with user.card(insert=True):
cmd = f'su {user.username} -c "whoami"'
user_shell.sendline(cmd)
user_shell.expect(f"PIN for {user.username}:")
user_shell.sendline(user.pin)
user_shell.expect(user.username)
Add user factory function that would be used in tests. This factory would generate (load from JSON) the user with requires a username and returns a new instance of the BaseUser object.
Code usage example: