Specs: extract add_kasmvnc_user_docker()

This commit is contained in:
Dmitry Maksyoma 2021-09-14 20:19:06 +12:00
parent 28c06893e3
commit dca392eafd

View File

@ -15,11 +15,15 @@ def run_cmd(cmd, **kwargs):
return completed_process return completed_process
with description('vncserver') as self: def add_kasmvnc_user_docker():
with it('selects passed DE with -s'):
completed_process = run_cmd('echo -e "password\\npassword\\n" | vncpasswd -u docker') completed_process = run_cmd('echo -e "password\\npassword\\n" | vncpasswd -u docker')
expect(completed_process.returncode).to(equal(0)) expect(completed_process.returncode).to(equal(0))
with description('vncserver') as self:
with it('selects passed DE with -s'):
add_kasmvnc_user_docker()
cmd = 'vncserver :1 -select-de mate -cert /etc/ssl/certs/ssl-cert-snakeoil.pem -key /etc/ssl/private/ssl-cert-snakeoil.key -sslOnly -FrameRate=24 -interface 0.0.0.0 -httpd /usr/share/kasmvnc/www -depth 24 -geometry 1280x1050' cmd = 'vncserver :1 -select-de mate -cert /etc/ssl/certs/ssl-cert-snakeoil.pem -key /etc/ssl/private/ssl-cert-snakeoil.key -sslOnly -FrameRate=24 -interface 0.0.0.0 -httpd /usr/share/kasmvnc/www -depth 24 -geometry 1280x1050'
try: try:
completed_process = run_cmd(cmd) completed_process = run_cmd(cmd)
@ -31,8 +35,7 @@ with description('vncserver') as self:
run_cmd('vncserver -kill :1') run_cmd('vncserver -kill :1')
with it('asks to select a DE, when ran with -select-de'): with it('asks to select a DE, when ran with -select-de'):
completed_process = run_cmd('echo -e "password\\npassword\\n" | vncpasswd -u docker') add_kasmvnc_user_docker()
expect(completed_process.returncode).to(equal(0))
cmd = 'vncserver :1 -select-de -cert /etc/ssl/certs/ssl-cert-snakeoil.pem -key /etc/ssl/private/ssl-cert-snakeoil.key -sslOnly -FrameRate=24 -interface 0.0.0.0 -httpd /usr/share/kasmvnc/www -depth 24 -geometry 1280x1050' cmd = 'vncserver :1 -select-de -cert /etc/ssl/certs/ssl-cert-snakeoil.pem -key /etc/ssl/private/ssl-cert-snakeoil.key -sslOnly -FrameRate=24 -interface 0.0.0.0 -httpd /usr/share/kasmvnc/www -depth 24 -geometry 1280x1050'
try: try: