From d30f74d7b395e2cdc4ae58619b273539fba30a97 Mon Sep 17 00:00:00 2001 From: Chris Dryden Date: Wed, 19 Nov 2025 10:58:12 -0800 Subject: [PATCH 01/22] Changing shell command to add recognizing a TTY for stty tests --- .github/workflows/GnuTests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/GnuTests.yml b/.github/workflows/GnuTests.yml index 55c57080821..e557bfe5ed6 100644 --- a/.github/workflows/GnuTests.yml +++ b/.github/workflows/GnuTests.yml @@ -117,7 +117,7 @@ jobs: ### Run tests as user - name: Run GNU tests - shell: bash + shell: 'script -q -e -c "bash {0}"' run: | ## Run GNU tests path_GNU='gnu' From 90dec7d47fe415a88faa5f41956f46b0fc4bc528 Mon Sep 17 00:00:00 2001 From: Chris Dryden Date: Mon, 24 Nov 2025 07:56:41 -0800 Subject: [PATCH 02/22] Added additional comment explaining use of script --- .github/workflows/GnuTests.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/GnuTests.yml b/.github/workflows/GnuTests.yml index e557bfe5ed6..6ba3914b497 100644 --- a/.github/workflows/GnuTests.yml +++ b/.github/workflows/GnuTests.yml @@ -117,6 +117,9 @@ jobs: ### Run tests as user - name: Run GNU tests + ### This shell has been changed from "bash" to this command + ### "script" will start a pty and the -q command removes the "script" initiation log + ### the -e flag makes it propogate the error code and -c runs the command in a pty shell: 'script -q -e -c "bash {0}"' run: | ## Run GNU tests From ecf62f6f29a1b3c82348639c79e767e6e71f05ac Mon Sep 17 00:00:00 2001 From: Chris Dryden Date: Mon, 24 Nov 2025 07:57:39 -0800 Subject: [PATCH 03/22] Explain the main purpose is to run the GNU stty tests --- .github/workflows/GnuTests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/GnuTests.yml b/.github/workflows/GnuTests.yml index 6ba3914b497..0ed75663abb 100644 --- a/.github/workflows/GnuTests.yml +++ b/.github/workflows/GnuTests.yml @@ -120,6 +120,7 @@ jobs: ### This shell has been changed from "bash" to this command ### "script" will start a pty and the -q command removes the "script" initiation log ### the -e flag makes it propogate the error code and -c runs the command in a pty + ### the primary purpose of this change is to run the stty GNU tests shell: 'script -q -e -c "bash {0}"' run: | ## Run GNU tests From 24254b705b5f0aab552b68a26c347e5097804edc Mon Sep 17 00:00:00 2001 From: Chris Dryden Date: Mon, 24 Nov 2025 07:58:14 -0800 Subject: [PATCH 04/22] Fixing spelling mistake --- .github/workflows/GnuTests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/GnuTests.yml b/.github/workflows/GnuTests.yml index 0ed75663abb..8b7860abc67 100644 --- a/.github/workflows/GnuTests.yml +++ b/.github/workflows/GnuTests.yml @@ -119,7 +119,7 @@ jobs: - name: Run GNU tests ### This shell has been changed from "bash" to this command ### "script" will start a pty and the -q command removes the "script" initiation log - ### the -e flag makes it propogate the error code and -c runs the command in a pty + ### the -e flag makes it propagate the error code and -c runs the command in a pty ### the primary purpose of this change is to run the stty GNU tests shell: 'script -q -e -c "bash {0}"' run: | From 06fb853dd1a32d672ac7a03c09467eddac029fa4 Mon Sep 17 00:00:00 2001 From: Chris Dryden Date: Mon, 24 Nov 2025 09:08:14 -0800 Subject: [PATCH 05/22] Reverting CI.yml file --- .github/workflows/GnuTests.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/GnuTests.yml b/.github/workflows/GnuTests.yml index 8b7860abc67..55c57080821 100644 --- a/.github/workflows/GnuTests.yml +++ b/.github/workflows/GnuTests.yml @@ -117,11 +117,7 @@ jobs: ### Run tests as user - name: Run GNU tests - ### This shell has been changed from "bash" to this command - ### "script" will start a pty and the -q command removes the "script" initiation log - ### the -e flag makes it propagate the error code and -c runs the command in a pty - ### the primary purpose of this change is to run the stty GNU tests - shell: 'script -q -e -c "bash {0}"' + shell: bash run: | ## Run GNU tests path_GNU='gnu' From 4e8cc1e9a557ba43428b250ac42ef13542cbcfb6 Mon Sep 17 00:00:00 2001 From: Chris Dryden Date: Mon, 24 Nov 2025 09:09:33 -0800 Subject: [PATCH 06/22] Adding pty helper inside gnu test script --- util/run-gnu-test.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/util/run-gnu-test.sh b/util/run-gnu-test.sh index 7fa52f84ee0..66bb46a1b4e 100755 --- a/util/run-gnu-test.sh +++ b/util/run-gnu-test.sh @@ -7,6 +7,16 @@ # ref: [How the GNU coreutils are tested](https://www.pixelbeat.org/docs/coreutils-testing.html) @@ # * note: to run a single test => `make check TESTS=PATH/TO/TEST/SCRIPT SUBDIRS=. VERBOSE=yes` + +# This is added to run the GNU tests inside a PTY as a controlling terminal +if [ "${INSIDE_TTY_WRAPPER:-0}" -ne 1 ]; then + export INSIDE_TTY_WRAPPER=1 + + # Start a new session and allocate a PTY as controlling terminal, + # then re-run this same script inside that session. + exec setsid script -qfec "bash \"$0\" \"$@\"" /dev/null +fi + # Use GNU version for make, nproc, readlink on *BSD case "$OSTYPE" in *bsd*) From 9780d38b557fbeea0b7060972c49aaa44210c47c Mon Sep 17 00:00:00 2001 From: Chris Dryden Date: Mon, 24 Nov 2025 11:18:32 -0800 Subject: [PATCH 07/22] Update run-gnu-test.sh --- util/run-gnu-test.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/util/run-gnu-test.sh b/util/run-gnu-test.sh index 66bb46a1b4e..28d5720a5f2 100755 --- a/util/run-gnu-test.sh +++ b/util/run-gnu-test.sh @@ -12,9 +12,14 @@ if [ "${INSIDE_TTY_WRAPPER:-0}" -ne 1 ]; then export INSIDE_TTY_WRAPPER=1 - # Start a new session and allocate a PTY as controlling terminal, - # then re-run this same script inside that session. - exec setsid script -qfec "bash \"$0\" \"$@\"" /dev/null + # Build the command string with proper shell quoting + cmd="bash $(printf '%q' "$0")" + for arg in "$@"; do + cmd="$cmd $(printf '%q' "$arg")" + done + + # New session + PTY; re-run this script inside it + exec setsid script -qfec "$cmd" /dev/null fi # Use GNU version for make, nproc, readlink on *BSD From 8724d33e3dfa232e9b25082bc48948526696cb23 Mon Sep 17 00:00:00 2001 From: Chris Dryden Date: Mon, 24 Nov 2025 12:14:02 -0800 Subject: [PATCH 08/22] Skip running on SELinux or other environments without script command --- util/run-gnu-test.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/util/run-gnu-test.sh b/util/run-gnu-test.sh index 28d5720a5f2..4425c5dbd40 100755 --- a/util/run-gnu-test.sh +++ b/util/run-gnu-test.sh @@ -2,14 +2,14 @@ # `run-gnu-test.bash [TEST]` # run GNU test (or all tests if TEST is missing/null) -# spell-checker:ignore (env/vars) GNULIB SRCDIR SUBDIRS OSTYPE ; (utils) shellcheck gnproc greadlink +# spell-checker:ignore (env/vars) GNULIB SRCDIR SUBDIRS OSTYPE ; (utils) shellcheck gnproc greadlink setsid qfec # ref: [How the GNU coreutils are tested](https://www.pixelbeat.org/docs/coreutils-testing.html) @@ # * note: to run a single test => `make check TESTS=PATH/TO/TEST/SCRIPT SUBDIRS=. VERBOSE=yes` - # This is added to run the GNU tests inside a PTY as a controlling terminal if [ "${INSIDE_TTY_WRAPPER:-0}" -ne 1 ]; then + export INSIDE_TTY_WRAPPER=1 # Build the command string with proper shell quoting @@ -19,9 +19,14 @@ if [ "${INSIDE_TTY_WRAPPER:-0}" -ne 1 ]; then done # New session + PTY; re-run this script inside it - exec setsid script -qfec "$cmd" /dev/null + command -v script || { + echo "DEBUG: environment does not have script command to run stty tests" + exec setsid script -qfec "$cmd" /dev/null + } fi + + # Use GNU version for make, nproc, readlink on *BSD case "$OSTYPE" in *bsd*) From df10360c7e0be7882c444de94005438983db42a9 Mon Sep 17 00:00:00 2001 From: Chris Dryden Date: Mon, 24 Nov 2025 12:32:57 -0800 Subject: [PATCH 09/22] Update run-gnu-test.sh --- util/run-gnu-test.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/util/run-gnu-test.sh b/util/run-gnu-test.sh index 4425c5dbd40..8ea10f42bfa 100755 --- a/util/run-gnu-test.sh +++ b/util/run-gnu-test.sh @@ -19,10 +19,11 @@ if [ "${INSIDE_TTY_WRAPPER:-0}" -ne 1 ]; then done # New session + PTY; re-run this script inside it - command -v script || { - echo "DEBUG: environment does not have script command to run stty tests" - exec setsid script -qfec "$cmd" /dev/null - } + if command -v script >/dev/null 2>&1; then + setsid script -q -c '...' /dev/null + else + echo "script(1) not available; skipping this test" + fi fi From e569e7849e7e7307ceeeda6321eb16ce2e70109f Mon Sep 17 00:00:00 2001 From: Chris Dryden Date: Mon, 24 Nov 2025 12:36:37 -0800 Subject: [PATCH 10/22] Update run-gnu-test.sh --- util/run-gnu-test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/run-gnu-test.sh b/util/run-gnu-test.sh index 8ea10f42bfa..8cdb920c1d2 100755 --- a/util/run-gnu-test.sh +++ b/util/run-gnu-test.sh @@ -20,7 +20,7 @@ if [ "${INSIDE_TTY_WRAPPER:-0}" -ne 1 ]; then # New session + PTY; re-run this script inside it if command -v script >/dev/null 2>&1; then - setsid script -q -c '...' /dev/null + setsid script -q -c "$cmd" /dev/null else echo "script(1) not available; skipping this test" fi From 8912edd8b3f286eba6f643fb50162d0180ae47eb Mon Sep 17 00:00:00 2001 From: Chris Dryden Date: Mon, 24 Nov 2025 12:55:32 -0800 Subject: [PATCH 11/22] Update run-gnu-test.sh --- util/run-gnu-test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/run-gnu-test.sh b/util/run-gnu-test.sh index 8cdb920c1d2..7e13c25e33f 100755 --- a/util/run-gnu-test.sh +++ b/util/run-gnu-test.sh @@ -20,7 +20,7 @@ if [ "${INSIDE_TTY_WRAPPER:-0}" -ne 1 ]; then # New session + PTY; re-run this script inside it if command -v script >/dev/null 2>&1; then - setsid script -q -c "$cmd" /dev/null + setsid script -qfec "$cmd" /dev/null else echo "script(1) not available; skipping this test" fi From 906923a431ac655b4e32678d935efce364185c8e Mon Sep 17 00:00:00 2001 From: Chris Dryden Date: Mon, 24 Nov 2025 13:32:35 -0800 Subject: [PATCH 12/22] Update GnuTests.yml --- .github/workflows/GnuTests.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/GnuTests.yml b/.github/workflows/GnuTests.yml index 55c57080821..54fef46b4c0 100644 --- a/.github/workflows/GnuTests.yml +++ b/.github/workflows/GnuTests.yml @@ -27,6 +27,7 @@ env: DEFAULT_BRANCH: ${{ github.event.repository.default_branch }} TEST_FULL_SUMMARY_FILE: 'gnu-full-result.json' TEST_ROOT_FULL_SUMMARY_FILE: 'gnu-root-full-result.json' + TEST_STTY_FULL_SUMMARY_FILE: 'gnu-stty-full-result.json' TEST_SELINUX_FULL_SUMMARY_FILE: 'selinux-gnu-full-result.json' TEST_SELINUX_ROOT_FULL_SUMMARY_FILE: 'selinux-root-gnu-full-result.json' @@ -137,12 +138,28 @@ jobs: path_GNU='gnu' path_UUTILS='uutils' bash "uutils/util/run-gnu-test.sh" run-root + ### Run tests as root + - name: Extract testing info from individual logs (run as root) into JSON shell: bash run : | path_UUTILS='uutils' python uutils/util/gnu-json-result.py gnu/tests > ${{ env.TEST_ROOT_FULL_SUMMARY_FILE }} + - name: Run GNU stty tests + shell: 'script -q -e -c "bash {0}"' + run: | + ## Run GNU root tests + path_GNU='gnu' + path_UUTILS='uutils' + bash "uutils/util/run-gnu-test.sh" tests/stty/*.sh + + - name: Extract testing info from individual logs (stty) into JSON + shell: bash + run : | + path_UUTILS='uutils' + python uutils/util/gnu-json-result.py gnu/tests > ${{ env.TEST_STTY_FULL_SUMMARY_FILE }} + ### Upload artifacts - name: Upload full json results uses: actions/upload-artifact@v5 From 4271af9b04ee8d510aca1d76aa538d8dab339efb Mon Sep 17 00:00:00 2001 From: Chris Dryden Date: Mon, 24 Nov 2025 13:33:30 -0800 Subject: [PATCH 13/22] Update run-gnu-test.sh --- util/run-gnu-test.sh | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/util/run-gnu-test.sh b/util/run-gnu-test.sh index 7e13c25e33f..7fa52f84ee0 100755 --- a/util/run-gnu-test.sh +++ b/util/run-gnu-test.sh @@ -2,32 +2,11 @@ # `run-gnu-test.bash [TEST]` # run GNU test (or all tests if TEST is missing/null) -# spell-checker:ignore (env/vars) GNULIB SRCDIR SUBDIRS OSTYPE ; (utils) shellcheck gnproc greadlink setsid qfec +# spell-checker:ignore (env/vars) GNULIB SRCDIR SUBDIRS OSTYPE ; (utils) shellcheck gnproc greadlink # ref: [How the GNU coreutils are tested](https://www.pixelbeat.org/docs/coreutils-testing.html) @@ # * note: to run a single test => `make check TESTS=PATH/TO/TEST/SCRIPT SUBDIRS=. VERBOSE=yes` -# This is added to run the GNU tests inside a PTY as a controlling terminal -if [ "${INSIDE_TTY_WRAPPER:-0}" -ne 1 ]; then - - export INSIDE_TTY_WRAPPER=1 - - # Build the command string with proper shell quoting - cmd="bash $(printf '%q' "$0")" - for arg in "$@"; do - cmd="$cmd $(printf '%q' "$arg")" - done - - # New session + PTY; re-run this script inside it - if command -v script >/dev/null 2>&1; then - setsid script -qfec "$cmd" /dev/null - else - echo "script(1) not available; skipping this test" - fi -fi - - - # Use GNU version for make, nproc, readlink on *BSD case "$OSTYPE" in *bsd*) From 08ea89b1b7eff164b61a75c56f770ab9947da220 Mon Sep 17 00:00:00 2001 From: Chris Dryden Date: Mon, 24 Nov 2025 13:47:22 -0800 Subject: [PATCH 14/22] Update GnuTests.yml --- .github/workflows/GnuTests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/GnuTests.yml b/.github/workflows/GnuTests.yml index 54fef46b4c0..961978d37b2 100644 --- a/.github/workflows/GnuTests.yml +++ b/.github/workflows/GnuTests.yml @@ -152,7 +152,7 @@ jobs: ## Run GNU root tests path_GNU='gnu' path_UUTILS='uutils' - bash "uutils/util/run-gnu-test.sh" tests/stty/*.sh + bash "uutils/util/run-gnu-test.sh" tests/stty/stty-row-col tests/stty/stty-pairs tests/stty/stty-invalid tests/stty/stty tests/stty/bad-speed - name: Extract testing info from individual logs (stty) into JSON shell: bash From c10b1d09b448662fabb54599b09da235c4046fae Mon Sep 17 00:00:00 2001 From: Chris Dryden Date: Mon, 24 Nov 2025 14:17:31 -0800 Subject: [PATCH 15/22] Update GnuTests.yml --- .github/workflows/GnuTests.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/GnuTests.yml b/.github/workflows/GnuTests.yml index 961978d37b2..3d8dc5f48ff 100644 --- a/.github/workflows/GnuTests.yml +++ b/.github/workflows/GnuTests.yml @@ -152,7 +152,11 @@ jobs: ## Run GNU root tests path_GNU='gnu' path_UUTILS='uutils' - bash "uutils/util/run-gnu-test.sh" tests/stty/stty-row-col tests/stty/stty-pairs tests/stty/stty-invalid tests/stty/stty tests/stty/bad-speed + bash "uutils/util/run-gnu-test.sh" tests/stty/stty-row-col + bash "uutils/util/run-gnu-test.sh" tests/stty/stty-pairs + bash "uutils/util/run-gnu-test.sh" tests/stty/stty-invalid + bash "uutils/util/run-gnu-test.sh" tests/stty/stty + bash "uutils/util/run-gnu-test.sh" tests/stty/bad-speed - name: Extract testing info from individual logs (stty) into JSON shell: bash From b831fd24317ad21cc02aea23e6ea067cf435df48 Mon Sep 17 00:00:00 2001 From: Chris Dryden Date: Fri, 28 Nov 2025 14:32:28 -0800 Subject: [PATCH 16/22] Update GnuTests.yml --- .github/workflows/GnuTests.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/GnuTests.yml b/.github/workflows/GnuTests.yml index 3d8dc5f48ff..a7239988f14 100644 --- a/.github/workflows/GnuTests.yml +++ b/.github/workflows/GnuTests.yml @@ -175,6 +175,12 @@ jobs: with: name: gnu-root-full-result path: ${{ env.TEST_ROOT_FULL_SUMMARY_FILE }} + - name: Upload stty json results + uses: actions/upload-artifact@v5 + with: + name: gnu-stty-full-result + path: ${{ env.TEST_STTY_FULL_SUMMARY_FILE }} + - name: Compress test logs shell: bash run : | From f6439b2a6773dd090494689d66f72c1ed4888adf Mon Sep 17 00:00:00 2001 From: Chris Dryden Date: Fri, 28 Nov 2025 21:11:40 -0800 Subject: [PATCH 17/22] Update GnuTests.yml --- .github/workflows/GnuTests.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/GnuTests.yml b/.github/workflows/GnuTests.yml index a7239988f14..1fefb1d0120 100644 --- a/.github/workflows/GnuTests.yml +++ b/.github/workflows/GnuTests.yml @@ -385,6 +385,13 @@ jobs: name: gnu-root-full-result path: results merge-multiple: true + - name: Download stty json results + uses: actions/download-artifact@v6 + with: + name: gnu-stty-full-result + path: results + merge-multiple: true + - name: Download selinux json results uses: actions/download-artifact@v6 with: From e9357bc2fe7054f31aa69640c2778a3000cc96de Mon Sep 17 00:00:00 2001 From: Chris Dryden Date: Fri, 28 Nov 2025 21:47:39 -0800 Subject: [PATCH 18/22] Update GnuTests.yml --- .github/workflows/GnuTests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/GnuTests.yml b/.github/workflows/GnuTests.yml index 1fefb1d0120..a76e03ad19b 100644 --- a/.github/workflows/GnuTests.yml +++ b/.github/workflows/GnuTests.yml @@ -414,7 +414,7 @@ jobs: path_UUTILS='uutils' json_count=$(ls -l results/*.json | wc -l) - if [[ "$json_count" -ne 4 ]]; then + if [[ "$json_count" -ne 5 ]]; then echo "::error ::Failed to download all results json files (expected 4 files, found $json_count); failing early" ls -lR results || true exit 1 From a7c89841f16780b2325809efc74ef19ba5ab21cf Mon Sep 17 00:00:00 2001 From: Christopher Dryden Date: Sun, 7 Dec 2025 19:51:13 +0000 Subject: [PATCH 19/22] Making the list of the tests to be run created dynamically and added comments --- util/run-gnu-test.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/util/run-gnu-test.sh b/util/run-gnu-test.sh index 7fa52f84ee0..9300c43abcf 100755 --- a/util/run-gnu-test.sh +++ b/util/run-gnu-test.sh @@ -54,7 +54,14 @@ if test $# -ge 1; then done fi -if [[ "$1" == "run-root" && "$has_selinux_tests" == true ]]; then +if [[ "$1" == "run-tty" ]]; then + # Handle TTY tests - dynamically find tests requiring TTY + shift + TTY_TESTS=$(grep -r "require_controlling_input_terminal" tests --include="*.sh" --include="*.pl" -l 2>/dev/null | tr '\n' ' ') + echo "Running TTY tests: $TTY_TESTS" + script -qec "timeout -sKILL 1h '${MAKE}' -j '$(${NPROC})' check TESTS='$TTY_TESTS' SUBDIRS=. RUN_EXPENSIVE_TESTS=yes VERBOSE=no gl_public_submodule_commit='' srcdir='${path_GNU}' TEST_SUITE_LOG='tests/test-suite-tty.log'" /dev/null || : + exit 0 +elif [[ "$1" == "run-root" && "$has_selinux_tests" == true ]]; then # Handle SELinux root tests separately shift if test -n "$CI"; then @@ -63,7 +70,7 @@ if [[ "$1" == "run-root" && "$has_selinux_tests" == true ]]; then sudo "${MAKE}" -j "$("${NPROC}")" check TESTS="$*" SUBDIRS=. RUN_EXPENSIVE_TESTS=yes RUN_VERY_EXPENSIVE_TESTS=yes VERBOSE=no gl_public_submodule_commit="" srcdir="${path_GNU}" TEST_SUITE_LOG="tests/test-suite-root.log" || : fi exit 0 -elif test "$1" != "run-root"; then +elif test "$1" != "run-root" && test "$1" != "run-tty"; then if test $# -ge 1; then # if set, run only the tests passed SPECIFIC_TESTS="" @@ -91,7 +98,7 @@ fi # * `srcdir=..` specifies the GNU source directory for tests (fixing failing/confused 'tests/factor/tNN.sh' tests and causing no harm to other tests) #shellcheck disable=SC2086 -if test "$1" != "run-root"; then +if test "$1" != "run-root" && test "$1" != "run-tty"; then # run the regular tests if test $# -ge 1; then timeout -sKILL 4h "${MAKE}" -j "$("${NPROC}")" check TESTS="$SPECIFIC_TESTS" SUBDIRS=. RUN_EXPENSIVE_TESTS=yes RUN_VERY_EXPENSIVE_TESTS=yes VERBOSE=no gl_public_submodule_commit="" srcdir="${path_GNU}" || : # Kill after 4 hours in case something gets stuck in make From d8eccd3e3f3da522773309318bbc78011932e689 Mon Sep 17 00:00:00 2001 From: Christopher Dryden Date: Sun, 7 Dec 2025 19:56:15 +0000 Subject: [PATCH 20/22] Making the list of the tests to be run created dynamically and added comments --- .github/workflows/GnuTests.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/GnuTests.yml b/.github/workflows/GnuTests.yml index a76e03ad19b..f55ead26ae1 100644 --- a/.github/workflows/GnuTests.yml +++ b/.github/workflows/GnuTests.yml @@ -138,7 +138,6 @@ jobs: path_GNU='gnu' path_UUTILS='uutils' bash "uutils/util/run-gnu-test.sh" run-root - ### Run tests as root - name: Extract testing info from individual logs (run as root) into JSON shell: bash @@ -146,17 +145,20 @@ jobs: path_UUTILS='uutils' python uutils/util/gnu-json-result.py gnu/tests > ${{ env.TEST_ROOT_FULL_SUMMARY_FILE }} + ### This shell has been changed from "bash" to this command + ### "script" will start a pty and the -q command removes the "script" initiation log + ### the -e flag makes it propagate the error code and -c runs the command in a pty + ### the primary purpose of this change is to run the tty GNU tests + ### The reason its separated from the rest of the tests is because one test can corrupt the other + ### tests through the use of the shared terminal and it changes the environment that the other + ### tests are run in, which can cause different results. - name: Run GNU stty tests shell: 'script -q -e -c "bash {0}"' run: | ## Run GNU root tests path_GNU='gnu' path_UUTILS='uutils' - bash "uutils/util/run-gnu-test.sh" tests/stty/stty-row-col - bash "uutils/util/run-gnu-test.sh" tests/stty/stty-pairs - bash "uutils/util/run-gnu-test.sh" tests/stty/stty-invalid - bash "uutils/util/run-gnu-test.sh" tests/stty/stty - bash "uutils/util/run-gnu-test.sh" tests/stty/bad-speed + bash "uutils/util/run-gnu-test.sh" run-tty - name: Extract testing info from individual logs (stty) into JSON shell: bash From 558a04416c91839a85b39759723b9d18d769f0f9 Mon Sep 17 00:00:00 2001 From: Christopher Dryden Date: Sun, 7 Dec 2025 20:12:30 +0000 Subject: [PATCH 21/22] Splitting the running of the stty tests so that the mv test does not break the stty tests --- util/run-gnu-test.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/util/run-gnu-test.sh b/util/run-gnu-test.sh index 9300c43abcf..36d800869d9 100755 --- a/util/run-gnu-test.sh +++ b/util/run-gnu-test.sh @@ -55,11 +55,15 @@ if test $# -ge 1; then fi if [[ "$1" == "run-tty" ]]; then - # Handle TTY tests - dynamically find tests requiring TTY + # Handle TTY tests - dynamically find tests requiring TTY and run each individually shift - TTY_TESTS=$(grep -r "require_controlling_input_terminal" tests --include="*.sh" --include="*.pl" -l 2>/dev/null | tr '\n' ' ') - echo "Running TTY tests: $TTY_TESTS" - script -qec "timeout -sKILL 1h '${MAKE}' -j '$(${NPROC})' check TESTS='$TTY_TESTS' SUBDIRS=. RUN_EXPENSIVE_TESTS=yes VERBOSE=no gl_public_submodule_commit='' srcdir='${path_GNU}' TEST_SUITE_LOG='tests/test-suite-tty.log'" /dev/null || : + TTY_TESTS=$(grep -r "require_controlling_input_terminal" tests --include="*.sh" --include="*.pl" -l 2>/dev/null) + echo "Running TTY tests individually:" + # If a test fails, it can break the implementation of the other tty tests. By running them seperately this stops the different tests from being able to break each other + for test in $TTY_TESTS; do + echo " Running: $test" + script -qec "timeout -sKILL 5m '${MAKE}' check TESTS='$test' SUBDIRS=. RUN_EXPENSIVE_TESTS=yes VERBOSE=no gl_public_submodule_commit='' srcdir='${path_GNU}'" /dev/null || : + done exit 0 elif [[ "$1" == "run-root" && "$has_selinux_tests" == true ]]; then # Handle SELinux root tests separately From f7f8a9428b0a0f6d31e55285cb7e975eb3482964 Mon Sep 17 00:00:00 2001 From: Christopher Dryden Date: Sun, 7 Dec 2025 20:14:16 +0000 Subject: [PATCH 22/22] Fixing spelling mistake --- util/run-gnu-test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/run-gnu-test.sh b/util/run-gnu-test.sh index 36d800869d9..43eb25f66c5 100755 --- a/util/run-gnu-test.sh +++ b/util/run-gnu-test.sh @@ -59,7 +59,7 @@ if [[ "$1" == "run-tty" ]]; then shift TTY_TESTS=$(grep -r "require_controlling_input_terminal" tests --include="*.sh" --include="*.pl" -l 2>/dev/null) echo "Running TTY tests individually:" - # If a test fails, it can break the implementation of the other tty tests. By running them seperately this stops the different tests from being able to break each other + # If a test fails, it can break the implementation of the other tty tests. By running them separately this stops the different tests from being able to break each other for test in $TTY_TESTS; do echo " Running: $test" script -qec "timeout -sKILL 5m '${MAKE}' check TESTS='$test' SUBDIRS=. RUN_EXPENSIVE_TESTS=yes VERBOSE=no gl_public_submodule_commit='' srcdir='${path_GNU}'" /dev/null || :