public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Alexey Kodanev <alexey.kodanev@oracle.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 3/3] network/stress/icmp: use ip xfrm for icmp4-uni-basic01 ipsec testing
Date: Fri, 11 Mar 2016 14:41:04 +0300	[thread overview]
Message-ID: <56E2AED0.3050605@oracle.com> (raw)
In-Reply-To: <20160311030836.GP2649@Leo.nay.redhat.com>

On 03/11/2016 06:08 AM, Hangbin Liu wrote:
> On Thu, Mar 10, 2016 at 10:32:06AM +0300, Alexey Kodanev wrote:
>> On 03/10/2016 09:50 AM, Hangbin Liu wrote:
>>>>>       # Unset SAD/SPD
>>>>> -    output_ipsec_conf flush | setkey -c >/dev/null 2>&1
>>>>> -    $LTP_RSH $RHOST ${LTPROOT}/'testcases/bin/output_ipsec_conf flush | PATH=/sbin:/usr/sbin:$PATH setkey -c' >/dev/null 2>&1
>>>>> +    tst_ipsec flush
>>>>>       # Clean up each interface
>>>>> -    initialize_if lhost ${LINK_NUM}
>>>>> -    initialize_if rhost ${LINK_NUM}
>>>>> +    tst_init_iface lhost ${LINK_NUM}
>>>>> +    tst_init_iface rhost ${LINK_NUM}
>>>> Can we remove them instead? Most tests expect that they are already
>>>> initialized.
>>> I think we'd better not remove them. uni-basic is still OK. But multi-diffip
>>> tests will add multi ip addresses. We need clean the env after each test.
>> OK, let's keep it only in tests which add/remove IP addresses.
> OK
>
>> By the way, if you are going to fix such tests please use IP range
>> that is defined with the following env vars:
>>
>> export IPV4_NET16_UNUSED=${IPV4_NET16_UNUSED:-"10.23"}
>> export IPV6_NET32_UNUSED=${IPV6_NET32_UNUSED:-"fd00:23"}
>>
>> it's from testscripts/network.sh.
> Thanks for this tip. multi-diffip and multi-diffnic use multi different subnets.
> So I think we still need keep using the previous method.
>
> while [ $ipaddr_pair_num -lt $IP_TOTAL_FOR_TCPIP ]; do
>      # Add new IP addresses
>      x=`expr $ipaddr_pair_num \/ 255 % 255`
>      y=`expr $ipaddr_pair_num % 255`
>      if [ $x -ge 255 ]; then
>          tst_info TINFO "This script cannot add more than $ipaddr_pair_num addresses"
>          break
>      fi
>
>      case $IP_VER in
>          4)
>          network_part="10.${x}.${y}"
>          network_broadcast=${network_part}.255

Please look at the stress/interface/if-addr-addlarge

while [ $cnt -le $IP_TOTAL ]; do
     if [ "$TST_IPV6" ]; then
         local hex_x=$(printf '%x' $x)
         local hex_y=$(printf '%x' $y)
         local new_ip=${IPV6_NET32_UNUSED}:1:1:1:$hex_x:$hex_y:1
     else
         local new_ip=${IPV4_NET16_UNUSED}.$x.$y
     fi
...

I think 254 * 254 (for IPv4) is more than enough for such tests.

Best regards,
Alexey

>
> while [ $link_num -lt $link_total ]; do
>      # name of interface of the local/remote host
>      lhost_ifname=`get_ifname lhost $link_num`
>      rhost_ifname=`get_ifname rhost $link_num`
>
>      # Set the IP address to each interface
>      case $IP_VER in
>          4)
>          network_part="10.0.${link_num}"
>          network_mask=24
>          lhost_host_part="2"     # local host
>          rhost_host_part="1"     # remote host
>
> Thanks
> Hangbin


  reply	other threads:[~2016-03-11 11:41 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-07  7:14 [LTP] [PATCH 0/3] networking/stress: add ip xfrm ipsec support Hangbin Liu
2016-03-07  7:14 ` [LTP] [PATCH 1/3] lib/test_net.sh: add tst_ping() to check icmp connectivity Hangbin Liu
2016-03-07  7:14 ` [LTP] [PATCH 2/3] network/stress: add ipsec lib Hangbin Liu
2016-03-09 12:42   ` Alexey Kodanev
2016-03-10  6:43     ` Hangbin Liu
2016-03-11  5:34     ` Hangbin Liu
2016-03-11 11:20       ` Alexey Kodanev
2016-03-11 14:10         ` Hangbin Liu
2016-03-07  7:14 ` [LTP] [PATCH 3/3] network/stress/icmp: use ip xfrm for icmp4-uni-basic01 ipsec testing Hangbin Liu
2016-03-09 12:53   ` Alexey Kodanev
2016-03-10  6:50     ` Hangbin Liu
2016-03-10  7:32       ` Alexey Kodanev
2016-03-11  3:08         ` Hangbin Liu
2016-03-11 11:41           ` Alexey Kodanev [this message]
2016-03-11 14:33             ` Hangbin Liu
2016-03-14  7:33               ` Alexey Kodanev
2016-03-15  9:41                 ` Hangbin Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56E2AED0.3050605@oracle.com \
    --to=alexey.kodanev@oracle.com \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox