diff --git a/tests/ci/Makefile b/tests/ci/Makefile --- a/tests/ci/Makefile +++ b/tests/ci/Makefile @@ -201,6 +201,9 @@ ci-set-full-var: .PHONY CITYPE=full +ci-set-reproducibility-var: .PHONY +CITYPE=reproducibility + ci-create-meta: .PHONY truncate -s 512M ${META_TAR} tar rvf ${META_TAR} -C ${META_DIR} . @@ -261,6 +264,8 @@ ci-full: ci-set-full-var ci-create-meta ci-checktarget .WAIT ci-runtest-${TARGET_ARCH:tl} .WAIT ci-extract-meta .PHONY +ci-reproducibility: ci-set-reproducibility-var ci-create-meta ci-checktarget .WAIT ci-runtest-${TARGET_ARCH:tl} .WAIT ci-extract-meta .PHONY + ci: ci-${CITYPE:tl} .PHONY .include "${RELEASEDIR}/Makefile.inc1" diff --git a/tests/ci/tools/ci.conf b/tests/ci/tools/ci.conf --- a/tests/ci/tools/ci.conf +++ b/tests/ci/tools/ci.conf @@ -38,6 +38,9 @@ if [ "${TARGET}" = "amd64" ]; then export VM_EXTRA_PACKAGES="${VM_EXTRA_PACKAGES} devel/linux-ltp" fi + if [ "${CITYPE}" == "reproducibility" ]; then + export VM_EXTRA_PACKAGES="${VM_EXTRA_PACKAGES} sysutils/py-diffoscope" + fi fi vm_extra_pre_umount() { @@ -120,6 +123,11 @@ mkdir -p ${DESTDIR}/usr/local/etc/rc.d cp -p ${scriptdir}/../../tests/ci/tools/freebsdci ${DESTDIR}/usr/local/etc/rc.d/ +if [ "${CITYPE}" = "reproducibility" ]; then + mkdir -p ${DESTDIR}/usr/src + cp -R ${scriptdir}/../../* ${DESTDIR}/usr/src/ +fi + return 0 } diff --git a/tests/ci/tools/freebsdci b/tests/ci/tools/freebsdci --- a/tests/ci/tools/freebsdci +++ b/tests/ci/tools/freebsdci @@ -100,12 +100,51 @@ echo "--------------------------------------------------------------" } +reproducibility_tests() +{ + echo + echo "--------------------------------------------------------------" + echo "BOOT sequence COMPLETED" + echo "TEST sequence STARTED" + if [ "${istar}" -eq 1 ]; then + rm -fr ${metadir} + mkdir -p ${metadir} + tar xvf ${tardev} -C ${metadir} + cd /usr/src + make buildworld -j1 + make buildkernel -j1 + cp -Rp /usr/src /usr/src1 + mkdir -p /usr/obj1 + chown -R tests:tests /usr/src1 /usr/obj1 + export MAKEOBJDIRPREFIX="/usr/obj1" + export LANG="et_EE.UTF-8" + export LC_ALL="et_EE.UTF-8" + export TZ="/usr/share/zoneinfo/Etc/GMT-14" + date $(date -v+1y -v+1m -v+1d -v+6H -v+23M +%Y%m%d%H%M.%S) + hostname $(openssl rand -hex 8) + cd /usr/src1 + sudo -u tests -E make buildworld -j${parallelism} + sudo -u tests -E make buildkernel -j${parallelism} + diffoscope --exclude-directory-metadata yes --html /${metadir}/diffoscope.html /usr/obj /usr/obj1 + tar cvf ${tardev} -C ${metadir} . + else + echo "ERROR: no device with POSIX tar archive format found." + # Don't shutdown because this is not run in unattended mode + exit 1 + fi + echo "TEST sequence COMPLETED" + echo "INITIATING system SHUTDOWN" + echo "--------------------------------------------------------------" +} + firstboot_ci_run() { if [ "$freebsdci_type" = "smoke" ]; then smoke_tests elif [ "$freebsdci_type" = "full" ]; then full_tests + elif [ "$freebsdci_type" = "reproducibility" ]; then + reproducibility_tests fi auto_shutdown }