Blame SOURCES/gdb-6.7-testsuite-stable-results.patch

2c2fa1
gdb/testsuite/gdb.base/fileio.c:
2c2fa1
gdb/testsuite/gdb.base/fileio.exp:
2c2fa1
2007-12-08  Jan Kratochvil  <jan.kratochvil@redhat.com>
2c2fa1
2c2fa1
	* gdb.base/fileio.c (ROOTSUBDIR): New macro.
2c2fa1
	(main): CHDIR into ROOTSUBDIR.  CHOWN ROOTSUBDIR and CHDIR into
2c2fa1
	ROOTSUBDIR if we are being run as root.
2c2fa1
	* gdb.base/fileio.exp: Change the startup and finish cleanup.
2c2fa1
	Change the test file reference to be into the `fileio.dir' directory.
2c2fa1
2c2fa1
2c2fa1
sources/gdb/testsuite/gdb.base/dump.exp:
2c2fa1
Found on RHEL-5.s390x.
2c2fa1
2c2fa1
2c2fa1
gdb-6.8.50.20090209/gdb/testsuite/gdb.base/auxv.exp:
2c2fa1
random FAIL: gdb.base/auxv.exp: matching auxv data from live and gcore
2c2fa1
2c2fa1
2c2fa1
gdb-6.8.50.20090209/gdb/testsuite/gdb.base/annota1.exp:
2c2fa1
frames-invalid can happen asynchronously.
2c2fa1
2c2fa1
Index: gdb-7.4.50.20120103/gdb/testsuite/gdb.base/fileio.c
2c2fa1
===================================================================
2c2fa1
--- gdb-7.4.50.20120103.orig/gdb/testsuite/gdb.base/fileio.c	2009-10-01 17:39:13.000000000 +0200
2c2fa1
+++ gdb-7.4.50.20120103/gdb/testsuite/gdb.base/fileio.c	2012-01-03 15:21:28.122729249 +0100
2c2fa1
@@ -58,6 +58,8 @@ system (const char * string);
2c2fa1
 1) Invalid string/command. -  returns 127.  */
2c2fa1
 static const char *strerrno (int err);
2c2fa1
 
2c2fa1
+#define ROOTSUBDIR "fileio.dir"
2c2fa1
+
2c2fa1
 #define FILENAME    "foo.fileio.test"
2c2fa1
 #define RENAMED     "bar.fileio.test"
2c2fa1
 #define NONEXISTANT "nofoo.fileio.test"
2c2fa1
@@ -542,6 +544,37 @@ strerrno (int err)
2c2fa1
 int
2c2fa1
 main ()
2c2fa1
 {
2c2fa1
+  /* ROOTSUBDIR is already prepared by fileio.exp.  We use it for easy cleanup
2c2fa1
+     (by fileio.exp) if we are run by multiple users in the same directory.  */
2c2fa1
+
2c2fa1
+  if (chdir (ROOTSUBDIR) != 0)
2c2fa1
+    {
2c2fa1
+      printf ("chdir " ROOTSUBDIR ": %s\n", strerror (errno));
2c2fa1
+      exit (1);
2c2fa1
+    }
2c2fa1
+
2c2fa1
+  /* These tests
2c2fa1
+       Open for write but no write permission returns EACCES
2c2fa1
+       Unlinking a file in a directory w/o write access returns EACCES
2c2fa1
+     fail if we are being run as root - drop the privileges here.  */
2c2fa1
+
2c2fa1
+  if (geteuid () == 0)
2c2fa1
+    {
2c2fa1
+      uid_t uid = 99;
2c2fa1
+
2c2fa1
+      if (chown (".", uid, uid) != 0)
2c2fa1
+	{
2c2fa1
+	  printf ("chown %d.%d " ROOTSUBDIR ": %s\n", (int) uid, (int) uid,
2c2fa1
+		  strerror (errno));
2c2fa1
+	  exit (1);
2c2fa1
+	}
2c2fa1
+      if (setuid (uid) || geteuid () == 0)
2c2fa1
+	{
2c2fa1
+	  printf ("setuid %d: %s\n", (int) uid, strerror (errno));
2c2fa1
+	  exit (1);
2c2fa1
+	}
2c2fa1
+    }
2c2fa1
+
2c2fa1
   /* Don't change the order of the calls.  They partly depend on each other */
2c2fa1
   test_open ();
2c2fa1
   test_write ();
2c2fa1
Index: gdb-7.4.50.20120103/gdb/testsuite/gdb.base/fileio.exp
2c2fa1
===================================================================
2c2fa1
--- gdb-7.4.50.20120103.orig/gdb/testsuite/gdb.base/fileio.exp	2011-12-26 12:24:55.000000000 +0100
2c2fa1
+++ gdb-7.4.50.20120103/gdb/testsuite/gdb.base/fileio.exp	2012-01-03 15:22:02.716601956 +0100
2c2fa1
@@ -42,8 +42,8 @@ if [get_compiler_info ${binfile}] {
2c2fa1
     return -1;
2c2fa1
 }
2c2fa1
 
2c2fa1
-remote_exec build {sh -xc test\ -r\ dir2.fileio.test\ &&\ chmod\ -f\ +w\ dir2.fileio.test}
2c2fa1
-remote_exec build {sh -xc rm\ -rf\ *.fileio.test}
2c2fa1
+remote_exec build {sh -xc rm\ -rf\ fileio.dir}
2c2fa1
+remote_exec build {sh -xc mkdir\ -m777\ fileio.dir}
2c2fa1
 
2c2fa1
 set oldtimeout $timeout
2c2fa1
 set timeout [expr "$timeout + 60"]
2c2fa1
@@ -85,7 +85,7 @@ gdb_test continue \
2c2fa1
 
2c2fa1
 gdb_test "continue" ".*" ""
2c2fa1
 
2c2fa1
-catch "system \"chmod -f -w nowrt.fileio.test\""
2c2fa1
+catch "system \"chmod -f -w fileio.dir/nowrt.fileio.test\""
2c2fa1
 
2c2fa1
 gdb_test continue \
2c2fa1
 "Continuing\\..*open 5:.*EACCES$stop_msg" \
2c2fa1
@@ -251,8 +251,8 @@ gdb_exit
2c2fa1
 # Wait till GDB really exits.
2c2fa1
 sleep 1
2c2fa1
 
2c2fa1
-remote_exec build {sh -xc test\ -r\ dir2.fileio.test\ &&\ chmod\ -f\ +w\ dir2.fileio.test}
2c2fa1
-remote_exec build {sh -xc rm\ -rf\ *.fileio.test}
2c2fa1
+remote_exec build {sh -xc test\ -r\ fileio.dir/dir2.fileio.test\ &&\ chmod\ -f\ +w\ fileio.dir/dir2.fileio.test}
2c2fa1
+remote_exec build {sh -xc rm\ -rf\ fileio.dir}
2c2fa1
 
2c2fa1
 set timeout $oldtimeout
2c2fa1
 return 0