7c0489
commit 279c68ce1336d84d82ce491a4b77086e574ba380
7c0489
Author: DJ Delorie <dj@redhat.com>
7c0489
Date:   Mon Feb 3 14:57:23 2020 -0500
7c0489
7c0489
    Run nptl/tst-pthread-getattr in a container
7c0489
    
7c0489
    See https://bugzilla.redhat.com/show_bug.cgi?id=1653942
7c0489
    
7c0489
    This test depends on the kernel's assignment of memory regions, but
7c0489
    running under ld.so explicitly changes those assignments, sometimes
7c0489
    sufficiently to cause the test to fail (esp with address space
7c0489
    randomization).
7c0489
    
7c0489
    The easiest way to "fix" the test, is to run it the way the user would
7c0489
    - without ld.so.  Running it in a container does that.
7c0489
    
7c0489
    Reviewed-by: Carlos O'Donell <carlos@redhat.com>
7c0489
7c0489
diff --git a/nptl/Makefile b/nptl/Makefile
7c0489
index b1003cf56b31ddfa..071c53866d14d2fe 100644
7c0489
--- a/nptl/Makefile
7c0489
+++ b/nptl/Makefile
7c0489
@@ -293,7 +293,7 @@ tests = tst-attr1 tst-attr2 tst-attr3 tst-default-attr \
7c0489
 	tst-exec1 tst-exec2 tst-exec3 tst-exec4 tst-exec5 \
7c0489
 	tst-exit1 tst-exit2 tst-exit3 \
7c0489
 	tst-stdio1 tst-stdio2 \
7c0489
-	tst-stack1 tst-stack2 tst-stack3 tst-stack4 tst-pthread-getattr \
7c0489
+	tst-stack1 tst-stack2 tst-stack3 tst-stack4 \
7c0489
 	tst-pthread-attr-affinity tst-pthread-mutexattr \
7c0489
 	tst-unload \
7c0489
 	tst-dlsym1 \
7c0489
@@ -322,6 +322,8 @@ tests = tst-attr1 tst-attr2 tst-attr3 tst-default-attr \
7c0489
 	tst-rwlock-pwn \
7c0489
 	tst-rwlock-tryrdlock-stall tst-rwlock-trywrlock-stall
7c0489
 
7c0489
+tests-container =  tst-pthread-getattr
7c0489
+
7c0489
 tests-internal := tst-rwlock19 tst-rwlock20 \
7c0489
 		  tst-sem11 tst-sem12 tst-sem13 \
7c0489
 		  tst-barrier5 tst-signal7 tst-mutex8 tst-mutex8-static \
7c0489
@@ -633,7 +635,7 @@ ifeq ($(build-shared),yes)
7c0489
 $(addprefix $(objpfx), \
7c0489
   $(filter-out $(tests-static) $(xtests-static) $(tests-reverse) \
7c0489
     $(tests-nolibpthread), \
7c0489
-    $(tests) $(tests-internal) $(xtests) $(test-srcs))): \
7c0489
+    $(tests) $(tests-internal) $(xtests) $(test-srcs) $(tests-container))): \
7c0489
 	$(objpfx)libpthread.so
7c0489
 $(objpfx)tst-unload: $(libdl)
7c0489
 # $(objpfx)../libc.so is used instead of $(common-objpfx)libc.so,