def verifyQuickTestInitialization(self, quickTestHandle): """ quickTestHandle = /api/v1/sessions/1/ixnetwork/quickTest/rfc2544throughput/2 """ for timer in range(1,20+1): currentAction = self.getQuickTestCurrentAction(quickTestHandle) print('verifyQuickTestInitialization currentState: %s' % currentAction) if timer < 20: if currentAction == 'TestEnded' or currentAction == 'None': self.ixnObj.logInfo('\nverifyQuickTestInitialization CurrentState = %s\n\tWaiting %s/20 seconds to change state' % (currentAction, timer)) time.sleep(1) continue else: break if timer >= 20: if currentAction == 'TestEnded' or currentAction == 'None': self.ixnObj.showErrorMessage() raise IxNetRestApiException('Quick Test is stuck at TestEnded.') ixNetworkVersionNumber = int(self.ixnObj.getIxNetworkVersion().split('.')[0]) applyQuickTestCounter = 60 for counter in range(1,applyQuickTestCounter+1): quickTestApplyStates = ['InitializingTest', 'ApplyFlowGroups', 'SetupStatisticsCollection'] currentAction = self.getQuickTestCurrentAction(quickTestHandle) if currentAction == None: currentAction = 'ApplyingAndInitializing' print('\nverifyQuickTestInitialization: %s Expecting: TransmittingFrames\n\tWaiting %s/%s seconds' % (currentAction, counter, applyQuickTestCounter)) if ixNetworkVersionNumber >= 8: if counter < applyQuickTestCounter and currentAction != 'TransmittingFrames': time.sleep(1) continue if counter < applyQuickTestCounter and currentAction == 'TransmittingFrames': self.ixnObj.logInfo('\nVerifyQuickTestInitialization is done applying configuration and has started transmitting frames\n') break if ixNetworkVersionNumber < 8: if counter < applyQuickTestCounter and currentAction == 'ApplyingAndInitializing': time.sleep(1) continue if counter < applyQuickTestCounter and currentAction == 'ApplyingAndInitializing': self.ixnObj.logInfo('\nVerifyQuickTestInitialization is done applying configuration and has started transmitting frames\n') break if counter == applyQuickTestCounter: if ixNetworkVersionNumber >= 8 and currentAction != 'TransmittingFrames': self.ixnObj.showErrorMessage() if currentAction == 'ApplyFlowGroups': self.ixnObj.logInfo('\nIxNetwork is stuck on Applying Flow Groups. You need to go to the session to FORCE QUIT it.\n') raise IxNetRestApiException('\nVerifyQuickTestInitialization is stuck on %s. Waited %s/%s seconds' % ( currentAction, counter, applyQuickTestCounter)) if ixNetworkVersionNumber < 8 and currentAction != 'Trial': self.ixnObj.showErrorMessage() raise IxNetRestApiException('\nVerifyQuickTestInitialization is stuck on %s. Waited %s/%s seconds' % ( currentAction, counter, applyQuickTestCounter))