From d9e6d623284ea5bd826686191b308d8b66ef26d7 Mon Sep 17 00:00:00 2001 From: Johannes Schauer Marin Rodrigues Date: Thu, 9 Feb 2023 10:04:22 +0100 Subject: [PATCH] tests: redirect all id output to /dev/null --- tests/as-debootstrap-unshare-wrapper | 2 +- tests/check-for-bit-by-bit-identical-format-output | 2 +- tests/chrootless-fakeroot | 2 +- tests/create-arm64-tarball | 2 +- tests/create-gzip-compressed-tarball | 2 +- tests/create-tarball-dry-run | 2 +- tests/custom-tmpdir | 2 +- tests/cwd-directory-not-accessible-by-unshared-user | 2 +- tests/dev-ptmx | 2 +- tests/install-doc-debian | 2 +- tests/install-doc-debian-and-output-tarball | 2 +- tests/install-doc-debian-and-test-hooks | 2 +- tests/install-libmagic-mgc-on-arm64 | 2 +- tests/jessie-or-older | 2 +- tests/missing-dev-sys-proc-inside-the-chroot | 2 +- tests/no-sbin-in-path | 2 +- tests/root-mode-inside-unshare-chroot | 2 +- tests/special-hooks-with-mode-mode | 2 +- tests/unpack-doc-debian | 2 +- tests/unshare-include-deb | 2 +- 20 files changed, 20 insertions(+), 20 deletions(-) diff --git a/tests/as-debootstrap-unshare-wrapper b/tests/as-debootstrap-unshare-wrapper index e928f33..e46d682 100644 --- a/tests/as-debootstrap-unshare-wrapper +++ b/tests/as-debootstrap-unshare-wrapper @@ -5,7 +5,7 @@ export SOURCE_DATE_EPOCH={{ SOURCE_DATE_EPOCH }} prefix= if [ "$(id -u)" -eq 0 ] && [ "{{ MODE }}" != "root" ] && [ "{{ MODE }}" != "auto" ]; then - if ! id "${SUDO_USER:-user}" 2>/dev/null; then + if ! id "${SUDO_USER:-user}" >/dev/null 2>&1; then if [ ! -e /mmdebstrap-testenv ]; then echo "this test modifies the system and should only be run inside a container" >&2 exit 1 diff --git a/tests/check-for-bit-by-bit-identical-format-output b/tests/check-for-bit-by-bit-identical-format-output index 39641c4..6187a2c 100644 --- a/tests/check-for-bit-by-bit-identical-format-output +++ b/tests/check-for-bit-by-bit-identical-format-output @@ -7,7 +7,7 @@ trap "rm -f /tmp/debian-chroot-{{ MODE }}.{{ FORMAT }} /tmp/debian-chroot-root.{ [ "$(id -u)" -eq 0 ] -if ! id "${SUDO_USER:-user}" 2>/dev/null; then +if ! id "${SUDO_USER:-user}" >/dev/null 2>&1; then if [ ! -e /mmdebstrap-testenv ]; then echo "this test modifies the system and should only be run inside a container" >&2 exit 1 diff --git a/tests/chrootless-fakeroot b/tests/chrootless-fakeroot index aa799dd..0f09e73 100644 --- a/tests/chrootless-fakeroot +++ b/tests/chrootless-fakeroot @@ -8,7 +8,7 @@ trap "rm -f /tmp/chrootless.tar /tmp/root.tar" EXIT INT TERM prefix= if [ "$(id -u)" -eq 0 ] && [ "{{ MODE }}" != "root" ] && [ "{{ MODE }}" != "auto" ]; then - if ! id "${SUDO_USER:-user}" 2>/dev/null; then + if ! id "${SUDO_USER:-user}" >/dev/null 2>&1; then if [ ! -e /mmdebstrap-testenv ]; then echo "this test modifies the system and should only be run inside a container" >&2 exit 1 diff --git a/tests/create-arm64-tarball b/tests/create-arm64-tarball index db7f54b..367948f 100644 --- a/tests/create-arm64-tarball +++ b/tests/create-arm64-tarball @@ -4,7 +4,7 @@ export LC_ALL=C.UTF-8 prefix= if [ "$(id -u)" -eq 0 ] && [ "{{ MODE }}" != "root" ] && [ "{{ MODE }}" != "auto" ]; then - if ! id "${SUDO_USER:-user}" 2>/dev/null; then + if ! id "${SUDO_USER:-user}" >/dev/null 2>&1; then if [ ! -e /mmdebstrap-testenv ]; then echo "this test modifies the system and should only be run inside a container" >&2 exit 1 diff --git a/tests/create-gzip-compressed-tarball b/tests/create-gzip-compressed-tarball index cbf772c..1492df2 100644 --- a/tests/create-gzip-compressed-tarball +++ b/tests/create-gzip-compressed-tarball @@ -4,7 +4,7 @@ export LC_ALL=C.UTF-8 prefix= if [ "$(id -u)" -eq 0 ] && [ "{{ MODE }}" != "root" ] && [ "{{ MODE }}" != "auto" ]; then - if ! id "${SUDO_USER:-user}" 2>/dev/null; then + if ! id "${SUDO_USER:-user}" >/dev/null 2>&1; then if [ ! -e /mmdebstrap-testenv ]; then echo "this test modifies the system and should only be run inside a container" >&2 exit 1 diff --git a/tests/create-tarball-dry-run b/tests/create-tarball-dry-run index 91bee4a..f4c5fe2 100644 --- a/tests/create-tarball-dry-run +++ b/tests/create-tarball-dry-run @@ -8,7 +8,7 @@ export LC_ALL=C.UTF-8 prefix= include=, if [ "$(id -u)" -eq 0 ] && [ "{{ MODE }}" != root ] && [ "{{ MODE }}" != auto ]; then - if ! id "${SUDO_USER:-user}" 2>/dev/null; then + if ! id "${SUDO_USER:-user}" >/dev/null 2>&1; then if [ ! -e /mmdebstrap-testenv ]; then echo "this test modifies the system and should only be run inside a container" >&2 exit 1 diff --git a/tests/custom-tmpdir b/tests/custom-tmpdir index 628cb37..bfd3651 100644 --- a/tests/custom-tmpdir +++ b/tests/custom-tmpdir @@ -5,7 +5,7 @@ export LC_ALL=C.UTF-8 [ "$(id -u)" -eq 0 ] [ {{ MODE }} = "unshare" ] -if ! id "${SUDO_USER:-user}" 2>/dev/null; then +if ! id "${SUDO_USER:-user}" >/dev/null 2>&1; then if [ ! -e /mmdebstrap-testenv ]; then echo "this test modifies the system and should only be run inside a container" >&2 exit 1 diff --git a/tests/cwd-directory-not-accessible-by-unshared-user b/tests/cwd-directory-not-accessible-by-unshared-user index 5312e01..859cf6b 100644 --- a/tests/cwd-directory-not-accessible-by-unshared-user +++ b/tests/cwd-directory-not-accessible-by-unshared-user @@ -5,7 +5,7 @@ export LC_ALL=C.UTF-8 [ "$(id -u)" -eq 0 ] [ {{ MODE }} = "unshare" ] -if ! id "${SUDO_USER:-user}" 2>/dev/null; then +if ! id "${SUDO_USER:-user}" >/dev/null 2>&1; then if [ ! -e /mmdebstrap-testenv ]; then echo "this test modifies the system and should only be run inside a container" >&2 exit 1 diff --git a/tests/dev-ptmx b/tests/dev-ptmx index 2636ed4..a17655b 100644 --- a/tests/dev-ptmx +++ b/tests/dev-ptmx @@ -9,7 +9,7 @@ fi prefix= if [ "$(id -u)" -eq 0 ] && [ "{{ MODE }}" != "root" ] && [ "{{ MODE }}" != "auto" ]; then - if ! id "${SUDO_USER:-user}" 2>/dev/null; then + if ! id "${SUDO_USER:-user}" >/dev/null 2>&1; then if [ ! -e /mmdebstrap-testenv ]; then echo "this test modifies the system and should only be run inside a container" >&2 exit 1 diff --git a/tests/install-doc-debian b/tests/install-doc-debian index 12d1084..407dcff 100644 --- a/tests/install-doc-debian +++ b/tests/install-doc-debian @@ -7,7 +7,7 @@ export LC_ALL=C.UTF-8 prefix= if [ "$(id -u)" -eq 0 ] && [ "{{ MODE }}" != "root" ] && [ "{{ MODE }}" != "auto" ]; then - if ! id "${SUDO_USER:-user}" 2>/dev/null; then + if ! id "${SUDO_USER:-user}" >/dev/null 2>&1; then if [ ! -e /mmdebstrap-testenv ]; then echo "this test modifies the system and should only be run inside a container" >&2 exit 1 diff --git a/tests/install-doc-debian-and-output-tarball b/tests/install-doc-debian-and-output-tarball index c9e0fbb..118ae89 100644 --- a/tests/install-doc-debian-and-output-tarball +++ b/tests/install-doc-debian-and-output-tarball @@ -8,7 +8,7 @@ export SOURCE_DATE_EPOCH={{ SOURCE_DATE_EPOCH }} prefix= if [ "$(id -u)" -eq 0 ] && [ "{{ MODE }}" != "root" ] && [ "{{ MODE }}" != "auto" ]; then - if ! id "${SUDO_USER:-user}" 2>/dev/null; then + if ! id "${SUDO_USER:-user}" >/dev/null 2>&1; then if [ ! -e /mmdebstrap-testenv ]; then echo "this test modifies the system and should only be run inside a container" >&2 exit 1 diff --git a/tests/install-doc-debian-and-test-hooks b/tests/install-doc-debian-and-test-hooks index 7c1e0c7..8b02873 100644 --- a/tests/install-doc-debian-and-test-hooks +++ b/tests/install-doc-debian-and-test-hooks @@ -8,7 +8,7 @@ export SOURCE_DATE_EPOCH={{ SOURCE_DATE_EPOCH }} prefix= if [ "$(id -u)" -eq 0 ] && [ "{{ MODE }}" != "root" ] && [ "{{ MODE }}" != "auto" ]; then - if ! id "${SUDO_USER:-user}" 2>/dev/null; then + if ! id "${SUDO_USER:-user}" >/dev/null 2>&1; then if [ ! -e /mmdebstrap-testenv ]; then echo "this test modifies the system and should only be run inside a container" >&2 exit 1 diff --git a/tests/install-libmagic-mgc-on-arm64 b/tests/install-libmagic-mgc-on-arm64 index a1349a2..8c75098 100644 --- a/tests/install-libmagic-mgc-on-arm64 +++ b/tests/install-libmagic-mgc-on-arm64 @@ -7,7 +7,7 @@ export LC_ALL=C.UTF-8 prefix= if [ "$(id -u)" -eq 0 ] && [ "{{ MODE }}" != "root" ] && [ "{{ MODE }}" != "auto" ]; then - if ! id "${SUDO_USER:-user}" 2>/dev/null; then + if ! id "${SUDO_USER:-user}" >/dev/null 2>&1; then if [ ! -e /mmdebstrap-testenv ]; then echo "this test modifies the system and should only be run inside a container" >&2 exit 1 diff --git a/tests/jessie-or-older b/tests/jessie-or-older index a624547..ddfe7a7 100644 --- a/tests/jessie-or-older +++ b/tests/jessie-or-older @@ -9,7 +9,7 @@ trap "rm -f /tmp/debian-chroot-{{ MODE }}.tar /tmp/debian-chroot-root-normal.tar prefix= if [ "$(id -u)" -eq 0 ] && [ "{{ MODE }}" != "root" ] && [ "{{ MODE }}" != "auto" ]; then - if ! id "${SUDO_USER:-user}" 2>/dev/null; then + if ! id "${SUDO_USER:-user}" >/dev/null 2>&1; then if [ ! -e /mmdebstrap-testenv ]; then echo "this test modifies the system and should only be run inside a container" >&2 exit 1 diff --git a/tests/missing-dev-sys-proc-inside-the-chroot b/tests/missing-dev-sys-proc-inside-the-chroot index 91cced3..d127911 100644 --- a/tests/missing-dev-sys-proc-inside-the-chroot +++ b/tests/missing-dev-sys-proc-inside-the-chroot @@ -7,7 +7,7 @@ export LC_ALL=C.UTF-8 prefix= if [ "$(id -u)" -eq 0 ] && [ "{{ MODE }}" != "root" ] && [ "{{ MODE }}" != "auto" ]; then - if ! id "${SUDO_USER:-user}" 2>/dev/null; then + if ! id "${SUDO_USER:-user}" >/dev/null 2>&1; then if [ ! -e /mmdebstrap-testenv ]; then echo "this test modifies the system and should only be run inside a container" >&2 exit 1 diff --git a/tests/no-sbin-in-path b/tests/no-sbin-in-path index f101b1e..0cedc0b 100644 --- a/tests/no-sbin-in-path +++ b/tests/no-sbin-in-path @@ -14,7 +14,7 @@ trap "rm -f /tmp/debian-chroot.tar" EXIT INT TERM prefix= if [ "$(id -u)" -eq 0 ] && [ "{{ MODE }}" != "root" ] && [ "{{ MODE }}" != "auto" ]; then - if ! id "${SUDO_USER:-user}" 2>/dev/null; then + if ! id "${SUDO_USER:-user}" >/dev/null 2>&1; then if [ ! -e /mmdebstrap-testenv ]; then echo "this test modifies the system and should only be run inside a container" >&2 exit 1 diff --git a/tests/root-mode-inside-unshare-chroot b/tests/root-mode-inside-unshare-chroot index 634cca0..e953c65 100644 --- a/tests/root-mode-inside-unshare-chroot +++ b/tests/root-mode-inside-unshare-chroot @@ -10,7 +10,7 @@ export LC_ALL=C.UTF-8 prefix= if [ "$(id -u)" -eq 0 ] && [ "{{ MODE }}" != "root" ] && [ "{{ MODE }}" != "auto" ]; then - if ! id "${SUDO_USER:-user}" 2>/dev/null; then + if ! id "${SUDO_USER:-user}" >/dev/null 2>&1; then if [ ! -e /mmdebstrap-testenv ]; then echo "this test modifies the system and should only be run inside a container" >&2 exit 1 diff --git a/tests/special-hooks-with-mode-mode b/tests/special-hooks-with-mode-mode index b8b9b39..99e2a47 100644 --- a/tests/special-hooks-with-mode-mode +++ b/tests/special-hooks-with-mode-mode @@ -4,7 +4,7 @@ export LC_ALL=C.UTF-8 prefix= if [ "$(id -u)" -eq 0 ] && [ "{{ MODE }}" != "root" ] && [ "{{ MODE }}" != "auto" ]; then - if ! id "${SUDO_USER:-user}" 2>/dev/null; then + if ! id "${SUDO_USER:-user}" >/dev/null 2>&1; then if [ ! -e /mmdebstrap-testenv ]; then echo "this test modifies the system and should only be run inside a container" >&2 exit 1 diff --git a/tests/unpack-doc-debian b/tests/unpack-doc-debian index cc48fa8..b51529a 100644 --- a/tests/unpack-doc-debian +++ b/tests/unpack-doc-debian @@ -6,7 +6,7 @@ export LC_ALL=C.UTF-8 prefix= if [ "$(id -u)" -eq 0 ] && [ "{{ MODE }}" != "root" ] && [ "{{ MODE }}" != "auto" ]; then - if ! id "${SUDO_USER:-user}" 2>/dev/null; then + if ! id "${SUDO_USER:-user}" >/dev/null 2>&1; then if [ ! -e /mmdebstrap-testenv ]; then echo "this test modifies the system and should only be run inside a container" >&2 exit 1 diff --git a/tests/unshare-include-deb b/tests/unshare-include-deb index a4daaf9..06373bf 100644 --- a/tests/unshare-include-deb +++ b/tests/unshare-include-deb @@ -7,7 +7,7 @@ export LC_ALL=C.UTF-8 prefix= if [ "$(id -u)" -eq 0 ] && [ "{{ MODE }}" != "root" ] && [ "{{ MODE }}" != "auto" ]; then - if ! id "${SUDO_USER:-user}" 2>/dev/null; then + if ! id "${SUDO_USER:-user}" >/dev/null 2>&1; then if [ ! -e /mmdebstrap-testenv ]; then echo "this test modifies the system and should only be run inside a container" >&2 exit 1