home *** CD-ROM | disk | FTP | other *** search
- // DIALTEST.SCP - Repeated dial and connect to test modem
- // Copyright (c) 2001, Vector Networks Limited
- // All Rights Reserved
- //
- // Revision History:
- // 6.10 11-May-01 DB - Created, using KUKATEST.SCP v6.00. 20-Sep-00.
- // 6.11 22-May-01 DB - Allow for " " as dummy pre-defined variable(s).
-
- // Predefined variables:
- // ClientName = "" - Name of Client at remote site
- // DialNumber = "0123456789" - Number to use to dial Bridge
- // OpenView = 1 - Opens a View Window (interactive)
- // Password = "GBBLLYDGKK" - Encrypted password for remote network
- // TestFile = "NSM.LIC" - File to check at Client
- // Username = "SCRIPTING/GBBLLYDGKK" - Username and password for Connect
- //
- // Tuning variables:
- // ConnectDelay = 1 - After dialling, before connecting
- // DialDelay = 10 - Before dialling
- // DisconnectDelay = 1- Before disconnecting
- // HangupDelay = 10 - After disconnecting, before hanging up
- // LoopDelay = 1 - Delay at end of every loop
-
- Function Main ()
- Dim ClientName as String, DialNumber as String, UserName as String, Password as String
- Dim DialUp as Integer, OpenView as Integer, TestFile as String, TestPath as String
- Dim Loops, LoopMax, ConnectErrors, DialErrors, TotalErrors
- Dim ConnectDelay, DialDelay, DisconnectDelay, HangupDelay, LoopDelay
-
- // Check for pre-defined variables and add default values
- // if any are not defined
-
- If (Trim (ClientName)) = "" Then
- ClientName = "TEST4"
- Endif
- If DialNumber = "" Then
- DialNumber = "50987"
- Else
- DialNumber = Trim (DialNumber)
- Endif
- If TestFile = "" Then
- TestFile = "NSM.LIC"
- Else
- TestFile = Trim (TestFile)
- Endif
-
- // Initialise counter variables
-
- Loops = 0
- ConnectErrors = 0
- DialErrors = 0
- TotalErrors = 0
-
- // Set the maximum loop count
-
- LoopMax = 100
-
- // and the various delay timers
-
- ConnectDelay = 1
- DialDelay = 10
- DisconnectDelay = 1
- HangupDelay = 10
- LoopDelay = 1
-
- If DialNumber != "" Then
- SetTransport (T_TCPIP, T_REMOTE)
- Else
- SetTransport (T_TCPIP)
- Endif
-
- For Loops = 1 to LoopMax
- If DialNumber != "" Then
- If (DialDelay > 0) Then
- Print "Pause before dialling..."
- Wait (DialDelay)
- Endif
- DialUp = Dial (DialNumber, Password)
- If DialUp = TRUE Then
- Print "Connected to Bridge at ", DialNumber
- If (ConnectDelay > 0) Then
- Print "Pause before connectling..."
- Wait (ConnectDelay)
- Endif
- Else
- Print "Dial failed in test cycle ", Loops, "."
- DialErrors = DialErrors + 1
- TotalErrors = TotalErrors + 1
- Goto LoopEnd
- Endif
- Endif
- If Connect (ClientName, UserName) Then
- Print "Connected to Client ", ClientName
- If TestFile != "" Then
- If FileExists (">" + GetInstallDir ("") + "\" + TestFile) Then
- Print "Test File ", TestFile, " found"
- Endif
- Endif
- If OpenView != 0 Then
- Share ()
- SetWindowMode (2)
- WaitEndView ()
- Endif
- If (DisconnectDelay > 0) Then
- Print "Pause before disconnectling..."
- Wait (DisconnectDelay)
- Endif
- Disconnect (ClientName)
- Print "Test cycle ", Loops, " completed."
- Else
- Print "Test cycle ", Loops, " failed."
- ConnectErrors = ConnectErrors + 1
- TotalErrors = TotalErrors + 1
- Endif
- If DialUp Then
- If (HangupDelay > 0) Then
- Print "Pause before hanging up..."
- Wait (HangupDelay)
- Endif
- Hangup ()
- DialUp = FALSE
- Endif
-
- LoopEnd:
- If (LoopDelay > 0) Then
- Print "Pause before looping..."
- Wait (LoopDelay)
- Endif
- Next
-
- Print "Test Summary"
- Print " Cycles completed : ", Loops
- Print " Dial Errors : ", DialErrors
- Print " Connect Errors : ", ConnectErrors
- Print " Total Errors : ", TotalErrors
-
- End Function
-