summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorJacek Galowicz <jacek@galowicz.de>2022-12-30 22:41:04 +0100
committerGitHub <noreply@github.com>2022-12-30 22:41:04 +0100
commit869545857fdf37dc6bd886a61b69b7321ada52aa (patch)
treeb63810a56305df8450a826f60b73dd60933600b9 /nixos
parent73247b7ed60663e504a383402b2ef302b7b4e601 (diff)
parentc876f0c146e9279a48fc5b88dca3438a43772d27 (diff)
downloadnixpkgs-869545857fdf37dc6bd886a61b69b7321ada52aa.tar
nixpkgs-869545857fdf37dc6bd886a61b69b7321ada52aa.tar.gz
nixpkgs-869545857fdf37dc6bd886a61b69b7321ada52aa.tar.bz2
nixpkgs-869545857fdf37dc6bd886a61b69b7321ada52aa.tar.lz
nixpkgs-869545857fdf37dc6bd886a61b69b7321ada52aa.tar.xz
nixpkgs-869545857fdf37dc6bd886a61b69b7321ada52aa.tar.zst
nixpkgs-869545857fdf37dc6bd886a61b69b7321ada52aa.zip
Merge pull request #208354 from bjornfor/nixos-test-driver-quote-shell-args
nixos/test-driver: quote some shell command lines
Diffstat (limited to 'nixos')
-rw-r--r--nixos/lib/test-driver/test_driver/machine.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/nixos/lib/test-driver/test_driver/machine.py b/nixos/lib/test-driver/test_driver/machine.py
index 322b7115778..6af964a0f58 100644
--- a/nixos/lib/test-driver/test_driver/machine.py
+++ b/nixos/lib/test-driver/test_driver/machine.py
@@ -101,14 +101,14 @@ def _perform_ocr_on_screenshot(
 
     tess_args = f"-c debug_file=/dev/null --psm 11"
 
-    cmd = f"convert {magick_args} {screenshot_path} tiff:{screenshot_path}.tiff"
+    cmd = f"convert {magick_args} '{screenshot_path}' 'tiff:{screenshot_path}.tiff'"
     ret = subprocess.run(cmd, shell=True, capture_output=True)
     if ret.returncode != 0:
         raise Exception(f"TIFF conversion failed with exit code {ret.returncode}")
 
     model_results = []
     for model_id in model_ids:
-        cmd = f"tesseract {screenshot_path}.tiff - {tess_args} --oem {model_id}"
+        cmd = f"tesseract '{screenshot_path}.tiff' - {tess_args} --oem '{model_id}'"
         ret = subprocess.run(cmd, shell=True, capture_output=True)
         if ret.returncode != 0:
             raise Exception(f"OCR failed with exit code {ret.returncode}")
@@ -744,7 +744,7 @@ class Machine:
             {"image": os.path.basename(filename)},
         ):
             self.send_monitor_command(f"screendump {tmp}")
-            ret = subprocess.run(f"pnmtopng {tmp} > {filename}", shell=True)
+            ret = subprocess.run(f"pnmtopng '{tmp}' > '{filename}'", shell=True)
             os.unlink(tmp)
             if ret.returncode != 0:
                 raise Exception("Cannot convert screenshot")