def make_data(self): fileids = ReadConstantFlie('file_id_db.txt') data_format = '%s\x1f%s\x1f%s\x1f%s\x1f%s\x1f%s\x1f%s\x1f%s\x1f%s\n' with open(os.path.abspath(os.path.dirname(__file__)) + '/../Datafile/expect_data_file/'\ 'server_live_push_channel.txt', 'w') as filedemanddata: for i in range(writelognumber): topic = "topic=" + "live_push_channel" timestamp = "timestamp=" + get_timestamp(server_input_time) file_id = 'file_id=' + fileids[random.randint( 0, 2500)].replace("\n", "") connections = 'connections=' + "1000" latest_offset = 'latest_offset=' + '5000' latest_chunk_id = 'latest_chunk_id=' + 'idtest10001' push_chunk_id = 'push_chunk_id=' + 'idtest9999' start_push_time = 'start_push_time=' + '1464191001' push_duration = 'push_duration=' + '10' filedemanddata.write( data_format % (topic, timestamp, file_id, connections, latest_offset, latest_chunk_id, push_chunk_id, start_push_time, push_duration)) return os.path.abspath( os.path.dirname(__file__) ) + '/../Datafile/expect_data_file/server_live_push_channel.txt'
def make_data(self): peerids = ReadConstantFlie('peer_id_db.txt') data_format = '%s\x1f%s\x1f%s\x1f%s\x1f%s\x1f%s\x1f%s\x1f%s\x1f%s\x1f%s\n' with open(os.path.abspath(os.path.dirname(__file__)) + '/../Datafile/expect_data_file/'\ 'server_peer_info.txt', 'w') as filedemanddata: for i in range(writelognumber): topic = "topic=" + "peer_info" timestamp = "timestamp=" + get_timestamp(server_input_time) peer_id = 'peer_id=' + peerids[random.randint( 0, 2500)].replace("\n", "") sdk_version = 'sdk_version=' + "2.4.0.1" nat_type = 'nat_type=' + '3' public_ip = 'public_ip=' + '192.168.0.110' public_port = 'public_port=' + '8888' private_ip = 'private_ip=' + '10.5.0.254' private_port = 'private_port=' + '8080' macs = 'macs=' + '74:D4:35:80:C0:60' filedemanddata.write( data_format % (topic, timestamp, peer_id, sdk_version, nat_type, public_ip, public_port, private_ip, private_port, macs)) return os.path.abspath(os.path.dirname( __file__)) + '/../Datafile/expect_data_file/server_peer_info.txt'
def make_data(self): peerids = ReadConstantFlie('peer_id_db.txt') data_format = '%s\x1f%s\x1f%s\x1f%s\x1f%s\x1f%s\x1f%s\x1f%s\x1f%s\n' with open(os.path.abspath(os.path.dirname(__file__)) + '/../Datafile/expect_data_file/'\ 'server_seeds_allocate.txt', 'w') as filedemanddata: for i in range(writelognumber): topic = "topic=" + "seeds_allocate" timestamp = "timestamp=" + get_timestamp(server_input_time) peer_id = 'peer_id=' + peerids[random.randint( 0, 2500)].replace("\n", "") seed_peer_id = 'seed_peer_id=' + "2.4.0.1" slice_map = 'slice_map=' + '3' public_ip = 'public_ip=' + '192.168.0.110' public_port = 'public_port=' + '8888' # private_ip = 'private_ip=' + '10.5.0.254' private_port = 'private_port=' + '8080' ppc = 'ppc=' + '1024' filedemanddata.write( data_format % (topic, timestamp, peer_id, public_ip, public_port, private_port, seed_peer_id, slice_map, ppc)) return os.path.abspath( os.path.dirname(__file__) ) + '/../Datafile/expect_data_file/server_seeds_allocate.txt'
def make_data(self): fileids = ReadConstantFlie('file_id_db.txt') data_format = '%s\x1f%s\x1f%s\x1f%s\x1f%s\x1f%s\x1f%s\x1f%s\x1f%s\x1f%s\n' with open(os.path.abspath(os.path.dirname(__file__)) + '/../Datafile/expect_data_file/'\ 'server_live_create_channel.txt', 'w') as filedemanddata: for i in range(writelognumber): topic = "topic=" + "live_create_channel" timestamp = "timestamp=" + get_timestamp(server_input_time) file_id = 'file_id=' + fileids[random.randint( 0, 2500)].replace("\n", "") file_url = 'file_url=' + "www.resource.test" date_file_url = 'date_file_url=' + "rtmp://live.hkstv.hk.lxdns.com/live/hks" rate = 'rate=' + '20000' input_video_format = 'input_video_format=' + 'RTMP' output_video_format = 'output_video_format=' + 'FLV' ppc = 'ppc=' + '2048' psize = 'psize=' + '65532' filedemanddata.write( data_format % (topic, timestamp, file_id, file_url, date_file_url, rate, input_video_format, output_video_format, ppc, psize)) return os.path.abspath( os.path.dirname(__file__) ) + '/../Datafile/expect_data_file/server_live_create_channel.txt'
def make_data(self): fileids = ReadConstantFlie('file_id_db.txt') data_format = '%s\x1f%s\x1f%s\n' with open(os.path.abspath(os.path.dirname(__file__)) + '/../Datafile/expect_data_file/'\ 'server_live_delete_channel.txt', 'w') as filedemanddata: for i in range(writelognumber): topic = "topic=" + "live_delete_channel" timestamp = "timestamp=" + get_timestamp(server_input_time) file_id = 'file_id=' + fileids[random.randint(0, 2500)].replace("\n", "") filedemanddata.write(data_format % (topic, timestamp, file_id)) return os.path.abspath(os.path.dirname(__file__)) + '/../Datafile/expect_data_file/server_live_delete_channel.txt'
def make_data(self): data_format = '%s\x1f%s\x1f%s\x1f%s\x1f%s\n' with open(os.path.abspath(os.path.dirname(__file__)) + '/../Datafile/expect_data_file/'\ 'server_push_error.txt', 'w') as filedemanddata: for i in range(writelognumber): topic = "topic=" + "push_error" timestamp = "timestamp=" + get_timestamp(server_input_time) level = 'level=' + "warn" module = 'module=' + 'testpushmodle' err_info = 'err_info=' + 'TESTPUSHERROE!!!' filedemanddata.write(data_format % (topic, timestamp, level, module, err_info)) return os.path.abspath(os.path.dirname(__file__)) + '/../Datafile/expect_data_file/server_push_error.txt'
def make_data(self): peerids = ReadConstantFlie('peer_id_db.txt') data_format = '%s\x1f%s\x1f%s\x1f%s\x1f%s\n' with open(os.path.abspath(os.path.dirname(__file__)) + '/../Datafile/expect_data_file/'\ 'server_fod_report.txt', 'w') as filedemanddata: for i in range(writelognumber): topic = "topic=" + "fod_report" timestamp = "timestamp=" + get_timestamp(server_input_time) peer_id = 'peer_id=' + peerids[random.randint(0, 2500)].replace("\n", "") fod_type = 'fod_type=' + "hls" # or channel public_ip = 'public_ip=' + '192.168.0.110' filedemanddata.write(data_format % (topic, timestamp, peer_id, fod_type, public_ip)) return os.path.abspath(os.path.dirname(__file__)) + '/../Datafile/expect_data_file/server_fod_report.txt'
def make_data(self): data_format = '%s\x1f%s\x1f%s\x1f%s\n' with open(os.path.abspath(os.path.dirname(__file__)) + '/../Datafile/expect_data_file/'\ 'server_push_request.txt', 'w') as filedemanddata: for i in range(writelognumber): topic = "topic=" + "push_request" timestamp = "timestamp=" + get_timestamp(server_input_time) request_url = 'request_url=' + "http://request.test.com" response_status_code = 'response_status_code=' + '200' filedemanddata.write( data_format % (topic, timestamp, request_url, response_status_code)) return os.path.abspath( os.path.dirname(__file__) ) + '/../Datafile/expect_data_file/server_push_request.txt'
def make_data(self): peerids = ReadConstantFlie('peer_id_db.txt') data_format = '%s\x1f%s\x1f%s\x1f%s\x1f%s\n' with open(os.path.abspath(os.path.dirname(__file__)) + '/../Datafile/expect_data_file/'\ 'server_sdk_lsm.txt', 'w') as filedemanddata: for i in range(writelognumber): topic = "topic=" + "sdk_lsm" timestamp = "timestamp=" + get_timestamp(server_input_time) peer_id = 'peer_id=' + peerids[random.randint( 0, 2500)].replace("\n", "") public_ip = 'public_ip=' + '192.168.0.110' lsm_used = 'lsm_used=' + '888815648' filedemanddata.write( data_format % (topic, timestamp, peer_id, public_ip, lsm_used)) return os.path.abspath(os.path.dirname( __file__)) + '/../Datafile/expect_data_file/server_sdk_lsm.txt'
def make_data(self): peerids = ReadConstantFlie('peer_id_db.txt') data_format = '%s\x1f%s\x1f%s\x1f%s\x1f%s\n' with open(os.path.abspath(os.path.dirname(__file__)) + '/../Datafile/expect_data_file/'\ 'server_peer_online_time.txt', 'w') as filedemanddata: for i in range(writelognumber): topic = "topic=" + "peer_online_time" timestamp = "timestamp=" + get_timestamp(server_input_time) peer_id = 'peer_id=' + peerids[random.randint( 0, 2500)].replace("\n", "") quarter = 'quarter=' + "131413344" online = 'online=' + '1' filedemanddata.write( data_format % (topic, timestamp, peer_id, quarter, online)) return os.path.abspath( os.path.dirname(__file__) ) + '/../Datafile/expect_data_file/server_peer_online_time.txt'
def make_data(self): peerids = ReadConstantFlie('peer_id_db.txt') fileids = ReadConstantFlie('file_id_db.txt') data_format = '%s\x1f%s\x1f%s\x1f%s\x1f%s\x1f%s\x1f%s\n' with open(os.path.abspath(os.path.dirname(__file__)) + '/../Datafile/expect_data_file/'\ 'server_rsm_change.txt', 'w') as filedemanddata: for i in range(writelognumber): topic = "topic=" + "rsm_change" timestamp = "timestamp=" + get_timestamp(server_input_time) peer_id = 'peer_id=' + peerids[random.randint(0, 2500)].replace("\n", "") operation = 'operation=' + 'create' # create, delete, update file_id = 'file_id=' + fileids[random.randint(0, 2500)].replace("\n", "") start_chunk_id = 'start_chunk_id=' + "12345" chunk_number = 'chunk_number=' + "1024" filedemanddata.write(data_format % (topic, timestamp, peer_id, file_id, operation, start_chunk_id, chunk_number)) return os.path.abspath(os.path.dirname(__file__)) + '/../Datafile/expect_data_file/server_rsm_change.txt'
def make_data(self): fileids = ReadConstantFlie('file_id_db.txt') data_format = '%s\x1f%s\x1f%s\x1f%s\x1f%s\n' with open(os.path.abspath(os.path.dirname(__file__)) + '/../Datafile/expect_data_file/'\ 'server_push_memory_cache.txt', 'w') as filedemanddata: for i in range(writelognumber): topic = "topic=" + "push_memory_cache" timestamp = "timestamp=" + get_timestamp(server_input_time) file_id = 'file_id=' + fileids[random.randint( 0, 2500)].replace("\n", "") chunk_id = 'chunk_id=' + 'testchunkid1212' behavior = 'behavior=' + 'out' filedemanddata.write( data_format % (topic, timestamp, file_id, chunk_id, behavior)) return os.path.abspath( os.path.dirname(__file__) ) + '/../Datafile/expect_data_file/server_push_memory_cache.txt'
def make_data(self): peer_ids = read_constant_file('peer_id_db.txt') data_format = '%s\x1f%s\x1f%s\x1f%s\x1f%s\x1f%s\x1f%s\n' with open(os.path.abspath(os.path.dirname(__file__)) + '/../Datafile/expect_data_file/'\ 'server_add_tenant.txt', 'w') as file_demand_data: for i in range(write_log_number): topic = "topic=" + "add_tenant" timestamp = "timestamp=" + get_timestamp(server_input_time) tenant_id = 'tenant_id=' + "testtenantid" + str( random.randint(1, 100000)) tenant_name = 'tenant_name=' + "testusename" groups = 'groups=' + 'TG1' peer_prefix = 'peer_prefix=' + peer_ids[random.randint( 0, 2500)][0:8] domain = 'domain=' + 'mail.Mytest.com' file_demand_data.write( data_format % (topic, timestamp, tenant_id, tenant_name, groups, peer_prefix, domain)) return os.path.abspath(os.path.dirname( __file__)) + '/../Datafile/expect_data_file/server_add_tenant.txt'
def make_data(self): peerids = ReadConstantFlie('peer_id_db.txt') fileids = ReadConstantFlie('file_id_db.txt') data_format = '%s\x1f%s\x1f%s\x1f%s\x1f%s\x1f%s\x1f%s\n' with open(os.path.abspath(os.path.dirname(__file__)) + '/../Datafile/expect_data_file/'\ 'server_file_seed_change.txt', 'w') as filedemanddata: for i in range(writelognumber): topic = "topic=" + "file_seed_change" timestamp = "timestamp=" + get_timestamp(server_input_time) peer_id = 'peer_id=' + peerids[random.randint( 0, 2500)].replace("\n", "") file_id = 'file_id=' + fileids[random.randint( 0, 2500)].replace("\n", "") operation = 'operation=' + '13' slice_map = 'slice_map=' + 'test_slice_map_data' cppc = 'cppc=' + '12306' filedemanddata.write(data_format % (topic, timestamp, peer_id, file_id, operation, slice_map, cppc)) return os.path.abspath( os.path.dirname(__file__) ) + '/../Datafile/expect_data_file/server_file_seed_change.txt'
def make_data(self): peerids = ReadConstantFlie('peer_id_db.txt') fileids = ReadConstantFlie('file_id_db.txt') data_format = '%s\x1f%s\x1f%s\x1f%s\x1f%s\x1f%s\n' with open(os.path.abspath(os.path.dirname(__file__)) + '/../Datafile/expect_data_file/'\ 'server_live_progress.txt', 'w') as filedemanddata: for i in range(writelognumber): topic = "topic=" + "live_progress" timestamp = "timestamp=" + get_timestamp(server_input_time) peer_id = 'peer_id=' + peerids[random.randint( 0, 2500)].replace("\n", "") public_ip = 'public_ip=' + '192.168.0.110' file_id = 'file_id=' + fileids[random.randint( 0, 2500)].replace("\n", "") chunk_id = 'chunk_id=' + "12345" filedemanddata.write( data_format % (topic, timestamp, peer_id, public_ip, file_id, chunk_id)) return os.path.abspath( os.path.dirname(__file__) ) + '/../Datafile/expect_data_file/server_live_progress.txt'