From 55f2445d7a756b2d9e9c992de98015e0f82ad5dd Mon Sep 17 00:00:00 2001 From: Abhi Date: Fri, 17 Mar 2023 14:53:48 -0500 Subject: [PATCH] terminal-emulator.sh tmux implementation and base unit tests - terminal-emulator.sh is a script that takes a log file as input and uses a detached tmux session to cat the log file to the terminal, and then save the contents of the pane history to an output log file. The output log file now emulates the contents displayed on a terminal Five basic tests are included in test-terminal-emulator.sh which run through ^H input during prompts, as well as VT100 escape sequences from parts of various log files, as well as testing the emulation of an on-screen GRUB MENU. - Added test-terminal-emulator which implements base unit tests to validate expected output versus generated output of special escape characters such as backspace and menu characters. - Added dependency information about terminal-emulator and a description/usage paragraph. Signed-off-by: Abhi Singh --- README.md | 17 ++++ terminal-emulator.sh | 80 +++++++++++++++++++ .../backspace/1/expected.log | 24 ++++++ .../backspace/1/input.log | 1 + .../backspace/2/expected.log | 24 ++++++ .../backspace/2/input.log | 1 + .../test-terminal-emulator/grub/expected.log | 65 +++++++++++++++ .../test-terminal-emulator/grub/input.log | 21 +++++ .../trimmed/1/expected.log | 77 ++++++++++++++++++ .../trimmed/1/input.log | 77 ++++++++++++++++++ .../trimmed/2/expected.log | 37 +++++++++ .../trimmed/2/input.log | 38 +++++++++ tests/test-terminal-emulator | 64 +++++++++++++++ 13 files changed, 526 insertions(+) create mode 100755 terminal-emulator.sh create mode 100644 tests/data/test-terminal-emulator/backspace/1/expected.log create mode 100644 tests/data/test-terminal-emulator/backspace/1/input.log create mode 100644 tests/data/test-terminal-emulator/backspace/2/expected.log create mode 100644 tests/data/test-terminal-emulator/backspace/2/input.log create mode 100644 tests/data/test-terminal-emulator/grub/expected.log create mode 100644 tests/data/test-terminal-emulator/grub/input.log create mode 100644 tests/data/test-terminal-emulator/trimmed/1/expected.log create mode 100644 tests/data/test-terminal-emulator/trimmed/1/input.log create mode 100644 tests/data/test-terminal-emulator/trimmed/2/expected.log create mode 100644 tests/data/test-terminal-emulator/trimmed/2/input.log create mode 100755 tests/test-terminal-emulator diff --git a/README.md b/README.md index b9eaec5..b21595b 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,8 @@ be available on your Linux distro as `python3-construct`. The `compatibles` script needs `bash`, `find`, `grep`, `xargs`, `sed` and `sort`. +The `terminal-emulator` script needs `tmux`. + If you want to generate the pdf version of this documentation, you need to install [pandoc]. @@ -463,6 +465,21 @@ At this point it is not perfect; some compatible strings can be missed and some others can be reported spuriously, but this is a reasonable approximation already. +# Terminal Emulator + +The `terminal-emulator` script converts log files with ANSI escape sequences +to log files that emulate terminal output and handle the escape sequences. The +output log files are very similar to what is achieved by cat'ing a log file to +a terminal. + +See the `tests/test-terminal-emulator` unit test for basic examples. + +The script has been tested with a handful of log files, and although there are +minor differences in spacing comparing an outputted log file to what you will +actually see in a real terminal emulator, this mainly varies based on the size +of the user display, so for the time being the terminal emulator is using a +160x48 size tmux detached session to emulate the terminal. + # Miscellaneous ## Documentation diff --git a/terminal-emulator.sh b/terminal-emulator.sh new file mode 100755 index 0000000..445588a --- /dev/null +++ b/terminal-emulator.sh @@ -0,0 +1,80 @@ +#!/bin/bash + +#terminal-emulator usage help +helpFunction() +{ + echo "" + echo "Usage: $0 -f input_file -o output_file -sb scrollback_size" + echo -e "\t-f input file that will be cleaned with ansi escape characters processed" + echo -e "\t-o output file that will contain the result of processed terminal\n" + echo "OPTIONAL:" + echo -e "\t-s manually set the size of the scrollback buffer, default is 1M lines" + exit 1 # Exit script after printing help +} + +#check if user has screen installed and on PATH +if ! command -v screen >/dev/null; then + echo "screen command not found: check that screen is installed and on your PATH ..." + exit 1 +fi + +#defaults to 1M lines to meet size of MOST log files +scrollback_size=1000000 + +#input args +while getopts "f:o:s:" opt +do + case "$opt" in + f ) input_file="$OPTARG" ;; + o ) output_file="$OPTARG" ;; + s ) scrollback_size="$OPTARG" ;; + ? ) helpFunction ;; # Print helpFunction in case parameter is non-existent + esac +done + +# Print helpFunction if input or output files are missing +if [ -z "$input_file" ] +then + echo "Error, input file is not specified"; + helpFunction +fi +if [ -z "$output_file" ] +then + echo "Error, output file is not specified"; + helpFunction +fi + +export input_file +export output_file +export scrollback_size +session_name="terminal_emulator" + +# if the .tmux.conf doesn't have the requested history limit then update it +grep -qxF "set -g history-limit $scrollback_size" ~/.tmux.conf || echo "set -g history-limit $scrollback_size" >> ~/.tmux.conf + +# create a detached tmux session with a size 160x48, and then send keys for catting the input file as well as start and end labels +# for the script to use when cleaning the output, wait on the tmux session to finish before capturing the output to a file +# kill the current session +tmux new-session -s "$session_name" -d -x160 -y48 +tmux send-keys -t "$session_name" "echo $'\nTERMINAL_EMULATOR_FILE_START'; cat $input_file; echo $'\nTERMINAL_EMULATOR_FILE_END'; tmux wait -S ping" Enter +tmux wait ping +tmux capture-pane -t "$session_name" -pS -"$scrollback_size" > "$output_file" +tmux kill-session -t "$session_name" + +# remove all lines above the output logfile that are not a part of the input logfile +line_number=$(grep -n "TERMINAL_EMULATOR_FILE_START" "$output_file" | tail -n1 | cut -d: -f1) +if [[ -n $line_number ]]; then + # If the start tag is found, then remove it along with the previous lines + sed -i "1,${line_number}d" "$output_file" +fi + +# remove all lines below the output logfile that are not a part of the input logfile +line_number=$(tac "$output_file" | grep -n "TERMINAL_EMULATOR_FILE_END" | head -n1 | cut -d: -f1) +if [[ -n $line_number ]]; then + # If the end tag is found, remove it along with all the lines after + line_number=$(( $(wc -l < $output_file) - $line_number )) + sed -i "1,${line_number}!b;${line_number}q" "$output_file" +fi + +#End of Script +echo "Terminal Emulator is complete." diff --git a/tests/data/test-terminal-emulator/backspace/1/expected.log b/tests/data/test-terminal-emulator/backspace/1/expected.log new file mode 100644 index 0000000..bd10aa1 --- /dev/null +++ b/tests/data/test-terminal-emulator/backspace/1/expected.log @@ -0,0 +1,24 @@ +Hit any key to stop autoboot: 0 + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/data/test-terminal-emulator/backspace/1/input.log b/tests/data/test-terminal-emulator/backspace/1/input.log new file mode 100644 index 0000000..ad9208f --- /dev/null +++ b/tests/data/test-terminal-emulator/backspace/1/input.log @@ -0,0 +1 @@ +Hit any key to stop autoboot: 3  2  1  0 \ No newline at end of file diff --git a/tests/data/test-terminal-emulator/backspace/2/expected.log b/tests/data/test-terminal-emulator/backspace/2/expected.log new file mode 100644 index 0000000..b6ec83f --- /dev/null +++ b/tests/data/test-terminal-emulator/backspace/2/expected.log @@ -0,0 +1,24 @@ +123458 + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/data/test-terminal-emulator/backspace/2/input.log b/tests/data/test-terminal-emulator/backspace/2/input.log new file mode 100644 index 0000000..c73e7aa --- /dev/null +++ b/tests/data/test-terminal-emulator/backspace/2/input.log @@ -0,0 +1 @@ +1234567  8 \ No newline at end of file diff --git a/tests/data/test-terminal-emulator/grub/expected.log b/tests/data/test-terminal-emulator/grub/expected.log new file mode 100644 index 0000000..26afb88 --- /dev/null +++ b/tests/data/test-terminal-emulator/grub/expected.log @@ -0,0 +1,65 @@ +Booting /efi\boot\bootaa64.efi +Welcome to GRUB! + + + +smc911x: detected LAN9220 controller +smc911x: phy initialized +smc911x: MAC 00:02:f7:00:8a:08 + + GNU GRUB version 2.11 + + ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ + │ │ + │ │ + │ Linux BusyBox │ + │*bbr/bsa │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + └ ┘ + + Use the ▲ and ▼ keys to select which entry is highlighted. + + The highlighted entry will be executed automatically in 0s. + + + Booting `bbr/bsa' + + + +/EndEntire \ No newline at end of file diff --git a/tests/data/test-terminal-emulator/grub/input.log b/tests/data/test-terminal-emulator/grub/input.log new file mode 100644 index 0000000..632e7cf --- /dev/null +++ b/tests/data/test-terminal-emulator/grub/input.log @@ -0,0 +1,21 @@ +Booting /efi\boot\bootaa64.efi +[?25hWelcome to GRUB! + + + +smc911x: detected LAN9220 controller +smc911x: phy initialized +smc911x: MAC 00:02:f7:00:8a:08 +[?25lGNU GRUB version 2.11 + + + +┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ Use the ▲ and ▼ keys to select which entry is highlighted. + + Press enter to boot the selected OS, `e' to edit the commands before booting or `c' for a command-line.   Linux BusyBox *bbr/bsa                                          The highlighted entry will be executed automatically in 5s.  The highlighted entry will be executed automatically in 4s.  The highlighted entry will be executed automatically in 3s.  The highlighted entry will be executed automatically in 2s.  The highlighted entry will be executed automatically in 1s.  The highlighted entry will be executed automatically in 0s. [?25h + + Booting `bbr/bsa' + + + +/EndEntire \ No newline at end of file diff --git a/tests/data/test-terminal-emulator/trimmed/1/expected.log b/tests/data/test-terminal-emulator/trimmed/1/expected.log new file mode 100644 index 0000000..af91c3c --- /dev/null +++ b/tests/data/test-terminal-emulator/trimmed/1/expected.log @@ -0,0 +1,77 @@ +U-Boot 2021.07 (Jul 05 2021 - 15:11:28 +0000) corstone1000 aarch64 + +DRAM: 2 GiB +Loading Environment from nowhere... OK +In: uart@1a510000 +Out: uart@1a510000 +Err: uart@1a510000 +Net: eth0: eth@4010000 +[FFA] Conduit is SMC +[FFA] FF-A driver 1.0 +FF-A framework 1.1 +[FFA] Versions are compatible +[FFA] endpoint ID is 0 +[FFA] FFA_RXTX_MAP features data 0x0 +[FFA] Using 1 4KB page(s) for RX/TX buffers size +[FFA] RX buffer at phys 0xfcf09000 +[FFA] TX buffer at phys 0xfcf08000 +[FFA] RX/TX buffers mapped +[FFA] Reading partitions data from the RX buffer +[FFA] Copying 1 page(s) of partitions data from RX buffer +[FFA] Partition ID 8002 : info cached +[FFA] Partition ID 8003 : info cached +[FFA] 2 partition(s) found and cached +[FFA] RX buffer released +Hit any key to stop autoboot: 0 +Loading kernel from 0x083EE000 to memory ... +loaded bin to memory: size: 12582912 +starting USB... +Bus usb@40200000: isp1763 bus width: 16, oc: not available +USB ISP 1763 HW rev. 32 started +scanning bus usb@40200000 for devices... port 1 high speed +3 USB Device(s) found + scanning usb for storage devices... 1 Storage Device(s) found +resetting USB... +Bus usb@40200000: isp1763 bus width: 16, oc: not available +USB ISP 1763 HW rev. 32 started +scanning bus usb@40200000 for devices... port 1 high speed +3 USB Device(s) found + scanning usb for storage devices... 1 Storage Device(s) found + +Device 0: Vendor: JMicron Rev: 0209 Prod: Tech + Type: Hard Disk + Capacity: 238475.1 MB = 232.8 GB (488397168 x 512) +... is now current device +Scanning usb 0:1... +load - load binary file from a filesystem + +Usage: +load [ [ [ [bytes [pos]]]]] + - Load binary file 'filename' from partition 'part' on device + type 'interface' instance 'dev' to address 'addr' in memory. + 'bytes' gives the size to load in bytes. + If 'bytes' is 0 or omitted, the file is read until the end. + 'pos' gives the file byte position to start reading from. + If 'pos' is 0 or omitted, the file is read from the start. +Scanning disks on usb... +Disk usb1 not ready +Disk usb2 not ready +Disk usb3 not ready +Found 3 disks +[FFA] Preparing for checking partitions count +[FFA] Searching partitions using the provided UUID +[FFA] No partition found. Querying framework ... +[FFA] Reading partitions data from the RX buffer +[FFA] RX buffer released +[FFA] Number of partition(s) found matching the UUID: 1 +EFI: Pre-allocating 1 partition(s) info structures +[FFA] Preparing for filling partitions info +[FFA] Searching partitions using the provided UUID +[FFA] Partition ID 8003 matches the provided UUID +EFI: MM partition ID 0x8003 +EFI: Corstone1000: Capsule shared buffer at 0x80000000 , size 8192 pages +BootOrder not defined +EFI boot manager: Cannot load any image +Found EFI removable media binary efi/boot/bootaa64.efi +700416 bytes read in 522 ms (1.3 MiB/s) +Booting /efi\boot\bootaa64.efi \ No newline at end of file diff --git a/tests/data/test-terminal-emulator/trimmed/1/input.log b/tests/data/test-terminal-emulator/trimmed/1/input.log new file mode 100644 index 0000000..ca06b5f --- /dev/null +++ b/tests/data/test-terminal-emulator/trimmed/1/input.log @@ -0,0 +1,77 @@ +U-Boot 2021.07 (Jul 05 2021 - 15:11:28 +0000) corstone1000 aarch64 + +DRAM: 2 GiB +Loading Environment from nowhere... OK +In: uart@1a510000 +Out: uart@1a510000 +Err: uart@1a510000 +Net: eth0: eth@4010000 +[FFA] Conduit is SMC +[FFA] FF-A driver 1.0 +FF-A framework 1.1 +[FFA] Versions are compatible +[FFA] endpoint ID is 0 +[FFA] FFA_RXTX_MAP features data 0x0 +[FFA] Using 1 4KB page(s) for RX/TX buffers size +[FFA] RX buffer at phys 0xfcf09000 +[FFA] TX buffer at phys 0xfcf08000 +[FFA] RX/TX buffers mapped +[FFA] Reading partitions data from the RX buffer +[FFA] Copying 1 page(s) of partitions data from RX buffer +[FFA] Partition ID 8002 : info cached +[FFA] Partition ID 8003 : info cached +[FFA] 2 partition(s) found and cached +[FFA] RX buffer released +Hit any key to stop autoboot: 3  2  1  0 +Loading kernel from 0x083EE000 to memory ... +loaded bin to memory: size: 12582912 +starting USB... +Bus usb@40200000: isp1763 bus width: 16, oc: not available +USB ISP 1763 HW rev. 32 started +scanning bus usb@40200000 for devices... port 1 high speed +3 USB Device(s) found + scanning usb for storage devices... 1 Storage Device(s) found +resetting USB... +Bus usb@40200000: isp1763 bus width: 16, oc: not available +USB ISP 1763 HW rev. 32 started +scanning bus usb@40200000 for devices... port 1 high speed +3 USB Device(s) found + scanning usb for storage devices... 1 Storage Device(s) found + +Device 0: Vendor: JMicron Rev: 0209 Prod: Tech + Type: Hard Disk + Capacity: 238475.1 MB = 232.8 GB (488397168 x 512) +... is now current device +Scanning usb 0:1... +load - load binary file from a filesystem + +Usage: +load [ [ [ [bytes [pos]]]]] + - Load binary file 'filename' from partition 'part' on device + type 'interface' instance 'dev' to address 'addr' in memory. + 'bytes' gives the size to load in bytes. + If 'bytes' is 0 or omitted, the file is read until the end. + 'pos' gives the file byte position to start reading from. + If 'pos' is 0 or omitted, the file is read from the start. +78Scanning disks on usb... +Disk usb1 not ready +Disk usb2 not ready +Disk usb3 not ready +Found 3 disks +[FFA] Preparing for checking partitions count +[FFA] Searching partitions using the provided UUID +[FFA] No partition found. Querying framework ... +[FFA] Reading partitions data from the RX buffer +[FFA] RX buffer released +[FFA] Number of partition(s) found matching the UUID: 1 +EFI: Pre-allocating 1 partition(s) info structures +[FFA] Preparing for filling partitions info +[FFA] Searching partitions using the provided UUID +[FFA] Partition ID 8003 matches the provided UUID +EFI: MM partition ID 0x8003 +EFI: Corstone1000: Capsule shared buffer at 0x80000000 , size 8192 pages +BootOrder not defined +EFI boot manager: Cannot load any image +Found EFI removable media binary efi/boot/bootaa64.efi +700416 bytes read in 522 ms (1.3 MiB/s) +Booting /efi\boot\bootaa64.efi \ No newline at end of file diff --git a/tests/data/test-terminal-emulator/trimmed/2/expected.log b/tests/data/test-terminal-emulator/trimmed/2/expected.log new file mode 100644 index 0000000..fe34584 --- /dev/null +++ b/tests/data/test-terminal-emulator/trimmed/2/expected.log @@ -0,0 +1,37 @@ +[ OK ] Listening on Syslog Socket. +[ OK ] Listening on initctl Compatibility Named Pipe. +[ OK ] Listening on Journal Audit Socket. +[ OK ] Listening on Journal Socket (/dev/log). +[ OK ] Listening on Journal Socket. +[ OK ] Listening on Network Service Netlink Socket. +[ OK ] Listening on udev Control Socket. +[ OK ] Listening on udev Kernel Socket. +[ OK ] Listening on User Database Manager Socket. + Mounting Huge Pages File System... + Mounting POSIX Message Queue File System... + Mounting Kernel Debug File System... + Mounting Temporary Directory (/tmp)... + Starting Load Kernel Module configfs... + Starting Load Kernel Module drm... + Starting Load Kernel Module fuse... + Starting Journal Service... + Starting Remount Root and Kernel File Systems... + Starting Apply Kernel Variables... + Starting Coldplug All udev Devices... +[ OK ] Mounted Huge Pages File System. +[ OK ] Mounted POSIX Message Queue File System. +[ OK ] Started Journal Service. +[ OK ] Mounted Kernel Debug File System. +[ OK ] Mounted Temporary Directory (/tmp). +[ OK ] Finished Load Kernel Module configfs. +[ OK ] Finished Load Kernel Module drm. +[ OK ] Finished Load Kernel Module fuse. +[ OK ] Finished Remount Root and Kernel File Systems. +[ OK ] Finished Apply Kernel Variables. + Mounting Kernel Configuration File System... + Starting Flush Journal to Persistent Storage... + Starting Create Static Device Nodes in /dev... +[ OK ] Mounted Kernel Configuration File System. +[ OK ] Finished Flush Journal to Persistent Storage. +[ OK ] Finished Create Static Device Nodes in /dev. +[ OK ] Reached target Local File Systems (Pre). \ No newline at end of file diff --git a/tests/data/test-terminal-emulator/trimmed/2/input.log b/tests/data/test-terminal-emulator/trimmed/2/input.log new file mode 100644 index 0000000..579bfba --- /dev/null +++ b/tests/data/test-terminal-emulator/trimmed/2/input.log @@ -0,0 +1,38 @@ + +[ OK ] Listening on Syslog Socket. +[ OK ] Listening on initctl Compatibility Named Pipe. +[ OK ] Listening on Journal Audit Socket. +[ OK ] Listening on Journal Socket (/dev/log). +[ OK ] Listening on Journal Socket. +[ OK ] Listening on Network Service Netlink Socket. +[ OK ] Listening on udev Control Socket. +[ OK ] Listening on udev Kernel Socket. +[ OK ] Listening on User Database Manager Socket. + Mounting Huge Pages File System... + Mounting POSIX Message Queue File System... + Mounting Kernel Debug File System... + Mounting Temporary Directory (/tmp)... + Starting Load Kernel Module configfs... + Starting Load Kernel Module drm... + Starting Load Kernel Module fuse... + Starting Journal Service... + Starting Remount Root and Kernel File Systems... + Starting Apply Kernel Variables... + Starting Coldplug All udev Devices... +[ OK ] Mounted Huge Pages File System. +[ OK ] Mounted POSIX Message Queue File System. +[ OK ] Started Journal Service. +[ OK ] Mounted Kernel Debug File System. +[ OK ] Mounted Temporary Directory (/tmp). +[ OK ] Finished Load Kernel Module configfs. +[ OK ] Finished Load Kernel Module drm. +[ OK ] Finished Load Kernel Module fuse. +[ OK ] Finished Remount Root and Kernel File Systems. +[ OK ] Finished Apply Kernel Variables. + Mounting Kernel Configuration File System... + Starting Flush Journal to Persistent Storage... + Starting Create Static Device Nodes in /dev... +[ OK ] Mounted Kernel Configuration File System. +[ OK ] Finished Flush Journal to Persistent Storage. +[ OK ] Finished Create Static Device Nodes in /dev. +[ OK ] Reached target Local File Systems (Pre). \ No newline at end of file diff --git a/tests/test-terminal-emulator b/tests/test-terminal-emulator new file mode 100755 index 0000000..c128d0d --- /dev/null +++ b/tests/test-terminal-emulator @@ -0,0 +1,64 @@ +#!/bin/bash +set -eu -o pipefail + +# Unit test for terminal-emulator.sh +# Usage: ./test-terminal-emulator [keep] +# We keep our temporary folder when `keep' is specified. + +# Verify that two files contain the same characters +# not checking for any whitespace differences or bblank lines +# $1, $2: input files +assert_files_identical() +{ + if ! diff -c -w -B "$1" "$2"; then + echo 'Generated output does not match expected output' >&3 + false + fi +} + +# Redirect all output to a log in current folder. +# Keep stdout on fd 3. +bn=$(basename "$0") +log="$bn.log" +exec 3>&1 >"$log" 2>&1 +set -x +echo -n 'Testing terminal emulator... ' >&3 +trap 'echo "ERROR! (see $log)" >&3' ERR + +# Make sure terminal-emulator.sh is in the path. +me=$(realpath "$0") +here="${me%/*}" +export PATH="$here/..:$PATH" + +# Temporary folder. +if [ "${1:-unset}" == keep ]; then + tmp=$(mktemp -d "$(basename "$0").XXX") +else + tmp=$(mktemp -d) + trap 'rm -fr "$tmp"' EXIT +fi + +data="$here/data/$(basename "$0")" + +#4 tests spanning 2 directories, one for backspaces and one for trimmed log files +echo -n 'backspace test 1, ' >&3 +terminal-emulator.sh -f "$data/backspace/1/input.log" -o "$tmp/1_out.log" +assert_files_identical "$data/backspace/1/expected.log" "$tmp/1_out.log" + +echo -n 'backspace test 2, ' >&3 +terminal-emulator.sh -f "$data/backspace/2/input.log" -o "$tmp/2_out.log" +assert_files_identical "$data/backspace/2/expected.log" "$tmp/2_out.log" + +echo -n 'trimmed test 1, ' >&3 +terminal-emulator.sh -f "$data/trimmed/1/input.log" -o "$tmp/3_out.log" +assert_files_identical "$data/trimmed/1/expected.log" "$tmp/3_out.log" + +echo -n 'trimmed test 2, ' >&3 +terminal-emulator.sh -f "$data/trimmed/2/input.log" -o "$tmp/4_out.log" +assert_files_identical "$data/trimmed/2/expected.log" "$tmp/4_out.log" + +echo -n 'grub menu test, ' >&3 +terminal-emulator.sh -f "$data/grub/input.log" -o "$tmp/5_out.log" +assert_files_identical "$data/grub/expected.log" "$tmp/5_out.log" + +echo 'ok.' >&3 -- GitLab