Commit e4d7f0b5 authored by Roland Clobus's avatar Roland Clobus Committed by Holger Levsen
Browse files

Re-enable the tests for live-build images.



If the snapshot server is not available, use deb.debian.org instead

Signed-off-by: Holger Levsen's avatarHolger Levsen <holger@layer-acht.org>
parent af1bedfa
......@@ -57,7 +57,7 @@ cleanup() {
publish_file DiffoscopeOutput ${RESULTSDIR}/${PROJECTNAME}/${CONFIGURATION}/live-image-amd64.hybrid.iso.html ${CONFIGURATION}-${DEBIAN_VERSION}.html
else
output_echo "Error: Something went wrong."
printenv > environment.txt
printenv >environment.txt
publish_file Environment ${PWD}/environment.txt ${CONFIGURATION}-${DEBIAN_VERSION}.txt
fi
fi
......@@ -89,6 +89,30 @@ if [ -z "${CONFIGURATION}" -o -z "${DEBIAN_VERSION}" ]; then
exit 1
fi
# Configuration option: Select the server for the repository
# Allowed values:
# auto (default): Detect the best available server
# snapshot (preferred): Use a snapshot server
# archive (fallback): Use deb.debian.org if a snapshot server is not available
#
# Note that 'archive' allows only for a time window of about 6 hours to test for reproducibility
export REPOSERVER=auto
if [ "${REPOSERVER}" == "auto" ]; then
set +e # We are interested in the return value
wget --quiet --no-hsts http://snapshot.notset.fr/mr/timestamp/debian/latest --output-document latest
RETURNVALUE=$?
rm -f latest
set -e
if [ ${RETURNVALUE} -eq 0 ]; then
export REPOSERVER=snapshot
else
# The snapshot server is not available
output_echo "Info: The snapshot server is not available, using deb.debian.org instead."
export REPOSERVER=archive
fi
fi
# Cleanup if something goes wrong
trap cleanup INT TERM EXIT
......@@ -118,15 +142,13 @@ cd ..
output_echo "Running the rebuild script for the 1st build."
set +e # We are interested in the return value
# The 3rd argument is provided to allow for local testing of this script.
# - If SNAPSHOT_TIMESTAMP is already set, use that timestamp instead of the latest snapshot
# - If SNAPSHOT_TIMESTAMP is already set, use that value
# - If SNAPSHOT_TIMESTAMP is not set, use REPOSERVER
export SNAPSHOT_TIMESTAMP="${SNAPSHOT_TIMESTAMP:-${REPOSERVER}}"
rebuild_script/test/rebuild.sh "$1" "$2" "${SNAPSHOT_TIMESTAMP}"
RETURNVALUE=$?
grep --quiet --no-messages "Build result: 0" summary.txt
BUILD_OK_FOUND=$?
# Retrieve the timestamp that was used
export SNAPSHOT_TIMESTAMP=$(grep --no-messages "Snapshot timestamp:" summary.txt | cut -f 3 -d " ")
set -e
if [ ${RETURNVALUE} -ne 0 -o ${BUILD_OK_FOUND} -ne 0 ]; then
......@@ -138,6 +160,12 @@ if [ ${RETURNVALUE} -ne 0 -o ${BUILD_OK_FOUND} -ne 0 ]; then
fi
output_echo "Warning: the build failed with ${RETURNVALUE}. The latest snapshot might not be complete (yet). Now trying again using the previous snapshot instead."
rebuild_script/test/rebuild.sh "$1" "$2" "${SNAPSHOT_TIMESTAMP}"
else
# Determine the value of SNAPSHOT_TIMESTAMP for the second build
# If 'archive' is used for the first build, use it for the second build too and hope that the same timestamp will still be available
if [ "${SNAPSHOT_TIMESTAMP}" != "archive" ]; then
export SNAPSHOT_TIMESTAMP=$(grep --no-messages "Snapshot timestamp:" summary.txt | cut -f 3 -d " ")
fi
fi
# Move the image away
......
......@@ -1012,7 +1012,7 @@
my_recipients: 'qa-jenkins-scm@lists.alioth.debian.org'
my_node: '{my_hname}'
my_timeout: '720'
my_disabled: true
my_disabled: false
imagetype:
- "smallest-build"
- cinnamon
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment