From 7df46ee92572273e8ab9bbc7b8ea738c1ad4e650 Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Mon, 1 Jun 2026 21:07:11 +0200 Subject: Testsuite: T8602: stop "cat" abuse Abusing cats is a prevalent problem in the Linux user community. Users, ranging from know-nothing neophytes to all-knowing professionals, engage in cat abuse on a daily basis, whether in their scripts or simple terminal commands. https://rseragon.github.io/posts/cat-abuse/ --- scripts/check-qemu-install | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/check-qemu-install b/scripts/check-qemu-install index 9a0eb560..5ff77ca0 100755 --- a/scripts/check-qemu-install +++ b/scripts/check-qemu-install @@ -560,7 +560,8 @@ def basic_cli_tests(c): c.expect(op_mode_prompt) # Get serial console interface name from flavor definition - c.sendline('cat /usr/share/vyos/flavor.json | jq -r ".console_type"') + flavor_json = '/usr/share/vyos/flavor.json' + c.sendline(f'jq -r ".console_type" {flavor_json}') c.expect(op_mode_prompt) lines = [l.strip() for l in c.before.splitlines() if l.strip()] console_type = lines[-1].decode('utf-8').strip() # e.g. ttyS @@ -570,13 +571,13 @@ def basic_cli_tests(c): if console_type == 'tty': return - c.sendline('cat /usr/share/vyos/flavor.json | jq -r ".console_num"') + c.sendline(f'jq -r ".console_num" {flavor_json}') c.expect(op_mode_prompt) lines = [l.strip() for l in c.before.splitlines() if l.strip()] console_num = lines[-1].decode('utf-8').strip() # e.g. 0 # Get serial console speed from flavor definition - c.sendline('cat /usr/share/vyos/flavor.json | jq -r ".console_speed"') + c.sendline(f'jq -r ".console_speed" {flavor_json}') c.expect(op_mode_prompt) lines = [l.strip() for l in c.before.splitlines() if l.strip()] console_speed = lines[-1].decode('utf-8').strip() # e.g. 115200 -- cgit v1.2.3