CATEGORII DOCUMENTE |
Bulgara | Ceha slovaca | Croata | Engleza | Estona | Finlandeza | Franceza |
Germana | Italiana | Letona | Lituaniana | Maghiara | Olandeza | Poloneza |
Sarba | Slovena | Spaniola | Suedeza | Turca | Ucraineana |
1. Overview__________ ______ ____ _____ _______ ______ _______________ 3
How it works__________ ______ ____ _____ _______ ______ ____________ 3
Installation__________ ______ ____ _____ _______ ______ _____________ 3
2. Components__________ ______ ____ _____ _______ ______ ____________ 4
2.1. “Terminal Server Client Simulation”__________ ______ ____ ____ 4
2.2. The scripting language__________ ______ ____ _______________ 5
2.2.1 Connect__________ ______ ____ _____ _______ ______ __________ 5
2.2.2 Logoff__________ ______ ____ _____ _______ ______ ____________ 6
2.2.3 Disconnect__________ ______ ____ _____ _______ ______ ________ 6
2.2.4 Start__________ ______ ____ _____ _______ ______ _____________ 6
2.2.5 Sendoutput__________ ______ ____ _____ _______ ______ _______ 7
2.2.6 Senddata__________ ______ ____ _____ _______ ______ _________ 7
2.2.7 Sendtext__________ ______ ____ _____ _______ ______ _________ 8
2.2.8 Sleep__________ ______ ____ _____ _______ ______ ____________ 8
2.2.9 Clipboard__________ ______ ____ _____ _______ ______ ________ 9
2.2.10 Loop__________ ______ ____ _____ _______ ______ ____________ 9
2.2.11 Check__________ ______ ____ _____ _______ ______ __________ 10
2.2.12 Call__________ ______ ____ _____ _______ ______ ____________ 10
2.2.13 Job__________ ______ ____ _____ _______ ______ ____________ 11
2.2.14 Comments__________ ______ ____ _____ _______ ______ ______ 12
2.2.15 UNICODE Strings__________ ______ ____ ________________ 12
3. Validation__________ ______ ____ _____ _______ ______ _____________ 13
Example 1__________ ______ ____ _____ _______ ______ ____________ 13
Example 2__________ ______ ____ _____ _______ ______ ____________ 13
Check function__________ ______ ____ _____ _______ ______ ________ 14
4. APIs exported from protocol DLLs__________ ______ ____ ________ 15
4.1 SCConnect__________ ______ ____ _____ _______ ______ __________ 15
4.2 SCDisconnect__________ ______ ____ _____ _______ ______ ________ 16
4.3 SCLogoff__________ ______ ____ _____ _______ ______ ____________ 16
4.4 SCStart__________ ______ ____ _____ _______ ______ _____________ 16
4.5 SCSenddata__________ ______ ____ _____ _______ ______ _________ 17
4.6 SCClipboard__________ ______ ____ _____ _______ ______ _________ 17
4.7 SCInit__________ ______ ____ _____ _______ ______ ______________ 18
5. Other APIs__________ ______ ____ _____ _______ ______ _____________ 18
This application works in a Terminal Server system. The main purpose of it is to drive most of the kernel and session manager testing. The program would get installed in the iostress and ntstress mix and would simulate multiple clients exercising a Terminal Server.
“Terminal Server Client Simulation” application runs as a stand-alone command-line application. The simulation would create a connection with Terminal Server and issue appropriate commands to load/unload remote sessions, run iostress, ntstress or “SpyHydra” application to simulate keyboard/mouse events. (For more information about “SpyHydra” application, see the “SpyHydra” documentation.)
A scripting language controls the Simulated Client. For more information about scripting language see 2.2.
The Terminal Server Client Simulation facility relies on the version 5.0 Terminal Server Client applications. To use smclient, you must first install the Terminal Server Client, then copy the smclient files to the same directory with the client.
The Client Simulation runs as a stand-alone application on a regular Win32 box. It creates several threads that run the jobs specified in the script file. This application can be used either in stress mix (ntstress, iostress) or in specific regression tests.
The outputs of the Client Simulation application are sent to the Terminal Server through a protocol specific DLL, ensuring thus an isolation between Client Simulation and protocol.
The following switches are valid for the Client Simulation application:
-f:FileName – specifies the name of the script file that contains the jobs description
-s:ServerName – specifies the exercised server name. If this switch is present then all connections are made with this server. If you omit this switch the application will use servers listed in server.ini file. The server name can be a UNICODE string (see UNICODE strings).
-t:nn – specifies the number of threads created by the application (default value is 1)
-l:nn – specifies the number of loops the script is executed; if “nn” is 0 then jobs are run forever
-p:ProtocolName – specifies the protocol used by this client to connect with Terminal Server (TSHARE or RS232)
-c – the application is used only for verifying the script file
-v – specifies the verbose mode; in this mode the Client Simulation will display lots of information about the current status of the application
-d – specifies that the application has to be run in debug mode, dumping extra information to debugger
Here is a short example of the smclient.ini file:
[servers]
;this section tells the server names used by smclient application
server1=YOURSERVER1
server2=YOURSERVER2
[dlls]
;this section specifies the protocol DLL names and also the check DLL name (see 3.)
;these DLL names are used by SmClient when it wants to load the proper protocol DLL
;according with the -p switch
tshare=tclient.dll
;rs232=sclrs232.dll
check=tclient.dll
[loaddlls]
;this section specifies the DLLs which will be loaded by smclient at the beginning of a script run
;if the DLL is not found smclient continues
dll1=mydll1.dll
dll2=mydll2.dll
Note: all servers name can be UNICODE strings (see UNICODE strings).
The following identifiers are reserved for use as Client Simulation keywords, and may not be used otherwise:
check
connect
disconnect
job
logoff
loop
senddata
sendoutput
sendtext
sleep
start
call
A connection between a user and a Terminal Server is done through a connect statement.
connect (<user_name>, <password>, <domain>, <xResolution>, <yResolution>);
where:
“user_name” is the user’s name attempting to connect to the Terminal Server
“password” is the user’s password
“domain” is the user’s domain
“xResolution” * “yResolution” specifies the connection resolution (example: 640 * 480)
Example:
connect (“user1”, “nopass”, “
The server to connect to is picked by the application from the server.ini file or from –s switch (if specified).
A connection is closed either by a logoff or by a disconnect command. All connect commands that appear between a connect command and a logoff/disconnect command are ignored.
Example:
connect (“user1”, “user1”, “
connect (“user2”, “user2” , “
logoff
If the domain string is the NULL string (for example: “”) then the server to connect to is used as a domain name.
Example:
If the connect to server is “server”, then the following command:
connect (“user1”, “user1”, “”, 640, 480);
is equivalent with:
connect (“user1”, “user1”, “server”, 640, 480);
Note: User name, password and domain strings can be UNICODE strings (see UNICODE strings).
To log off a user from a Terminal Server use the logoff statement. The user is logged off from the last opened connection.
logoff
Example:
logoff
If there is no opened connection, all logoff commands are ignored.
Example:
connect (“user1”, “user1” , “
logoff
logoff this command is ignored
To disconnect a user from a Terminal Server use the disconnect statement. The user is disconnected from the last opened connection.
disconnect
Example:
disconnect
If there is no opened connection, all disconnect commands are ignored.
Example:
connect (“user1”, “user1” , “
disconnect
disconnect this command is ignored
logoff this command is ignored
connect (“user1”, “user1” , “
logoff
disconnect this command is ignored
logoff this command is ignored
To launch an application in the last opened connection, use the start statement.
start (<application_command_line>);
where:
“application_command_line” is the application command line
Example:
start (“hydrasrvstressstress”);
If there is no opened connection, all start commands are ignored.
connect (“user1”, “user1” , “
start (“stress”); this command is executed
disconnect
start (“spyhydra”); this command is ignored
Note: The application command line string can be a UNICODE string (see UNICODE strings).
To send events (keyboard/mouse events) to the Terminal Server, use sendoutput statement. Events are sent through the last opened connection.
sendoutput (<events_file>, <milliseconds>);
where:
“events_file” is the file that contains the keyboard/mouse events to send to the Terminal Server. For a description of this file see the scripting file format in SpyHydra documentation.
“milliseconds” specifies the time, in milliseconds, for which to suspend execution after each command sent from the “events_file” file.
Example:
sendoutput (“data.dat”, 250);
If there is no opened connection, all sendoutput commands are ignored.
connect (“user1”, “user1” , “
sendoutput (“data.dat”, 500); this command is executed
logoff
sendoutput (“data.dat”, 1000); this command is ignored
To send a specific event (keyboard or mouse) to the Terminal Server, use senddata statement. The specified event is sent through the last opened connection.
senddata (<message_name>, <wparam>, <lparam>);
where:
“message_name” is the message name to be sent to the Terminal Server. The only supported messages are the mouse and keyboard messages. For a complete reference of the messages supported by this application see SpyHydra documentation.
“wparam” depends on the “message_name” message
“lparam” depends on the “message_name” message
Example:
senddata (“WM_MOUSEMOVE”, 12345678, -2186758);
If there is no opened connection, all senddata commands are ignored.
connect (“user1”, “user1” , “
senddata (“WM_KEYDOWN”, 50, 196609); this command is executed
logoff
senddata (“WM_CHAR”, 51, 262145); this command is ignored
To send a string (no special characters) to the Terminal Server, use sendtext statement. The specified string is sent through the last opened connection.
sendtext (<string>, <milliseconds>);
where:
“string” is the string to be sent to the Terminal Server.
“milliseconds” specifies the time, in milliseconds, for which to suspend execution after each character sent from the “string”.
Example:
sendtext (“send this string to the server”, 500);
If there is no opened connection, all sendtext commands are ignored.
connect (“user1”, “user1” , “
sendtext (“string”, 250); this command is executed
logoff
sendtext (“string”, 500); this command is ignored
Note: The string to be sent can be a UNICODE string (see UNICODE strings).
To suspend the execution of the current job for a specified interval use the sleep keyword.
sleep (<milliseconds>);
where:
“milliseconds” specifies the time, in milliseconds, for which to suspend execution.
Example:
sleep (1000);
Sleep commands are executed whether they are inside or outside of an open connection.
sleep (1000); this command is executed
connect (“user1”, “user1” , “
sleep (1000); this command is executed
logoff
sleep (1000); this command is executed
To put/get something into/from the clipboard use the clipboard keyword.
clipboard (<operation>, <file_name>);
where:
“operation” specifies the clipboard operation: copy/paste.
“file_name” is the file that contains what to put/get into/from the clipboard.
Example:
clipboard (copy, “clipboard.dat”);
or
clipboard (paste, “clipboard.dat”);
If there is no opened connection, all clipboard commands are ignored.
connect (“user1”, “user1” , “
clipboard (copy, “file.dat”); this command is executed
logoff
clipboard (paste, “file.dat”); this command is ignored
In a loop statement, the statement list is executed until the value of the counter becomes zero. If the initial value of the counter is zero, then the loop is executed forever.
loop (<counter>)
where:
“counter” specifies how many times the loop is run;
<statement_list>:
<statement> |
<statement_list> <statement>
Example:
loop (10)
In order to verify that something worked OK on the Terminal Server use the check statement.
check (<check_function>, <function_params>);
where:
“check_function” is a null-terminated string that contains the check function name. This function should be exported from the Check.dll library.
“function_params” is a null-terminated string that contains the check parameters. Is Check function responsibility to parse this string.
Example:
check (“CheckStart”, “param1 param2”);
If there is no opened connection, all check commands are ignored.
connect (“user1”, “user1” , “
check (“Check”, “param1 param2”); this command is executed
logoff
check (“Check”, “param1 param2”); this command is ignored
The “Check” function is exported from a test specific DLL (the name of this DLL being specified through the smclient.ini file) and its purpose is to validate the results of a test. For more information see next section Validation.
Note: The function parameters string can be a UNICODE string (see UNICODE strings).
Call statement is used to call a function from a DLL not specified in smclient.ini.
call (<DLL_library>, <function_name>, <function_params>);
where:
“DLL_library” is a null-terminated string that contains the DLL name.
“function_name” is a null-terminated string that contains the function name. This function should be exported from the “DLL_library” library.
“function_params” is a null-terminated string that contains the function parameters. Is function responsibility to parse this string.
Example:
call (“c:tempmydll.dll”, “MyFunction”, “param1 param2”);
Call commands are run either there is an opened connection or not.
connect (“user1”, “user1” , “
call (“mydll.dll”, “fun”, “param1 param2”); this command is executed
logoff
call (“mydll.dll”, “fun”, “param1 param2”); this command is executed
The “Fun” function is exported from “mydll.dll” DLL. For more information see section Other APIs.
Job is like an anonymous function. It contains one or more statements that are executed in sequence. The job keyword is not a statement therefore it cannot be used in a loop or another job.
job
where:
<statement_list>:
<statement> |
<statement_list> <statement>
Example:
job
job
job
logoff ();
job
For questions or feedback concerning this tool, please contact rkinput@microsoft.com.
© 1985-2000 Microsoft Corporation. All rights reserved.
This
product includes software developed by the
Politica de confidentialitate | Termeni si conditii de utilizare |
Vizualizari: 156
Importanta:
Termeni si conditii de utilizare | Contact
© SCRIGROUP 2024 . All rights reserved