[Reproducible-builds] [misc] 01/02: test-reproducibility: stop trying to reproduce the time
Jérémy Bobbio
lunar at moszumanska.debian.org
Mon Sep 1 00:11:46 UTC 2014
This is an automated email from the git hooks/post-receive script.
lunar pushed a commit to branch master
in repository misc.
commit f4146ee73d3538213efb144bf02899b5f8f162bc
Author: Jérémy Bobbio <lunar at debian.org>
Date: Sun Aug 31 22:23:42 2014 +0000
test-reproducibility: stop trying to reproduce the time
libfaketime has been too unreliable for anything complex… meh :(
---
test-reproducibility/t/all | 1 -
test-reproducibility/t/test-script | 6 ------
test-reproducibility/test-reproducibility | 26 ++++++++++----------------
3 files changed, 10 insertions(+), 23 deletions(-)
diff --git a/test-reproducibility/t/all b/test-reproducibility/t/all
index 0fdf000..fbd69e2 100755
--- a/test-reproducibility/t/all
+++ b/test-reproducibility/t/all
@@ -1,6 +1,5 @@
#!/bin/sh
-date -u
pwd
id
hostname
diff --git a/test-reproducibility/t/test-script b/test-reproducibility/t/test-script
index 1ce73e2..aed9b02 100755
--- a/test-reproducibility/t/test-script
+++ b/test-reproducibility/t/test-script
@@ -9,11 +9,6 @@ OUTPUT="$(../test-reproducibility echo)"
assert test $? -eq 0
assert test "$OUTPUT" = "OK"
-echo "Testing timestamps."
-OUTPUT="$(../test-reproducibility date -u)"
-assert test $? -eq 1
-assert test "$OUTPUT" = "ERRORS: timestamps"
-
echo "Testing build path."
OUTPUT="$(../test-reproducibility pwd)"
assert test $? -eq 1
@@ -38,7 +33,6 @@ 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 "timestamps"
echo "$OUTPUT" | assert grep -q -w "build-path"
echo "$OUTPUT" | assert grep -q -w "usernames"
echo "$OUTPUT" | assert grep -q -w "hostname"
diff --git a/test-reproducibility/test-reproducibility b/test-reproducibility/test-reproducibility
index 5c19411..fceb743 100755
--- a/test-reproducibility/test-reproducibility
+++ b/test-reproducibility/test-reproducibility
@@ -1,14 +1,17 @@
#!/bin/sh
# test-reproducibility: run the same command several time, varying only one
-# factor each time amongst time, current directory, current user and group,
+# 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 faketime proot sudo unshare; do
+for cmd in proot sudo unshare; do
if ! type "$cmd" >/dev/null 2>&1; then
echo "$cmd is missing." >&2
exit 254
@@ -40,18 +43,14 @@ else
fi
run_baseline() {
- TEST_REPRODUCIBILITY_STAGE="baseline" faketime -f "@$NOW i0,1" $COMMAND
-}
-
-run_different_time() {
- TEST_REPRODUCIBILITY_STAGE="timestamps" $COMMAND
+ TEST_REPRODUCIBILITY_STAGE="baseline" $COMMAND
}
run_different_path() {
local parent
parent="$(dirname "$PWD")"
- faketime -f "@$NOW i0,1" proot -b "$PWD:$parent/different" sh -c "cd $parent/different && TEST_REPRODUCIBILITY_STAGE="build-path" $COMMAND"
+ proot -b "$PWD:$parent/different" sh -c "cd $parent/different && TEST_REPRODUCIBILITY_STAGE="build-path" $COMMAND"
}
run_different_user() {
@@ -59,34 +58,30 @@ run_different_user() {
new_uid=$(($(id -u) + 1))
new_gid=$(($(id -g) + 1))
- TEST_REPRODUCIBILITY_STAGE="usernames" faketime -f "@$NOW i0,1" proot -i "$new_uid:$new_gid" $COMMAND
+ 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 faketime -f \"@$NOW i0,1\" $COMMAND'"
+ 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" faketime -f "@$NOW i0,1" proot -k "${current_kernel}+different" $COMMAND
+ TEST_REPRODUCIBILITY_STAGE="kernel-version" proot -k "${current_kernel}+different" $COMMAND
}
(run_baseline > "$TEST_REPRODUCIBILITY_TMPDIR/output-baseline")
-(run_different_time > "$TEST_REPRODUCIBILITY_TMPDIR/output-different-time")
(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-time" >/dev/null; then
- ERRORS="${ERRORS:+$ERRORS }timestamps"
-fi
if ! diff -q "$TEST_REPRODUCIBILITY_TMPDIR/output-baseline" "$TEST_REPRODUCIBILITY_TMPDIR/output-different-path" >/dev/null; then
ERRORS="${ERRORS:+$ERRORS }build-path"
fi
@@ -102,7 +97,6 @@ fi
if [ "$ERRORS" ]; then
echo "ERRORS: $ERRORS"
- diff -u "$TEST_REPRODUCIBILITY_TMPDIR/output-baseline" "$TEST_REPRODUCIBILITY_TMPDIR/output-different-time" || true
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
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/misc.git
More information about the Reproducible-builds
mailing list