[LTP] [PATCH] syscalls/fchmodat: fix test, don't use test current directory

Alexey Kodanev alexey.kodanev@oracle.com
Tue Feb 2 15:37:20 CET 2016



On 02/02/2016 05:14 PM, Cyril Hrubis wrote:
> Hi!
>> @@ -73,6 +73,7 @@ int main(int ac, char **av)
>>   {
>>   	int lc;
>>   	int i;
>> +	size_t k;
>>   
>>   	/* Disable test if the version of the kernel is less than 2.6.16 */
>>   	if ((tst_kvercmp(2, 6, 16)) < 0) {
>> @@ -104,6 +105,12 @@ int main(int ac, char **av)
>>   			}
>>   		}
>>   
>> +		for (k = 0; k < ARRAY_SIZE(tst_fds); ++k)
>> +			SAFE_CLOSE(cleanup, tst_fds[k]);
>> +
>> +		SAFE_UNLINK(cleanup, testfile);
>> +		SAFE_UNLINK(cleanup, testfile3);
>> +		SAFE_RMDIR(cleanup, pathname);
> Is there any reason why we call the setup_every_copy() for each
> iteration instead of doing it once in the setup()?

Hard to say, it seems this test never used with '-i' parameter.

I think we can change the test-case and move setup_every_copy()
to setup(), as the only difference with permissions will be that the 
test directory
mode won't be changed from 0700 -> 0600 on every iteration.

Thanks,
Alexey

>
>
> Otherwise the patch looks good.
>



More information about the Ltp mailing list