[misc] 01/05: Drop test-reproducibility.

Chris Lamb chris at chris-lamb.co.uk
Wed Nov 1 20:40:25 UTC 2017


This is an automated email from the git hooks/post-receive script.

lamby pushed a commit to branch master
in repository misc.

commit 8c9765734553a12944a7f689b84a0b7580228406
Author: Chris Lamb <lamby at debian.org>
Date:   Wed Nov 1 21:36:17 2017 +0100

    Drop test-reproducibility.
---
 test-reproducibility/build-and-compare    |  17 -----
 test-reproducibility/t/all                |   6 --
 test-reproducibility/t/test-script        |  42 ------------
 test-reproducibility/test-reproducibility | 108 ------------------------------
 4 files changed, 173 deletions(-)

diff --git a/test-reproducibility/build-and-compare b/test-reproducibility/build-and-compare
deleted file mode 100755
index 7b99254..0000000
--- a/test-reproducibility/build-and-compare
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/bin/sh
-# build-and-compare: sample script to build a package and then compare
-# the output with the base line.
-#
-# Copyright © 2014 Lunar <lunar at debian.org>
-# Licensed under WTFPL — http://www.wtfpl.net/txt/copying/
-
-test "$TEST_REPRODUCIBILITY_STAGE" || exit 1
-
-rm -rf source
-dpkg-source -x *.dsc source
-cd source
-dpkg-buildpackage -b -j1 >/dev/null
-rm -rf ../builds/$TEST_REPRODUCIBILITY_STAGE
-mkdir -p ../builds/$TEST_REPRODUCIBILITY_STAGE
-dcmd cp ../*.changes ../builds/$TEST_REPRODUCIBILITY_STAGE
-debbindiff ../builds/baseline/*.changes ../builds/$TEST_REPRODUCIBILITY_STAGE/*.changes
diff --git a/test-reproducibility/t/all b/test-reproducibility/t/all
deleted file mode 100755
index fbd69e2..0000000
--- a/test-reproducibility/t/all
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-
-pwd
-id
-hostname
-uname -r
diff --git a/test-reproducibility/t/test-script b/test-reproducibility/t/test-script
deleted file mode 100755
index aed9b02..0000000
--- a/test-reproducibility/t/test-script
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/bin/sh
-
-assert() {
-	"$@" || { echo "'$@' failed." && exit 1; }
-}
-
-echo "Testing happy path."
-OUTPUT="$(../test-reproducibility echo)"
-assert test $? -eq 0
-assert test "$OUTPUT" = "OK"
-
-echo "Testing build path."
-OUTPUT="$(../test-reproducibility pwd)"
-assert test $? -eq 1
-assert test "$OUTPUT" = "ERRORS: build-path"
-
-echo "Testing usernames."
-OUTPUT="$(../test-reproducibility id)"
-assert test $? -eq 1
-assert test "$OUTPUT" = "ERRORS: usernames"
-
-echo "Testing hostname."
-OUTPUT="$(../test-reproducibility hostname)"
-assert test $? -eq 1
-assert test "$OUTPUT" = "ERRORS: hostname"
-
-echo "Testing kernel version."
-OUTPUT="$(../test-reproducibility uname -r)"
-assert test $? -eq 1
-assert test "$OUTPUT" = "ERRORS: kernel-version"
-
-echo "Testing all of the above"
-OUTPUT="$(../test-reproducibility ./all)"
-assert test $? -eq 1
-echo "$OUTPUT" | assert grep -q "^ERRORS:"
-echo "$OUTPUT" | assert grep -q -w "build-path"
-echo "$OUTPUT" | assert grep -q -w "usernames"
-echo "$OUTPUT" | assert grep -q -w "hostname"
-echo "$OUTPUT" | assert grep -q -w "kernel-version"
-
-echo "All good."
-exit 0
diff --git a/test-reproducibility/test-reproducibility b/test-reproducibility/test-reproducibility
deleted file mode 100755
index fceb743..0000000
--- a/test-reproducibility/test-reproducibility
+++ /dev/null
@@ -1,108 +0,0 @@
-#!/bin/sh
-# test-reproducibility: run the same command several time, varying only one
-# factor each time amongst current directory, current user and group,
-# hostname and kernel version.
-#
-# The time is not reproduced and will vary with every execution as anything a
-# bit complex will not work with libfaketime. *sigh*
-#
-# Copyright © 2014 Lunar <lunar at debian.org>
-# Licensed under WTFPL — http://www.wtfpl.net/txt/copying/
-
-set -e
-
-for cmd in proot sudo unshare; do
-	if ! type "$cmd" >/dev/null 2>&1; then
-		echo "$cmd is missing." >&2
-		exit 254
-	fi
-done
-
-if [ $# -eq 0 ]; then
-	echo "Usage: $0 <script|-c command ...>" >&2
-	exit 253
-fi
-
-NOW="$(date +'%Y-%m-%d %H:%M:%S')"
-
-TEST_REPRODUCIBILITY_TMPDIR="$(mktemp -d)"
-if ! [ -d "$TEST_REPRODUCIBILITY_TMPDIR" ]; then
-	echo "Unable to create temporary directory." >&2
-	exit 254
-fi
-trap "rm -rf '$TEST_REPRODUCIBILITY_TMPDIR'" EXIT
-
-if [ "$1" = "-c" ]; then
-	shift
-	COMMAND="$TEST_REPRODUCIBILITY_TMPDIR/command"
-	echo "#!/bin/sh" > "$COMMAND"
-	echo "$@" >> "$COMMAND"
-	chmod +x "$COMMAND"
-else
-	COMMAND="$1"
-fi
-
-run_baseline() {
-	TEST_REPRODUCIBILITY_STAGE="baseline" $COMMAND
-}
-
-run_different_path() {
-	local parent
-
-	parent="$(dirname "$PWD")"
-	proot -b "$PWD:$parent/different" sh -c "cd $parent/different && TEST_REPRODUCIBILITY_STAGE="build-path" $COMMAND"
-}
-
-run_different_user() {
-	local new_uid new_gid
-
-	new_uid=$(($(id -u) + 1))
-	new_gid=$(($(id -g) + 1))
-	TEST_REPRODUCIBILITY_STAGE="usernames" proot -i "$new_uid:$new_gid" $COMMAND
-}
-
-run_different_hostname() {
-	local current_user
-
-	current_user="$(whoami)"
-	sudo unshare --uts -- sh -c "hostname different-hostname && su $current_user -c 'TEST_REPRODUCIBILITY_STAGE=hostname $COMMAND'"
-}
-
-run_different_kernel() {
-	local current_kernel
-
-	current_kernel="$(uname -r)"
-	TEST_REPRODUCIBILITY_STAGE="kernel-version" proot -k "${current_kernel}+different" $COMMAND
-}
-
-(run_baseline > "$TEST_REPRODUCIBILITY_TMPDIR/output-baseline")
-(run_different_path > "$TEST_REPRODUCIBILITY_TMPDIR/output-different-path")
-(run_different_user > "$TEST_REPRODUCIBILITY_TMPDIR/output-different-user")
-(run_different_hostname > "$TEST_REPRODUCIBILITY_TMPDIR/output-different-hostname")
-(run_different_kernel > "$TEST_REPRODUCIBILITY_TMPDIR/output-different-kernel")
-
-ERRORS=""
-if ! diff -q "$TEST_REPRODUCIBILITY_TMPDIR/output-baseline" "$TEST_REPRODUCIBILITY_TMPDIR/output-different-path" >/dev/null; then
-	ERRORS="${ERRORS:+$ERRORS }build-path"
-fi
-if ! diff -q "$TEST_REPRODUCIBILITY_TMPDIR/output-baseline" "$TEST_REPRODUCIBILITY_TMPDIR/output-different-user" >/dev/null; then
-	ERRORS="${ERRORS:+$ERRORS }usernames"
-fi
-if ! diff -q "$TEST_REPRODUCIBILITY_TMPDIR/output-baseline" "$TEST_REPRODUCIBILITY_TMPDIR/output-different-hostname" >/dev/null; then
-	ERRORS="${ERRORS:+$ERRORS }hostname"
-fi
-if ! diff -q "$TEST_REPRODUCIBILITY_TMPDIR/output-baseline" "$TEST_REPRODUCIBILITY_TMPDIR/output-different-kernel" >/dev/null; then
-	ERRORS="${ERRORS:+$ERRORS }kernel-version"
-fi
-
-if [ "$ERRORS" ]; then
-	echo "ERRORS: $ERRORS"
-	diff -u "$TEST_REPRODUCIBILITY_TMPDIR/output-baseline" "$TEST_REPRODUCIBILITY_TMPDIR/output-different-path" || true
-	diff -u "$TEST_REPRODUCIBILITY_TMPDIR/output-baseline" "$TEST_REPRODUCIBILITY_TMPDIR/output-different-user" || true
-	diff -u "$TEST_REPRODUCIBILITY_TMPDIR/output-baseline" "$TEST_REPRODUCIBILITY_TMPDIR/output-different-hostname" || true
-	diff -u "$TEST_REPRODUCIBILITY_TMPDIR/output-baseline" "$TEST_REPRODUCIBILITY_TMPDIR/output-different-kernel" || true
-	exit 1
-fi
-
-echo "OK"
-exit 0

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/misc.git



More information about the Reproducible-commits mailing list