From ed78c9dcc59758aa2df114972dd7be3cc9173353 Mon Sep 17 00:00:00 2001 From: Dmitry Maksyoma Date: Tue, 14 Sep 2021 20:20:55 +1200 Subject: [PATCH] Specs: extract kill_xvnc() --- spec/vncserver_spec.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/spec/vncserver_spec.py b/spec/vncserver_spec.py index b08619a..bab8e37 100644 --- a/spec/vncserver_spec.py +++ b/spec/vncserver_spec.py @@ -20,6 +20,10 @@ def add_kasmvnc_user_docker(): expect(completed_process.returncode).to(equal(0)) +def kill_xvnc(): + run_cmd('vncserver -kill :1') + + with description('vncserver') as self: with it('selects passed DE with -s'): add_kasmvnc_user_docker() @@ -32,7 +36,7 @@ with description('vncserver') as self: completed_process = run_cmd('grep -q mate ~/.vnc/xstartup') expect(completed_process.returncode).to(equal(0)) finally: - run_cmd('vncserver -kill :1') + kill_xvnc() with it('asks to select a DE, when ran with -select-de'): add_kasmvnc_user_docker() @@ -45,4 +49,4 @@ with description('vncserver') as self: completed_process = run_cmd('grep -q cinnamon ~/.vnc/xstartup') expect(completed_process.returncode).to(equal(0)) finally: - run_cmd('vncserver -kill :1') + kill_xvnc()