diff options
author | Anton Lindqvist <anton@cvs.openbsd.org> | 2023-07-10 17:46:30 +0000 |
---|---|---|
committer | Anton Lindqvist <anton@cvs.openbsd.org> | 2023-07-10 17:46:30 +0000 |
commit | d3486f02c51ba4fbfda8d65a2c56b273c43f1124 (patch) | |
tree | 7db442d4a30a92d5ca071b442dae640f6c1f336e /regress | |
parent | e89c088e17ca7499536e71eded7c75fa59b06fcb (diff) |
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@
Diffstat (limited to 'regress')
-rw-r--r-- | regress/usr.bin/rsync/lib.sh | 11 |
1 files 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 ) } |