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