generic/062: don't assume same readdir order after re-creating directory
authorEric Biggers <ebiggers@google.com>
Tue, 13 Dec 2016 06:57:01 +0000 (22:57 -0800)
committerEryu Guan <eguan@redhat.com>
Sun, 18 Dec 2016 04:14:29 +0000 (12:14 +0800)
commit84db46e3d327ad06b6eb7cb8c90bea72fed257aa
tree9f015014f2b49c39b253ae266bfa4b5ce17b7acd
parentf69c41e5df58d0487258228366f17001a6d0f3a8
generic/062: don't assume same readdir order after re-creating directory

generic/062 uses getfattr to dump xattrs for a directory tree, then
deletes and recreates that directory tree, then dumps the xattrs
again and compares the dump to the original.  This was failing when
run on ext4 with encryption enabled because getfattr's output is in
readdir order, but ext4 encryption by design chooses unpredictable
encrypted filenames for each new directory, causing the readdir
order to change after backup and restore.  It is not really a valid
assumption that the readdir order will always be the same, so update
the test to sort the filenames, removing this assumption.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
tests/generic/062