def importCrfFile(self, crfFile, localCrfFileToUpload=None): """ 1> Upload the local crfFile to the gateway server. 2> Import the .crf config file, which will decompress the .rxf and .tst file. Parameters crfFile: The crfFile path either on the gateway server already or the path to put on the gateway server. If path is c:\\VoIP\\config.crf, then this method will add a timestamp folder in c:\\VoIP -> c:\\VoIP\\12-14-36-944630\\config.crf localCrfFileToUpload: If the .crf file is located in a remote Linux, provide the path. Example: /home/hgee/config.crf """ timestampFolder = str(self.getTime()).replace(':', '-').replace('.', '-') if self.osPlatform == 'windows': filename = crfFile.split('\\')[-1] pathOnServer = crfFile.split('\\')[:-1] if self.osPlatform == 'linux': filename = crfFile.split('/')[-1] pathOnServer = crfFile.split('/')[:-1] pathOnServer = [x for x in pathOnServer if x != ''] pathOnServer.append(timestampFolder) ;# [c:, VoIP, 13-08-28-041835] self.importConfigPath = pathOnServer # To delete these timestamp folders after the test is done. if self.osPlatform == 'linux': self.importConfigPath = '/'.join(self.importConfigPath) if self.osPlatform == 'windows': self.importConfigPath = '\\'.join(self.importConfigPath) pathOnServer.append(filename) ;# [c:, VoIP, 13-08-28-041835, VoLTE_S1S11_1UE_2APNs_8.50.crf] if self.osPlatform == 'windows': pathOnServer = '\\'.join(pathOnServer) ;# c:\\VoIP\\13-08-28-041835\\VoLTE_S1S11_1UE_2APNs_8.50.crf srcFile = pathOnServer if self.osPlatform == 'linux': pathOnServer = '/'.join(pathOnServer) ;# /mnt/ixload-share/13-08-28-041835/VoLTE_S1S11_1UE_2APNs_8.50.crf pathOnServer = '/'+pathOnServer srcFile = pathOnServer self.uploadFile(localCrfFileToUpload, pathOnServer) destRxf = srcFile.replace('crf', 'rxf') loadTestUrl = self.sessionIdUrl + '/ixLoad/test/operations/importConfig/' self.logInfo('\nimportConfig: srcFile: {} destRxf: {}'.format(srcFile, destRxf)) response = self.post(loadTestUrl, data={'srcFile': srcFile, 'destRxf': destRxf}) operationsId = response.headers['Location'] status = self.verifyStatus(self.httpHeader+operationsId)