diff options
| author | Christian Breunig <christian@breunig.cc> | 2026-06-01 21:07:11 +0200 |
|---|---|---|
| committer | Christian Breunig <christian@breunig.cc> | 2026-06-02 06:54:08 +0200 |
| commit | 7df46ee92572273e8ab9bbc7b8ea738c1ad4e650 (patch) | |
| tree | 78775e3c382ee369659752048fb52c14e27b1ee7 /scripts | |
| parent | 097a04e3bad808162cf348d3bc5bd1faf5127007 (diff) | |
| download | vyos-build-7df46ee92572273e8ab9bbc7b8ea738c1ad4e650.tar.gz vyos-build-7df46ee92572273e8ab9bbc7b8ea738c1ad4e650.zip | |
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/
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/check-qemu-install | 7 |
1 files changed, 4 insertions, 3 deletions
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 |
