[Toybox] [PATCH] chattr: fix exit status, redo the tests.

enh enh at google.com
Wed Feb 5 15:54:04 PST 2020


The e2fsprogs chattr(1) returns failure when it fails to do what was
asked of it, and so should we. Fixing this then reveals a lot of issues
with the tests that were being accidentally swept under the carpet.

The bulk of this patch is going through all the tests, removing the
duplicates and making the remaining tests more thorough.

I've tested this on ext4 and f2fs on a variety of 4.x and 5.x kernel
versions (but nothing older). We might need to reduce the list of
attribtues we try to toggle, but the more thorough tests use
well-supported attributes.

I've also fixed the -R test to actually involve a directory hierarchy.
---
 tests/chattr.test   | 155 ++++++++++++--------------------------------
 toys/other/lsattr.c |   1 -
 2 files changed, 40 insertions(+), 116 deletions(-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-chattr-fix-exit-status-redo-the-tests.patch
Type: text/x-patch
Size: 11075 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20200205/5ec5ba6c/attachment-0002.bin>


More information about the Toybox mailing list