[LTP] [PATCH v4 7/7] Add file_attr04 test
    Cyril Hrubis 
    chrubis@suse.cz
       
    Tue Aug  5 16:10:13 CEST 2025
    
    
  
Hi!
> +static void test_invalid_fd(struct tst_fd *fd)
> +{
> +	memset(attr, 0, sizeof(*attr));
We should properly skip the valid DIR fd with:
	if (fd->type == TST_FD_DIR) {
		tst_res(TCONF, "Skipping DIR fd");
		return;
	}
I suppose that you get ENOENT because the file attributes are not
supported on the filesystem on /tmp and that it may pass on xfs.
> +	if (tst_variant) {
> +		TST_EXP_FAIL_ARR(file_getattr(
> +			fd->fd, FILENAME,
> +			attr, FILE_ATTR_SIZE_LATEST,
> +			0), exp_errnos, ARRAY_SIZE(exp_errnos));
> +	} else {
> +		TST_EXP_FAIL_ARR(file_setattr(
> +			fd->fd, FILENAME,
> +			attr, FILE_ATTR_SIZE_LATEST,
> +			0), exp_errnos, ARRAY_SIZE(exp_errnos));
> +	}
> +}
-- 
Cyril Hrubis
chrubis@suse.cz
    
    
More information about the ltp
mailing list