#!/usr/bin/perl # # $Copyright$ # $TINY: LLA_DADSuccess.seq,v 1.7 2002/03/05 03:04:55 masaxmasa Exp $ # ######################################################################## BEGIN { $V6evalTool::TestVersion = '$Name: $ '; } use V6evalTool; use DAD_LCNA; #------------------------------------------------------ #----- get sequence arguments #------------------------------------------------------ $howto_initNUT="none"; foreach (@ARGV) { # How to configure address of NUT? # sample: boot, ra, manual+_GLOBAL0A0N_UCAST /^addrconf=(\S+)/ && do {$DAD_LCNA::howto_addrconf=$1; next; }; # How to initialize NUT? # sample: none, DADSuccess_boot, DADFail_boot /^init=(\S+)/ && do {$howto_initNUT=$1; next; }; # Sequence debug options # sample: qR /^sd=(\S+)/ && do {$seqdebugopt=$1; next; }; seqERROR("Unknown sequence option '$_'"); } #------------------------------------------------------ #----- test condition $IF=Link0; # network interface #----- initialize NUT vLog("*** Target initialization phase ***"); $rret=vRemote("reboot_async.rmt","","timeout=5"); vLog("reboot_async.rmt returned status $rret"); #----- start Capturing vLog("*** Target testing phase ***"); vCapture($IF); #----- wait a DAD NS coming from NUT %ret=vRecv($IF,$DAD_LCNA::wait_dadns{$DAD_LCNA::howto_addrconf},0,$count,DADNS_from_NUT); #----- if received frame is a DAD NS if( $ret{status} == 0) { vLog("TN received the DAD NS sent from NUT."); if($DAD_LCNA::DupAddrDetectTransmits == 0) { vLog("But DupAddrDetectTransmits == 0"); seqNG(); }else{ vSleep($DAD_LCNA::RetransTimerSec); # if ($DAD_LCNA::seqCheckNUTAddrConfigured($IF) eq TRUE) { if( seqCheckNUTAddrConfigured($IF) eq TRUE ) { seqOK(); }else{ vLog("NUT sent DAD NS but not responds to DAD NS to Same address."); seqNG(); } } } elsif( $ret{status} == 1 ) { #----timeout vLog("TN received no DAD NS sent from NUT. It seems that NUT doesn't perform DAD process."); #----- check if NUT's address is configured vSleep($DAD_LCNA::RetransTimerSec); if (seqCheckNUTAddrConfigured($IF) eq TRUE) { vLog('Without DAD, NUT assigned the address to the interface.'); if ($DAD_LCNA::DupAddrDetectTransmits == 0) { vLog("Because DupAddrDetectTransmits == 0"); seqOK(); }else{ seqNG(); } }else{ vLog("NUT's interface is down or in strange state."); seqNG(); } } #----- error if( $ret{status} != 0 ) { seqERROR(vErrmsg(%ret)); #exit } #end ######################################################################## __END__ =head1 NAME LLA_DADSuccess - check normal DAD process that should succeed =head1 TARGET All Node =head1 SYNOPSIS LLA_DADSuccess.seq [-tooloption ...] -pkt [addrconf=] -tooloption : v6eval tool option : packet definition file (v6eval tool option) : how to configure address on NUT; boot/reboot =begin html
 detail of v6eval tool option: see perldoc V6evalTool.pm, perldoc V6evalRemote.pm
=end html =head1 INITIALIZATION =begin html
 Reboot NUT or Initialize interface of NUT or Initialize IPv6 stack of NUT.
=end html =head1 TEST PROCEDURE =over 1 =item Test for Unicast address configuration The following tests are prepared in this test package. See INDEX file. B NUT performs DAD for its Link-local unicast address made by stateless address autoconfiguration. B TN NUT --------------------------------- Initialize NUT NUT configures address (reboot or interface initialization etc...) TN wait the DAD NS sent from NUT <=== Judgement #1: DAD NS ======= name: DADNS_from_NUT Wait for DupAddrDetectTransmits*RetransTimer Check if NUT's address is configured ==== Action #1: DAD NS =========> name: DADNS_from_TN <=== Judgement #2: DAD NA ======= name: DADNA_from_NUT =back 1 =head1 JUDGEMENT =over 1 =item Test for Link-local Unicast address autoconfiguration B B Judgement #1. NUT MUST transmit DAD NS for its autoconfigured Link-local address. name: DADNS_from_NUT src: ::0 dst: solnode[NUT's tentative Link-local] TargetAddress: NUT's tentative Link-local Action #1. TN transmits DAD NS to check if NUT's address is configured name: DADNS_from_TN src: ::0 dst: solnode[NUT's Link-local] TargetAddress: NUT's Link-local Judgement #2. NUT MUST transmit DAD NA for its autoconfigured Link-local address. name: DADNA_from_NUT, DADNA_from_NUT_woTLL src: NUT's Link-local dst: allnode TargetAddress: NUT's Link-local RFlag: 0 ( if NUT is a Router then 1) SFlag: 0 OFlag: 1 TLLOPT: NUT's MAC address =back 1 =head1 SEE ALSO =begin html
 detail of v6eval tool option: see perldoc V6evalTool.pm, perldoc V6evalRemote.pm
=end html =cut