public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH] syscalls/clone08: Skip test_clone_stopped after kernel 2.6.25
@ 2014-04-29  8:44 shuang.qiu
  2014-04-29  9:04 ` Xiaoguang Wang
  2014-04-29  9:25 ` Jan Stancek
  0 siblings, 2 replies; 5+ messages in thread
From: shuang.qiu @ 2014-04-29  8:44 UTC (permalink / raw)
  To: ltp-list

From: Shuang Qiu <shuang.qiu@oracle.com>

According to CLONE manual page "From Linux 2.6.25 this flag is
deprecated.You probably never wanted to use it, you certainly shouldn’t
be using it,  and  soon  it  will  go away",skip test_clone_stopped
after kernel 2.6.25.

Signed-off-by: Shuang Qiu <shuang.qiu@oracle.com>
---
 testcases/kernel/syscalls/clone/clone08.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/testcases/kernel/syscalls/clone/clone08.c b/testcases/kernel/syscalls/clone/clone08.c
index 14ebf60..610986d 100644
--- a/testcases/kernel/syscalls/clone/clone08.c
+++ b/testcases/kernel/syscalls/clone/clone08.c
@@ -84,15 +84,24 @@ int main(int ac, char **av)
 {
 	char *msg;
 	int i, lc;
+	int clone_stopped = 0;
 
 	msg = parse_opts(ac, av, NULL, NULL);
 	if (msg != NULL)
 		tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
 
 	setup();
+
+#ifdef CLONE_STOPPED
+	if (tst_kvercmp(2, 6, 25) > 0)
+		clone_stopped =1;
+#endif
+		
 	for (lc = 0; TEST_LOOPING(lc); lc++) {
 		tst_count = 0;
 		for (i = 0; i < TST_TOTAL; i++) {
+			if (clone_stopped == 1 && i ==3)
+				continue;
 			tst_resm(TINFO, "running %s", test_cases[i].name);
 			test_cases[i].testfunc(i);
 		}
-- 
1.7.7


------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.  Get 
unparalleled scalability from the best Selenium testing platform available.
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

* Re: [LTP] [PATCH] syscalls/clone08: Skip test_clone_stopped after kernel 2.6.25
  2014-04-29  8:44 [LTP] [PATCH] syscalls/clone08: Skip test_clone_stopped after kernel 2.6.25 shuang.qiu
@ 2014-04-29  9:04 ` Xiaoguang Wang
  2014-04-29 10:51   ` Shuang Qiu
  2014-04-29  9:25 ` Jan Stancek
  1 sibling, 1 reply; 5+ messages in thread
From: Xiaoguang Wang @ 2014-04-29  9:04 UTC (permalink / raw)
  To: shuang.qiu; +Cc: ltp-list

Hi,

On 04/29/2014 04:44 PM, shuang.qiu@oracle.com wrote:
> From: Shuang Qiu <shuang.qiu@oracle.com>
>
> According to CLONE manual page "From Linux 2.6.25 this flag is
> deprecated.You probably never wanted to use it, you certainly shouldn’t
> be using it,  and  soon  it  will  go away",skip test_clone_stopped
> after kernel 2.6.25.
>
> Signed-off-by: Shuang Qiu <shuang.qiu@oracle.com>
> ---
>  testcases/kernel/syscalls/clone/clone08.c |    9 +++++++++
>  1 files changed, 9 insertions(+), 0 deletions(-)
>
> diff --git a/testcases/kernel/syscalls/clone/clone08.c b/testcases/kernel/syscalls/clone/clone08.c
> index 14ebf60..610986d 100644
> --- a/testcases/kernel/syscalls/clone/clone08.c
> +++ b/testcases/kernel/syscalls/clone/clone08.c
> @@ -84,15 +84,24 @@ int main(int ac, char **av)
>  {
>  	char *msg;
>  	int i, lc;
> +	int clone_stopped = 0;
>  
>  	msg = parse_opts(ac, av, NULL, NULL);
>  	if (msg != NULL)
>  		tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
>  
>  	setup();
> +
> +#ifdef CLONE_STOPPED
> +	if (tst_kvercmp(2, 6, 25) > 0)
> +		clone_stopped =1;
> +#endif
> +		
>  	for (lc = 0; TEST_LOOPING(lc); lc++) {
>  		tst_count = 0;
>  		for (i = 0; i < TST_TOTAL; i++) {
> +			if (clone_stopped == 1 && i ==3)
> +				continue;
>  			tst_resm(TINFO, "running %s", test_cases[i].name);
>  			test_cases[i].testfunc(i);
>  		}
I think you should do the kernel version comparison in test_clone_stopped(), and if
kernel is after 2.6.25, you may print a TCONF with tst_resm() and return.

Here you use "i == 3", but if other elements are added in struct test_case arry,
the index for test_clone_stopped may change.

Regards,
Xiaoguang Wang


------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.  Get 
unparalleled scalability from the best Selenium testing platform available.
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

* Re: [LTP] [PATCH] syscalls/clone08: Skip test_clone_stopped after kernel 2.6.25
  2014-04-29  8:44 [LTP] [PATCH] syscalls/clone08: Skip test_clone_stopped after kernel 2.6.25 shuang.qiu
  2014-04-29  9:04 ` Xiaoguang Wang
@ 2014-04-29  9:25 ` Jan Stancek
  2014-04-29 10:54   ` Shuang Qiu
  1 sibling, 1 reply; 5+ messages in thread
From: Jan Stancek @ 2014-04-29  9:25 UTC (permalink / raw)
  To: shuang qiu; +Cc: ltp-list





----- Original Message -----
> From: "shuang qiu" <shuang.qiu@oracle.com>
> To: ltp-list@lists.sourceforge.net
> Sent: Tuesday, 29 April, 2014 10:44:26 AM
> Subject: [LTP] [PATCH] syscalls/clone08: Skip test_clone_stopped after	kernel 2.6.25
> 
> From: Shuang Qiu <shuang.qiu@oracle.com>
> 
> According to CLONE manual page "From Linux 2.6.25 this flag is
> deprecated.You probably never wanted to use it, you certainly shouldn’t
> be using it,  and  soon  it  will  go away",skip test_clone_stopped
> after kernel 2.6.25.

Hi,

"This flag was deprecated from Linux 2.6.25 onward, and was removed altogether in Linux 2.6.38."

As I understand, marking it as deprecated didn't prevent anyone from using it.
So, shouldn't the test still be valid up to 2.6.38, when it was finally removed?

> 
> Signed-off-by: Shuang Qiu <shuang.qiu@oracle.com>
> ---
>  testcases/kernel/syscalls/clone/clone08.c |    9 +++++++++
>  1 files changed, 9 insertions(+), 0 deletions(-)
> 
> diff --git a/testcases/kernel/syscalls/clone/clone08.c
> b/testcases/kernel/syscalls/clone/clone08.c
> index 14ebf60..610986d 100644
> --- a/testcases/kernel/syscalls/clone/clone08.c
> +++ b/testcases/kernel/syscalls/clone/clone08.c
> @@ -84,15 +84,24 @@ int main(int ac, char **av)
>  {
>  	char *msg;
>  	int i, lc;
> +	int clone_stopped = 0;
>  
>  	msg = parse_opts(ac, av, NULL, NULL);
>  	if (msg != NULL)
>  		tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
>  
>  	setup();
> +
> +#ifdef CLONE_STOPPED
> +	if (tst_kvercmp(2, 6, 25) > 0)
> +		clone_stopped =1;
> +#endif
> +
>  	for (lc = 0; TEST_LOOPING(lc); lc++) {
>  		tst_count = 0;
>  		for (i = 0; i < TST_TOTAL; i++) {
> +			if (clone_stopped == 1 && i ==3)
> +				continue;

I'd suggest to put the check directly to test_clone_stopped()
and you can avoid using checks that depend on order of testcases:

diff --git a/testcases/kernel/syscalls/clone/clone08.c b/testcases/kernel/syscalls/clone/clone08.c
index 14ebf60..9518382 100644
--- a/testcases/kernel/syscalls/clone/clone08.c
+++ b/testcases/kernel/syscalls/clone/clone08.c
@@ -238,6 +238,11 @@ static void test_clone_stopped(int t)
        int flag;
        pid_t child;
 
+       if (tst_kvercmp(2, 6, 38) >= 0) {
+               tst_resm(TINFO, "CLONE_STOPPED skipped for kernels >= 2.6.38");
+               return;
+       }
+
        stopped_flag = 0;
        child = clone_child(&test_cases[t], 1);

Regards,
Jan

>  			tst_resm(TINFO, "running %s", test_cases[i].name);
>  			test_cases[i].testfunc(i);
>  		}
> --
> 1.7.7
> 
> 
> ------------------------------------------------------------------------------
> "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
> Instantly run your Selenium tests across 300+ browser/OS combos.  Get
> unparalleled scalability from the best Selenium testing platform available.
> Simple to use. Nothing to install. Get started now for free."
> http://p.sf.net/sfu/SauceLabs
> _______________________________________________
> Ltp-list mailing list
> Ltp-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ltp-list
> 

------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.  Get 
unparalleled scalability from the best Selenium testing platform available.
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

* Re: [LTP] [PATCH] syscalls/clone08: Skip test_clone_stopped after kernel 2.6.25
  2014-04-29  9:04 ` Xiaoguang Wang
@ 2014-04-29 10:51   ` Shuang Qiu
  0 siblings, 0 replies; 5+ messages in thread
From: Shuang Qiu @ 2014-04-29 10:51 UTC (permalink / raw)
  To: Xiaoguang Wang; +Cc: ltp-list

On 04/29/2014 05:04 PM, Xiaoguang Wang wrote:
> Hi,
>
> On 04/29/2014 04:44 PM, shuang.qiu@oracle.com wrote:
>> From: Shuang Qiu <shuang.qiu@oracle.com>
>>
>> According to CLONE manual page "From Linux 2.6.25 this flag is
>> deprecated.You probably never wanted to use it, you certainly shouldn’t
>> be using it,  and  soon  it  will  go away",skip test_clone_stopped
>> after kernel 2.6.25.
>>
>> Signed-off-by: Shuang Qiu <shuang.qiu@oracle.com>
>> ---
>>   testcases/kernel/syscalls/clone/clone08.c |    9 +++++++++
>>   1 files changed, 9 insertions(+), 0 deletions(-)
>>
>> diff --git a/testcases/kernel/syscalls/clone/clone08.c b/testcases/kernel/syscalls/clone/clone08.c
>> index 14ebf60..610986d 100644
>> --- a/testcases/kernel/syscalls/clone/clone08.c
>> +++ b/testcases/kernel/syscalls/clone/clone08.c
>> @@ -84,15 +84,24 @@ int main(int ac, char **av)
>>   {
>>   	char *msg;
>>   	int i, lc;
>> +	int clone_stopped = 0;
>>   
>>   	msg = parse_opts(ac, av, NULL, NULL);
>>   	if (msg != NULL)
>>   		tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
>>   
>>   	setup();
>> +
>> +#ifdef CLONE_STOPPED
>> +	if (tst_kvercmp(2, 6, 25) > 0)
>> +		clone_stopped =1;
>> +#endif
>> +		
>>   	for (lc = 0; TEST_LOOPING(lc); lc++) {
>>   		tst_count = 0;
>>   		for (i = 0; i < TST_TOTAL; i++) {
>> +			if (clone_stopped == 1 && i ==3)
>> +				continue;
>>   			tst_resm(TINFO, "running %s", test_cases[i].name);
>>   			test_cases[i].testfunc(i);
>>   		}
> I think you should do the kernel version comparison in test_clone_stopped(), and if
> kernel is after 2.6.25, you may print a TCONF with tst_resm() and return.
>
> Here you use "i == 3", but if other elements are added in struct test_case arry,
> the index for test_clone_stopped may change.
Yes,that is a better fix,will update.

Thanks
Shuang
>
> Regards,
> Xiaoguang Wang
>



------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.  Get 
unparalleled scalability from the best Selenium testing platform available.
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

* Re: [LTP] [PATCH] syscalls/clone08: Skip test_clone_stopped after kernel 2.6.25
  2014-04-29  9:25 ` Jan Stancek
@ 2014-04-29 10:54   ` Shuang Qiu
  0 siblings, 0 replies; 5+ messages in thread
From: Shuang Qiu @ 2014-04-29 10:54 UTC (permalink / raw)
  To: Jan Stancek; +Cc: ltp-list

On 04/29/2014 05:25 PM, Jan Stancek wrote:
>
>
>
> ----- Original Message -----
>> From: "shuang qiu" <shuang.qiu@oracle.com>
>> To: ltp-list@lists.sourceforge.net
>> Sent: Tuesday, 29 April, 2014 10:44:26 AM
>> Subject: [LTP] [PATCH] syscalls/clone08: Skip test_clone_stopped after	kernel 2.6.25
>>
>> From: Shuang Qiu <shuang.qiu@oracle.com>
>>
>> According to CLONE manual page "From Linux 2.6.25 this flag is
>> deprecated.You probably never wanted to use it, you certainly shouldn’t
>> be using it,  and  soon  it  will  go away",skip test_clone_stopped
>> after kernel 2.6.25.
> Hi,
>
> "This flag was deprecated from Linux 2.6.25 onward, and was removed altogether in Linux 2.6.38."
>
> As I understand, marking it as deprecated didn't prevent anyone from using it.
> So, shouldn't the test still be valid up to 2.6.38, when it was finally removed?
Sorry,I did not find "removed altogether in Linux 2.6.38" in my lower 
version of manual page.
I agree and will update.
>
>> Signed-off-by: Shuang Qiu <shuang.qiu@oracle.com>
>> ---
>>   testcases/kernel/syscalls/clone/clone08.c |    9 +++++++++
>>   1 files changed, 9 insertions(+), 0 deletions(-)
>>
>> diff --git a/testcases/kernel/syscalls/clone/clone08.c
>> b/testcases/kernel/syscalls/clone/clone08.c
>> index 14ebf60..610986d 100644
>> --- a/testcases/kernel/syscalls/clone/clone08.c
>> +++ b/testcases/kernel/syscalls/clone/clone08.c
>> @@ -84,15 +84,24 @@ int main(int ac, char **av)
>>   {
>>   	char *msg;
>>   	int i, lc;
>> +	int clone_stopped = 0;
>>   
>>   	msg = parse_opts(ac, av, NULL, NULL);
>>   	if (msg != NULL)
>>   		tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
>>   
>>   	setup();
>> +
>> +#ifdef CLONE_STOPPED
>> +	if (tst_kvercmp(2, 6, 25) > 0)
>> +		clone_stopped =1;
>> +#endif
>> +
>>   	for (lc = 0; TEST_LOOPING(lc); lc++) {
>>   		tst_count = 0;
>>   		for (i = 0; i < TST_TOTAL; i++) {
>> +			if (clone_stopped == 1 && i ==3)
>> +				continue;
> I'd suggest to put the check directly to test_clone_stopped()
> and you can avoid using checks that depend on order of testcases:
>
> diff --git a/testcases/kernel/syscalls/clone/clone08.c b/testcases/kernel/syscalls/clone/clone08.c
> index 14ebf60..9518382 100644
> --- a/testcases/kernel/syscalls/clone/clone08.c
> +++ b/testcases/kernel/syscalls/clone/clone08.c
> @@ -238,6 +238,11 @@ static void test_clone_stopped(int t)
>          int flag;
>          pid_t child;
>   
> +       if (tst_kvercmp(2, 6, 38) >= 0) {
> +               tst_resm(TINFO, "CLONE_STOPPED skipped for kernels >= 2.6.38");
> +               return;
> +       }
> +
>          stopped_flag = 0;
>          child = clone_child(&test_cases[t], 1);
Yes,it looks better,thanks for help.

Thanks
Shuang
>
> Regards,
> Jan
>
>>   			tst_resm(TINFO, "running %s", test_cases[i].name);
>>   			test_cases[i].testfunc(i);
>>   		}
>> --
>> 1.7.7
>>
>>
>> ------------------------------------------------------------------------------
>> "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
>> Instantly run your Selenium tests across 300+ browser/OS combos.  Get
>> unparalleled scalability from the best Selenium testing platform available.
>> Simple to use. Nothing to install. Get started now for free."
>> http://p.sf.net/sfu/SauceLabs
>> _______________________________________________
>> Ltp-list mailing list
>> Ltp-list@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/ltp-list
>>



------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.  Get 
unparalleled scalability from the best Selenium testing platform available.
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

end of thread, other threads:[~2014-04-29 10:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-29  8:44 [LTP] [PATCH] syscalls/clone08: Skip test_clone_stopped after kernel 2.6.25 shuang.qiu
2014-04-29  9:04 ` Xiaoguang Wang
2014-04-29 10:51   ` Shuang Qiu
2014-04-29  9:25 ` Jan Stancek
2014-04-29 10:54   ` Shuang Qiu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox