All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] selftests: net: vrf_strict_mode_test: add support to select a test to run
@ 2022-04-20  4:55 Jaehee Park
  2022-04-20  5:01 ` Jaehee
  2022-04-21 14:52 ` Roopa Prabhu
  0 siblings, 2 replies; 7+ messages in thread
From: Jaehee Park @ 2022-04-20  4:55 UTC (permalink / raw)
  To: outreachy, Julia Denham, Roopa Prabhu, Stefano Brivio, netdev,
	jhpark1013

Add a boilerplate test loop to run all tests in
vrf_strict_mode_test.sh.

Signed-off-by: Jaehee Park <jhpark1013@gmail.com>
---
 .../testing/selftests/net/vrf_strict_mode_test.sh  | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/net/vrf_strict_mode_test.sh b/tools/testing/selftests/net/vrf_strict_mode_test.sh
index 865d53c1781c..116ca43381b5 100755
--- a/tools/testing/selftests/net/vrf_strict_mode_test.sh
+++ b/tools/testing/selftests/net/vrf_strict_mode_test.sh
@@ -14,6 +14,8 @@ INIT_NETNS_NAME="init"
 
 PAUSE_ON_FAIL=${PAUSE_ON_FAIL:=no}
 
+TESTS="vrf_strict_mode_tests_init vrf_strict_mode_tests_testns vrf_strict_mode_tests_mix"
+
 log_test()
 {
 	local rc=$1
@@ -391,7 +393,17 @@ fi
 cleanup &> /dev/null
 
 setup
-vrf_strict_mode_tests
+for t in $TESTS
+do
+	case $t in
+	vrf_strict_mode_tests_init|vrf_strict_mode_init) vrf_strict_mode_tests_init;;
+	vrf_strict_mode_tests_testns|vrf_strict_mode_testns) vrf_strict_mode_tests_testns;;
+	vrf_strict_mode_tests_mix|vrf_strict_mode_mix) vrf_strict_mode_tests_mix;;
+
+	help) echo "Test names: $TESTS"; exit 0;;
+
+	esac
+done
 cleanup
 
 print_log_test_results
-- 
2.25.1


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

* Re: [PATCH net-next] selftests: net: vrf_strict_mode_test: add support to select a test to run
  2022-04-20  4:55 [PATCH net-next] selftests: net: vrf_strict_mode_test: add support to select a test to run Jaehee Park
@ 2022-04-20  5:01 ` Jaehee
  2022-04-21 14:52 ` Roopa Prabhu
  1 sibling, 0 replies; 7+ messages in thread
From: Jaehee @ 2022-04-20  5:01 UTC (permalink / raw)
  To: Outreachy Linux Kernel, Julia Denham, Roopa Prabhu,
	Stefano Brivio, netdev, Jaehee Park

Sorry, I sent two of the same patch by accident. Please ignore this one.


On Wed, Apr 20, 2022 at 12:55 AM Jaehee Park <jhpark1013@gmail.com> wrote:
>
> Add a boilerplate test loop to run all tests in
> vrf_strict_mode_test.sh.
>
> Signed-off-by: Jaehee Park <jhpark1013@gmail.com>
> ---
>  .../testing/selftests/net/vrf_strict_mode_test.sh  | 14 +++++++++++++-
>  1 file changed, 13 insertions(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/net/vrf_strict_mode_test.sh b/tools/testing/selftests/net/vrf_strict_mode_test.sh
> index 865d53c1781c..116ca43381b5 100755
> --- a/tools/testing/selftests/net/vrf_strict_mode_test.sh
> +++ b/tools/testing/selftests/net/vrf_strict_mode_test.sh
> @@ -14,6 +14,8 @@ INIT_NETNS_NAME="init"
>
>  PAUSE_ON_FAIL=${PAUSE_ON_FAIL:=no}
>
> +TESTS="vrf_strict_mode_tests_init vrf_strict_mode_tests_testns vrf_strict_mode_tests_mix"
> +
>  log_test()
>  {
>         local rc=$1
> @@ -391,7 +393,17 @@ fi
>  cleanup &> /dev/null
>
>  setup
> -vrf_strict_mode_tests
> +for t in $TESTS
> +do
> +       case $t in
> +       vrf_strict_mode_tests_init|vrf_strict_mode_init) vrf_strict_mode_tests_init;;
> +       vrf_strict_mode_tests_testns|vrf_strict_mode_testns) vrf_strict_mode_tests_testns;;
> +       vrf_strict_mode_tests_mix|vrf_strict_mode_mix) vrf_strict_mode_tests_mix;;
> +
> +       help) echo "Test names: $TESTS"; exit 0;;
> +
> +       esac
> +done
>  cleanup
>
>  print_log_test_results
> --
> 2.25.1
>

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

* Re: [PATCH net-next] selftests: net: vrf_strict_mode_test: add support to select a test to run
  2022-04-20  4:55 [PATCH net-next] selftests: net: vrf_strict_mode_test: add support to select a test to run Jaehee Park
  2022-04-20  5:01 ` Jaehee
@ 2022-04-21 14:52 ` Roopa Prabhu
       [not found]   ` <ea64041b-635b-8c71-c9ac-b158403a276e@nvidia.com>
  2022-04-21 16:47   ` Jaehee Park
  1 sibling, 2 replies; 7+ messages in thread
From: Roopa Prabhu @ 2022-04-21 14:52 UTC (permalink / raw)
  To: Jaehee Park, outreachy, Julia Denham, Roopa Prabhu,
	Stefano Brivio, netdev


On 4/19/22 21:55, Jaehee Park wrote:
> Add a boilerplate test loop to run all tests in
> vrf_strict_mode_test.sh.
>
> Signed-off-by: Jaehee Park <jhpark1013@gmail.com>
> ---

Jaehee, this needs more work. The idea is to be able to run individual 
tests with -t option.

An example is drop_monitor_tests.sh, see the usage and getopts arg 
parsing at the beginning of the test

eg ./drop_monitor_tests.sh -t <testname>


>   .../testing/selftests/net/vrf_strict_mode_test.sh  | 14 +++++++++++++-
>   1 file changed, 13 insertions(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/net/vrf_strict_mode_test.sh b/tools/testing/selftests/net/vrf_strict_mode_test.sh
> index 865d53c1781c..116ca43381b5 100755
> --- a/tools/testing/selftests/net/vrf_strict_mode_test.sh
> +++ b/tools/testing/selftests/net/vrf_strict_mode_test.sh
> @@ -14,6 +14,8 @@ INIT_NETNS_NAME="init"
>   
>   PAUSE_ON_FAIL=${PAUSE_ON_FAIL:=no}
>   
> +TESTS="vrf_strict_mode_tests_init vrf_strict_mode_tests_testns vrf_strict_mode_tests_mix"
> +
>   log_test()
>   {
>   	local rc=$1
> @@ -391,7 +393,17 @@ fi
>   cleanup &> /dev/null
>   
>   setup
> -vrf_strict_mode_tests
> +for t in $TESTS
> +do
> +	case $t in
> +	vrf_strict_mode_tests_init|vrf_strict_mode_init) vrf_strict_mode_tests_init;;
> +	vrf_strict_mode_tests_testns|vrf_strict_mode_testns) vrf_strict_mode_tests_testns;;
> +	vrf_strict_mode_tests_mix|vrf_strict_mode_mix) vrf_strict_mode_tests_mix;;
> +
> +	help) echo "Test names: $TESTS"; exit 0;;
> +
> +	esac
> +done
>   cleanup
>   
>   print_log_test_results

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

* Re: Fwd: [PATCH net-next] selftests: net: vrf_strict_mode_test: add support to select a test to run
       [not found]   ` <ea64041b-635b-8c71-c9ac-b158403a276e@nvidia.com>
@ 2022-04-21 15:05     ` Roopa Prabhu
  0 siblings, 0 replies; 7+ messages in thread
From: Roopa Prabhu @ 2022-04-21 15:05 UTC (permalink / raw)
  To: Alaa Mohamed; +Cc: Jaehee Park, outreachy


On 4/21/22 07:53, Roopa Prabhu wrote:
>
> Alaa, looks like your test patch also has the same problem
>

To elaborate some more, fib_rule_tests.sh also needs to support -t to 
make the patch useful. something like the below.

I have now added some clarifying notes and also testing notes to the 
networking task board under Task5 for this.


diff --git a/tools/testing/selftests/net/fib_rule_tests.sh 
b/tools/testing/selftests/net/fib_rule_tests.sh
index bbe3b379927a..d0651a413053 100755
--- a/tools/testing/selftests/net/fib_rule_tests.sh
+++ b/tools/testing/selftests/net/fib_rule_tests.sh
@@ -304,6 +304,24 @@ run_fibrule_tests()
         fib_rule6_test
  }

+usage()
+{
+       cat <<EOF
+usage: ${0##*/} OPTS
+
+        -t <test>   Test(s) to run (default: all)
+                    (options: $TESTS)
+EOF
+}
+
+while getopts ":t:h" opt; do
+       case $opt in
+               t) TESTS=$OPTARG;;
+               h) usage; exit 0;;
+               *) usage; exit 1;;
+       esac
+done
+



>
>
> -------- Forwarded Message --------
> Subject: 	Re: [PATCH net-next] selftests: net: vrf_strict_mode_test: 
> add support to select a test to run
> Date: 	Thu, 21 Apr 2022 07:52:45 -0700
> From: 	Roopa Prabhu <roopa@nvidia.com>
> To: 	Jaehee Park <jhpark1013@gmail.com>, outreachy@lists.linux.dev, 
> Julia Denham <jdenham@redhat.com>, Roopa Prabhu 
> <roopa.prabhu@gmail.com>, Stefano Brivio <sbrivio@redhat.com>, 
> netdev@vger.kernel.org
>
>
>
>
> On 4/19/22 21:55, Jaehee Park wrote:
>> Add a boilerplate test loop to run all tests in
>> vrf_strict_mode_test.sh.
>>
>> Signed-off-by: Jaehee Park <jhpark1013@gmail.com>
>> ---
>
> Jaehee, this needs more work. The idea is to be able to run individual 
> tests with -t option.
>
> An example is drop_monitor_tests.sh, see the usage and getopts arg 
> parsing at the beginning of the test
>
> eg ./drop_monitor_tests.sh -t <testname>
>
>
>> .../testing/selftests/net/vrf_strict_mode_test.sh | 14 +++++++++++++-
>> 1 file changed, 13 insertions(+), 1 deletion(-)
>>
>> diff --git a/tools/testing/selftests/net/vrf_strict_mode_test.sh 
>> b/tools/testing/selftests/net/vrf_strict_mode_test.sh
>> index 865d53c1781c..116ca43381b5 100755
>> --- a/tools/testing/selftests/net/vrf_strict_mode_test.sh
>> +++ b/tools/testing/selftests/net/vrf_strict_mode_test.sh
>> @@ -14,6 +14,8 @@ INIT_NETNS_NAME="init"
>> PAUSE_ON_FAIL=${PAUSE_ON_FAIL:=no}
>> +TESTS="vrf_strict_mode_tests_init vrf_strict_mode_tests_testns 
>> vrf_strict_mode_tests_mix"
>> +
>> log_test()
>> {
>> local rc=$1
>> @@ -391,7 +393,17 @@ fi
>> cleanup &> /dev/null
>> setup
>> -vrf_strict_mode_tests
>> +for t in $TESTS
>> +do
>> + case $t in
>> + vrf_strict_mode_tests_init|vrf_strict_mode_init) 
>> vrf_strict_mode_tests_init;;
>> + vrf_strict_mode_tests_testns|vrf_strict_mode_testns) 
>> vrf_strict_mode_tests_testns;;
>> + vrf_strict_mode_tests_mix|vrf_strict_mode_mix) 
>> vrf_strict_mode_tests_mix;;
>> +
>> + help) echo "Test names: $TESTS"; exit 0;;
>> +
>> + esac
>> +done
>> cleanup
>> print_log_test_results

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

* Re: [PATCH net-next] selftests: net: vrf_strict_mode_test: add support to select a test to run
  2022-04-21 14:52 ` Roopa Prabhu
       [not found]   ` <ea64041b-635b-8c71-c9ac-b158403a276e@nvidia.com>
@ 2022-04-21 16:47   ` Jaehee Park
  1 sibling, 0 replies; 7+ messages in thread
From: Jaehee Park @ 2022-04-21 16:47 UTC (permalink / raw)
  To: Roopa Prabhu
  Cc: outreachy, Julia Denham, Roopa Prabhu, Stefano Brivio, netdev

On Thu, Apr 21, 2022 at 07:52:45AM -0700, Roopa Prabhu wrote:
> 
> On 4/19/22 21:55, Jaehee Park wrote:
> > Add a boilerplate test loop to run all tests in
> > vrf_strict_mode_test.sh.
> > 
> > Signed-off-by: Jaehee Park <jhpark1013@gmail.com>
> > ---
> 
> Jaehee, this needs more work. The idea is to be able to run individual tests
> with -t option.
> 
> An example is drop_monitor_tests.sh, see the usage and getopts arg parsing
> at the beginning of the test
> 
> eg ./drop_monitor_tests.sh -t <testname>
> 
> 

Thanks Roopa, I've sent version 2 for your review. 


> >   .../testing/selftests/net/vrf_strict_mode_test.sh  | 14 +++++++++++++-
> >   1 file changed, 13 insertions(+), 1 deletion(-)
> > 
> > diff --git a/tools/testing/selftests/net/vrf_strict_mode_test.sh b/tools/testing/selftests/net/vrf_strict_mode_test.sh
> > index 865d53c1781c..116ca43381b5 100755
> > --- a/tools/testing/selftests/net/vrf_strict_mode_test.sh
> > +++ b/tools/testing/selftests/net/vrf_strict_mode_test.sh
> > @@ -14,6 +14,8 @@ INIT_NETNS_NAME="init"
> >   PAUSE_ON_FAIL=${PAUSE_ON_FAIL:=no}
> > +TESTS="vrf_strict_mode_tests_init vrf_strict_mode_tests_testns vrf_strict_mode_tests_mix"
> > +
> >   log_test()
> >   {
> >   	local rc=$1
> > @@ -391,7 +393,17 @@ fi
> >   cleanup &> /dev/null
> >   setup
> > -vrf_strict_mode_tests
> > +for t in $TESTS
> > +do
> > +	case $t in
> > +	vrf_strict_mode_tests_init|vrf_strict_mode_init) vrf_strict_mode_tests_init;;
> > +	vrf_strict_mode_tests_testns|vrf_strict_mode_testns) vrf_strict_mode_tests_testns;;
> > +	vrf_strict_mode_tests_mix|vrf_strict_mode_mix) vrf_strict_mode_tests_mix;;
> > +
> > +	help) echo "Test names: $TESTS"; exit 0;;
> > +
> > +	esac
> > +done
> >   cleanup
> >   print_log_test_results

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

* Re: [PATCH] [net-next] selftests: net: vrf_strict_mode_test: add support to select a test to run
  2022-04-20  4:46 [PATCH] [net-next] " Jaehee Park
@ 2022-04-21 14:53 ` Roopa Prabhu
  0 siblings, 0 replies; 7+ messages in thread
From: Roopa Prabhu @ 2022-04-21 14:53 UTC (permalink / raw)
  To: Jaehee Park, outreachy, Julia Denham, Roopa Prabhu,
	Stefano Brivio, netdev


On 4/19/22 21:46, Jaehee Park wrote:
> Add a boilerplate test loop to run all tests in
> vrf_strict_mode_test.sh.
>
> Signed-off-by: Jaehee Park <jhpark1013@gmail.com>
> ---

pls ignore this, duplicate patch


>   .../testing/selftests/net/vrf_strict_mode_test.sh  | 14 +++++++++++++-
>   1 file changed, 13 insertions(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/net/vrf_strict_mode_test.sh b/tools/testing/selftests/net/vrf_strict_mode_test.sh
> index 865d53c1781c..116ca43381b5 100755
> --- a/tools/testing/selftests/net/vrf_strict_mode_test.sh
> +++ b/tools/testing/selftests/net/vrf_strict_mode_test.sh
> @@ -14,6 +14,8 @@ INIT_NETNS_NAME="init"
>   
>   PAUSE_ON_FAIL=${PAUSE_ON_FAIL:=no}
>   
> +TESTS="vrf_strict_mode_tests_init vrf_strict_mode_tests_testns vrf_strict_mode_tests_mix"
> +
>   log_test()
>   {
>   	local rc=$1
> @@ -391,7 +393,17 @@ fi
>   cleanup &> /dev/null
>   
>   setup
> -vrf_strict_mode_tests
> +for t in $TESTS
> +do
> +	case $t in
> +	vrf_strict_mode_tests_init|vrf_strict_mode_init) vrf_strict_mode_tests_init;;
> +	vrf_strict_mode_tests_testns|vrf_strict_mode_testns) vrf_strict_mode_tests_testns;;
> +	vrf_strict_mode_tests_mix|vrf_strict_mode_mix) vrf_strict_mode_tests_mix;;
> +
> +	help) echo "Test names: $TESTS"; exit 0;;
> +
> +	esac
> +done
>   cleanup
>   
>   print_log_test_results

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

* [PATCH] [net-next] selftests: net: vrf_strict_mode_test: add support to select a test to run
@ 2022-04-20  4:46 Jaehee Park
  2022-04-21 14:53 ` Roopa Prabhu
  0 siblings, 1 reply; 7+ messages in thread
From: Jaehee Park @ 2022-04-20  4:46 UTC (permalink / raw)
  To: outreachy, Julia Denham, Roopa Prabhu, Stefano Brivio, netdev,
	jhpark1013

Add a boilerplate test loop to run all tests in
vrf_strict_mode_test.sh.

Signed-off-by: Jaehee Park <jhpark1013@gmail.com>
---
 .../testing/selftests/net/vrf_strict_mode_test.sh  | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/net/vrf_strict_mode_test.sh b/tools/testing/selftests/net/vrf_strict_mode_test.sh
index 865d53c1781c..116ca43381b5 100755
--- a/tools/testing/selftests/net/vrf_strict_mode_test.sh
+++ b/tools/testing/selftests/net/vrf_strict_mode_test.sh
@@ -14,6 +14,8 @@ INIT_NETNS_NAME="init"
 
 PAUSE_ON_FAIL=${PAUSE_ON_FAIL:=no}
 
+TESTS="vrf_strict_mode_tests_init vrf_strict_mode_tests_testns vrf_strict_mode_tests_mix"
+
 log_test()
 {
 	local rc=$1
@@ -391,7 +393,17 @@ fi
 cleanup &> /dev/null
 
 setup
-vrf_strict_mode_tests
+for t in $TESTS
+do
+	case $t in
+	vrf_strict_mode_tests_init|vrf_strict_mode_init) vrf_strict_mode_tests_init;;
+	vrf_strict_mode_tests_testns|vrf_strict_mode_testns) vrf_strict_mode_tests_testns;;
+	vrf_strict_mode_tests_mix|vrf_strict_mode_mix) vrf_strict_mode_tests_mix;;
+
+	help) echo "Test names: $TESTS"; exit 0;;
+
+	esac
+done
 cleanup
 
 print_log_test_results
-- 
2.25.1


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

end of thread, other threads:[~2022-04-21 16:47 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-20  4:55 [PATCH net-next] selftests: net: vrf_strict_mode_test: add support to select a test to run Jaehee Park
2022-04-20  5:01 ` Jaehee
2022-04-21 14:52 ` Roopa Prabhu
     [not found]   ` <ea64041b-635b-8c71-c9ac-b158403a276e@nvidia.com>
2022-04-21 15:05     ` Fwd: " Roopa Prabhu
2022-04-21 16:47   ` Jaehee Park
  -- strict thread matches above, loose matches on Subject: below --
2022-04-20  4:46 [PATCH] [net-next] " Jaehee Park
2022-04-21 14:53 ` Roopa Prabhu

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.