1 #
   2 # CDDL HEADER START
   3 #
   4 # The contents of this file are subject to the terms of the
   5 # Common Development and Distribution License (the "License").
   6 # You may not use this file except in compliance with the License.
   7 #
   8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9 # or http://www.opensolaris.org/os/licensing.
  10 # See the License for the specific language governing permissions
  11 # and limitations under the License.
  12 #
  13 # When distributing Covered Code, include this CDDL HEADER in each
  14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15 # If applicable, add the following below this CDDL HEADER, with the
  16 # fields enclosed by brackets "[]" replaced with your own identifying
  17 # information: Portions Copyright [yyyy] [name of copyright owner]
  18 #
  19 # CDDL HEADER END
  20 #
  21 
  22 #
  23 # Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
  24 # Use is subject to license terms.
  25 #
  26 # Setclientid and setclientid_confirm testing.
  27 
  28 # TESTROOT directory; must be set in the environment already
  29 set TESTROOT $env(TESTROOT)
  30 
  31 source [file join ${TESTROOT} tcl.init]
  32 source [file join ${TESTROOT} testproc]
  33 source [file join ${TESTROOT} lcltools]
  34 
  35 # setting local variables
  36 set TNAME $argv0
  37 
  38 
  39 # Start testing
  40 # --------------------------------------------------------------
  41 # e: setclientid_confirm: clientid set to 0s
  42 set tag $TNAME{e}
  43 Connect
  44 set expct "STALE_CLIENTID"
  45 set ASSERTION "setclientid_confirm: clientid set to 0s,\n\texpect $expct"
  46 putmsg stdout 0 "$tag: $ASSERTION"
  47 set verifier "[clock clicks]"
  48 set owner "$tag"
  49 set cverf ""
  50 set st [setclient $verifier $owner clientid cverf res]
  51 # 4 words all set to 0s
  52 set clientid [binary format "s4" {0 0 0 0}]
  53 if {$st == "OK"} {
  54         set st [setclientconf $clientid $cverf res]
  55         set retcode "FAIL"
  56 } else {
  57         set retcode "UNRESOLVED"
  58 }
  59 ckres "Setclientid_confirm" $st $expct $res $PASS $retcode
  60 Disconnect
  61 
  62 
  63 # f: setclientid_confirm: clientid set to 1s
  64 set tag $TNAME{f}
  65 Connect
  66 set expct "STALE_CLIENTID"
  67 set ASSERTION "setclientid_confirm: clientid set to 1s,\n\texpect $expct"
  68 putmsg stdout 0 "$tag: $ASSERTION"
  69 set verifier "[clock clicks]"
  70 set owner "$tag"
  71 set cverf ""
  72 set st [setclient $verifier $owner clientid cverf res]
  73 # 4 words all set to 1s
  74 set clientid [binary format "S4" {65535 65535 65535 65535}]
  75 if {$st == "OK"} {
  76         set st [setclientconf $clientid $cverf res]
  77         set retcode "FAIL"
  78 } else {
  79         set retcode "UNRESOLVED"
  80 }
  81 ckres "Setclientid_confirm" $st $expct $res $PASS $retcode
  82 Disconnect
  83 
  84 
  85 # h: Setclientid_confirm: clientid set to -1
  86 set tag $TNAME{h}
  87 Connect
  88 set expct "STALE_CLIENTID"
  89 set ASSERTION "Setclientid_confirm: clientid set to -1,\n\texpect $expct"
  90 putmsg stdout 0 "$tag: $ASSERTION"
  91 set verifier "[clock clicks]"
  92 set owner "$tag"
  93 set cverf ""
  94 set st [setclient $verifier $owner clientid cverf res]
  95 set clientid "-1"
  96 if {$st == "OK"} {
  97         set st [setclientconf $clientid $cverf res]
  98         set retcode "FAIL"
  99 } else {
 100         set retcode "UNRESOLVED"
 101 }
 102 ckres "Setclientid_confirm" $st $expct $res $PASS $retcode
 103 Disconnect
 104 
 105 
 106 # i: generate resource error
 107 #set tag $TNAME{i}
 108 #set expct "RESOURCE"
 109 #set ASSERTION "generate resource error"
 110 #putmsg stdout 0 "$tag: $ASSERTION"
 111 #putmsg stdout 0 "\tTest UNTESTED need server thread to insert problem" 
 112 
 113 
 114 # --------------------------------------------------------------
 115 # Disconnect and exit
 116 
 117 exit $PASS