about summary refs log tree commit diff
path: root/posix
diff options
context:
space:
mode:
Diffstat (limited to 'posix')
-rw-r--r--posix/Makefile6
-rw-r--r--posix/bug-ga2.c13
-rw-r--r--posix/bug-ga2.root/etc/hosts1
-rw-r--r--posix/bug-ga2.root/etc/nsswitch.conf2
-rw-r--r--posix/bug-ga2.root/etc/services1
5 files changed, 14 insertions, 9 deletions
diff --git a/posix/Makefile b/posix/Makefile
index 693082ed28..fa2d0675cd 100644
--- a/posix/Makefile
+++ b/posix/Makefile
@@ -106,7 +106,8 @@ tests		:= test-errno tstgetopt testfnm runtests runptests \
 tests-internal	:= bug-regex5 bug-regex20 bug-regex33 \
 		   tst-rfc3484 tst-rfc3484-2 tst-rfc3484-3 \
 		   tst-glob_lstat_compat tst-spawn4-compat
-xtests		:= bug-ga2 tst-getaddrinfo4 tst-getaddrinfo5
+tests-container := bug-ga2
+xtests		:= tst-getaddrinfo4 tst-getaddrinfo5
 ifeq (yes,$(build-shared))
 test-srcs	:= globtest
 tests           += wordexp-test tst-exec tst-spawn tst-spawn2 tst-spawn3
@@ -153,8 +154,7 @@ tests-special += $(objpfx)bug-regex2-mem.out $(objpfx)bug-regex14-mem.out \
 		 $(objpfx)tst-boost-mem.out $(objpfx)tst-getconf.out \
 		 $(objpfx)bug-glob2-mem.out $(objpfx)tst-vfork3-mem.out \
 		 $(objpfx)tst-fnmatch-mem.out $(objpfx)bug-regex36-mem.out \
-		 $(objpfx)tst-glob-tilde-mem.out
-xtests-special += $(objpfx)bug-ga2-mem.out
+		 $(objpfx)tst-glob-tilde-mem.out $(objpfx)bug-ga2-mem.out
 endif
 
 include ../Rules
diff --git a/posix/bug-ga2.c b/posix/bug-ga2.c
index 5ea759b8ce..712e40de48 100644
--- a/posix/bug-ga2.c
+++ b/posix/bug-ga2.c
@@ -3,9 +3,10 @@
 #include <netdb.h>
 #include <stdio.h>
 #include <string.h>
+#include <support/check.h>
 
-int
-main (void)
+static int
+do_test (void)
 {
   struct addrinfo hints, *res;
   int i, ret;
@@ -20,11 +21,11 @@ main (void)
       ret = getaddrinfo ("www.gnu.org", "http", &hints, &res);
 
       if (ret)
-	{
-	  printf ("%s\n", gai_strerror (ret));
-	  return 1;
-	}
+	FAIL_EXIT1 ("%s\n", gai_strerror (ret));
+
       freeaddrinfo (res);
     }
   return 0;
 }
+
+#include <support/test-driver.c>
diff --git a/posix/bug-ga2.root/etc/hosts b/posix/bug-ga2.root/etc/hosts
new file mode 100644
index 0000000000..65151f27f5
--- /dev/null
+++ b/posix/bug-ga2.root/etc/hosts
@@ -0,0 +1 @@
+192.0.2.1 www.gnu.org
diff --git a/posix/bug-ga2.root/etc/nsswitch.conf b/posix/bug-ga2.root/etc/nsswitch.conf
new file mode 100644
index 0000000000..fd2edb44dc
--- /dev/null
+++ b/posix/bug-ga2.root/etc/nsswitch.conf
@@ -0,0 +1,2 @@
+services: files
+hosts:    files
diff --git a/posix/bug-ga2.root/etc/services b/posix/bug-ga2.root/etc/services
new file mode 100644
index 0000000000..94d4f07612
--- /dev/null
+++ b/posix/bug-ga2.root/etc/services
@@ -0,0 +1 @@
+http 80/tcp