Specs: test specifying custom user name for guided user creation

This commit is contained in:
Dmitry Maksyoma 2021-09-16 18:37:08 +12:00
parent a27ad89677
commit df35fadc9b

View File

@ -143,3 +143,21 @@ with description('vncserver') as self:
user = os.environ['USER']
completed_process = run_cmd(f'grep -q {user} {home_dir}/.kasmpasswd')
expect(completed_process.returncode).to(equal(0))
with fit('specify custom username'):
custom_username = 'custom_username'
child = pexpect.spawn(f'{vncserver_cmd} -select-de cinnamon',
timeout=2)
child.expect('Enter username')
child.sendline(custom_username)
child.expect('Password:')
child.sendline('password')
child.expect('Verify:')
child.sendline('password')
child.expect(pexpect.EOF)
child.close()
expect(child.exitstatus).to(equal(0))
home_dir = os.environ['HOME']
completed_process = run_cmd(f'grep -qw {custom_username} {home_dir}/.kasmpasswd')
expect(completed_process.returncode).to(equal(0))