Specs: pexpect starts Xvnc now

KASM-1609_select_de_to_run
Dmitry Maksyoma 4 years ago
parent f857d47ccf
commit 5f7d3ad43a

@ -147,9 +147,11 @@ with description('vncserver') as self:
with fit('specify custom username'):
custom_username = 'custom_username'
child = pexpect.spawn(f'{vncserver_cmd} -select-de cinnamon',
timeout=2)
# child.logfile = sys.stdout.buffer
child = pexpect.spawn('/bin/bash',
['-ic', f':;{vncserver_cmd} -select-de cinnamon'],
timeout=5, encoding='utf-8')
running_xvnc = True
child.logfile_read = sys.stderr
child.expect('Enter username')
child.sendline(custom_username)
child.expect('Password:')
@ -157,13 +159,11 @@ with description('vncserver') as self:
child.expect('Verify:')
child.sendline('password')
child.expect(pexpect.EOF)
child.close()
expect(child.exitstatus).to(equal(0))
child.wait()
# expect(child.exitstatus).to(equal(0))
# TOOD: Xvnc won't bind to a port under pexpect, and its output is
# invisible.
home_dir = os.environ['HOME']
completed_process = run_cmd(f'grep -qw {custom_username} {home_dir}/.kasmpasswd')
expect(completed_process.returncode).to(equal(0))
os.system(f'pgrep Xvnc >/dev/null || cat {home_dir}/.vnc/*.log')
# os.system(f'pgrep Xvnc >/dev/null || cat {home_dir}/.vnc/*.log')

Loading…
Cancel
Save