|
一个程序来控制多台agent 并行运行的例子
[ ] // 一段脚本,同时在两台机器上运行,用于有多台电脑,同时执行不同的脚本,提高执行效率
[-] testcase run_2Test () appstate none
[ ] // SetUpMachine (sMach1, MyFirstApp, "MyFirstAppState")
[ ] // SetUpMachine (sMach2, MySecondApp, "MySecondAppState")
[ ] // SetMultiAppStates ()
[ ] HMACHINE target_machine // target computer
[ ] HMACHINE host_machine // host computer
[ ] host_machine = Connect ("(Local)")// save host's handle
[ ] // save targent machine's hangle
[ ] target_machine = Connect ("192.168.2.94")
[-] spawn
[ ] SetMachine (target_machine)
[ ] Agent.DisplayMessage("I am back",getmachinename())
[ ] // Here is placed code that drives test operations
[-] spawn
[ ] SetMachine (host_machine)
[ ] Agent.DisplayMessage("I am back",getmachinename())
[ ] // Here is placed code that drives test operations
[ ] rendezvous
[ ] Disconnect(host_machine)
[ ] Disconnect(target_machine) |
|