[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[SCM] Debian package checker branch, master, updated. 2.5.10-29-g4226711



The following commit has been merged in the master branch:
commit 42267110b79b705f3ef51a92d02cec92b048a173
Author: Niels Thykier <niels@thykier.net>
Date:   Thu Jul 12 23:58:12 2012 +0200

    t: Add test for binaries not linked against libc
    
    Signed-off-by: Niels Thykier <niels@thykier.net>

diff --git a/t/COVERAGE b/t/COVERAGE
index b36d138..26b7108 100644
--- a/t/COVERAGE
+++ b/t/COVERAGE
@@ -1,12 +1,10 @@
 Last generated 2012-07-12
-Coverage: 819/964 (84.96%), w. legacy tests: 921/964 (95.54%)
+Coverage: 822/964 (85.27%), w. legacy tests: 923/964 (95.75%)
 
 The following tags are not tested by the test suite:
 
 binaries binary-file-compressed-with-upx
-binaries library-not-linked-against-libc
 binaries ocaml-custom-executable
-binaries program-not-linked-against-libc
 
 cruft source-contains-prebuilt-windows-binary
 
@@ -62,7 +60,6 @@ The following tags are only tested by the legacy test suite:
 binaries binary-has-unneeded-section
 binaries binary-with-bad-dynamic-table
 binaries debug-file-should-use-detached-symbols
-binaries shared-lib-without-dependency-information
 binaries statically-linked-binary
 binaries unstripped-binary-or-object
 
@@ -242,7 +239,6 @@ debug
   changelog-file-missing-in-native-package
   changelog-should-not-mention-nmu
   debug-file-should-use-detached-symbols
-  shared-lib-without-dependency-information
   sharedobject-in-library-directory-missing-soname
   symbols-declared-but-not-shlib
   symbols-declares-dependency-on-other-package
diff --git a/t/tests/binaries-libc-link/debian/Makefile b/t/tests/binaries-libc-link/debian/Makefile
new file mode 100644
index 0000000..def6d3c
--- /dev/null
+++ b/t/tests/binaries-libc-link/debian/Makefile
@@ -0,0 +1,26 @@
+all: basic basic.1 libbasic-nodeps libbasic-nolibc
+
+basic.1: basic.pod
+	pod2man --section 1 < $< > $@
+
+basic: basic.o
+	ld -o$@ $< -lm $(LFLAGS)
+
+libbasic-nodeps: basic.o
+	ld --shared -o$@ $<
+
+libbasic-nolibc: basic.o
+	ld --shared -o$@ $< -lm
+
+install:
+	install -d $(DESTDIR)/usr/bin
+	install -d $(DESTDIR)/usr/lib/basic
+	install -d $(DESTDIR)/usr/share/man/man1
+	install -m 755 -c basic $(DESTDIR)/usr/bin/basic
+	install -m 755 -c libbasic-* $(DESTDIR)/usr/lib/basic
+	install -m 644 -c basic.1 $(DESTDIR)/usr/share/man/man1
+
+clean distclean:
+	rm -f basic libbasic-* basic.1
+
+check test:
diff --git a/t/tests/binaries-libc-link/debian/basic.c b/t/tests/binaries-libc-link/debian/basic.c
new file mode 100644
index 0000000..77bc677
--- /dev/null
+++ b/t/tests/binaries-libc-link/debian/basic.c
@@ -0,0 +1,5 @@
+int
+main(void)
+{
+  return 0;
+}
diff --git a/t/tests/binaries-libc-link/debian/basic.pod b/t/tests/binaries-libc-link/debian/basic.pod
new file mode 100644
index 0000000..d395e96
--- /dev/null
+++ b/t/tests/binaries-libc-link/debian/basic.pod
@@ -0,0 +1,14 @@
+=head1 NAME
+
+basic -- segfaults
+
+=head1 SYNOPSIS
+
+ basic
+
+=head1 DESCRIPTION
+
+It tends to seg. fault, but if it doesn't it will return 0 like
+/bin/true.
+
+=cut
diff --git a/t/tests/binaries-libc-link/desc b/t/tests/binaries-libc-link/desc
new file mode 100644
index 0000000..5df4d70
--- /dev/null
+++ b/t/tests/binaries-libc-link/desc
@@ -0,0 +1,9 @@
+Testname: binaries-libc-link
+Sequence: 6000
+Version: 1.0
+Description: Binaries not linked against libc
+Architecture: any
+Test-For:
+ library-not-linked-against-libc
+ program-not-linked-against-libc
+ shared-lib-without-dependency-information
diff --git a/t/tests/binaries-libc-link/post_test b/t/tests/binaries-libc-link/post_test
new file mode 100644
index 0000000..c156be8
--- /dev/null
+++ b/t/tests/binaries-libc-link/post_test
@@ -0,0 +1,3 @@
+# The LDFLAGS parts of the hardening flags are a bit difficult to pass
+# to the linker so just drop them.
+/hardening-no-/ d
diff --git a/t/tests/binaries-libc-link/tags b/t/tests/binaries-libc-link/tags
new file mode 100644
index 0000000..e43f702
--- /dev/null
+++ b/t/tests/binaries-libc-link/tags
@@ -0,0 +1,3 @@
+W: binaries-libc-link: library-not-linked-against-libc usr/lib/basic/libbasic-nolibc
+W: binaries-libc-link: program-not-linked-against-libc usr/bin/basic
+W: binaries-libc-link: shared-lib-without-dependency-information usr/lib/basic/libbasic-nodeps

-- 
Debian package checker


Reply to: