From 9e65b746a757233cead8214d840aaa67ab45e7fa Mon Sep 17 00:00:00 2001 From: Chris Dryden Date: Wed, 19 Nov 2025 10:58:12 -0800 Subject: [PATCH 01/18] 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 5986487dbca..6f76a0baf3e 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 a1532116c032fd72a368ab59db64504bbeb24600 Mon Sep 17 00:00:00 2001 From: Chris Dryden Date: Mon, 24 Nov 2025 07:56:41 -0800 Subject: [PATCH 02/18] 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 6f76a0baf3e..21a60da9621 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 46ae81780b91c2ad66ad6681884b0a42ea26896c Mon Sep 17 00:00:00 2001 From: Chris Dryden Date: Mon, 24 Nov 2025 07:57:39 -0800 Subject: [PATCH 03/18] 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 21a60da9621..8def6d1c322 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 b6379b833bf0836b41b50e3dedb5a2f57d125281 Mon Sep 17 00:00:00 2001 From: Chris Dryden Date: Mon, 24 Nov 2025 07:58:14 -0800 Subject: [PATCH 04/18] 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 8def6d1c322..608f3aa07ad 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 470c4b5c6ea99734e6d4cf80d99d5da9ac6e4bc3 Mon Sep 17 00:00:00 2001 From: Chris Dryden Date: Mon, 24 Nov 2025 09:08:14 -0800 Subject: [PATCH 05/18] 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 608f3aa07ad..5986487dbca 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 a392346deb04ddb0f292fd723f2aaa33b957c06f Mon Sep 17 00:00:00 2001 From: Chris Dryden Date: Mon, 24 Nov 2025 09:09:33 -0800 Subject: [PATCH 06/18] 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 042f22d685aee7317faa8f48e35d68cd3bca581e Mon Sep 17 00:00:00 2001 From: Chris Dryden Date: Mon, 24 Nov 2025 11:18:32 -0800 Subject: [PATCH 07/18] 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 294739e2d5bab764971a6aa31914b5b868e48455 Mon Sep 17 00:00:00 2001 From: Chris Dryden Date: Mon, 24 Nov 2025 12:14:02 -0800 Subject: [PATCH 08/18] 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 ee74e6a0d07c554d17580d0c77400d00c3348687 Mon Sep 17 00:00:00 2001 From: Chris Dryden Date: Mon, 24 Nov 2025 12:32:57 -0800 Subject: [PATCH 09/18] 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 6661620e48a3b461197cfb219832db6e44027022 Mon Sep 17 00:00:00 2001 From: Chris Dryden Date: Mon, 24 Nov 2025 12:36:37 -0800 Subject: [PATCH 10/18] 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 2f98746e7be1decdb468a483c7db429f5fc0ccb8 Mon Sep 17 00:00:00 2001 From: Chris Dryden Date: Mon, 24 Nov 2025 12:55:32 -0800 Subject: [PATCH 11/18] 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 3f9a74ded09a1d1367474ed415a838c84194dce8 Mon Sep 17 00:00:00 2001 From: Chris Dryden Date: Mon, 24 Nov 2025 13:32:35 -0800 Subject: [PATCH 12/18] 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 5986487dbca..20c9dbbf424 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 adffa81d547c346c7411977b588fc454add8e4d8 Mon Sep 17 00:00:00 2001 From: Chris Dryden Date: Mon, 24 Nov 2025 13:33:30 -0800 Subject: [PATCH 13/18] 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 41c51d430f951ab6c44e9bc8a73e5e56221228b7 Mon Sep 17 00:00:00 2001 From: Chris Dryden Date: Mon, 24 Nov 2025 13:47:22 -0800 Subject: [PATCH 14/18] 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 20c9dbbf424..ef29cf10af9 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 76dcd8c84e8f15fc5e0c8c7e05e82d0c378d071b Mon Sep 17 00:00:00 2001 From: Chris Dryden Date: Mon, 24 Nov 2025 14:17:31 -0800 Subject: [PATCH 15/18] 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 ef29cf10af9..ab082c49b77 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 6a7fed075ee189c123cb0cfa699f4cbb93e97ea8 Mon Sep 17 00:00:00 2001 From: Chris Dryden Date: Fri, 28 Nov 2025 14:32:28 -0800 Subject: [PATCH 16/18] 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 ab082c49b77..6efac7ab3ca 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 01646075bded8d7c7e84ef30d453844e1c6e5a8a Mon Sep 17 00:00:00 2001 From: Chris Dryden Date: Fri, 28 Nov 2025 21:11:40 -0800 Subject: [PATCH 17/18] 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 6efac7ab3ca..26a22ee9304 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 48ffbb74702239bbe99c51489c2d66010fb49617 Mon Sep 17 00:00:00 2001 From: Chris Dryden Date: Fri, 28 Nov 2025 21:47:39 -0800 Subject: [PATCH 18/18] 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 26a22ee9304..8d6a8ed22d8 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