diff options
Diffstat (limited to 'tests/check-against-debootstrap-dist')
-rw-r--r-- | tests/check-against-debootstrap-dist | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/tests/check-against-debootstrap-dist b/tests/check-against-debootstrap-dist index b5706c6..40e5798 100644 --- a/tests/check-against-debootstrap-dist +++ b/tests/check-against-debootstrap-dist @@ -70,6 +70,8 @@ rm /tmp/debian-{{ DIST }}-debootstrap/var/cache/debconf/templates.dat-old \ /tmp/debian-{{ DIST }}-mm/var/cache/debconf/templates.dat-old rm /tmp/debian-{{ DIST }}-debootstrap/var/lib/dpkg/status-old \ /tmp/debian-{{ DIST }}-mm/var/lib/dpkg/status-old +rm -f /tmp/debian-{{ DIST }}-debootstrap/var/lib/dpkg/diversions-old \ + /tmp/debian-{{ DIST }}-mm/var/lib/dpkg/diversions-old # remove dpkg files rm /tmp/debian-{{ DIST }}-debootstrap/var/lib/dpkg/available rm /tmp/debian-{{ DIST }}-debootstrap/var/lib/dpkg/cmethopt @@ -155,24 +157,44 @@ if [ "{{ VARIANT }}" = "-" ] && [ "{{ DIST}}" = oldstable ]; then fi for log in faillog lastlog; do - if ! cmp /tmp/debian-{{ DIST }}-debootstrap/var/log/$log /tmp/debian-{{ DIST }}-mm/var/log/$log >&2;then + f1="/tmp/debian-{{ DIST }}-debootstrap/var/log/$log" + f2="/tmp/debian-{{ DIST }}-mm/var/log/$log" + # skip cmp if file is absent in both chroots + if [ ! -e "$f1" ] && [ ! -e "$f2" ]; then + continue + fi + if ! cmp "$f1" "$f2" >&2;then # if the files differ, make sure they are all zeroes - cmp -n "$(stat -c %s "/tmp/debian-{{ DIST }}-debootstrap/var/log/$log")" "/tmp/debian-{{ DIST }}-debootstrap/var/log/$log" /dev/zero >&2 - cmp -n "$(stat -c %s "/tmp/debian-{{ DIST }}-mm/var/log/$log")" "/tmp/debian-{{ DIST }}-mm/var/log/$log" /dev/zero >&2 + cmp -n "$(stat -c %s "$f1")" "$f1" /dev/zero >&2 + cmp -n "$(stat -c %s "$f2")" "$f2" /dev/zero >&2 # then delete them - rm /tmp/debian-{{ DIST }}-debootstrap/var/log/$log /tmp/debian-{{ DIST }}-mm/var/log/$log + rm "$f1" "$f2" fi done -# the order in which systemd and cron get installed differ and thus the order -# of lines in /etc/group and /etc/gshadow differs if [ "{{ VARIANT }}" = "-" ]; then + # the order in which systemd and cron get installed differ and thus the order + # of lines in /etc/group and /etc/gshadow differs for f in group group- gshadow gshadow-; do for d in mm debootstrap; do sort /tmp/debian-{{ DIST }}-$d/etc/$f > /tmp/debian-{{ DIST }}-$d/etc/$f.bak mv /tmp/debian-{{ DIST }}-$d/etc/$f.bak /tmp/debian-{{ DIST }}-$d/etc/$f done done + # the order in which systemd and passwd get installed differ and thus + # the order of lines in /etc/shadow and /etc/shadow- differs + for f in shadow shadow-; do + for d in mm debootstrap; do + sort /tmp/debian-{{ DIST }}-$d/etc/$f > /tmp/debian-{{ DIST }}-$d/etc/$f.bak + mv /tmp/debian-{{ DIST }}-$d/etc/$f.bak /tmp/debian-{{ DIST }}-$d/etc/$f + done + done + # and since the order was different, ignore the *- files + for f in shadow- passwd-; do + for d in mm debootstrap; do + rm /tmp/debian-{{ DIST }}-$d/etc/$f + done + done fi # since debootstrap 1.0.133 there is no tzdata in the buildd variant and thus |