* [LTP] [PATCH 1/3] net: Create tst_ipsec_setup to remove duplicity
@ 2018-06-14 13:15 Petr Vorel
2018-06-14 13:15 ` [LTP] [PATCH 2/3] net/icmp-uni-basic.sh: Remove LINK_NUM + related setup Petr Vorel
2018-06-14 13:15 ` [LTP] [PATCH 3/3] net/icmp: Unify log info messages Petr Vorel
0 siblings, 2 replies; 5+ messages in thread
From: Petr Vorel @ 2018-06-14 13:15 UTC (permalink / raw)
To: ltp
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
Same as in v1.
---
testcases/network/stress/dccp/dccp_ipsec.sh | 11 +----------
testcases/network/stress/icmp/icmp-uni-basic.sh | 10 ++--------
testcases/network/stress/ipsec/ipsec_lib.sh | 9 +++++++++
testcases/network/stress/sctp/sctp_ipsec.sh | 11 +----------
testcases/network/stress/tcp/tcp_ipsec.sh | 11 +----------
testcases/network/stress/udp/udp_ipsec.sh | 11 +----------
6 files changed, 15 insertions(+), 48 deletions(-)
diff --git a/testcases/network/stress/dccp/dccp_ipsec.sh b/testcases/network/stress/dccp/dccp_ipsec.sh
index 6c39fa39d..624f8e0af 100755
--- a/testcases/network/stress/dccp/dccp_ipsec.sh
+++ b/testcases/network/stress/dccp/dccp_ipsec.sh
@@ -23,15 +23,6 @@ TST_CLEANUP="tst_ipsec_cleanup"
. ipsec_lib.sh
-do_setup()
-{
- # Configure SAD/SPD
- if [ -n "$IPSEC_MODE" -a -n "$IPSEC_PROTO" ]; then
- tst_ipsec lhost $(tst_ipaddr) $(tst_ipaddr rhost)
- tst_ipsec rhost $(tst_ipaddr rhost) $(tst_ipaddr)
- fi
-}
-
do_test()
{
for p in $IPSEC_SIZE_ARRAY; do
@@ -40,7 +31,7 @@ do_test()
done
}
-do_setup
+tst_ipsec_setup
do_test
diff --git a/testcases/network/stress/icmp/icmp-uni-basic.sh b/testcases/network/stress/icmp/icmp-uni-basic.sh
index 78017ee7a..5fe6b9b13 100755
--- a/testcases/network/stress/icmp/icmp-uni-basic.sh
+++ b/testcases/network/stress/icmp/icmp-uni-basic.sh
@@ -26,15 +26,13 @@ TST_CLEANUP="tst_ipsec_cleanup"
. ipsec_lib.sh
LINK_NUM=${LINK_NUM:-0}
-DO_IPSEC=${DO_IPSEC:-false}
-[ -n "$IPSEC_MODE" -a -n "$IPSEC_PROTO" ] && DO_IPSEC=true || DO_IPSEC=false
# Test description
tst_resm TINFO "Sending ICMP messages with the following conditions"
tst_resm TINFO "- Version of IP is IPv${TST_IPV6:-4}"
tst_resm TINFO "- Size of packets are ( $IPSEC_SIZE_ARRAY )"
-if $DO_IPSEC; then
+if [ -n "$IPSEC_MODE" -a -n "$IPSEC_PROTO" ]; then
case $IPSEC_PROTO in
ah) tst_resm TINFO "- IPsec [ AH / $IPSEC_MODE ]" ;;
esp) tst_resm TINFO "- IPsec [ ESP / $IPSEC_MODE ]" ;;
@@ -49,11 +47,7 @@ rhost_ifname=$(tst_iface rhost $LINK_NUM)
lhost_addr=$(tst_ipaddr)
rhost_addr=$(tst_ipaddr rhost)
-# Configure SAD/SPD
-if $DO_IPSEC ; then
- tst_ipsec lhost $lhost_addr $rhost_addr
- tst_ipsec rhost $rhost_addr $lhost_addr
-fi
+tst_ipsec_setup
PING_MAX="$IPSEC_REQUESTS"
diff --git a/testcases/network/stress/ipsec/ipsec_lib.sh b/testcases/network/stress/ipsec/ipsec_lib.sh
index 480fe064a..2e001c718 100644
--- a/testcases/network/stress/ipsec/ipsec_lib.sh
+++ b/testcases/network/stress/ipsec/ipsec_lib.sh
@@ -111,6 +111,15 @@ cleanup_vti=
ALG=
ALGR=
+tst_ipsec_setup()
+{
+ # Configure SAD/SPD
+ if [ -n "$IPSEC_MODE" -a -n "$IPSEC_PROTO" ]; then
+ tst_ipsec lhost $(tst_ipaddr) $(tst_ipaddr rhost)
+ tst_ipsec rhost $(tst_ipaddr rhost) $(tst_ipaddr)
+ fi
+}
+
# tst_ipsec_cleanup: flush ipsec state and policy rules
tst_ipsec_cleanup()
{
diff --git a/testcases/network/stress/sctp/sctp_ipsec.sh b/testcases/network/stress/sctp/sctp_ipsec.sh
index 677ccbfed..5f99bc7df 100755
--- a/testcases/network/stress/sctp/sctp_ipsec.sh
+++ b/testcases/network/stress/sctp/sctp_ipsec.sh
@@ -23,15 +23,6 @@ TST_CLEANUP="tst_ipsec_cleanup"
. ipsec_lib.sh
-do_setup()
-{
- # Configure SAD/SPD
- if [ -n "$IPSEC_MODE" -a -n "$IPSEC_PROTO" ]; then
- tst_ipsec lhost $(tst_ipaddr) $(tst_ipaddr rhost)
- tst_ipsec rhost $(tst_ipaddr rhost) $(tst_ipaddr)
- fi
-}
-
do_test()
{
for p in $IPSEC_SIZE_ARRAY; do
@@ -40,7 +31,7 @@ do_test()
done
}
-do_setup
+tst_ipsec_setup
do_test
diff --git a/testcases/network/stress/tcp/tcp_ipsec.sh b/testcases/network/stress/tcp/tcp_ipsec.sh
index aeb33d663..86f455532 100755
--- a/testcases/network/stress/tcp/tcp_ipsec.sh
+++ b/testcases/network/stress/tcp/tcp_ipsec.sh
@@ -25,15 +25,6 @@ max_requests=10
. ipsec_lib.sh
-do_setup()
-{
- # Configure SAD/SPD
- if [ -n "$IPSEC_MODE" -a -n "$IPSEC_PROTO" ]; then
- tst_ipsec lhost $(tst_ipaddr) $(tst_ipaddr rhost)
- tst_ipsec rhost $(tst_ipaddr rhost) $(tst_ipaddr)
- fi
-}
-
do_test()
{
for p in $IPSEC_SIZE_ARRAY; do
@@ -42,7 +33,7 @@ do_test()
done
}
-do_setup
+tst_ipsec_setup
do_test
diff --git a/testcases/network/stress/udp/udp_ipsec.sh b/testcases/network/stress/udp/udp_ipsec.sh
index 4ebf087a6..9b5ac07b2 100755
--- a/testcases/network/stress/udp/udp_ipsec.sh
+++ b/testcases/network/stress/udp/udp_ipsec.sh
@@ -23,15 +23,6 @@ TST_CLEANUP="tst_ipsec_cleanup"
. ipsec_lib.sh
-do_setup()
-{
- # Configure SAD/SPD
- if [ -n "$IPSEC_MODE" -a -n "$IPSEC_PROTO" ]; then
- tst_ipsec lhost $(tst_ipaddr) $(tst_ipaddr rhost)
- tst_ipsec rhost $(tst_ipaddr rhost) $(tst_ipaddr)
- fi
-}
-
do_test()
{
for p in $IPSEC_SIZE_ARRAY; do
@@ -40,7 +31,7 @@ do_test()
done
}
-do_setup
+tst_ipsec_setup
do_test udp
do_test udp_lite
--
2.17.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [LTP] [PATCH 2/3] net/icmp-uni-basic.sh: Remove LINK_NUM + related setup
2018-06-14 13:15 [LTP] [PATCH 1/3] net: Create tst_ipsec_setup to remove duplicity Petr Vorel
@ 2018-06-14 13:15 ` Petr Vorel
2018-06-14 13:15 ` [LTP] [PATCH 3/3] net/icmp: Unify log info messages Petr Vorel
1 sibling, 0 replies; 5+ messages in thread
From: Petr Vorel @ 2018-06-14 13:15 UTC (permalink / raw)
To: ltp
LINK_NUM should not be setup in the test + some variables weren't used.
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
Changes v1->v2:
Properly remove $LINK_NUM
---
testcases/network/stress/icmp/icmp-uni-basic.sh | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/testcases/network/stress/icmp/icmp-uni-basic.sh b/testcases/network/stress/icmp/icmp-uni-basic.sh
index 5fe6b9b13..fc84899dd 100755
--- a/testcases/network/stress/icmp/icmp-uni-basic.sh
+++ b/testcases/network/stress/icmp/icmp-uni-basic.sh
@@ -25,8 +25,6 @@ TST_CLEANUP="tst_ipsec_cleanup"
. ipsec_lib.sh
-LINK_NUM=${LINK_NUM:-0}
-
# Test description
tst_resm TINFO "Sending ICMP messages with the following conditions"
tst_resm TINFO "- Version of IP is IPv${TST_IPV6:-4}"
@@ -40,17 +38,10 @@ if [ -n "$IPSEC_MODE" -a -n "$IPSEC_PROTO" ]; then
esac
fi
-# name of interface of the local/remote host
-lhost_ifname=$(tst_iface lhost $LINK_NUM)
-rhost_ifname=$(tst_iface rhost $LINK_NUM)
-
-lhost_addr=$(tst_ipaddr)
-rhost_addr=$(tst_ipaddr rhost)
-
tst_ipsec_setup
PING_MAX="$IPSEC_REQUESTS"
-tst_ping $lhost_ifname $rhost_addr $IPSEC_SIZE_ARRAY
+tst_ping $(tst_iface) $(tst_ipaddr rhost) $IPSEC_SIZE_ARRAY
tst_exit
--
2.17.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [LTP] [PATCH 3/3] net/icmp: Unify log info messages
2018-06-14 13:15 [LTP] [PATCH 1/3] net: Create tst_ipsec_setup to remove duplicity Petr Vorel
2018-06-14 13:15 ` [LTP] [PATCH 2/3] net/icmp-uni-basic.sh: Remove LINK_NUM + related setup Petr Vorel
@ 2018-06-14 13:15 ` Petr Vorel
2018-06-18 14:29 ` Alexey Kodanev
1 sibling, 1 reply; 5+ messages in thread
From: Petr Vorel @ 2018-06-14 13:15 UTC (permalink / raw)
To: ltp
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
New in v2.
---
testcases/network/stress/icmp/icmp-uni-basic.sh | 5 +----
testcases/network/stress/icmp/icmp-uni-vti.sh | 2 +-
2 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/testcases/network/stress/icmp/icmp-uni-basic.sh b/testcases/network/stress/icmp/icmp-uni-basic.sh
index fc84899dd..79581b46c 100755
--- a/testcases/network/stress/icmp/icmp-uni-basic.sh
+++ b/testcases/network/stress/icmp/icmp-uni-basic.sh
@@ -25,10 +25,7 @@ TST_CLEANUP="tst_ipsec_cleanup"
. ipsec_lib.sh
-# Test description
-tst_resm TINFO "Sending ICMP messages with the following conditions"
-tst_resm TINFO "- Version of IP is IPv${TST_IPV6:-4}"
-tst_resm TINFO "- Size of packets are ( $IPSEC_SIZE_ARRAY )"
+tst_resm TINFO "Sending ICMP messages"
if [ -n "$IPSEC_MODE" -a -n "$IPSEC_PROTO" ]; then
case $IPSEC_PROTO in
diff --git a/testcases/network/stress/icmp/icmp-uni-vti.sh b/testcases/network/stress/icmp/icmp-uni-vti.sh
index 7fa211d7f..ea8b5c828 100755
--- a/testcases/network/stress/icmp/icmp-uni-vti.sh
+++ b/testcases/network/stress/icmp/icmp-uni-vti.sh
@@ -26,7 +26,7 @@ do_test()
{
PING_MAX="$IPSEC_REQUESTS"
- tst_resm TINFO "Sending ICMP messages..."
+ tst_resm TINFO "Sending ICMP messages"
tst_ping $tst_vti $ip_rmt_tun $IPSEC_SIZE_ARRAY
}
--
2.17.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [LTP] [PATCH 3/3] net/icmp: Unify log info messages
2018-06-14 13:15 ` [LTP] [PATCH 3/3] net/icmp: Unify log info messages Petr Vorel
@ 2018-06-18 14:29 ` Alexey Kodanev
2018-06-18 17:42 ` Petr Vorel
0 siblings, 1 reply; 5+ messages in thread
From: Alexey Kodanev @ 2018-06-18 14:29 UTC (permalink / raw)
To: ltp
On 06/14/2018 04:15 PM, Petr Vorel wrote:
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
> New in v2.
> ---
Hi Petr,
> testcases/network/stress/icmp/icmp-uni-basic.sh | 5 +----
> testcases/network/stress/icmp/icmp-uni-vti.sh | 2 +-
> 2 files changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/testcases/network/stress/icmp/icmp-uni-basic.sh b/testcases/network/stress/icmp/icmp-uni-basic.sh
> index fc84899dd..79581b46c 100755
> --- a/testcases/network/stress/icmp/icmp-uni-basic.sh
> +++ b/testcases/network/stress/icmp/icmp-uni-basic.sh
> @@ -25,10 +25,7 @@ TST_CLEANUP="tst_ipsec_cleanup"
>
> . ipsec_lib.sh
>
> -# Test description
> -tst_resm TINFO "Sending ICMP messages with the following conditions"
> -tst_resm TINFO "- Version of IP is IPv${TST_IPV6:-4}"
> -tst_resm TINFO "- Size of packets are ( $IPSEC_SIZE_ARRAY )"
> +tst_resm TINFO "Sending ICMP messages">
> if [ -n "$IPSEC_MODE" -a -n "$IPSEC_PROTO" ]; then
> case $IPSEC_PROTO in
Probably better to fix the similar issue here with printing IPsec
protocol/mode type too, i.e. remove the above if block and print the
message in ipsec_lib.sh/tst_ipsec() instead, so it would be the same
as in tst_ipsec_setup_vti() now:
tst_resm TINFO "Test vti$TST_IPV6 + IPsec[$IPSEC_PROTO/$IPSEC_MODE]"
> diff --git a/testcases/network/stress/icmp/icmp-uni-vti.sh b/testcases/network/stress/icmp/icmp-uni-vti.sh
> index 7fa211d7f..ea8b5c828 100755
> --- a/testcases/network/stress/icmp/icmp-uni-vti.sh
> +++ b/testcases/network/stress/icmp/icmp-uni-vti.sh
> @@ -26,7 +26,7 @@ do_test()
> {
> PING_MAX="$IPSEC_REQUESTS"
>
> - tst_resm TINFO "Sending ICMP messages..."
> + tst_resm TINFO "Sending ICMP messages"
> tst_ping $tst_vti $ip_rmt_tun $IPSEC_SIZE_ARRAY
> }
>
The rest looks fine to me.
Thanks,
Alexey
^ permalink raw reply [flat|nested] 5+ messages in thread
* [LTP] [PATCH 3/3] net/icmp: Unify log info messages
2018-06-18 14:29 ` Alexey Kodanev
@ 2018-06-18 17:42 ` Petr Vorel
0 siblings, 0 replies; 5+ messages in thread
From: Petr Vorel @ 2018-06-18 17:42 UTC (permalink / raw)
To: ltp
Hi Alexey,
> Hi Petr,
> > -# Test description
> > -tst_resm TINFO "Sending ICMP messages with the following conditions"
> > -tst_resm TINFO "- Version of IP is IPv${TST_IPV6:-4}"
> > -tst_resm TINFO "- Size of packets are ( $IPSEC_SIZE_ARRAY )"
> > +tst_resm TINFO "Sending ICMP messages">
> > if [ -n "$IPSEC_MODE" -a -n "$IPSEC_PROTO" ]; then
> > case $IPSEC_PROTO in
> Probably better to fix the similar issue here with printing IPsec
> protocol/mode type too, i.e. remove the above if block and print the
> message in ipsec_lib.sh/tst_ipsec() instead, so it would be the same
> as in tst_ipsec_setup_vti() now:
> tst_resm TINFO "Test vti$TST_IPV6 + IPsec[$IPSEC_PROTO/$IPSEC_MODE]"
I replaced test with
https://patchwork.ozlabs.org/patch/931107/
(part of big patchset Migrate tests using virt_lib.sh and ipsec_lib.sh to new API
https://patchwork.ozlabs.org/project/ltp/list/?series=50725)
i.e in tst_ipsec_setup()
{
# Configure SAD/SPD
if [ -n "$IPSEC_MODE" -a -n "$IPSEC_PROTO" ]; then
+ tst_resm TINFO "IPsec[$IPSEC_PROTO/$IPSEC_MODE]"
tst_ipsec lhost $(tst_ipaddr) $(tst_ipaddr rhost)
tst_ipsec rhost $(tst_ipaddr rhost) $(tst_ipaddr)
1) IMHO it does not make sense print info about it when no IPsec is done
2) Removed "vti$TST_IPV6" as tst_ipsec_setup is not used for VTI.
> > diff --git a/testcases/network/stress/icmp/icmp-uni-vti.sh b/testcases/network/stress/icmp/icmp-uni-vti.sh
> > index 7fa211d7f..ea8b5c828 100755
> > --- a/testcases/network/stress/icmp/icmp-uni-vti.sh
> > +++ b/testcases/network/stress/icmp/icmp-uni-vti.sh
> > @@ -26,7 +26,7 @@ do_test()
> > {
> > PING_MAX="$IPSEC_REQUESTS"
> > - tst_resm TINFO "Sending ICMP messages..."
> > + tst_resm TINFO "Sending ICMP messages"
> > tst_ping $tst_vti $ip_rmt_tun $IPSEC_SIZE_ARRAY
> > }
> The rest looks fine to me.
Thanks, I pushed the second two.
> Thanks,
> Alexey
Kind regards,
Petr
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-06-18 17:42 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-14 13:15 [LTP] [PATCH 1/3] net: Create tst_ipsec_setup to remove duplicity Petr Vorel
2018-06-14 13:15 ` [LTP] [PATCH 2/3] net/icmp-uni-basic.sh: Remove LINK_NUM + related setup Petr Vorel
2018-06-14 13:15 ` [LTP] [PATCH 3/3] net/icmp: Unify log info messages Petr Vorel
2018-06-18 14:29 ` Alexey Kodanev
2018-06-18 17:42 ` 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.