All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH v1] lib/tst_test.sh: skip test if ip returns "Error: Unknown device type"
@ 2021-07-22  6:34 Radoslav Kolev
  2021-07-22  7:49 ` Petr Vorel
  0 siblings, 1 reply; 12+ messages in thread
From: Radoslav Kolev @ 2021-07-22  6:34 UTC (permalink / raw)
  To: ltp

In network stress test groups there are tests expecting
CONFIG_NET_IPVTI to be enabled in the kernel, and if it's not they
fail. There is a check for VTI support in the ip utility, but not
for the kernel. Skip these tests if vti device type is not known by
the kernel.

Signed-off-by: Radoslav Kolev <radoslav.kolev@suse.com>
---
 testcases/lib/tst_test.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/testcases/lib/tst_test.sh b/testcases/lib/tst_test.sh
index c6aa2c487..0458c90c2 100644
--- a/testcases/lib/tst_test.sh
+++ b/testcases/lib/tst_test.sh
@@ -241,12 +241,13 @@ TST_RTNL_CHK()
 	local msg1="RTNETLINK answers: Function not implemented"
 	local msg2="RTNETLINK answers: Operation not supported"
 	local msg3="RTNETLINK answers: Protocol not supported"
+	local msg4="Error: Unknown device type"
 	local output="$($@ 2>&1 || echo 'LTP_ERR')"
 	local msg
 
 	echo "$output" | grep -q "LTP_ERR" || return 0
 
-	for msg in "$msg1" "$msg2" "$msg3"; do
+	for msg in "$msg1" "$msg2" "$msg3" "$msg4"; do
 		echo "$output" | grep -q "$msg" && tst_brk TCONF "'$@': $msg"
 	done
 
-- 
2.26.2


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

* [LTP] [PATCH v1] lib/tst_test.sh: skip test if ip returns "Error: Unknown device type"
  2021-07-22  6:34 [LTP] [PATCH v1] lib/tst_test.sh: skip test if ip returns "Error: Unknown device type" Radoslav Kolev
@ 2021-07-22  7:49 ` Petr Vorel
  2021-07-27  8:20   ` Radoslav Kolev
  0 siblings, 1 reply; 12+ messages in thread
From: Petr Vorel @ 2021-07-22  7:49 UTC (permalink / raw)
  To: ltp

Hi Radoslav,

> In network stress test groups there are tests expecting
> CONFIG_NET_IPVTI to be enabled in the kernel, and if it's not they
> fail. There is a check for VTI support in the ip utility, but not
> for the kernel. Skip these tests if vti device type is not known by
> the kernel.

LGTM.
Reviewed-by: Petr Vorel <pvorel@suse.cz>

Kind regards,
Petr

> Signed-off-by: Radoslav Kolev <radoslav.kolev@suse.com>
> ---
>  testcases/lib/tst_test.sh | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

> diff --git a/testcases/lib/tst_test.sh b/testcases/lib/tst_test.sh
> index c6aa2c487..0458c90c2 100644
> --- a/testcases/lib/tst_test.sh
> +++ b/testcases/lib/tst_test.sh
> @@ -241,12 +241,13 @@ TST_RTNL_CHK()
>  	local msg1="RTNETLINK answers: Function not implemented"
>  	local msg2="RTNETLINK answers: Operation not supported"
>  	local msg3="RTNETLINK answers: Protocol not supported"
> +	local msg4="Error: Unknown device type"
>  	local output="$($@ 2>&1 || echo 'LTP_ERR')"
>  	local msg

>  	echo "$output" | grep -q "LTP_ERR" || return 0

> -	for msg in "$msg1" "$msg2" "$msg3"; do
> +	for msg in "$msg1" "$msg2" "$msg3" "$msg4"; do
>  		echo "$output" | grep -q "$msg" && tst_brk TCONF "'$@': $msg"
>  	done

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

* [LTP] [PATCH v1] lib/tst_test.sh: skip test if ip returns "Error: Unknown device type"
  2021-07-22  7:49 ` Petr Vorel
@ 2021-07-27  8:20   ` Radoslav Kolev
  2021-07-27  8:44     ` Alexey Kodanev
  0 siblings, 1 reply; 12+ messages in thread
From: Radoslav Kolev @ 2021-07-27  8:20 UTC (permalink / raw)
  To: ltp

On 7/22/21 10:49 AM, Petr Vorel wrote:
> Hi Radoslav,
>
>> In network stress test groups there are tests expecting
>> CONFIG_NET_IPVTI to be enabled in the kernel, and if it's not they
>> fail. There is a check for VTI support in the ip utility, but not
>> for the kernel. Skip these tests if vti device type is not known by
>> the kernel.
> LGTM.
> Reviewed-by: Petr Vorel <pvorel@suse.cz>

Thanks for the review, Petr!

Alexey, please let me know if you have any comments.


Regards,

Radoslav


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

* [LTP] [PATCH v1] lib/tst_test.sh: skip test if ip returns "Error: Unknown device type"
  2021-07-27  8:20   ` Radoslav Kolev
@ 2021-07-27  8:44     ` Alexey Kodanev
  2021-07-27 10:02       ` Petr Vorel
  0 siblings, 1 reply; 12+ messages in thread
From: Alexey Kodanev @ 2021-07-27  8:44 UTC (permalink / raw)
  To: ltp

Hi Radoslav,
On 27.07.2021 11:20, Radoslav Kolev wrote:
> On 7/22/21 10:49 AM, Petr Vorel wrote:
>> Hi Radoslav,
>>
>>> In network stress test groups there are tests expecting
>>> CONFIG_NET_IPVTI to be enabled in the kernel, and if it's not they
>>> fail. There is a check for VTI support in the ip utility, but not
>>> for the kernel. Skip these tests if vti device type is not known by
>>> the kernel.
>> LGTM.
>> Reviewed-by: Petr Vorel <pvorel@suse.cz>
> 
> Thanks for the review, Petr!
> 
> Alexey, please let me know if you have any comments.
> 
> 

What about checking vti drivers in stress/ipsec/ipsec_lib.sh:tst_ipsec_setup_vti()
Similar to the checks for xfrm_user driver there...

For example:

tst_net_run -q "tst_check_drivers ip_vti ip6_vti" || \
    tst_brk TCONF "vti driver not available on lhost or rhost"


I think this should work for wireguard02 test as well.

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

* [LTP] [PATCH v1] lib/tst_test.sh: skip test if ip returns "Error: Unknown device type"
  2021-07-27  8:44     ` Alexey Kodanev
@ 2021-07-27 10:02       ` Petr Vorel
  2021-07-28 11:38         ` Alexey Kodanev
  0 siblings, 1 reply; 12+ messages in thread
From: Petr Vorel @ 2021-07-27 10:02 UTC (permalink / raw)
  To: ltp

Hi Alexey, Radoslav,

> Hi Radoslav,

> On 27.07.2021 11:20, Radoslav Kolev wrote:
> > On 7/22/21 10:49 AM, Petr Vorel wrote:
> >> Hi Radoslav,

> >>> In network stress test groups there are tests expecting
> >>> CONFIG_NET_IPVTI to be enabled in the kernel, and if it's not they
> >>> fail. There is a check for VTI support in the ip utility, but not
> >>> for the kernel. Skip these tests if vti device type is not known by
> >>> the kernel.
> >> LGTM.
> >> Reviewed-by: Petr Vorel <pvorel@suse.cz>

> > Thanks for the review, Petr!

> > Alexey, please let me know if you have any comments.



> What about checking vti drivers in stress/ipsec/ipsec_lib.sh:tst_ipsec_setup_vti()
> Similar to the checks for xfrm_user driver there...

> For example:

> tst_net_run -q "tst_check_drivers ip_vti ip6_vti" || \
>     tst_brk TCONF "vti driver not available on lhost or rhost"


> I think this should work for wireguard02 test as well.

The above LGTM, Radoslav, do you have time to look into it?
Alexey, do we also accept this patch? IMHO this error should be mostly TCONF and
it'd work for other possible drivers.

Kind regards,
Petr

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

* [LTP] [PATCH v1] lib/tst_test.sh: skip test if ip returns "Error: Unknown device type"
  2021-07-27 10:02       ` Petr Vorel
@ 2021-07-28 11:38         ` Alexey Kodanev
  2021-07-28 13:06           ` Petr Vorel
  0 siblings, 1 reply; 12+ messages in thread
From: Alexey Kodanev @ 2021-07-28 11:38 UTC (permalink / raw)
  To: ltp

On 27.07.2021 13:02, Petr Vorel wrote:
> Hi Alexey, Radoslav,
> 
>> Hi Radoslav,
> 
>> On 27.07.2021 11:20, Radoslav Kolev wrote:
>>> On 7/22/21 10:49 AM, Petr Vorel wrote:
>>>> Hi Radoslav,
> 
>>>>> In network stress test groups there are tests expecting
>>>>> CONFIG_NET_IPVTI to be enabled in the kernel, and if it's not they
>>>>> fail. There is a check for VTI support in the ip utility, but not
>>>>> for the kernel. Skip these tests if vti device type is not known by
>>>>> the kernel.
>>>> LGTM.
>>>> Reviewed-by: Petr Vorel <pvorel@suse.cz>
> 
>>> Thanks for the review, Petr!
> 
>>> Alexey, please let me know if you have any comments.
> 
> 
> 
>> What about checking vti drivers in stress/ipsec/ipsec_lib.sh:tst_ipsec_setup_vti()
>> Similar to the checks for xfrm_user driver there...
> 
>> For example:
> 
>> tst_net_run -q "tst_check_drivers ip_vti ip6_vti" || \
>>     tst_brk TCONF "vti driver not available on lhost or rhost"
> 
> 
>> I think this should work for wireguard02 test as well.
> 
> The above LGTM, Radoslav, do you have time to look into it?
> Alexey, do we also accept this patch? IMHO this error should be mostly TCONF and
> it'd work for other possible drivers.
> 

Not sure if we really want to add the new patterns every time the
error message from ip changes. For example depending on the ip/libc
the error can be "Error: Unknown device type." or "RTNETLINK answers:
Not supported".

We could also save the error message in setup by passing the wrong
type and then compare it during the test:

no_dev_msg="$(ip link add ltp0 type ltp0 2>&1)"

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

* [LTP] [PATCH v1] lib/tst_test.sh: skip test if ip returns "Error: Unknown device type"
  2021-07-28 11:38         ` Alexey Kodanev
@ 2021-07-28 13:06           ` Petr Vorel
  2021-07-28 14:00             ` Radoslav Kolev
  2021-07-28 14:04             ` [LTP] [PATCH v2] ipsec_lib.sh: check ip_vti/ip6_vti are enabled or skip tests Radoslav Kolev
  0 siblings, 2 replies; 12+ messages in thread
From: Petr Vorel @ 2021-07-28 13:06 UTC (permalink / raw)
  To: ltp

> On 27.07.2021 13:02, Petr Vorel wrote:
> > Hi Alexey, Radoslav,

> >> Hi Radoslav,

> >> On 27.07.2021 11:20, Radoslav Kolev wrote:
> >>> On 7/22/21 10:49 AM, Petr Vorel wrote:
> >>>> Hi Radoslav,

> >>>>> In network stress test groups there are tests expecting
> >>>>> CONFIG_NET_IPVTI to be enabled in the kernel, and if it's not they
> >>>>> fail. There is a check for VTI support in the ip utility, but not
> >>>>> for the kernel. Skip these tests if vti device type is not known by
> >>>>> the kernel.
> >>>> LGTM.
> >>>> Reviewed-by: Petr Vorel <pvorel@suse.cz>

> >>> Thanks for the review, Petr!

> >>> Alexey, please let me know if you have any comments.



> >> What about checking vti drivers in stress/ipsec/ipsec_lib.sh:tst_ipsec_setup_vti()
> >> Similar to the checks for xfrm_user driver there...

> >> For example:

> >> tst_net_run -q "tst_check_drivers ip_vti ip6_vti" || \
> >>     tst_brk TCONF "vti driver not available on lhost or rhost"


> >> I think this should work for wireguard02 test as well.

> > The above LGTM, Radoslav, do you have time to look into it?
> > Alexey, do we also accept this patch? IMHO this error should be mostly TCONF and
> > it'd work for other possible drivers.


> Not sure if we really want to add the new patterns every time the
> error message from ip changes. For example depending on the ip/libc
> the error can be "Error: Unknown device type." or "RTNETLINK answers:
> Not supported".
Sure, more effective ways are always welcome.

> We could also save the error message in setup by passing the wrong
> type and then compare it during the test:

> no_dev_msg="$(ip link add ltp0 type ltp0 2>&1)"
Yep, that'd be safer. But your original proposal to check ip_vti ip6_vti
is IMHO the best solution. Radoslav, would you send a new patch with it?

Kind regards,
Petr

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

* [LTP] [PATCH v1] lib/tst_test.sh: skip test if ip returns "Error: Unknown device type"
  2021-07-28 13:06           ` Petr Vorel
@ 2021-07-28 14:00             ` Radoslav Kolev
  2021-07-28 14:04             ` [LTP] [PATCH v2] ipsec_lib.sh: check ip_vti/ip6_vti are enabled or skip tests Radoslav Kolev
  1 sibling, 0 replies; 12+ messages in thread
From: Radoslav Kolev @ 2021-07-28 14:00 UTC (permalink / raw)
  To: ltp

On 7/28/21 4:06 PM, Petr Vorel wrote:
> Yep, that'd be safer. But your original proposal to check ip_vti ip6_vti
> is IMHO the best solution. Radoslav, would you send a new patch with it?

Agreed that the proposed by Alexey is a better approach. Yes, patch is 
coming.


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

* [LTP] [PATCH v2] ipsec_lib.sh: check ip_vti/ip6_vti are enabled or skip tests
  2021-07-28 13:06           ` Petr Vorel
  2021-07-28 14:00             ` Radoslav Kolev
@ 2021-07-28 14:04             ` Radoslav Kolev
  2021-07-30  7:08               ` Petr Vorel
  1 sibling, 1 reply; 12+ messages in thread
From: Radoslav Kolev @ 2021-07-28 14:04 UTC (permalink / raw)
  To: ltp

In network stress test groups there are tests expecting
CONFIG_NET_IPVTI/CONFIG_IPV6_VTI to be enabled in the kernel,
and if it's not they fail. There is a check for VTI support in
the ip utility, but not for the kernel. Skip these tests if
there is no ip_vti/ip6_vti support in the kernel.

Signed-off-by: Radoslav Kolev <radoslav.kolev@suse.com>
---
 testcases/network/stress/ipsec/ipsec_lib.sh | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/testcases/network/stress/ipsec/ipsec_lib.sh b/testcases/network/stress/ipsec/ipsec_lib.sh
index e395e1ff3..fce05622d 100644
--- a/testcases/network/stress/ipsec/ipsec_lib.sh
+++ b/testcases/network/stress/ipsec/ipsec_lib.sh
@@ -292,6 +292,14 @@ tst_ipsec_setup_vti()
 
 	tst_res TINFO "Test vti$TST_IPV6 + IPsec[$IPSEC_PROTO/$IPSEC_MODE]"
 
+	if [ "$TST_IPV6" ]; then
+                tst_net_run -q "tst_check_drivers ip6_vti" || \
+                        tst_brk TCONF "ip6_vti driver not available on lhost or rhost"
+        else
+                tst_net_run -q "tst_check_drivers ip_vti" || \
+                        tst_brk TCONF "ip_vti driver not available on lhost or rhost"
+        fi
+
 	tst_ipsec_vti lhost $ip_loc $ip_rmt $tst_vti
 	tst_ipsec_vti rhost $ip_rmt $ip_loc $tst_vti
 
-- 
2.26.2


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

* [LTP] [PATCH v2] ipsec_lib.sh: check ip_vti/ip6_vti are enabled or skip tests
  2021-07-28 14:04             ` [LTP] [PATCH v2] ipsec_lib.sh: check ip_vti/ip6_vti are enabled or skip tests Radoslav Kolev
@ 2021-07-30  7:08               ` Petr Vorel
  2021-07-30  7:50                 ` Alexey Kodanev
  0 siblings, 1 reply; 12+ messages in thread
From: Petr Vorel @ 2021-07-30  7:08 UTC (permalink / raw)
  To: ltp

Hi Radoslav,

...
> +	if [ "$TST_IPV6" ]; then
> +                tst_net_run -q "tst_check_drivers ip6_vti" || \
> +                        tst_brk TCONF "ip6_vti driver not available on lhost or rhost"
> +        else
> +                tst_net_run -q "tst_check_drivers ip_vti" || \
> +                        tst_brk TCONF "ip_vti driver not available on lhost or rhost"
> +        fi
nit: broken indentation, but that'll be fix during merge.

LGTM, but I'm going to merge shorter version (we have $TST_IPV6 for this
purpose).

tst_net_run -q "tst_check_drivers ip${TST_IPV6}_vti" || \
	tst_brk TCONF "ip${TST_IPV6}_vti driver not available on lhost or rhost"

Reviewed-by: Petr Vorel <pvorel@suse.cz>

Kind regards,
Petr

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

* [LTP] [PATCH v2] ipsec_lib.sh: check ip_vti/ip6_vti are enabled or skip tests
  2021-07-30  7:08               ` Petr Vorel
@ 2021-07-30  7:50                 ` Alexey Kodanev
  2021-07-30  9:45                   ` Petr Vorel
  0 siblings, 1 reply; 12+ messages in thread
From: Alexey Kodanev @ 2021-07-30  7:50 UTC (permalink / raw)
  To: ltp

On 30.07.2021 10:08, Petr Vorel wrote:
> Hi Radoslav,
> 
> ...
>> +	if [ "$TST_IPV6" ]; then
>> +                tst_net_run -q "tst_check_drivers ip6_vti" || \
>> +                        tst_brk TCONF "ip6_vti driver not available on lhost or rhost"
>> +        else
>> +                tst_net_run -q "tst_check_drivers ip_vti" || \
>> +                        tst_brk TCONF "ip_vti driver not available on lhost or rhost"
>> +        fi
> nit: broken indentation, but that'll be fix during merge.
> 
> LGTM, but I'm going to merge shorter version (we have $TST_IPV6 for this
> purpose).
> 
> tst_net_run -q "tst_check_drivers ip${TST_IPV6}_vti" || \
> 	tst_brk TCONF "ip${TST_IPV6}_vti driver not available on lhost or rhost"
> 
> Reviewed-by: Petr Vorel <pvorel@suse.cz>

Thanks Radoslav, Petr!

Reviewed-by: Alexey Kodanev <aleksei.kodanev@bell-sw.com>

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

* [LTP] [PATCH v2] ipsec_lib.sh: check ip_vti/ip6_vti are enabled or skip tests
  2021-07-30  7:50                 ` Alexey Kodanev
@ 2021-07-30  9:45                   ` Petr Vorel
  0 siblings, 0 replies; 12+ messages in thread
From: Petr Vorel @ 2021-07-30  9:45 UTC (permalink / raw)
  To: ltp

Hi Radoslav, Alexey,

thanks a lot both, merged.

Kind regards,
Petr

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

end of thread, other threads:[~2021-07-30  9:45 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-22  6:34 [LTP] [PATCH v1] lib/tst_test.sh: skip test if ip returns "Error: Unknown device type" Radoslav Kolev
2021-07-22  7:49 ` Petr Vorel
2021-07-27  8:20   ` Radoslav Kolev
2021-07-27  8:44     ` Alexey Kodanev
2021-07-27 10:02       ` Petr Vorel
2021-07-28 11:38         ` Alexey Kodanev
2021-07-28 13:06           ` Petr Vorel
2021-07-28 14:00             ` Radoslav Kolev
2021-07-28 14:04             ` [LTP] [PATCH v2] ipsec_lib.sh: check ip_vti/ip6_vti are enabled or skip tests Radoslav Kolev
2021-07-30  7:08               ` Petr Vorel
2021-07-30  7:50                 ` Alexey Kodanev
2021-07-30  9:45                   ` Petr Vorel

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.