syscalls/access01: Set umask value before run case
PATCH 1/1 syscalls/access01: Set umask value before run case
The case will fail when set the umask to 0077 acquiescently in system. Because the value of actual mode is 'set value' & ~'default value for the umask' when create dir.
So add 'umask(0022)' in setup().
--- testcases/kernel/syscalls/access/access01.c | 2 ++ 1 file changed, 2 insertions(+)
testcases/kernel/syscalls/access/access01.c +2 -0
@@ -315,6 +315,8 @@ static void setup(void) {struct passwd *pw; +umask (0022 ); + pw =SAFE_GETPWNAM ("nobody" ); uid = pw->pw_uid;
--
2.6.2
PATCH 1/1 syscalls/access01: Set umask value before run case
----- Original Message -----
Quoted 4 lines
The case will fail when set the umask to 0077 acquiescently in system. Because the value of actual mode is 'set value' & ~'default value for the umask' when create dir.
So add 'umask(0022)' insetup().
We do umask(0) in ltp-pan:
# umask 0077
# /opt/ltp/runltp -p -d results -l RUNTEST.log -o RUNTEST.run.log -s access01 -f syscalls > /dev/null
# cat /opt/ltp/results/RUNTEST.log Test Start Time: Fri Sep 22 14:24:28 2017 ----------------------------------------- Testcase Result Exit Value -------- ------ ---------- access01 PASS 0
I'm aware that running tests outside of ltp-pan is sometimes useful, so maybe we could add this to a library rather than in each test separately? What do you think Cyril?
Regards,
Jan
PATCH 1/1 syscalls/access01: Set umask value before run case
Quoted 22 lines · Jan Stancek
----- Original Message -----
Quoted 4 lines
The case will fail when set the umask to 0077 acquiescently in system. Because the value of actual mode is 'set value' & ~'default value for the umask' when create dir.
So add 'umask(0022)' insetup().We do umask(0) in ltp-pan:
# umask 0077# /opt/ltp/runltp -p -d results -l RUNTEST.log -o RUNTEST.run.log -s access01 -f syscalls > /dev/null# cat /opt/ltp/results/RUNTEST.log Test Start Time: Fri Sep 22 14:24:28 2017 ----------------------------------------- Testcase Result Exit Value -------- ------ ---------- access01 PASS 0
Quoted 3 lines
I'm aware that running tests outside of ltp-pan is sometimes useful, so maybe we could add this to a library rather than in each test separately? What do you think Cyril?
Yes, I shouldn't run it without runltp script.
Thanks,
Bixuan Cui
Quoted 5 lines
Regards,
Jan
PATCH 1/1 syscalls/access01: Set umask value before run case
In reply to Jan StancekHi!
Quoted 14 lines
We do umask(0) in ltp-pan:
# umask 0077# /opt/ltp/runltp -p -d results -l RUNTEST.log -o RUNTEST.run.log -s access01 -f syscalls > /dev/null# cat /opt/ltp/results/RUNTEST.log Test Start Time: Fri Sep 22 14:24:28 2017 ----------------------------------------- Testcase Result Exit Value -------- ------ ---------- access01 PASS 0
Quoted 3 lines
I'm aware that running tests outside of ltp-pan is sometimes useful, so maybe we could add this to a library rather than in each test separately? What do you think Cyril?
Running tests outside ltp-pan should indeed possible but I'm not sure that we want to change the umask in the test library. Most of the testcases will run with the more restrictive umask just fine and I would rather test the system in the default configuration. So changing it in the test setup in this case sounds reasonable to me.
Signature · 2 lines
Cyril Hrubis [email protected]
PATCH 1/1 syscalls/access01: Set umask value before run case
----- Original Message -----
Quoted 20 lines
Hi!
Quoted 15 lines
We do umask(0) in ltp-pan:
# umask 0077# /opt/ltp/runltp -p -d results -l RUNTEST.log -o RUNTEST.run.log -s access01 -f syscalls > /dev/null# cat /opt/ltp/results/RUNTEST.log Test Start Time: Fri Sep 22 14:24:28 2017 ----------------------------------------- Testcase Result Exit Value -------- ------ ---------- access01 PASS 0Quoted 3 lines
I'm aware that running tests outside of ltp-pan is sometimes useful, so maybe we could add this to a library rather than in each test separately? What do you think Cyril?
Quoted 5 lines
Running tests outside ltp-pan should indeed possible but I'm not sure that we want to change the umask in the test library. Most of the testcases will run with the more restrictive umask just fine and I would rather test the system in the default configuration. So changing it in the test setup in this case sounds reasonable to me.
OK, Will you push the patch?
Regards,
Jan
PATCH 1/1 syscalls/access01: Set umask value before run case
PATCH 1/1 syscalls/access01: Set umask value before run case
In reply to Bixuan CuiHi!
I've reworded the commit message and pushed, thanks.
Signature · 2 lines
Cyril Hrubis [email protected]
PATCH 1/1 syscalls/access01: Set umask value before run case
Quoted 2 lines · Cyril Hrubis
Hi!
I've reworded the commit message and pushed, thanks.
Thanks,
Bixuan Cui