[LTP] [PATCH v2 1/3] llistxattr/llistxattr01.c: add new testcase
Cyril Hrubis
chrubis@suse.cz
Wed Feb 24 14:38:14 CET 2016
Hi!
> The testcase checks the basic functionality of the llistxattr(2).
> llistxattr(2) retrieves the list of extended attribute names
> associated with the link itself in the filesystem.
I've added tst_require_root() into the test setup, since modifying
attrinbutes in security namespace requires it.
> +static void set_xattr(const char *path, const char *key)
> +{
> + int n;
> +
> + n = lsetxattr(path, key, VALUE, VALUE_SIZE, XATTR_CREATE);
> + if (n == -1) {
> + if (errno == ENOTSUP) {
> + tst_brkm(TCONF, cleanup,
> + "no xattr support in fs or mounted "
> + "without user_xattr option");
> + }
> +
> + if (errno == EEXIST) {
> + tst_brkm(TFAIL, cleanup, "exist attribute %s", key);
> + } else {
> + tst_brkm(TFAIL | TERRNO, cleanup,
> + "lsetxattr() failed");
And changed these two to TBROK since it's more "test broken in setup"
rather than "test assertion failed".
And pushed, thanks.
--
Cyril Hrubis
chrubis@suse.cz
More information about the Ltp
mailing list