All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP]  [PATCH] syscalls/access01: Set umask value before run case
@ 2017-09-19 13:04 Bixuan Cui
  2017-09-22 12:28 ` Jan Stancek
  2017-10-03 15:52 ` Cyril Hrubis
  0 siblings, 2 replies; 8+ messages in thread
From: Bixuan Cui @ 2017-09-19 13:04 UTC (permalink / raw)
  To: ltp

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().

Signed-off-by: Cui Bixuan <cuibixuan@huawei.com>
---
 testcases/kernel/syscalls/access/access01.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/testcases/kernel/syscalls/access/access01.c b/testcases/kernel/syscalls/access/access01.c
index 7a92525..b679832 100644
--- a/testcases/kernel/syscalls/access/access01.c
+++ b/testcases/kernel/syscalls/access/access01.c
@@ -315,6 +315,8 @@ static void setup(void)
 {
 	struct passwd *pw;

+	umask(0022);
+
 	pw = SAFE_GETPWNAM("nobody");

 	uid = pw->pw_uid;
--
2.6.2


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [LTP] [PATCH] syscalls/access01: Set umask value before run case
  2017-09-19 13:04 [LTP] [PATCH] syscalls/access01: Set umask value before run case Bixuan Cui
@ 2017-09-22 12:28 ` Jan Stancek
  2017-09-25  2:34   ` Bixuan Cui
  2017-09-25 12:31   ` Cyril Hrubis
  2017-10-03 15:52 ` Cyril Hrubis
  1 sibling, 2 replies; 8+ messages in thread
From: Jan Stancek @ 2017-09-22 12:28 UTC (permalink / raw)
  To: ltp



----- Original Message -----
> 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().

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [LTP] [PATCH] syscalls/access01: Set umask value before run case
  2017-09-22 12:28 ` Jan Stancek
@ 2017-09-25  2:34   ` Bixuan Cui
  2017-09-25 12:31   ` Cyril Hrubis
  1 sibling, 0 replies; 8+ messages in thread
From: Bixuan Cui @ 2017-09-25  2:34 UTC (permalink / raw)
  To: ltp

On 2017/9/22 20:28, Jan Stancek wrote:
> 
> 
> ----- Original Message -----
>> 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().
> 
> 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?
Yes, I shouldn't run it without runltp script.

Thanks,
Bixuan Cui
> 
> Regards,
> Jan
> 
> 



^ permalink raw reply	[flat|nested] 8+ messages in thread

* [LTP] [PATCH] syscalls/access01: Set umask value before run case
  2017-09-22 12:28 ` Jan Stancek
  2017-09-25  2:34   ` Bixuan Cui
@ 2017-09-25 12:31   ` Cyril Hrubis
  2017-10-03  6:42     ` Jan Stancek
  1 sibling, 1 reply; 8+ messages in thread
From: Cyril Hrubis @ 2017-09-25 12:31 UTC (permalink / raw)
  To: ltp

Hi!
> 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?

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.

-- 
Cyril Hrubis
chrubis@suse.cz

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [LTP] [PATCH] syscalls/access01: Set umask value before run case
  2017-09-25 12:31   ` Cyril Hrubis
@ 2017-10-03  6:42     ` Jan Stancek
  2017-10-03 15:52       ` Cyril Hrubis
  0 siblings, 1 reply; 8+ messages in thread
From: Jan Stancek @ 2017-10-03  6:42 UTC (permalink / raw)
  To: ltp


----- Original Message -----
> Hi!
> > 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?
> 
> 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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [LTP] [PATCH] syscalls/access01: Set umask value before run case
  2017-09-19 13:04 [LTP] [PATCH] syscalls/access01: Set umask value before run case Bixuan Cui
  2017-09-22 12:28 ` Jan Stancek
@ 2017-10-03 15:52 ` Cyril Hrubis
  2017-10-09  5:27   ` Bixuan Cui
  1 sibling, 1 reply; 8+ messages in thread
From: Cyril Hrubis @ 2017-10-03 15:52 UTC (permalink / raw)
  To: ltp

Hi!
I've reworded the commit message and pushed, thanks.

-- 
Cyril Hrubis
chrubis@suse.cz

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [LTP] [PATCH] syscalls/access01: Set umask value before run case
  2017-10-03  6:42     ` Jan Stancek
@ 2017-10-03 15:52       ` Cyril Hrubis
  0 siblings, 0 replies; 8+ messages in thread
From: Cyril Hrubis @ 2017-10-03 15:52 UTC (permalink / raw)
  To: ltp

Hi!
> OK, Will you push the patch?

Done.

-- 
Cyril Hrubis
chrubis@suse.cz

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [LTP] [PATCH] syscalls/access01: Set umask value before run case
  2017-10-03 15:52 ` Cyril Hrubis
@ 2017-10-09  5:27   ` Bixuan Cui
  0 siblings, 0 replies; 8+ messages in thread
From: Bixuan Cui @ 2017-10-09  5:27 UTC (permalink / raw)
  To: ltp

On 2017/10/3 23:52, Cyril Hrubis wrote:
> Hi!
> I've reworded the commit message and pushed, thanks.

Thanks,
Bixuan Cui

> 



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-10-09  5:27 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-19 13:04 [LTP] [PATCH] syscalls/access01: Set umask value before run case Bixuan Cui
2017-09-22 12:28 ` Jan Stancek
2017-09-25  2:34   ` Bixuan Cui
2017-09-25 12:31   ` Cyril Hrubis
2017-10-03  6:42     ` Jan Stancek
2017-10-03 15:52       ` Cyril Hrubis
2017-10-03 15:52 ` Cyril Hrubis
2017-10-09  5:27   ` Bixuan Cui

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.