Spec: add user creation test
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import os
|
||||
import pexpect
|
||||
import shutil
|
||||
import subprocess
|
||||
from path import Path
|
||||
@@ -123,3 +124,22 @@ with description('vncserver') as self:
|
||||
expect(completed_process.returncode).to(equal(0))
|
||||
|
||||
check_de_was_setup_to_run('cinnamon')
|
||||
|
||||
with context('guided user creation'):
|
||||
with fit('asks to create a user if none exist'):
|
||||
child = pexpect.spawn(f'{vncserver_cmd} -select-de cinnamon',
|
||||
timeout=2)
|
||||
child.expect('Enter username')
|
||||
child.sendline()
|
||||
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']
|
||||
user = os.environ['USER']
|
||||
completed_process = run_cmd(f'grep -q {user} {home_dir}/.kasmpasswd')
|
||||
expect(completed_process.returncode).to(equal(0))
|
||||
|
||||
Reference in New Issue
Block a user