From 12c8bb6e64069874457a19c8aea9ae8a0d7535fb Mon Sep 17 00:00:00 2001 From: Lifailon Date: Mon, 17 Feb 2025 12:09:58 +0300 Subject: [PATCH] update keys on ascii --- test.sh | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/test.sh b/test.sh index 383bc4d..75c92b6 100644 --- a/test.sh +++ b/test.sh @@ -15,25 +15,25 @@ trap " exit \$exitCode " EXIT -# Test journald +# Test 1 sleep 2 tmux send-keys -t test-session "cron" tmux send-keys -t test-session "$(echo -e '\t')" -tmux send-keys -t test-session "$(echo -e '\e[C')" +tmux send-keys -t test-session "$(echo -e '\x1b[C')" sleep 2 tmux send-keys -t test-session "$(echo -e '\r')" sleep 2 tmux send-keys -t test-session "$(echo -e '\t\t\t')" -tmux send-keys -t test-session "$(echo -e '\e[A')" +tmux send-keys -t test-session "$(echo -e '\x1b[A')" tmux send-keys -t test-session "started" sleep 2 if [ "$debug" == "true" ]; then tmux capture-pane -p; fi output=$(tmux capture-pane -p) if echo "$output" | grep -q "Started cron"; then - echo "✔ Test Journald: Passed" + echo "✔ Test read journal from systemd-journald: Passed" else - echo "❌ Test Journald: Failed" + echo "❌ Test read journal from systemd-journald: Failed" exitCode=1 fi @@ -41,10 +41,10 @@ for i in {1..7}; do tmux send-keys -t test-session "$(echo -e '\x7f')"; done tmux send-keys -t test-session "$(echo -e '\t\t')" for i in {1..4}; do tmux send-keys -t test-session "$(echo -e '\x7f')"; done -# Test filesystem +# Test 2 tmux send-keys -t test-session "input" tmux send-keys -t test-session "$(echo -e '\t\t')" -tmux send-keys -t test-session "$(echo -e '\e[C')" +tmux send-keys -t test-session "$(echo -e '\x1b[C')" sleep 3 tmux send-keys -t test-session "$(echo -e '\r')" sleep 3 @@ -52,16 +52,16 @@ if [ "$debug" == "true" ]; then tmux capture-pane -p; fi output=$(tmux capture-pane -p) if echo "$output" | grep -q "First line" && echo "$output" | grep -q "Second line"; then - echo "✔ Test Filesystem: Passed" + echo "✔ Test read file: Passed" else - echo "❌ Test Filesystem: Failed" + echo "❌ Test read file: Failed" exitCode=2 fi tmux send-keys -t test-session "$(echo -e '\t\t\t\t')" for i in {1..5}; do tmux send-keys -t test-session "$(echo -e '\x7f')"; done -# Test docker +# Test 3 tmux send-keys -t test-session "ping" tmux send-keys -t test-session "$(echo -e '\t\t\t')" tmux send-keys -t test-session "$(echo -e '\r')" @@ -73,8 +73,8 @@ if [ "$debug" == "true" ]; then tmux capture-pane -p; fi output=$(tmux capture-pane -p) if echo "$output" | grep -q "The server is running on http://localhost:3005" && echo "$output" | grep -q "Local: http://localhost:8085"; then - echo "✔ Test Docker: Passed" + echo "✔ Test read log from docker container: Passed" else - echo "❌ Test Docker: Failed" + echo "❌ Test read log from docker container: Failed" exitCode=3 fi