public inbox for libc-help@sourceware.org
 help / color / mirror / Atom feed
* Testcase for BZ 28519
@ 2023-03-20 18:10 Joe Simmons-Talbott
  2023-03-20 20:14 ` Florian Weimer
  0 siblings, 1 reply; 3+ messages in thread
From: Joe Simmons-Talbott @ 2023-03-20 18:10 UTC (permalink / raw)
  To: libc-help

Hi,

I'm trying to write a testcase for BZ 28519 but not having much luck.
My testcase is below.  For a simple application that calls
'system("-echo")' I get the same behavior as the BZ but for the testcase
I get the expected behavior where sh fails to find "-echo".

Does anyone have any thought on what I might be missing?

Thanks,
Joe

My testcase looks like this:

diff --git a/stdlib/tst-system.c b/stdlib/tst-system.c
index 47a0afe6bf..6f3329c08e 100644
--- a/stdlib/tst-system.c
+++ b/stdlib/tst-system.c
@@ -146,6 +146,20 @@ do_test (void)
     TEST_COMPARE_STRING (result.out.buffer, "...\n");
   }

+  {
+    struct support_capture_subprocess result;
+    const char *cmd = "-echo";
+    result = support_capture_subprocess (call_system,
+                                        &(struct args) { cmd, 127, 0 });
+    support_capture_subprocess_check (&result, "system", 0, sc_allow_stderr);
+       printf("JOE: %s\n", result.err.buffer);
+    char *returnerr = xasprintf ("%s: execing %s failed: "
+                                "No such file or directory",
+                                basename(_PATH_BSHELL), cmd);
+    TEST_COMPARE_STRING (result.err.buffer, returnerr);
+    free (returnerr);
+  }
+
   {
     struct support_capture_subprocess result;
     result = support_capture_subprocess (call_system,


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

end of thread, other threads:[~2023-03-21 17:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-20 18:10 Testcase for BZ 28519 Joe Simmons-Talbott
2023-03-20 20:14 ` Florian Weimer
2023-03-21 17:19   ` Joe Talbott

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).