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 # NFSv4 stress test for Setclientid
  27 
  28 # Get the TESTROOT directory; set to '.' if not defined
  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 set tag "$TNAME{1}"
  38 set LOOP 10000
  39 
  40 if { $argc > 0 } {
  41         set LOOP [lindex $argv 0]
  42 }
  43 
  44 putmsg stdout 0 "\n"
  45 putmsg stdout 0 "$tag: looping $LOOP times on Setclientid/Setclient_confirm"
  46 putmsg stdout 0 "\t START TIME: [clock format [clock seconds]]"
  47 
  48 
  49 # connect to the test server
  50 Connect
  51 
  52 
  53 # Place the preparation of the test here
  54 # --------------------------------------------------------------
  55 # set unique and common string ids and verifiers
  56 
  57 set common_id_string $env(USER)
  58 
  59 set i 0
  60 
  61 while { ${i} < $LOOP } {
  62     set id_string "$common_id_string-[clock clicks]"
  63     set clientid [getclientid $id_string]
  64     if {$clientid == -1} {
  65         putmsg stderr 0 "Test FAIL: failed to get clientid"
  66         putmsg stderr 0 "\t loop=$i"
  67         Disconnect
  68         exit $FAIL
  69     }
  70     incr i
  71 }
  72 
  73 putmsg stdout 0 "\t Test PASS: test run completed successfully"
  74 putmsg stdout 0 "\t END TIME: [clock format [clock seconds]]"
  75 putmsg stdout 0 "\n"
  76 
  77 # Final cleanup (your cleanup stuffs can go here)
  78 # --------------------------------------------------------------
  79 # disconnect and exit
  80 Disconnect
  81 exit $PASS