From 23abbfa633f7e017a7939aa3966e0d7d24df480d Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Thu, 28 Aug 2014 12:31:23 +0200 Subject: test: NPTL: sync WRITE_BUFFER_SIZE with glibc test Test on Linux 3.16.1 in Qemu ARM fails with: TEST_EXEC nptl/ tst-cancel4 ret == 1 ; expected_ret == 0 make[1]: *** [tst-cancel4.exe] Error 1 The output of failed test is: minimum write buffer size too large ../Test.mak:89: recipe for target 'tst-cancel4.exe' failed Signed-off-by: Waldemar Brodkorb Signed-off-by: Bernhard Reutner-Fischer --- test/nptl/tst-cancel4.c | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/nptl/tst-cancel4.c b/test/nptl/tst-cancel4.c index e7119589f..53abf83ee 100644 --- a/test/nptl/tst-cancel4.c +++ b/test/nptl/tst-cancel4.c @@ -83,7 +83,30 @@ static pthread_barrier_t b2; # define IPC_ADDVAL 0 #endif -#define WRITE_BUFFER_SIZE 4096 +/* The WRITE_BUFFER_SIZE value needs to be chosen such that if we set + the socket send buffer size to '1', a write of this size on that + socket will block. + + The Linux kernel imposes a minimum send socket buffer size which + has changed over the years. As of Linux 3.10 the value is: + + 2 * (2048 + SKB_DATA_ALIGN(sizeof(struct sk_buff))) + + which is attempting to make sure that with standard MTUs, + TCP can always queue up at least 2 full sized packets. + + Furthermore, there is logic in the socket send paths that + will allow one more packet (of any size) to be queued up as + long as some socket buffer space remains. Blocking only + occurs when we try to queue up a new packet and the send + buffer space has already been fully consumed. + + Therefore we must set this value to the largest possible value of + the formula above (and since it depends upon the size of "struct + sk_buff", it is dependent upon machine word size etc.) plus some + slack space. */ + +#define WRITE_BUFFER_SIZE 16384 /* Cleanup handling test. */ static int cl_called; @@ -758,7 +781,6 @@ tf_sigpause (void *arg) pthread_cleanup_push (cl, NULL); - /* Just for fun block the cancellation signal. */ sigpause (SIGCANCEL); pthread_cleanup_pop (0); -- cgit v1.2.3 From ad687dda63a43d5ea5ed834475cec5e0a618ebf5 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Thu, 28 Aug 2014 12:31:24 +0200 Subject: test: do not depend on compile When you cross-compile the testsuite and then try to run on a system without gcc/binutils it would be nice if no compiling or linking is tried. Refresh test/README (suggested by Khem) Signed-off-by: Waldemar Brodkorb Signed-off-by: Bernhard Reutner-Fischer --- test/Makefile | 2 +- test/README | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'test') diff --git a/test/Makefile b/test/Makefile index b759bf9ea..787c530d4 100644 --- a/test/Makefile +++ b/test/Makefile @@ -45,7 +45,7 @@ endif test check all: run -run: compile subdirs_run +run: subdirs_run compile: $(top_builddir)$(LOCAL_INSTALL_PATH) subdirs_compile diff --git a/test/README b/test/README index 8fb12d9a7..28225b063 100644 --- a/test/README +++ b/test/README @@ -5,12 +5,11 @@ Following make targets are avaialable make compile -This will compile and link the tests +This will compile and link the tests. make run -This will check for binaries, if they are not there it -will call 'compile' target, then it will execute all the tests. +This will execute all the tests. make check make all -- cgit v1.2.3 From 697dbb016e4bc63d20a7c871a9580e7dce32d1b0 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Thu, 28 Aug 2014 12:31:29 +0200 Subject: test: get out of the endless while loop, when bind failed When bind() fails in this test, then /tmp get filled up with temp files and upcoming tests will fail, because they need to create temp files, too. Better exit from the loop. Test still needs to be investigated to fix the failing bind(). Signed-off-by: Waldemar Brodkorb Signed-off-by: Bernhard Reutner-Fischer --- test/nptl/tst-cancel4.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'test') diff --git a/test/nptl/tst-cancel4.c b/test/nptl/tst-cancel4.c index 53abf83ee..4ba40450e 100644 --- a/test/nptl/tst-cancel4.c +++ b/test/nptl/tst-cancel4.c @@ -1015,6 +1015,8 @@ tf_accept (void *arg) if (++tries > 10) { printf ("%s: too many unsuccessful bind calls\n", __FUNCTION__); + /* prevent endless loop, when bind fails forever */ + exit (1); } strcpy (sun.sun_path, "/tmp/tst-cancel4-socket-1-XXXXXX"); -- cgit v1.2.3 From 512fd3804b963a6738ce59d25dd44a7d9143b8b7 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Thu, 28 Aug 2014 12:31:30 +0200 Subject: test: sync with glibc, use do_test This breaks out of a deadlock, which occurs when testing for powerpc. (qemu) Otherwise the test suite does not finish. Signed-off-by: Waldemar Brodkorb Signed-off-by: Bernhard Reutner-Fischer --- test/nptl/tst-sem3.c | 33 ++++++++++++++++++--------------- test/nptl/tst-sem4.c | 7 +++++-- 2 files changed, 23 insertions(+), 17 deletions(-) (limited to 'test') diff --git a/test/nptl/tst-sem3.c b/test/nptl/tst-sem3.c index d14f6f633..7b75e29e2 100644 --- a/test/nptl/tst-sem3.c +++ b/test/nptl/tst-sem3.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002, 2003 Free Software Foundation, Inc. +/* Copyright (C) 2002-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 2002. @@ -28,7 +28,7 @@ int -main (void) +do_test (void) { size_t ps = sysconf (_SC_PAGESIZE); char tmpfname[] = "/tmp/tst-sem3.XXXXXX"; @@ -43,7 +43,7 @@ main (void) if (fd == -1) { printf ("cannot open temporary file: %m\n"); - exit (1); + return 1; } /* Make sure it is always removed. */ @@ -56,14 +56,14 @@ main (void) if (write (fd, data, ps) != (ssize_t) ps) { puts ("short write"); - exit (1); + return 1; } mem = mmap (NULL, ps, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); if (mem == MAP_FAILED) { printf ("mmap failed: %m\n"); - exit (1); + return 1; } s = (sem_t *) (((uintptr_t) mem + __alignof (sem_t)) @@ -73,25 +73,25 @@ main (void) if (sem_init (s, 1, 1) == -1) { puts ("init failed"); - exit (1); + return 1; } if (TEMP_FAILURE_RETRY (sem_wait (s)) == -1) { puts ("1st wait failed"); - exit (1); + return 1; } errno = 0; if (TEMP_FAILURE_RETRY (sem_trywait (s)) != -1) { puts ("trywait succeeded"); - exit (1); + return 1; } else if (errno != EAGAIN) { puts ("trywait didn't return EAGAIN"); - exit (1); + return 1; } *p = 0; @@ -101,7 +101,7 @@ main (void) if (pid == -1) { puts ("fork failed"); - exit (1); + return 1; } else if (pid == 0) { @@ -109,13 +109,13 @@ main (void) if ((*p)++ != 0) { puts ("child: *p != 0"); - exit (1); + return 1; } if (sem_post (s) == -1) { puts ("child: 1st post failed"); - exit (1); + return 1; } puts ("child done"); @@ -125,17 +125,20 @@ main (void) if (TEMP_FAILURE_RETRY (sem_wait (s)) == -1) { printf ("parent: 2nd wait failed: %m\n"); - exit (1); + return 1; } if (*p != 1) { puts ("*p != 1"); - exit (1); + return 1; } puts ("parent done"); } - exit (0); + return 0; } + +#define TEST_FUNCTION do_test () +#include "../test-skeleton.c" diff --git a/test/nptl/tst-sem4.c b/test/nptl/tst-sem4.c index 125759bab..72ed97d37 100644 --- a/test/nptl/tst-sem4.c +++ b/test/nptl/tst-sem4.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002 Free Software Foundation, Inc. +/* Copyright (C) 2002-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 2002. @@ -32,7 +32,7 @@ remove_sem (int status, void *arg) int -main (void) +do_test (void) { sem_t *s; sem_t *s2; @@ -144,3 +144,6 @@ main (void) return 0; } + +#define TEST_FUNCTION do_test () +#include "../test-skeleton.c" -- cgit v1.2.3 From 88041f133f06d81a9bf6c72fc6e41a604eddf4b8 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Thu, 28 Aug 2014 12:31:26 +0200 Subject: test: disable test for systems without FPU This test fails for systems without fpu. For example m68k build for non-mmu/non-fpu systems fail. Signed-off-by: Waldemar Brodkorb Signed-off-by: Bernhard Reutner-Fischer --- test/math/Makefile.in | 3 +++ 1 file changed, 3 insertions(+) (limited to 'test') diff --git a/test/math/Makefile.in b/test/math/Makefile.in index d241baa9e..147d579f4 100644 --- a/test/math/Makefile.in +++ b/test/math/Makefile.in @@ -13,6 +13,9 @@ endif ifeq ($(DO_C99_MATH),) TESTS_DISABLED += test-float test-ifloat test-double test-idouble rint signgam ilogb endif +ifeq ($(UCLIBC_HAS_FPU),) +TESTS_DISABLED += test-fpucw +endif DODIFF_rint := 1 DODIFF_signgam := 1 -- cgit v1.2.3 From ff48662bbadd3d49fabe6fdfeb8e8181d4c80b06 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Thu, 4 Sep 2014 13:12:52 +0200 Subject: test: disable librt shmtest on non-MMU systems This test fails for non-MMU systems, because it uses fork() Thanks to Waldemar Brodkorb! Signed-off-by: Bernhard Reutner-Fischer --- test/librt/Makefile.in | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'test') diff --git a/test/librt/Makefile.in b/test/librt/Makefile.in index 15ecbae5b..f25522cbe 100644 --- a/test/librt/Makefile.in +++ b/test/librt/Makefile.in @@ -2,3 +2,7 @@ # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. LDFLAGS_shmtest := -lrt + +ifeq ($(ARCH_USE_MMU),) +TESTS_DISABLED := shmtest +endif -- cgit v1.2.3 From bc23c6440d34d85c8e6bb04656beb233bba47cb8 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Thu, 4 Sep 2014 13:16:35 +0200 Subject: test: wcsftime depends on XLOCALE Thanks to Waldemar Brodkorb for noticing. Signed-off-by: Bernhard Reutner-Fischer --- test/time/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test') diff --git a/test/time/Makefile.in b/test/time/Makefile.in index 05f73a45d..02c8d910c 100644 --- a/test/time/Makefile.in +++ b/test/time/Makefile.in @@ -5,7 +5,7 @@ TESTS_DISABLED := bug-asctime bug-asctime_r time tst-mktime2 tst-posixtz \ tst-strftime tst-strptime tst-timezone ifneq ($(UCLIBC_HAS_XLOCALE),y) -TESTS_DISABLED += tst-ftime_l +TESTS_DISABLED += tst-ftime_l tst_wcsftime endif CFLAGS_tst-strptime2 := -std=c99 -- cgit v1.2.3