diff --git a/test/gui/shared/scripts/helpers/SetupClientHelper.py b/test/gui/shared/scripts/helpers/SetupClientHelper.py index 95c7658a1fb..32584508e12 100644 --- a/test/gui/shared/scripts/helpers/SetupClientHelper.py +++ b/test/gui/shared/scripts/helpers/SetupClientHelper.py @@ -234,24 +234,24 @@ def unlock_keyring(): if stderr: output = stderr.decode('utf-8') test.log(output) - # if not output.strip().endswith('false'): - # test.log('Unlocking keyring...') - # password = os.getenv('VNC_PW') - # command = f'echo -n "{password}" | gnome-keyring-daemon -r --unlock' - # stdout, stderr, returncode = run_sys_command(command) - # if stdout: - # output = stdout.decode('utf-8') - # if stderr: - # output = stderr.decode('utf-8') - # if returncode: - # test.log(f'Failed to unlock keyring:\n{output}') - # test.log(output) - - -def run_sys_command(command=None): + if not output.strip().endswith('false'): + test.log('Unlocking keyring...') + password = os.getenv('VNC_PW') + command = f'echo -n "{password}" | gnome-keyring-daemon -r --unlock' + stdout, stderr, returncode = run_sys_command(command, True) + if stdout: + output = stdout.decode('utf-8') + if stderr: + output = stderr.decode('utf-8') + if returncode: + test.log(f'Failed to unlock keyring:\n{output}') + test.log(output) + + +def run_sys_command(command=None, shell=False): cmd = subprocess.run( command, - shell=True, + shell=shell, stdout=subprocess.PIPE, stderr=subprocess.PIPE, check=False,