diff --git a/src/tests/cli_common.py b/src/tests/cli_common.py index f8d7001fc8..e66ca61459 100644 --- a/src/tests/cli_common.py +++ b/src/tests/cli_common.py @@ -31,7 +31,8 @@ def is_windows(): def path_for_gpg(path): # GPG built for mingw/msys doesn't work with Windows paths - if re.match(r'^[a-z]:[\\\/].*', path.lower()): + # Native Windows program cannot work with MSys paths either + if re.match(r'^[a-z]:[\\\/].*', path.lower()) and sys.platform.startswith('msys'): path = '/' + path[0] + '/' + path[3:].replace('\\', '/') return path @@ -100,7 +101,7 @@ def rnp_file_path(relpath, check = True): def run_proc_windows(proc, params, stdin=None): exe = os.path.basename(proc) - # test special quote cases + # test special quote cases params = list(map(lambda st: st.replace('"', '\\"'), params)) # We need to escape empty parameters/ones with spaces with quotes params = tuple(map(lambda st: st if (st and not any(x in st for x in [' ','\r','\t'])) else '"%s"' % st, [exe] + params)) @@ -176,9 +177,9 @@ def run_proc_windows(proc, params, stdin=None): err = file_text(stderr_path).replace('\r\n', '\n') os.unlink(stdout_path) os.unlink(stderr_path) - if stdin: + if stdin: os.unlink(stdin_path) - if passfo: + if passfo: os.unlink(pass_path) logging.debug(err.strip()) logging.debug(out.strip()) diff --git a/src/tests/cli_tests.py b/src/tests/cli_tests.py index 1f4981005f..87ab8a2086 100755 --- a/src/tests/cli_tests.py +++ b/src/tests/cli_tests.py @@ -908,7 +908,7 @@ def setup(loglvl): os.environ["RNP_LOG_CONSOLE"] = "1" GPGDIR = os.path.join(WORKDIR, '.gpg') - GPGHOME = path_for_gpg(GPGDIR) if is_windows() else GPGDIR + GPGHOME = path_for_gpg(GPGDIR) GPG = os.getenv('RNP_TESTS_GPG_PATH') or find_utility('gpg') GPGCONF = os.getenv('RNP_TESTS_GPGCONF_PATH') or find_utility('gpgconf') gpg_check_features()