From b474150f278a28c86b3cb4915303996110085687 Mon Sep 17 00:00:00 2001 From: Johannes Schauer Marin Rodrigues Date: Fri, 10 Feb 2023 04:10:23 +0100 Subject: [PATCH] tests: fall back to diffoscope if cmp failed --- tests/chrootless | 2 +- tests/chrootless-fakeroot | 2 +- tests/chrootless-foreign | 2 +- tests/merged-fakechroot-inside-unmerged-chroot | 2 +- tests/pivot_root | 8 ++++---- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/chrootless b/tests/chrootless index e182173..d72e8b8 100644 --- a/tests/chrootless +++ b/tests/chrootless @@ -11,6 +11,6 @@ for INCLUDE in '' 'apt' 'apt,build-essential' 'systemd-sysv'; do ${INCLUDE:+--include="$INCLUDE"} \ {{ DIST }} "/tmp/$MODE.tar" {{ MIRROR }} done - cmp /tmp/root.tar /tmp/chrootless.tar + cmp /tmp/root.tar /tmp/chrootless.tar || diffoscope /tmp/root.tar /tmp/chrootless.tar rm /tmp/chrootless.tar /tmp/root.tar done diff --git a/tests/chrootless-fakeroot b/tests/chrootless-fakeroot index 0f09e73..1c3b68b 100644 --- a/tests/chrootless-fakeroot +++ b/tests/chrootless-fakeroot @@ -30,6 +30,6 @@ for INCLUDE in '' 'apt' 'apt,build-essential' 'systemd-sysv'; do $prefix fakeroot {{ CMD }} --mode={{ MODE }} --variant={{ VARIANT }} --hook-dir=./hooks/merged-usr \ ${INCLUDE:+--include="$INCLUDE"} \ {{ DIST }} /tmp/chrootless.tar {{ MIRROR }} - cmp /tmp/root.tar /tmp/chrootless.tar + cmp /tmp/root.tar /tmp/chrootless.tar || diffoscope /tmp/root.tar /tmp/chrootless.tar rm /tmp/chrootless.tar /tmp/root.tar done diff --git a/tests/chrootless-foreign b/tests/chrootless-foreign index 430c9c4..242699b 100644 --- a/tests/chrootless-foreign +++ b/tests/chrootless-foreign @@ -63,6 +63,6 @@ for INCLUDE in '' 'apt' 'systemd-sysv'; do > "/tmp/$tar.tar.tmp" mv "/tmp/$tar.tar.tmp" "/tmp/$tar.tar" done - cmp /tmp/root.tar /tmp/chrootless.tar + cmp /tmp/root.tar /tmp/chrootless.tar || diffoscope /tmp/root.tar /tmp/chrootless.tar rm /tmp/chrootless.tar /tmp/root.tar done diff --git a/tests/merged-fakechroot-inside-unmerged-chroot b/tests/merged-fakechroot-inside-unmerged-chroot index 4b2fe4a..c05ada1 100644 --- a/tests/merged-fakechroot-inside-unmerged-chroot +++ b/tests/merged-fakechroot-inside-unmerged-chroot @@ -46,4 +46,4 @@ chmod +x script.sh --customize-hook=./script.sh \ --customize-hook="copy-out /tmp/chroot-fakechroot.tar /tmp" \ {{ DIST }} /dev/null {{ MIRROR }} -cmp /tmp/chroot-fakechroot.tar /tmp/chroot-root.tar +cmp /tmp/chroot-fakechroot.tar /tmp/chroot-root.tar || diffoscope /tmp/chroot-fakechroot.tar /tmp/chroot-root.tar diff --git a/tests/pivot_root b/tests/pivot_root index f51e221..a708924 100644 --- a/tests/pivot_root +++ b/tests/pivot_root @@ -38,8 +38,8 @@ if [ {{ MODE }} = "unshare" ]; then --customize-hook='umount -l mnt sys' \ {{ DIST }} /tmp/chroot2.tar {{ MIRROR }} - cmp /tmp/chroot1.tar /tmp/chroot2.tar - cmp /tmp/chroot1.tar /tmp/chroot3.tar + cmp /tmp/chroot1.tar /tmp/chroot2.tar || diffoscope /tmp/chroot1.tar /tmp/chroot2.tar + cmp /tmp/chroot1.tar /tmp/chroot3.tar || diffoscope /tmp/chroot1.tar /tmp/chroot3.tar rm /tmp/chroot2.tar /tmp/chroot3.tar fi @@ -51,5 +51,5 @@ $prefix {{ CMD }} --mode={{ MODE }} --variant=apt --include=mount \ --customize-hook='rm "$1/'"$MMDEBSTRAP"'"' \ {{ DIST }} /tmp/chroot2.tar {{ MIRROR }} -cmp /tmp/chroot1.tar /tmp/chroot2.tar -cmp /tmp/chroot1.tar /tmp/chroot3.tar +cmp /tmp/chroot1.tar /tmp/chroot2.tar || diffoscope /tmp/chroot1.tar /tmp/chroot2.tar +cmp /tmp/chroot1.tar /tmp/chroot3.tar || diffoscope /tmp/chroot1.tar /tmp/chroot3.tar