From a8f40aaabdece475f767f6597c872fcd117fcf4b Mon Sep 17 00:00:00 2001 From: anton Date: Mon, 10 Jul 2023 17:46:29 +0000 Subject: [PATCH] The rsync tests are unstable since the directory listing includes the last modification timestamp. One directory represents the one rsync is operating on and the other is our reference to compare against. If the current time managed to tick up to the next minute between creation of the two directories, the timestamps will differ. Improving the normalization in the findme helper makes the tests stable. ok bluhm@ claudio@ --- regress/usr.bin/rsync/lib.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/regress/usr.bin/rsync/lib.sh b/regress/usr.bin/rsync/lib.sh index 37732b686d3..6d7b51b88eb 100644 --- a/regress/usr.bin/rsync/lib.sh +++ b/regress/usr.bin/rsync/lib.sh @@ -65,9 +65,14 @@ findme () fi ( cd "$1" ; shift - # Cut out the inode number and blocks used. - # Maybe later also cut out size in bytes for directories. - find "$@" -ls | sed 's/^ *[0-9]* *[0-9]* *//' | sort + # Remove unstable fields: + # 1: inode + # 2: size in blocks + # 8-10: last modification time + find "$@" -ls | + sed -e 's/[[:space:]][[:space:]]*/ /g' | + cut -d ' ' -f 3-7,11- | + sort ) } -- 2.20.1