From 6262c1921c5714dbbda000a3ca04c627435e1d2c Mon Sep 17 00:00:00 2001 From: Johannes Schauer Marin Rodrigues Date: Wed, 26 Jun 2024 07:34:55 +0200 Subject: [PATCH] tests/check-against-debootstrap-dist: allow for different installation order of passwd and systemd --- tests/check-against-debootstrap-dist | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/tests/check-against-debootstrap-dist b/tests/check-against-debootstrap-dist index ee4de26..40e5798 100644 --- a/tests/check-against-debootstrap-dist +++ b/tests/check-against-debootstrap-dist @@ -172,15 +172,29 @@ for log in faillog lastlog; do 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