public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] x86/cet: fix shadow stack test scripts
@ 2024-02-05 20:22 Michael Jeanson
  2024-02-06  2:10 ` H.J. Lu
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Jeanson @ 2024-02-05 20:22 UTC (permalink / raw)
  To: libc-alpha; +Cc: Michael Jeanson

Some shadow stack test scripts use the '==' operator with the 'test'
command to validate exit codes resulting in the following error:

  sysdeps/x86_64/tst-shstk-legacy-1e.sh: 31: test: 139: unexpected operator

The '==' operator is invalid for the 'test' command, use '-eq' like the
previous call to 'test'.

Change-Id: Ib4d444cc1c9bbb9626d5ab3a40a427faf3567e12
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
---
 sysdeps/x86_64/tst-shstk-legacy-1e-static.sh | 2 +-
 sysdeps/x86_64/tst-shstk-legacy-1e.sh        | 2 +-
 sysdeps/x86_64/tst-shstk-legacy-1g.sh        | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/sysdeps/x86_64/tst-shstk-legacy-1e-static.sh b/sysdeps/x86_64/tst-shstk-legacy-1e-static.sh
index 46f1233757..0a9a164a3e 100755
--- a/sysdeps/x86_64/tst-shstk-legacy-1e-static.sh
+++ b/sysdeps/x86_64/tst-shstk-legacy-1e-static.sh
@@ -26,7 +26,7 @@ ${common_objpfx}elf/tst-shstk-legacy-1e-static
 status=$?
 if test $status -eq 77; then
   exit 77
-elif test $status == 139; then
+elif test $status -eq 139; then
   exit 0
 else
   exit 1
diff --git a/sysdeps/x86_64/tst-shstk-legacy-1e.sh b/sysdeps/x86_64/tst-shstk-legacy-1e.sh
index 31212453d9..3dec5623e4 100755
--- a/sysdeps/x86_64/tst-shstk-legacy-1e.sh
+++ b/sysdeps/x86_64/tst-shstk-legacy-1e.sh
@@ -28,7 +28,7 @@ ${test_program_prefix} \
 status=$?
 if test $status -eq 77; then
   exit 77
-elif test $status == 139; then
+elif test $status -eq 139; then
   exit 0
 else
   exit 1
diff --git a/sysdeps/x86_64/tst-shstk-legacy-1g.sh b/sysdeps/x86_64/tst-shstk-legacy-1g.sh
index e84087068e..249831e816 100755
--- a/sysdeps/x86_64/tst-shstk-legacy-1g.sh
+++ b/sysdeps/x86_64/tst-shstk-legacy-1g.sh
@@ -28,7 +28,7 @@ ${test_program_prefix} \
 status=$?
 if test $status -eq 77; then
   exit 77
-elif test $status == 139; then
+elif test $status -eq 139; then
   exit 0
 else
   exit 1
-- 
2.34.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] x86/cet: fix shadow stack test scripts
  2024-02-05 20:22 [PATCH] x86/cet: fix shadow stack test scripts Michael Jeanson
@ 2024-02-06  2:10 ` H.J. Lu
  0 siblings, 0 replies; 2+ messages in thread
From: H.J. Lu @ 2024-02-06  2:10 UTC (permalink / raw)
  To: Michael Jeanson; +Cc: libc-alpha

On Mon, Feb 5, 2024 at 12:23 PM Michael Jeanson <mjeanson@efficios.com> wrote:
>
> Some shadow stack test scripts use the '==' operator with the 'test'
> command to validate exit codes resulting in the following error:
>
>   sysdeps/x86_64/tst-shstk-legacy-1e.sh: 31: test: 139: unexpected operator
>
> The '==' operator is invalid for the 'test' command, use '-eq' like the
> previous call to 'test'.
>
> Change-Id: Ib4d444cc1c9bbb9626d5ab3a40a427faf3567e12
> Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
> ---
>  sysdeps/x86_64/tst-shstk-legacy-1e-static.sh | 2 +-
>  sysdeps/x86_64/tst-shstk-legacy-1e.sh        | 2 +-
>  sysdeps/x86_64/tst-shstk-legacy-1g.sh        | 2 +-
>  3 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/sysdeps/x86_64/tst-shstk-legacy-1e-static.sh b/sysdeps/x86_64/tst-shstk-legacy-1e-static.sh
> index 46f1233757..0a9a164a3e 100755
> --- a/sysdeps/x86_64/tst-shstk-legacy-1e-static.sh
> +++ b/sysdeps/x86_64/tst-shstk-legacy-1e-static.sh
> @@ -26,7 +26,7 @@ ${common_objpfx}elf/tst-shstk-legacy-1e-static
>  status=$?
>  if test $status -eq 77; then
>    exit 77
> -elif test $status == 139; then
> +elif test $status -eq 139; then
>    exit 0
>  else
>    exit 1
> diff --git a/sysdeps/x86_64/tst-shstk-legacy-1e.sh b/sysdeps/x86_64/tst-shstk-legacy-1e.sh
> index 31212453d9..3dec5623e4 100755
> --- a/sysdeps/x86_64/tst-shstk-legacy-1e.sh
> +++ b/sysdeps/x86_64/tst-shstk-legacy-1e.sh
> @@ -28,7 +28,7 @@ ${test_program_prefix} \
>  status=$?
>  if test $status -eq 77; then
>    exit 77
> -elif test $status == 139; then
> +elif test $status -eq 139; then
>    exit 0
>  else
>    exit 1
> diff --git a/sysdeps/x86_64/tst-shstk-legacy-1g.sh b/sysdeps/x86_64/tst-shstk-legacy-1g.sh
> index e84087068e..249831e816 100755
> --- a/sysdeps/x86_64/tst-shstk-legacy-1g.sh
> +++ b/sysdeps/x86_64/tst-shstk-legacy-1g.sh
> @@ -28,7 +28,7 @@ ${test_program_prefix} \
>  status=$?
>  if test $status -eq 77; then
>    exit 77
> -elif test $status == 139; then
> +elif test $status -eq 139; then
>    exit 0
>  else
>    exit 1
> --
> 2.34.1
>

LGTM.

Thanks.

-- 
H.J.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-02-06  2:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-05 20:22 [PATCH] x86/cet: fix shadow stack test scripts Michael Jeanson
2024-02-06  2:10 ` H.J. Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).