def getQuickTestCsvFiles(self, quickTestHandle, copyToPath, csvFile='all'): """ Description Copy Quick Test CSV result files to a specified path on either Windows or Linux. Note: Currently only supports copying from Windows. Copy from Linux is coming in November. quickTestHandle: The Quick Test handle. copyToPath: The destination path to copy to. If copy to Windows: c:\\Results\\Path If copy to Linux: /home/user1/results/path csvFile: A list of CSV files to get: 'all', one or more CSV files to get: AggregateResults.csv, iteration.csv, results.csv, logFile.txt, portMap.csv """ resultsPath = self.getQuickTestResultPath(quickTestHandle) self.ixnObj.logInfo('\ngetQuickTestCsvFiles: %s' % resultsPath) if csvFile == 'all': getCsvFiles = ['AggregateResults.csv', 'iteration.csv', 'results.csv', 'logFile.txt', 'portMap.csv'] else: if type(csvFile) is not list: getCsvFiles = [csvFile] else: getCsvFiles = csvFile for eachCsvFile in getCsvFiles: # Backslash indicates the results resides on a Windows OS. if '\\' in resultsPath: if bool(re.match('[a-z]:.*', copyToPath, re.I)): self.fileMgmtObj.copyFileWindowsToLocalWindows(resultsPath+'\\{0}'.format(eachCsvFile), copyToPath) else: self.fileMgmtObj.copyFileWindowsToLocalLinux(resultsPath+'\\{0}'.format(eachCsvFile), copyToPath) else: # TODO: Copy from Linux to Windows and Linux to Linux. pass StartedFlag == 1: # We only care about traffic not running in the beginning. # If traffic ran and stopped, then break out. self.ixnObj.logInfo('\nisRunning=False. Quick Test is complete') return 0 if isRunningBreakFlag < 20: print('isRunning=False. Wait {0}/20 seconds'.format(isRunningBreakFlag)) isRunningBreakFlag += 1 time.sleep(1) continue if isRunningBreakFlag == 20: raise IxNetRestApiException('Quick Test failed to start:', response.json()['status'])