Unverified Commit b814ba1b authored by Mattia Rizzolo's avatar Mattia Rizzolo
Browse files

reproducible: expand the check for the wrong future to also detect when we...


reproducible: expand the check for the wrong future to also detect when we accidentally came back to the present

Signed-off-by: Mattia Rizzolo's avatarMattia Rizzolo <mattia@debian.org>
parent db5ca26e
Loading
Loading
Loading
Loading
+25 −8
Original line number Diff line number Diff line
#!/bin/bash
# vim: set noexpandtab:

# Copyright 2014-2017 Holger Levsen <holger@layer-acht.org>
#         © 2015 Mattia Rizzolo <mattia@mapreri.org>
#         © 2015-2018 Mattia Rizzolo <mattia@mapreri.org>
# released under the GPLv=2

DEBUG=false
@@ -11,6 +12,9 @@ common_init "$@"
# common code defining db access
. /srv/jenkins/bin/reproducible_common.sh

# to have a list of the nodes running in the future
. /srv/jenkins/bin/jenkins_node_definitions.sh

# some defaults
DIRTY=false
REP_RESULTS=/srv/reproducible-results
@@ -100,15 +104,28 @@ fi
#
# check for correct future
#
# (yes this is hardcoded but meh…)
# (XXX: yes this is hardcoded but meh…)
echo "$(date -u) - testing whether the time is right..."
if [ "$(date +%Y)" = "2020" ] ; then
	echo "Warning, today is the wrong future: $(date -u)."
get_node_ssh_port "$HOSTNAME"
real_year=2018
year=$(date +%Y)
if "$NODE_RUN_IN_THE_FUTURE"; then
	if [ "$year" -eq "$real_year" ]; then
		echo "Warning, today we came back to the present: $(date -u)."
		DIRTY=true
elif [ "$(date +%Y)" = "2019" ] ; then
	elif [ "$year" -eq $(( $real_year + 1 )) ] ; then
		echo "Good, today is the right future: $(date -u)."
	else
	echo "Cherrish today, $(date -u)."
		echo "Warning, today is the wrong future: $(date -u)."
		DIRTY=true
	fi
else
	if [ "$year" -eq "$real_year" ]; then
		echo "This host run in the present as it should: $(date -u)."
	else
		echo "Warning, today is the wrong present: $(date -u)."
		DIRTY=true
	fi
fi

#
+2 −1
Original line number Diff line number Diff line
@@ -21,7 +21,8 @@ warning /Warning: The following builds have failed due to diffoscope schroot pro
warning /W: The repository .+ is not signed./
warning /W: There is no public key available for the following key IDs:.+/
warning /Warning: /.../shm.+please tell the jenkins admins to fix this./
warning /Warning, today is the wrong future:.+/
warning /^Warning, today we came back to the present:/
warning /^Warning, today is the wrong (present|future):/
warning /Warning: curl http:..www.debian.org failed, probably the proxy is down for.+/
warning /Warning, more than one kernel in.+/
warning /Warning, rise of the jenkins job zombies.+/