28653a
commit 4eda036f5b897fa8bc20ddd2099b5a6ed4239dc9
28653a
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
28653a
Date:   Tue Mar 24 15:48:34 2020 -0300
28653a
28653a
    stdlib: Move tst-system to tests-container
28653a
    
28653a
    Fix some issues with different shell and error messages.
28653a
    
28653a
    Checked on x86_64-linux-gnu and i686-linux-gnu.
28653a
28653a
diff --git a/stdlib/Makefile b/stdlib/Makefile
28653a
index 01194bbf7cc96851..9d0edcf6a7749b28 100644
28653a
--- a/stdlib/Makefile
28653a
+++ b/stdlib/Makefile
28653a
@@ -70,7 +70,7 @@ tests		:= tst-strtol tst-strtod testmb testrand testsort testdiv   \
28653a
 		   test-canon test-canon2 tst-strtoll tst-environ	    \
28653a
 		   tst-xpg-basename tst-random tst-random2 tst-bsearch	    \
28653a
 		   tst-limits tst-rand48 bug-strtod tst-setcontext	    \
28653a
-		   tst-setcontext2 test-a64l tst-qsort tst-system testmb2   \
28653a
+		   tst-setcontext2 test-a64l tst-qsort testmb2              \
28653a
 		   bug-strtod2 tst-atof1 tst-atof2 tst-strtod2		    \
28653a
 		   tst-rand48-2 tst-makecontext tst-strtod5		    \
28653a
 		   tst-qsort2 tst-makecontext2 tst-strtod6 tst-unsetenv1    \
28653a
@@ -92,6 +92,7 @@ tests		:= tst-strtol tst-strtod testmb testrand testsort testdiv   \
28653a
 tests-internal	:= tst-strtod1i tst-strtod3 tst-strtod4 tst-strtod5i \
28653a
 		   tst-tls-atexit tst-tls-atexit-nodelete
28653a
 tests-static	:= tst-secure-getenv
28653a
+tests-container := tst-system
28653a
 
28653a
 ifeq ($(build-hardcoded-path-in-tests),yes)
28653a
 tests += tst-empty-env
28653a
diff --git a/stdlib/tst-system.c b/stdlib/tst-system.c
28653a
index b61bd347df7ec46a..194e09828dd5c206 100644
28653a
--- a/stdlib/tst-system.c
28653a
+++ b/stdlib/tst-system.c
28653a
@@ -88,7 +88,8 @@ do_test (void)
28653a
 					 });
28653a
     support_capture_subprocess_check (&result, "system", 0, sc_allow_stderr);
28653a
 
28653a
-    char *returnerr = xasprintf ("%s: 1: %s: not found\n",
28653a
+    char *returnerr = xasprintf ("%s: execing %s failed: "
28653a
+				 "No such file or directory",
28653a
 				 basename(_PATH_BSHELL), cmd);
28653a
     TEST_COMPARE_STRING (result.err.buffer, returnerr);
28653a
     free (returnerr);
28653a
@@ -106,7 +107,8 @@ do_test (void)
28653a
 					 });
28653a
     support_capture_subprocess_check (&result, "system", 0, sc_allow_stderr);
28653a
 
28653a
-    char *returnerr = xasprintf ("%s: 1: %s: File name too long\n",
28653a
+    char *returnerr = xasprintf ("%s: execing %s failed: "
28653a
+				 "File name too long",
28653a
 				 basename(_PATH_BSHELL), cmd);
28653a
     TEST_COMPARE_STRING (result.err.buffer, returnerr);
28653a
     free (returnerr);
28653a
@@ -116,7 +118,7 @@ do_test (void)
28653a
     struct support_capture_subprocess result;
28653a
     result = support_capture_subprocess (call_system,
28653a
 					 &(struct args) {
28653a
-					   "kill -USR1 $$", 0, SIGUSR1
28653a
+					   "kill $$", 0, SIGTERM
28653a
 					 });
28653a
     support_capture_subprocess_check (&result, "system", 0, sc_allow_none);
28653a
   }
28653a
@@ -136,7 +138,7 @@ do_test (void)
28653a
     support_capture_subprocess_check (&result, "system", 0, sc_allow_none);
28653a
   }
28653a
 
28653a
-  TEST_COMPARE (system (":"), 0);
28653a
+  TEST_COMPARE (system (""), 0);
28653a
 
28653a
   return 0;
28653a
 }