Index: [Article Count Order] [Thread]

Date: Mon, 19 Nov 2007 20:46:24 +0900
From: Mitsuru Chinen <mitch@linux.vnet.ibm.com>
Subject: [dhcptest:00249] vRemoteAsync is preferable in test #33 when system is not manual
To: dhcptest@tahi.org
Message-Id: <20071119204624.548b4d58.mitch@linux.vnet.ibm.com>
X-Mail-Count: 00249

Hi all,

I ran the test that Miyata-san mentioned before (dhcpv6.p2.108b2.tgz).
And I found the following test doesn't work correctly when `system'
is not `manual' in nut.def file.

  #33 C_RFC3315_17_1_2_SolWaitAdv.seq
       - Check the duration of transaction of Solicit-Advertise

The login/logout process via serial line takes time. The duration of
that process affects the test results. So, I'd like you to use
vRemoteAsync() at the test. I attached a proposal patch. 
Could you integrate this patch if it is acceptable?

Best Regards,
----
Mitsuru Chinen <mitch@linux.vnet.ibm.com>


diff --git a/rfc3315/C_RFC3315_17_1_2_SolWaitAdv.seq b/rfc3315/C_RFC3315_17_1_2_SolWaitAdv.seq
index 8bfe5d9..d45c9e1 100755
--- a/rfc3315/C_RFC3315_17_1_2_SolWaitAdv.seq
+++ b/rfc3315/C_RFC3315_17_1_2_SolWaitAdv.seq
@@ -37,10 +37,15 @@ if($ret == 0){
 	dhcpExitFail;
 }
 
-my $ret = vRemote("dhcp6c.rmt", "start", "iana", "iaid=111111", "link0=$IF0_NUT");
+if($V6evalTool::NutDef{System} ne 'manual'){
+	$ret = vRemoteAsync("dhcp6c.rmt", "start", "iana", "iaid=111111", "link0=$IF0_NUT");
+} else {
+	$ret = vRemote("dhcp6c.rmt", "start", "iana", "iaid=111111", "link0=$IF0_NUT");
+}
+
 if($ret != 0){
 	vLogHTML('<FONT COLOR="#FF0000">Cannot Initialize DHCPv6 Client program.</FONT><BR>');
-	dhcpExitFail;
+	goto fail;
 };
 
 #--------------------------------------------------------------#
@@ -48,12 +53,12 @@ if($ret != 0){
 #--------------------------------------------------------------#
 my ($retsol,%sol) = wait_for_solicit($IF0,$init_timeout) ;
 if($retsol != 0){
-	dhcpExitFail;
+	goto fail;
 }
 
 $ret = options_exist(\%sol,$CMP_ETIME);
 if($ret != 0){
-	dhcpExitFail;
+	goto fail;
 }
 
 $recvtime = getReceivedtime(\%sol);
@@ -65,7 +70,7 @@ $SID_OPTION = "opt_SID_LLT_server1";
 $IA_NA_OPTION = "opt_IA_NA_Addr_woStatus";
 my ($retadv, %adv) = send_advertise($IF0, "advertise_server1_to_nut", \%sol, "");
 if($retadv != 0){
-	dhcpExitFail;
+	goto fail;
 }
 
 #--------------------------------------------------------------#
@@ -73,7 +78,7 @@ if($retadv != 0){
 #--------------------------------------------------------------#
 my ($retreq,%req) = wait_for_request($IF0,30);
 if($retreq != 0){
-	dhcpExitFail;
+	goto fail;
 }
 
 $replytime = getReceivedtime(\%req);
@@ -82,14 +87,24 @@ $interval = $replytime - $recvtime;
 $ret = check_equal($interval, $IRT, $RAND);
 if($ret != 0){
         vLogHTML('<FONT COLOR="#FF0000"> RT != IRT + RAND*IRT </FONT><BR>');
-        dhcpExitFail;
+        goto fail;
 };
 
 vLogHTML("<FONT COLOR=\"#FF0000\">Delay is $interval sec. It satisfies RT = IRT + RAND*IRT.</FONT><BR>");
 
+if($V6evalTool::NutDef{System} ne 'manual') {
+	vRemoteAsyncWait();
+}
 vClear($IF0);
 vStop($IF0);
 dhcpExitPass;
+
+fail:
+	if ($V6evalTool::NutDef{System} ne 'manual') {
+		vRemoteAsyncWait()
+	}
+	dhcpExitFail;
+
 ##NEED
 ###############################################################################
 __END__