def setup(): try: # Connect to the StormTest server, e.g. "jack", or "123.123.123.123", # and send a comment to help others to identify the purpose of the test StormTest.ConnectToServer(TestEnvironment.ServerName, "Hello World Test") # Reserves a slot on the server and start serial logging slot_resa_result = StormTest.ReserveSlot(5, TestEnvironment.RC_KeySet, logParam, False) if slot_resa_result == 1: StormTest.ShowVideo() #StormTest.StartVideoLog() test_result = doTest() StormTest.CloseVideo() #StormTest.StopVideoLog() else: test_result = StormTest.TM.NOT_RUN except: import traceback traceback.print_exc() test_result = StormTest.TM.FAIL # End of test - release ports back to the server finally: StormTest.ReleaseServerConnection() # Return test result return test_result
def __openConnection(server, description): try: log.info("Opening connection to server: '%s'" % server) StormTest.ConnectToServer(server, description) except SystemExit: log.error("Failed to connect to server") StormTest.EndLogRegion('Open Connection', StormTest.LogRegionStyle.Fail, comment='Failed to connect to server (%s)' % server) return False log.info("Connection established with the server") return True