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