#!/usr/bin/perl # # Copyright (C) 1999,2000 Yokogawa Electric Corporation and # YDC Corporation. # All rights reserved. # # Redistribution and use of this software in source and binary # forms, with or without modification, are permitted provided that # the following conditions and disclaimer are agreed and accepted # by the user: # # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in # the documentation and/or other materials provided with # the distribution. # # 3. Neither the names of the copyrighters, the name of the project # which is related to this software (hereinafter referred to as # "project") nor the names of the contributors may be used to # endorse or promote products derived from this software without # specific prior written permission. # # 4. No merchantable use may be permitted without prior written # notification to the copyrighters. # # 5. The copyrighters, the project and the contributors may prohibit # the use of this software at any time. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHTERS, THE PROJECT AND # CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING # BUT NOT LIMITED THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS # FOR A PARTICULAR PURPOSE, ARE DISCLAIMED. IN NO EVENT SHALL THE # COPYRIGHTERS, THE PROJECT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, # INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING # IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # # $Id: ADDRCONFSuccess.seq,v 1.1.1.1 2000/10/31 22:39:54 sekiya Exp $ ######################################################################## BEGIN { $V6evalTool::TestVersion = '$Name: $ '; } use V6evalTool; use DAD; #----- get sequence arguments $howto_initNUT="none"; $send = "ok"; foreach (@ARGV) { /^addrconf=(\S+)/ && do {$DAD::howto_addrconf=$1; # How to configure address of NUT? next; }; # sample: boot, ra, manual+_GLOBAL0A0N_UCAST /^init=(\S+)/ && do {$howto_initNUT=$1; # How to initialize NUT? next; }; # sample: none, DADSuccess_boot, DADFail_boot /^sd=(\S+)/ && do {$seqdebugopt=$1; # sequence debug options next; }; # sample: qR seqERROR("Unknown sequence option '$_'"); } #----- test condition $IF=Link0; # network interface seqSetDADParam($seqdebugopt); $term_handler = \&termination; # set termination handler #----- set %pktdesc seqSetPktdesc(); #----- initialize NUT vLog("*** Target initialization phase ***"); seqInitNUT($IF, $howto_initNUT); #----- start Capturing vLog("*** Target testing phase ***"); vCapture($IF) ; #----- Configure Address on NUT seqConfAddrNUT($IF); #----- wait a DAD NS comming from NUT %ret=seqWaitDADNSfromNUT($IF); #----- if received frame is a DAD NS if( $ret{status} == 0) { vLog("TN received the DAD NS sends from NUT."); #----- wait for NUT to finish DAD vSleep($DAD::RetransTimerSec, "Wait for NUT to finish DAD. ($DAD::RetransTimerSec [sec])"); }elsif( $ret{status} == 1 ) { #----- timeout vLog("TN received no DAD NS sends from NUT. It seems that NUT doesn't perform DAD process."); }else{ #----- error seqERROR(vErrmsg(%ret)); #exit } #----- check if NUT's address is configured #seqWaitNUTbeReady(); vSleep($DAD::RetransTimerSec); if (seqCheckNUTAddrConfigured($IF) eq TRUE) { seqOK(); }else{ seqNG(); } ### termination sequence after vLog OK,NG ### set as $term_handler=\&termination; sub termination() { my ($total_waitsec, $vlt_index, $ret); my (@vltlist) = (0,60); vLog("*** Target termination phase ***"); #seqWaitNUTbeReady("NOSTOP"); ## wait for address lifetime expiry vLog("Wait for NUT's address Lifetime expiry."); ($total_waitsec, $vlt_index) = seqProbeVLT($IF, 10, @vltlist); if ($vlt_index < 0) { vLog("NUT's address Lifetime does not expire."); vLog("Remote boot NUT. "); $rret=vRemote("reboot.rmt","","timeout=300"); vLog("reboot.rmt returned status $rret") if $rret > 0; }else{ vLog("NUT's address Lifetime expired: total_waitsec=$total_waitsec [sec]"); } } #end ######################################################################## __END__ =head1 NAME ADDRCONFSuccess - check if address is configured =head1 TARGET Host and Router =head1 SYNOPSIS ADDRCONFSuccess.seq [-tooloption ...] -pkt [addrconf=] [init=,...] [sd=] -tooloption : v6eval tool option : packet definition file (v6eval tool option) : how to configure address on NUT; boot/manual+/ra : how to initialize NUT; DADSuccess_boot/DADFail_boot/ra : debug options =begin html
 detail of v6eval tool option: see perldoc V6evalTool.pm, perldoc V6evalRemote.pm
 detail of parameters: see Test sequence for IPv6 Stateless Address Autoconfiguration.
=end html =head1 INITIALIZATION =begin html
 detail of Initialization: see Test sequence for IPv6 Stateless Address Autoconfiguration.
=end html =head1 TEST PROCEDURE The following tests are prepared in this test package. See INDEX file. B ADDRCONF Success when NUT received Valid RA (Global address) ADDRCONF Success when NUT received Valid RA (Site-local address) NUT ignores prefixopt if ValidLifeTime is 0 (known prefix but without IPSEC authentication) B TN(or X) NUT ------------------------------ Initialize NUT (see ...) Send Unsolicited RA to configure address of NUT (sequence parameter addrconf=ra) ==== Action #1: Unsolicited RA ===> name: usolra TN wait the DAD NS sends from NUT. (This judgement is informational only.) <=== Judgement #1: DAD NS ==== name: dadns_from_NUT Wait for NUT to finish DAD. (sleep $RetransTimerSec [sec]) Check if NUT's address is configured. ==== Action #2: DAD NS ====> name: chkconf_dadns_to_NUT DAD NA come from NUT because NUT's address is configured. <=== Judgement #2: DAD NA come==== name: chkconf_dadna_from_NUT (or chkconf_dadna_from_NUT_rf1 if NUT is a Router) =head1 JUDGEMENT B B< ADDRCONF Success when NUT received Valid RA (Global address) -pkt GLOBAL0_valRA.def addrconf=ra init=DADSuccess_boot> Action #1. Send Unsolicited RA to configure address of NUT name: usolra src: TN's Link-local address dst: allnodes multicast SLL option exists Prefix option PrefixLength: _GLOBAL0_UCAST_PRFXLEN (64) LFlag: 1 AFlag: 1 ValidLifetime: 10000 PreferredLifetime: 10000 Prefix: _GLOBAL0_UCAST_PRFX Judgement #1. DAD NS should come from NUT on Global address autoconfiguration. (This judgement is informational only.) name: dadns_from_NUT src: ::0 dst: solnode[NUT's tentative _GLOBAL0_UCAST_PRFX + interface-id] TargetAddress: NUT's tentative _GLOBAL0_UCAST_PRFX + interface-id Action #2. Send DAD NS to check if NUT's address is configured name: chkconf_dadns_to_NUT src: ::0 dst: solnode[NUT's _GLOBAL0_UCAST_PRFX + interface-id] TargetAddress: NUT's _GLOBAL0_UCAST_PRFX + interface-id Judgement #2. DAD NA come from NUT because NUT's address is configured. name: chkconf_dadna_from_NUT (or chkconf_dadna_from_NUT_rf1 if NUT is a Router) src: NUT's Link-local address or _GLOBAL0_UCAST_PRFX + interface-id dst: allnodes multicast TargetAddress: NUT's _GLOBAL0_UCAST_PRFX + interface-id OFlag: 1 RFlag: 0 ( if NUT is a Router then 1) B< ADDRCONF Success when NUT received Valid RA (Site-local address) -pkt SLOCAL0_valRA.def addrconf=ra init=DADSuccess_boot> Action #1. Send Unsolicited RA to configure address of NUT name: usolra src: TN's Link-local address dst: allnodes multicast SLL option exists Prefix option PrefixLength: _SLOCAL0_UCAST_PRFXLEN (64) LFlag: 1 AFlag: 1 ValidLifetime: 10000 PreferredLifetime: 10000 Prefix: _SLOCAL0_UCAST_PRFX Judgement #1. DAD NS should come from NUT on Global address autoconfiguration. (This judgement is informational only.) name: dadns_from_NUT src: ::0 dst: solnode[NUT's tentative _SLOCAL0_UCAST_PRFX + interface-id] TargetAddress: NUT's tentative _SLOCAL0_UCAST_PRFX + interface-id Action #2. Send DAD NS to check if NUT's address is configured name: chkconf_dadns_to_NUT src: ::0 dst: solnode[NUT's _SLOCAL0_UCAST_PRFX + interface-id] TargetAddress: NUT's _SLOCAL0_UCAST_PRFX + interface-id Judgement #2. DAD NA come from NUT because NUT's address is configured. name: chkconf_dadna_from_NUT (or chkconf_dadna_from_NUT_rf1 if NUT is a Router) src: NUT's Link-local address or _SLOCAL0_UCAST_PRFX + interface-id dst: allnodes multicast TargetAddress: NUT's _SLOCAL0_UCAST_PRFX + interface-id OFlag: 1 RFlag: 0 ( if NUT is a Router then 1) B< NUT ignores prefixopt if ValidLifeTime is 0 (known prefix but without IPSEC authentication) -pkt GLOBAL0_irregRA_prfxopt_ignore_VLT0.def addrconf=ra init=DADSuccess_boot,ra> Initialize NUT. Initialize Action #1. reboot NUT and autoconfigure Link-local address. Initialize Action #2. send Unsolicited RA from TN to NUT to configure address of NUT. name: usolra_init src: TN's Link-local address dst: allnodes multicast SLL option exists Prefix option PrefixLength: _GLOBAL0_UCAST_PRFXLEN (64) LFlag: 1 AFlag: 1 ValidLifetime: 10000 PreferredLifetime: 10000 Prefix: _GLOBAL0_UCAST_PRFX Action #1. Send strange Unsolicited RA to check if NUT ignore this. (ValidLifetime=0, PreferredLifetime=0. Prefix is same as the RA sending on the initialization phase.) name: usolra src: TN's Link-local address dst: allnodes multicast SLL option exists Prefix option PrefixLength: _GLOBAL0_UCAST_PRFXLEN (64) LFlag: 1 AFlag: 1 ValidLifetime: 0 PreferredLifetime: 0 Prefix: _GLOBAL0_UCAST_PRFX Judgement #1. DAD NS does come from NUT (This judgement is informational only.) name: dadns_from_NUT src: ::0 dst: solnode[NUT's tentative _GLOBAL0_UCAST_PRFX + interface-id] TargetAddress: NUT's tentative _GLOBAL0_UCAST_PRFX + interface-id Action #2. Send DAD NS to check if NUT's address is configured name: chkconf_dadns_to_NUT src: ::0 dst: solnode[NUT's _GLOBAL0_UCAST_PRFX + interface-id] TargetAddress: NUT's _GLOBAL0_UCAST_PRFX + interface-id Judgement #2. DAD NA come from NUT because NUT's address is configured. name: chkconf_dadna_from_NUT (or chkconf_dadna_from_NUT_rf1 if NUT is a Router) src: NUT's Link-local address or _GLOBAL0_UCAST_PRFX + interface-id dst: allnodes multicast TargetAddress: NUT's _GLOBAL0_UCAST_PRFX + interface-id OFlag: 1 RFlag: 0 ( if NUT is a Router then 1) =head1 SEE ALSO =begin html
 detail of v6eval tool option: see perldoc V6evalTool.pm, perldoc V6evalRemote.pm
 detail of parameters: see Test sequence for IPv6 Stateless Address Autoconfiguration.
=end html =cut