]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: fix another test failure in test/du/inodes.sh
authorBernhard Voelker <mail@bernhard-voelker.de>
Sun, 28 Jul 2013 23:51:55 +0000 (01:51 +0200)
committerBernhard Voelker <mail@bernhard-voelker.de>
Sun, 28 Jul 2013 23:51:55 +0000 (01:51 +0200)
Prompted by the continuous integration build failure at:
http://hydra.nixos.org/build/5584121

du(1) uses the first file object of the two test files linked to the
same inode, 'd/f' and 'd/h', whatever the system returns first.
Use 'd/f' in both the expected and the actual output.

* test/du/inodes.sh: Change the expected output as described above
when returning the --all directory entries (without -l).  Also replace
the name of the hardlink 'd/h' by 'd/f' in the actual output.

tests/du/inodes.sh

index 692aa5ff526452555682bbf80499347e65314bb6..7564c812ad726d00f75f96832362cac4bc26e8a2 100755 (executable)
@@ -67,9 +67,12 @@ compare /dev/null err || fail=1
 
 # Count all items: 1-1-3.
 # Sort output because the directory entry order is not defined.
-printf '1\td/d\n1\td/h\n3\td\n' | sort > exp || framework_failure_
+# Also replace the hardlink with the original file name because
+# the system may either return 'd/f' or 'd/h' first, and du(1)
+# will ignore the other one.
+printf '1\td/d\n1\td/f\n3\td\n' | sort > exp || framework_failure_
 du --inodes -a d > out.tmp 2>err || fail=1
-sort <out.tmp >out || framework_failure_
+sed 's/h$/f/' out.tmp | sort >out || framework_failure_
 compare exp out || fail=1
 compare /dev/null err || fail=1