def testUploadFile300KB(self): logging.info("%s ---- : %s" % ("testUploadFile300KB", "start")) user_id, device_id = self.ecg_login_upload(device_index=8, filname_prefix="300KB", topic_suffix="300KB") time.sleep(2) fileSizeUtil.data_validation(user_id=user_id, device_id=device_id, file_num=1, file_size=300 * 1024) logging.info("%s ---- : %s" % ("testUploadFile300KB", "end"))
def test_noncontinue_upload_in300s(self): logging.info("%s ---- : %s" % ("test_noncontinue_upload_in300s", "start")) user_id, device_id = self.login_device(index=3) file_num = self.upload_file_intervial(user_id, device_id) time.sleep(10) fileSizeUtil.data_validation(user_id=user_id, device_id=device_id, file_num=file_num) logging.info("%s ---- : %s" % ("test_noncontinue_upload_in300s", "end"))
def upload_ecg_data(self, device_index, file_number=100): user_id, device_id = self.login_device(device_index) self.ecg_upload2(user_id, device_id, upload_file_num=file_number, client_index=device_index, test_mode=False) time.sleep(15) fileSizeUtil.data_validation(user_id=user_id, device_id=device_id, file_num=file_number)
def test_network_pack_repeat_upload(self): try: self.network_fault_commondl("eth0", "add", "duplicate", "1%") time.sleep(1) device_index = 1 user_id, device_id = self.login_device(device_index) self.ecg_upload2(user_id, device_id, upload_file_num=100, client_index=device_index) time.sleep(15) fileSizeUtil.data_validation(user_id=user_id, device_id=device_id, file_num=100) finally: self.network_fault_commondl("eth0", "del", "duplicate", "1%")
def test_continue_upload_greater_than_300s(self): logging.info("%s ---- : %s" % ("test_continue_upload file greater_than_300s", "start")) user_id, device_id = self.login_device(index=4) file_num = self.upload_file_intervial(user_id, device_id, time_period=320, time_interval=3) time.sleep(10) fileSizeUtil.data_validation(user_id=user_id, device_id=device_id, file_num=file_num) logging.info("%s ---- : %s" % ("test_continue_upload file greater_than_300s", "end"))
def test_continue_upload_in300s(self): logging.info("%s ---- : %s : %s" % ("test_continue_upload_in300s", "start", self.str2datetime(time.localtime()))) user_id, device_id = self.login_device(index=2) file_num = self.upload_file_intervial(user_id, device_id, time_period=300, time_interval=2) time.sleep(10) fileSizeUtil.data_validation(user_id=user_id, device_id=device_id, file_num=file_num) logging.info("%s ---- : %s : %s" % ("test_continue_upload_in300s", "end", self.str2datetime(time.localtime())))
def test_continue_upload_file_1_5GB(self): logging.info("%s ---- : %s : %s" % ("test_continue_upload_file_1.5GB", "start", self.str2datetime(time.localtime()))) # "1.5GB is : %s" % (1.5 * 1024 * 1024 * 1024,) data_size = 1610612736.0 # "each bin file size is %s" % 262152 bin_size = 262152 bin_file_number = int(math.ceil(data_size / bin_size)) user_id, device_id = self.login_device(5) for i in range(bin_file_number): self.ecg_upload(user_id, device_id, topic_suffix=i) logging.info("%s ---- : %s : %s" % ("test_continue_upload_file_1.5GB", "end", self.str2datetime(time.localtime()))) time.sleep(20) fileSizeUtil.data_validation(user_id=user_id, device_id=device_id, file_num=bin_file_number)