Skip to content

Commit

Permalink
test: shell option
Browse files Browse the repository at this point in the history
  • Loading branch information
saw-jan committed Sep 24, 2024
1 parent 440bed6 commit 2aa9ccc
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions test/gui/shared/scripts/helpers/SetupClientHelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 2aa9ccc

Please sign in to comment.