mirror of
https://github.com/kasmtech/KasmVNC.git
synced 2025-01-21 05:18:50 +01:00
Specs: WIP
This commit is contained in:
parent
f0e63b2e3d
commit
90d9cbe65b
@ -1,4 +1,5 @@
|
|||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
import pexpect
|
import pexpect
|
||||||
import shutil
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
@ -144,10 +145,11 @@ with description('vncserver') as self:
|
|||||||
completed_process = run_cmd(f'grep -qw {user} {home_dir}/.kasmpasswd')
|
completed_process = run_cmd(f'grep -qw {user} {home_dir}/.kasmpasswd')
|
||||||
expect(completed_process.returncode).to(equal(0))
|
expect(completed_process.returncode).to(equal(0))
|
||||||
|
|
||||||
with it('specify custom username'):
|
with fit('specify custom username'):
|
||||||
custom_username = 'custom_username'
|
custom_username = 'custom_username'
|
||||||
child = pexpect.spawn(f'{vncserver_cmd} -select-de cinnamon',
|
child = pexpect.spawn(f'{vncserver_cmd} -select-de cinnamon',
|
||||||
timeout=2)
|
timeout=2)
|
||||||
|
# child.logfile = sys.stdout.buffer
|
||||||
child.expect('Enter username')
|
child.expect('Enter username')
|
||||||
child.sendline(custom_username)
|
child.sendline(custom_username)
|
||||||
child.expect('Password:')
|
child.expect('Password:')
|
||||||
@ -158,6 +160,10 @@ with description('vncserver') as self:
|
|||||||
child.close()
|
child.close()
|
||||||
expect(child.exitstatus).to(equal(0))
|
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']
|
home_dir = os.environ['HOME']
|
||||||
completed_process = run_cmd(f'grep -qw {custom_username} {home_dir}/.kasmpasswd')
|
completed_process = run_cmd(f'grep -qw {custom_username} {home_dir}/.kasmpasswd')
|
||||||
expect(completed_process.returncode).to(equal(0))
|
expect(completed_process.returncode).to(equal(0))
|
||||||
|
|
||||||
|
os.system(f'pgrep Xvnc >/dev/null || cat {home_dir}/.vnc/*.log')
|
||||||
|
Loading…
Reference in New Issue
Block a user