Commit 09e8ad69 by liuxiaoxing

日常迭代

parent c44dd137
......@@ -52,8 +52,8 @@ ry_adplan_name = 'c测试1'
ry_adcreative_name = 'c测试1'
# bytedance_int 今日头条,kuaishou_int 快手,tencentams_int (新)广点通,rryingxiao_int 人人营销
pid = 'rryingxiao_int'
URL = 'http://uri6.com/tkio/aAvmI3a?noredirect=true'
# URL = 'http://52.80.137.106:8083/tkio/zuAnuqa?noredirect=true'
# URL = 'http://uri6.com/tkio/ry2MN3a?order_id=987688761&demand_id=987688761&itemid=987688761&noredirect=true'
URL = 'http://52.80.137.106:8083/tkio/3Qz2Ufa?noredirect=true'
# 测试头条衍生事件回调时加上
# callback= http%3A%2F%2Fad.toutiao.com%2Ftrack%2Factivate%2F%3Fcallback%3DCKP4rs-Zn4QDEKiQ6teZn4QDGN6L8Y-h9Wcg3ovxj6H1ZyiE0PjgroSEAzAOOM_X-8IDQik0YWY1NzdlOC1lZmViLTRmZDEtYmZkZC00MzE1Zjc1MmJhMGF1NTQ5M0iA0pOtA1AAiAEAkAECmAEA%26os%3D0%26muid%3D
......@@ -148,9 +148,9 @@ for index in range(1):
"ry_adcreative_id": ry_adcreative_id,
# "project_id":proiect_id,
# "advert_id":advert_id,
# "project_name": proiect_name,
# "advert_name": advert_name,
# # # # # 账户id
# # "project_name": proiect_name,
# # "advert_name": advert_name,
# # # # # # 账户id
"accountid": accountid,
# 'imei2': 'null',
# 'meid': i
......@@ -217,14 +217,14 @@ for index in range(1):
# print('androidid', a)
w = w + 1
time.sleep(6)
try:
allEvent().installUpload(i, ip, appkey)
# allEvent().formevent(i, ip, appkey)
except Exception:
print('install_wrong:', w)
w = w + 1
# time.sleep(6)
# try:
# allEvent().installUpload(i, ip, appkey)
# # allEvent().formevent(i, ip, appkey)
#
# except Exception:
# print('install_wrong:', w)
# w = w + 1
# # # # #
# # # # #
......
......@@ -9,8 +9,8 @@ headers = {'Content-Type': 'application/json', 'X-RY-Access-Token': 'test_access
# 测试环境
URL_batch = 'http://10.3.20.42:8080/receive/batch'
# URL = 'http://52.80.137.106:8080/receive/tkio/'
URL = 'http://log.trackingio.com/receive/tkio/'
URL = 'http://52.80.137.106:8080/receive/tkio/'
# URL = 'http://log.trackingio.com/receive/tkio/'
# URL = 'http://jisulog.sortda.com/receive/tkio/'
# URL = 'http://172.31.21.207:8080/receive/tkio/'
# URL = 'http://120.53.212.71/receive/tkio/'
......
......@@ -10,7 +10,7 @@ import hashlib
#安卓常规渠道激活
appkey = '16dc0cb882d3dbec4f7f66251a84d6dd'
appkey = '7f43b32bad452c092096136c9be73d09'
# 线上预约app
# 7f64fbd64513bc74aa6b5bf753ae0953
# 16dc0cb882d3dbec4f7f66251a84d6dd
......@@ -30,7 +30,7 @@ appkey = '16dc0cb882d3dbec4f7f66251a84d6dd'
# allEvent().payEvent(i, ip, appkey)
# print("开始时间"+datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S'))
for index in range(3):
for index in range(1):
# 随机生成12为数组
s = ''.join(str(random.choice(range(10))) for _ in range(18))
p = ''.join(str(random.choice(range(10))) for _ in range(12))
......
......@@ -48,7 +48,7 @@ data = [
"application_info": {
"appkey": "344234354",
"bundleid": "grere34543f4r4",
# www.jd111.com
# www.jd111.com
"app_version": "1",
"channel_name": "google"
},
......@@ -138,10 +138,10 @@ def send_request():
# 对接se地址
# url = 'http://tmtest-se.trackingio.com/receive/tkiov2/sdk'
# 测试
url = "http://tmtest.trackingio.com/receive/tkiov2/sdk"
# url = "http://tmtest.trackingio.com/receive/tkiov2/sdk"
# 线上
# url = "http://tkio-receive.solar-engine.com/receive/tkiov2/sdk"
data[0]['timestamp_info']['install_time'] = int(round(time.time() * 1000))
url = "http://tkio-receive.solar-engine.com/receive/tkiov2/sdk"
# data[0]['timestamp_info']['install_time'] = int(round(time.time() * 1000))
print(data)
response = requests.request("POST", url, headers=headers, data=json.dumps(data))
......@@ -188,7 +188,6 @@ def send_requests2s():
return response
def send_requestgoogle():
global data
# 对接se地址
......@@ -208,6 +207,7 @@ def send_requestgoogle():
response["status"] = s
return response
# 批量上报的数据中存在异常数据
def test_piliang():
# data.append(data[0])
......@@ -294,7 +294,7 @@ def test_app_version_empty():
def test_app_version_illegal_length():
data[0]["application_info"]["app_version"] = chaochang
response = send_request()
assert response["status"] == "103"
assert response["status"] == "0"
# app_version 特殊字符
......@@ -566,7 +566,6 @@ def test_integration_types2s3():
assert response["status"] == "111"
# integration_type为大写SDK
def test_integration_type4():
data[0]["collector_info"]["integration_type"] = 'SDK'
......@@ -588,8 +587,6 @@ def test_integration_type6():
assert response["status"] == "111"
# collector_version为空
def test_collector_version_empty():
data[0]["collector_info"]["collector_version"] = ''
......@@ -627,9 +624,9 @@ def test_retried_times_empty():
# retried_times超过2个字符
def test_retried_times_illegal_length():
data[0]["collector_info"]["retried_times"] = "123"
data[0]["collector_info"]["retried_times"] = "0"
response = send_request()
assert response["status"] == "113"
assert response["status"] == "0"
# -------------------------终端设备信息-------------------------
......@@ -661,7 +658,7 @@ def test_os_ios2():
data[0]["device_info"]["os"] = '2'
data[0]['application_info']['channel_name'] = 'default'
response = send_request()
assert response["status"] == "124"
assert response["status"] == "219"
# os为空
......@@ -706,8 +703,6 @@ def test_os_version4():
assert response["status"] == "0"
# manufacturer为空
def test_manufacturerempty():
data[0]["device_info"]["manufacturer"] = ""
......@@ -719,7 +714,7 @@ def test_manufacturerempty():
def test_manufacturer_illegal_length():
data[0]["device_info"]["manufacturer"] = chaochang
response = send_request()
assert response["status"] == "117"
assert response["status"] == "0"
# manufacturer为特殊字符
......@@ -740,7 +735,7 @@ def test_model_empty():
def test_model_illegal_length():
data[0]["device_info"]["model"] = chaochang
response = send_request()
assert response["status"] == "118"
assert response["status"] == "0"
# model为特殊字符
......@@ -754,14 +749,10 @@ def test_model_illegal_length():
def test_ipv4():
data[0]["device_info"]["ipv4"] = "12.2"
response = send_request()
assert response["status"] == "119"
assert response["status"] == "0"
# ipv4 超长
def test_ipv4_illegal_length():
data[0]["device_info"]["ipv4"] = "12.2323423.32432421321421.32423424"
response = send_request()
assert response["status"] == "119"
# 集成方式为s2s,ipv4不传
......@@ -769,7 +760,7 @@ def test_ipv4_s2s():
data[0]["device_info"]["ipv4"] = ""
data[0]["collector_info"]["integration_type"] = 's2s'
response = send_requests2s()
assert response["status"] == "119"
assert response["status"] == "0"
# 集成方式为s2s,传ipv4
......@@ -801,7 +792,7 @@ def test_ipv6_illegal_length():
data[0]["device_info"]["ipv6"] = chaochang
data[0]["collector_info"]["integration_type"] = 'sdk'
response = send_request()
assert response["status"] == "120"
assert response["status"] == "0"
# ua为空,os为android
......@@ -817,7 +808,7 @@ def test_ua_androidempty():
data[0]["device_info"]["ua"] = ""
data[0]["device_info"]["os"] = 'web'
response = send_request()
assert response["status"] == "121"
assert response["status"] == "0"
# ua为空,os为iOS
......@@ -826,7 +817,7 @@ def test_ua_iosempty():
data[0]["device_info"]["os"] = '2'
data[0]["application_info"]["channel_name"] = 'default'
response = send_request()
assert response["status"] == "121"
assert response["status"] == "219"
# ua不为空,但是是无法解析的ua
......@@ -862,13 +853,13 @@ def test_oaidempty():
# oaid长度超长
def test_oaid_illegal_length():
data[0]["device_info"]["oaid"] = cc612
data[0]["device_info"]["device_id"] = "1a34fc556a43c453"
data[0]["device_info"]["device_id_type"] = "android_id"
data[0]["device_info"]["android_id"] = "1a34fc556a43c453"
response = send_request()
assert response["status"] == "126"
# def test_oaid_illegal_length():
# data[0]["device_info"]["oaid"] = code_nums2(600)
# data[0]["device_info"]["device_id"] = "1a34fc556a43c453"
# data[0]["device_info"]["device_id_type"] = "android_id"
# data[0]["device_info"]["android_id"] = "1a34fc556a43c453"
# response = send_request()
# assert response["status"] == "126"
# oaid_md5为空
......@@ -887,41 +878,41 @@ def test_oaid_md5_empty():
# oaid_md5长度超长
def test_oaid_md5_illegal_length():
data[0]["device_info"]["oaid_md5"] = cc612
data[0]["device_info"]["device_id"] = "1a34fc556a43c453"
data[0]["device_info"]["device_id_type"] = "android_id"
data[0]["device_info"]["android_id"] = "1a34fc556a43c453"
response = send_request()
assert response["status"] == "127"
# def test_oaid_md5_illegal_length():
# data[0]["device_info"]["oaid_md5"] = cc612
# data[0]["device_info"]["device_id"] = "1a34fc556a43c453"
# data[0]["device_info"]["device_id_type"] = "android_id"
# data[0]["device_info"]["android_id"] = "1a34fc556a43c453"
# response = send_request()
# assert response["status"] == "127"
# 安卓系统,上报idfa
def test_idfa():
data[0]["device_info"]["idfa"] = "3DEA635F-B24F-434B-833F-4ED028FEAEEF"
response = send_request()
assert response["status"] == "115"
assert response["status"] == "220"
# 安卓系统,上报idfa_md5
def test_idfa_md5():
data[0]["device_info"]["idfa_md5"] = "8e488a40a17aed2f6752f51382a4eafc"
response = send_request()
assert response["status"] == "115"
assert response["status"] == "220"
# 安卓系统,上报idfv
def test_idfv():
data[0]["device_info"]["idfv"] = "3DEA635F-B24F-434B-833F-4ED028FEAEEF"
response = send_request()
assert response["status"] == "115"
assert response["status"] == "220"
# 安卓系统,上报idfv_md5
def test_idfv_md5():
data[0]["device_info"]["idfv_md5"] = "8e488a40a17aed2f6752f51382a4eafc"
response = send_request()
assert response["status"] == "115"
assert response["status"] == "220"
# imei1为空
......@@ -935,13 +926,13 @@ def test_imei1_empty():
# imei1长度超长
def test_imei1__illegal_length():
data[0]["device_info"]["imei1"] = chaochang
data[0]["device_info"]["device_id"] = "1a34fc556a43c453"
data[0]["device_info"]["device_id_type"] = "android_id"
data[0]["device_info"]["android_id"] = "1a34fc556a43c453"
response = send_request()
assert response["status"] == "128"
# def test_imei1__illegal_length():
# data[0]["device_info"]["imei1"] = chaochang
# data[0]["device_info"]["device_id"] = "1a34fc556a43c453"
# data[0]["device_info"]["device_id_type"] = "android_id"
# data[0]["device_info"]["android_id"] = "1a34fc556a43c453"
# response = send_request()
# assert response["status"] == "128"
# imei1_md5为空
......@@ -955,13 +946,13 @@ def test_imei1_md5_empty():
# imei1_md5长度超长
def test_imei1_md5_illegal_length():
data[0]["device_info"]["imei1_md5"] = cc612
data[0]["device_info"]["device_id"] = "1a34fc556a43c453"
data[0]["device_info"]["device_id_type"] = "android_id"
data[0]["device_info"]["android_id"] = "1a34fc556a43c453"
response = send_request()
assert response["status"] == "129"
# def test_imei1_md5_illegal_length():
# data[0]["device_info"]["imei1_md5"] = cc612
# data[0]["device_info"]["device_id"] = "1a34fc556a43c453"
# data[0]["device_info"]["device_id_type"] = "android_id"
# data[0]["device_info"]["android_id"] = "1a34fc556a43c453"
# response = send_request()
# assert response["status"] == "129"
# imei2为空
......@@ -975,13 +966,13 @@ def test_imei2_empty():
# imei2长度超长
def test_imei2_illegal_length():
data[0]["device_info"]["imei2"] = chaochang
data[0]["device_info"]["device_id"] = "1a34fc556a43c453"
data[0]["device_info"]["device_id_type"] = "android_id"
data[0]["device_info"]["android_id"] = "1a34fc556a43c453"
response = send_request()
assert response["status"] == "130"
# def test_imei2_illegal_length():
# data[0]["device_info"]["imei2"] = chaochang
# data[0]["device_info"]["device_id"] = "1a34fc556a43c453"
# data[0]["device_info"]["device_id_type"] = "android_id"
# data[0]["device_info"]["android_id"] = "1a34fc556a43c453"
# response = send_request()
# assert response["status"] == "130"
# imei2_md5为空
......@@ -995,13 +986,13 @@ def test_imei2_md5_empty():
# imei2_md5长度超长
def test_imei2_md5_illegal_length():
data[0]["device_info"]["imei2_md5"] = cc612
data[0]["device_info"]["device_id"] = "1a34fc556a43c453"
data[0]["device_info"]["device_id_type"] = "android_id"
data[0]["device_info"]["android_id"] = "1a34fc556a43c453"
response = send_request()
assert response["status"] == "131"
# def test_imei2_md5_illegal_length():
# data[0]["device_info"]["imei2_md5"] = cc612
# data[0]["device_info"]["device_id"] = "1a34fc556a43c453"
# data[0]["device_info"]["device_id_type"] = "android_id"
# data[0]["device_info"]["android_id"] = "1a34fc556a43c453"
# response = send_request()
# assert response["status"] == "131"
# gaid为空
......@@ -1015,13 +1006,13 @@ def test_gaid_empty():
# gaid长度超长
def test_imei2__illegal_length():
data[0]["device_info"]["gaid"] = chaochang
data[0]["device_info"]["device_id"] = "1a34fc556a43c453"
data[0]["device_info"]["device_id_type"] = "android_id"
data[0]["device_info"]["android_id"] = "1a34fc556a43c453"
response = send_request()
assert response["status"] == "132"
# def test_imei2__illegal_length():
# data[0]["device_info"]["gaid"] = chaochang
# data[0]["device_info"]["device_id"] = "1a34fc556a43c453"
# data[0]["device_info"]["device_id_type"] = "android_id"
# data[0]["device_info"]["android_id"] = "1a34fc556a43c453"
# response = send_request()
# assert response["status"] == "132"
# gaid_md5为空
......@@ -1035,13 +1026,13 @@ def test_gaid_md5_empty():
# gaid_md5长度超长
def test_imei2_md5_illegal_length():
data[0]["device_info"]["gaid_md5"] = cc612
data[0]["device_info"]["device_id"] = "1a34fc556a43c453"
data[0]["device_info"]["device_id_type"] = "android_id"
data[0]["device_info"]["android_id"] = "1a34fc556a43c453"
response = send_request()
assert response["status"] == "133"
# def test_imei2_md5_illegal_length():
# data[0]["device_info"]["gaid_md5"] = cc612
# data[0]["device_info"]["device_id"] = "1a34fc556a43c453"
# data[0]["device_info"]["device_id_type"] = "android_id"
# data[0]["device_info"]["android_id"] = "1a34fc556a43c453"
# response = send_request()
# assert response["status"] == "133"
# mac为空
......@@ -1055,13 +1046,13 @@ def test_mac_empty():
# mac长度超长
def test_mac__illegal_length():
data[0]["device_info"]["mac"] = chaochang
data[0]["device_info"]["device_id"] = "1a34fc556a43c453"
data[0]["device_info"]["device_id_type"] = "android_id"
data[0]["device_info"]["android_id"] = "1a34fc556a43c453"
response = send_request()
assert response["status"] == "134"
# def test_mac__illegal_length():
# data[0]["device_info"]["mac"] = chaochang
# data[0]["device_info"]["device_id"] = "1a34fc556a43c453"
# data[0]["device_info"]["device_id_type"] = "android_id"
# data[0]["device_info"]["android_id"] = "1a34fc556a43c453"
# response = send_request()
# assert response["status"] == "134"
# mac_md5为空
......@@ -1075,13 +1066,13 @@ def test_mac_md5_empty():
# mac_md5长度超长
def test_mac_md5_illegal_length():
data[0]["device_info"]["mac_md5"] = cc612
data[0]["device_info"]["device_id"] = "1a34fc556a43c453"
data[0]["device_info"]["device_id_type"] = "android_id"
data[0]["device_info"]["android_id"] = "1a34fc556a43c453"
response = send_request()
assert response["status"] == "135"
# def test_mac_md5_illegal_length():
# data[0]["device_info"]["mac_md5"] = cc612
# data[0]["device_info"]["device_id"] = "1a34fc556a43c453"
# data[0]["device_info"]["device_id_type"] = "android_id"
# data[0]["device_info"]["android_id"] = "1a34fc556a43c453"
# response = send_request()
# assert response["status"] == "135"
# android_id为空,android_id_md5不为空
......@@ -1096,36 +1087,36 @@ def test_android_id_empty():
# android_id长度超长
def test_android_id__illegal_length():
data[0]["device_info"]["android_id"] = chaochang
data[0]["device_info"]["android_id_md5"] = "9120163167c05aed85f30bf88495bd89"
data[0]["device_info"]["device_id"] = "3DEA678F-B24F-434B-833F-4ED028FEAEEF"
data[0]["device_info"]["device_id_type"] = "oaid"
data[0]["device_info"]["oaid"] = "3DEA678F-B24F-434B-833F-4ED028FEAEEF"
response = send_request()
assert response["status"] == "136"
# def test_android_id__illegal_length():
# data[0]["device_info"]["android_id"] = chaochang
# data[0]["device_info"]["android_id_md5"] = "9120163167c05aed85f30bf88495bd89"
# data[0]["device_info"]["device_id"] = "3DEA678F-B24F-434B-833F-4ED028FEAEEF"
# data[0]["device_info"]["device_id_type"] = "oaid"
# data[0]["device_info"]["oaid"] = "3DEA678F-B24F-434B-833F-4ED028FEAEEF"
# response = send_request()
# assert response["status"] == "136"
# android_id为空,android_id_md5为空
def test_android_id_md5__empty():
data[0]["device_info"]["android_id"] = ''
data[0]["device_info"]["android_id_md5"] = ""
data[0]["device_info"]["device_id"] = "3DEA678F-B24F-434B-833F-4ED028FEAEEF"
data[0]["device_info"]["device_id_type"] = "oaid"
data[0]["device_info"]["oaid"] = "3DEA678F-B24F-434B-833F-4ED028FEAEEF"
response = send_request()
assert response["status"] == "136"
# def test_android_id_md5__empty():
# data[0]["device_info"]["android_id"] = ''
# data[0]["device_info"]["android_id_md5"] = ""
# data[0]["device_info"]["device_id"] = "3DEA678F-B24F-434B-833F-4ED028FEAEEF"
# data[0]["device_info"]["device_id_type"] = "oaid"
# data[0]["device_info"]["oaid"] = "3DEA678F-B24F-434B-833F-4ED028FEAEEF"
# response = send_request()
# assert response["status"] == "136"
# android_id_md5长度超长
def test_android_id_illegal_length():
data[0]["device_info"]["android_id"] = "7564324234234322"
data[0]["device_info"]["android_id_md5"] = chaochang
data[0]["device_info"]["device_id"] = "3DEA678F-B24F-434B-833F-4ED028FEAEEF"
data[0]["device_info"]["device_id_type"] = "oaid"
data[0]["device_info"]["oaid"] = "3DEA678F-B24F-434B-833F-4ED028FEAEEF"
response = send_request()
assert response["status"] == "136"
# def test_android_id_illegal_length():
# data[0]["device_info"]["android_id"] = "7564324234234322"
# data[0]["device_info"]["android_id_md5"] = chaochang
# data[0]["device_info"]["device_id"] = "3DEA678F-B24F-434B-833F-4ED028FEAEEF"
# data[0]["device_info"]["device_id_type"] = "oaid"
# data[0]["device_info"]["oaid"] = "3DEA678F-B24F-434B-833F-4ED028FEAEEF"
# response = send_request()
# assert response["status"] == "136"
# *******************************修改了需求,修改为:移除device_id与设备id的一致性校验。例如device_id_type=oaid时,不校验device_id与oaid是否一致***************************
......@@ -1163,7 +1154,7 @@ def test_device_id_empty1():
def test_device_id_type_empty2():
data[0]["device_info"]["device_id_type"] = ''
response = send_request()
assert response["status"] == "138"
assert response["status"] == "0"
# device_id_type为one_id
......@@ -1198,7 +1189,7 @@ def test_device_id3():
def test_device_id_type_illegal_length():
data[0]["device_info"]["device_id_type"] = chaochang
response = send_request()
assert response["status"] == "138"
assert response["status"] == "0"
# device_id_md5_type为空,device_id_md5有值
......@@ -1208,7 +1199,7 @@ def test_device_id_md5_type_empty():
data[0]["device_info"]["device_id_md5_type"] = ''
data[0]["device_info"]['oaid_md5'] = '4f71f3a43123b1538e93e8c0b9773d06'
response = send_request()
assert response["status"] == "139"
assert response["status"] == "0"
# device_id_md5_type为任意字符,device_id_md5有值
......@@ -1916,7 +1907,7 @@ def test_is_rendered3():
def test_custom_params2():
data[0]['event_info']['custom_params']["@#¥@#¥#@"] = '@#2321321@#¥#@'
response = send_request()
assert response["status"] == "160"
assert response["status"] == "0"
# key超过32位
......@@ -1980,7 +1971,7 @@ def test_custom_params3():
def test_country1():
data[0]['timestamp_info']['country'] = ''
response = send_request()
assert response["status"] == "216"
assert response["status"] == "0"
# country为16个字符
......@@ -1994,7 +1985,7 @@ def test_country2():
def test_country3():
data[0]['timestamp_info']['country'] = code_nums(17)
response = send_request()
assert response["status"] == "216"
assert response["status"] == "0"
# country包含特殊字符
......@@ -2022,7 +2013,7 @@ def test_language2():
def test_language3():
data[0]['device_info']['language'] = code_nums2(33)
response = send_request()
assert response["status"] == "217"
assert response["status"] == "0"
# language包含中文
......@@ -2057,7 +2048,7 @@ def test_device_type2():
def test_device_type3():
data[0]['device_info']['device_type'] = code_nums2(17)
response = send_request()
assert response["status"] == "218"
assert response["status"] == "0"
# device_type包含中文
......@@ -2130,7 +2121,6 @@ def test_ad_appid3():
assert response["status"] == "0"
# product_name为空
def test_product_name1():
data[0]['event_info']['event_data']['product_name'] = ''
......@@ -2152,9 +2142,6 @@ def test_product_name3():
assert response["status"] == "0"
# product_id为空
def test_product_id1():
data[0]['event_info']['event_data']['product_id'] = ''
......@@ -2196,6 +2183,7 @@ def test_product_num3():
response = send_request()
assert response["status"] == "0"
# product_num为number类型
def test_product_num4():
data[0]['event_info']['event_data']['product_num'] = 232
......@@ -2203,8 +2191,6 @@ def test_product_num4():
assert response["status"] == "0"
# bid_type为空
def test_bid_type1():
data[0]['event_info']['event_data']['bid_type'] = ''
......@@ -2228,6 +2214,743 @@ def test_bid_type3():
assert response["status"] == "0"
# ---------------------------事件数据入库规则优化-------------------------
# **************install_time、current_event_time参数校验测试用例*******************
# 前提条件:
# 1:appkey、report_time、boudleid、event_name、event_type、channel_name、collector_version、integration_type、time_zone 同时满足校验规则
# 2:所有Device_info至少有一个参数符合校验规则
# event_name为install事件,有install_time
def test_event_1():
data[0]["application_info"]["appkey"] = "344234354"
data[0]["application_info"]["bundleid"] = "grere34543f4r4"
data[0]["application_info"]["channel_name"] = "google"
data[0]["timestamp_info"]["time_zone"] = "GMT+08"
data[0]["timestamp_info"]["install_time"] = "1675920494521"
data[0]["timestamp_info"]["report_time"] = "1675920494521"
data[0]["event_info"]["event_name"] = "install"
data[0]["event_info"]["event_type"] = "preset"
data[0]["collector_info"]["collector_version"] = "1.0.0"
data[0]["collector_info"]["integration_type"] = "sdk"
data[0]["device_info"]["device_id"] = "1a34fc556a43c453"
response = send_request()
assert response["status"] == "0"
# event_name为login事件,有 current_event_time
def test_event_2():
data[0]["application_info"]["appkey"] = "344234354"
data[0]["application_info"]["bundleid"] = "grere34543f4r4"
data[0]["application_info"]["channel_name"] = "google"
data[0]["timestamp_info"]["time_zone"] = "GMT+08"
data[0]["timestamp_info"]["current_event_time"] = "1675920494521"
data[0]["timestamp_info"]["report_time"] = "1675920494521"
data[0]["event_info"]["event_name"] = "login"
data[0]["event_info"]["event_type"] = "preset"
data[0]["collector_info"]["collector_version"] = "1.0.0"
data[0]["collector_info"]["integration_type"] = "sdk"
data[0]["device_info"]["device_id"] = "1a34fc556a43c453"
response = send_request()
assert response["status"] == "0"
# event_name为install事件,install_time为空
def test_event_3():
data[0]["application_info"]["appkey"] = "344234354"
data[0]["application_info"]["bundleid"] = "grere34543f4r4"
data[0]["application_info"]["channel_name"] = "google"
data[0]["timestamp_info"]["time_zone"] = "GMT+08"
data[0]["timestamp_info"]["current_event_time"] = "1675920494521"
data[0]["timestamp_info"]["install_time"] = ""
data[0]["timestamp_info"]["report_time"] = "1675920494521"
data[0]["event_info"]["event_name"] = "install"
data[0]["event_info"]["event_type"] = "preset"
data[0]["collector_info"]["collector_version"] = "1.0.0"
data[0]["collector_info"]["integration_type"] = "sdk"
data[0]["device_info"]["device_id"] = "1a34fc556a43c453"
response = send_request()
assert response["status"] == "107"
# event_name为login事件,current_event_time为空
def test_event_4():
data[0]["application_info"]["appkey"] = "344234354"
data[0]["application_info"]["bundleid"] = "grere34543f4r4"
data[0]["application_info"]["channel_name"] = "google"
data[0]["timestamp_info"]["time_zone"] = "GMT+08"
data[0]["timestamp_info"]["current_event_time"] = ""
data[0]["timestamp_info"]["report_time"] = "1675920494521"
data[0]["event_info"]["event_name"] = "login"
data[0]["event_info"]["event_type"] = "preset"
data[0]["collector_info"]["collector_version"] = "1.0.0"
data[0]["collector_info"]["integration_type"] = "sdk"
data[0]["device_info"]["device_id"] = "1a34fc556a43c453"
response = send_request()
assert response["status"] == "108"
# *******************appkey、report_time、boudleid、event_name、event_type、channel_name、collector_version、integration_type、time_zone 参数校验测试用例*******************
# 前提条件
# 1.event_name为install事件,install_time不为空
# 2:所有Device_info至少有一个参数符合校验规则
# appkey为空
def test_event_5():
data[0]["application_info"]["appkey"] = ""
data[0]["application_info"]["bundleid"] = "grere34543f4r4"
data[0]["application_info"]["channel_name"] = "google"
data[0]["timestamp_info"]["time_zone"] = "GMT+08"
data[0]["timestamp_info"]["install_time"] = "1675920494521"
data[0]["timestamp_info"]["report_time"] = "1675920494521"
data[0]["event_info"]["event_name"] = "install"
data[0]["event_info"]["event_type"] = "preset"
data[0]["collector_info"]["collector_version"] = "1.0.0"
data[0]["collector_info"]["integration_type"] = "sdk"
data[0]["device_info"]["device_id"] = "1a34fc556a43c453"
response = send_request()
assert response["status"] == "101"
# report_time为空
def test_event_6():
data[0]["application_info"]["appkey"] = "344234354"
data[0]["application_info"]["bundleid"] = "grere34543f4r4"
data[0]["application_info"]["channel_name"] = "google"
data[0]["timestamp_info"]["time_zone"] = "GMT+08"
data[0]["timestamp_info"]["install_time"] = "1675920494521"
data[0]["timestamp_info"]["report_time"] = ""
data[0]["event_info"]["event_name"] = "install"
data[0]["event_info"]["event_type"] = "preset"
data[0]["collector_info"]["collector_version"] = "1.0.0"
data[0]["collector_info"]["integration_type"] = "sdk"
data[0]["device_info"]["device_id"] = "1a34fc556a43c453"
response = send_request()
assert response["status"] == "109"
# boudleid 为空
def test_event_7():
data[0]["application_info"]["appkey"] = "344234354"
data[0]["application_info"]["bundleid"] = ""
data[0]["application_info"]["channel_name"] = "google"
data[0]["timestamp_info"]["time_zone"] = "GMT+08"
data[0]["timestamp_info"]["install_time"] = "1675920494521"
data[0]["timestamp_info"]["report_time"] = "1675920494521"
data[0]["event_info"]["event_name"] = "install"
data[0]["event_info"]["event_type"] = "preset"
data[0]["collector_info"]["collector_version"] = "1.0.0"
data[0]["collector_info"]["integration_type"] = "sdk"
data[0]["device_info"]["device_id"] = "1a34fc556a43c453"
response = send_request()
assert response["status"] == "102"
# event_name 为空
def test_event_8():
data[0]["application_info"]["appkey"] = "344234354"
data[0]["application_info"]["bundleid"] = "grere34543f4r4"
data[0]["application_info"]["channel_name"] = "google"
data[0]["timestamp_info"]["time_zone"] = "GMT+08"
data[0]["timestamp_info"]["install_time"] = "1675920494521"
data[0]["timestamp_info"]["report_time"] = "1675920494521"
data[0]["event_info"]["event_name"] = ""
data[0]["event_info"]["event_type"] = "preset"
data[0]["collector_info"]["collector_version"] = "1.0.0"
data[0]["collector_info"]["integration_type"] = "sdk"
data[0]["device_info"]["device_id"] = "1a34fc556a43c453"
response = send_request()
assert response["status"] == "143"
# event_type 为空
def test_event_9():
data[0]["application_info"]["appkey"] = "344234354"
data[0]["application_info"]["bundleid"] = "grere34543f4r4"
data[0]["application_info"]["channel_name"] = "google"
data[0]["timestamp_info"]["time_zone"] = "GMT+08"
data[0]["timestamp_info"]["install_time"] = "1675920494521"
data[0]["timestamp_info"]["report_time"] = "1675920494521"
data[0]["event_info"]["event_name"] = "install"
data[0]["event_info"]["event_type"] = ""
data[0]["collector_info"]["collector_version"] = "1.0.0"
data[0]["collector_info"]["integration_type"] = "sdk"
data[0]["device_info"]["device_id"] = "1a34fc556a43c453"
response = send_request()
assert response["status"] == "144"
# channel_name 为空
def test_event_10():
data[0]["application_info"]["appkey"] = "344234354"
data[0]["application_info"]["bundleid"] = "grere34543f4r4"
data[0]["application_info"]["channel_name"] = ""
data[0]["timestamp_info"]["time_zone"] = "GMT+08"
data[0]["timestamp_info"]["install_time"] = "1675920494521"
data[0]["timestamp_info"]["report_time"] = "1675920494521"
data[0]["event_info"]["event_name"] = "install"
data[0]["event_info"]["event_type"] = "preset"
data[0]["collector_info"]["collector_version"] = "1.0.0"
data[0]["collector_info"]["integration_type"] = "sdk"
data[0]["device_info"]["device_id"] = "1a34fc556a43c453"
response = send_request()
assert response["status"] == "104"
# collector_version 为空
def test_event_11():
data[0]["application_info"]["appkey"] = "344234354"
data[0]["application_info"]["bundleid"] = "grere34543f4r4"
data[0]["application_info"]["channel_name"] = "google"
data[0]["timestamp_info"]["time_zone"] = "GMT+08"
data[0]["timestamp_info"]["install_time"] = "1675920494521"
data[0]["timestamp_info"]["report_time"] = "1675920494521"
data[0]["event_info"]["event_name"] = "install"
data[0]["event_info"]["event_type"] = "preset"
data[0]["collector_info"]["collector_version"] = ""
data[0]["collector_info"]["integration_type"] = "sdk"
data[0]["device_info"]["device_id"] = "1a34fc556a43c453"
response = send_request()
assert response["status"] == "112"
# integration_type 为空
def test_event_12():
data[0]["application_info"]["appkey"] = "344234354"
data[0]["application_info"]["bundleid"] = "grere34543f4r4"
data[0]["application_info"]["channel_name"] = "google"
data[0]["timestamp_info"]["time_zone"] = "GMT+08"
data[0]["timestamp_info"]["install_time"] = "1675920494521"
data[0]["timestamp_info"]["report_time"] = "1675920494521"
data[0]["event_info"]["event_name"] = "install"
data[0]["event_info"]["event_type"] = "preset"
data[0]["collector_info"]["collector_version"] = "1.0.0"
data[0]["collector_info"]["integration_type"] = ""
data[0]["device_info"]["device_id"] = "1a34fc556a43c453"
response = send_request()
assert response["status"] == "111"
# time_zone 为空
def test_event_13():
data[0]["application_info"]["appkey"] = "344234354"
data[0]["application_info"]["bundleid"] = "grere34543f4r4"
data[0]["application_info"]["channel_name"] = "google"
data[0]["timestamp_info"]["time_zone"] = ""
data[0]["timestamp_info"]["install_time"] = "1675920494521"
data[0]["timestamp_info"]["report_time"] = "1675920494521"
data[0]["event_info"]["event_name"] = "install"
data[0]["event_info"]["event_type"] = "preset"
data[0]["collector_info"]["collector_version"] = "1.0.0"
data[0]["collector_info"]["integration_type"] = "sdk"
data[0]["device_info"]["device_id"] = "1a34fc556a43c453"
response = send_request()
assert response["status"] == "106"
# *******************Device_info参数校验测试用例*******************
# 前提条件
# 1.event_name为install事件,install_time不为空
# 2:appkey、report_time、boudleid、event_name、event_type、channel_name、collector_version、integration_type、time_zone 全部符合规则
# Device_info中的参数全部符合校验
def test_event_14():
data[0]["application_info"]["appkey"] = "344234354"
data[0]["application_info"]["bundleid"] = "grere34543f4r4"
data[0]["application_info"]["channel_name"] = "google"
data[0]["timestamp_info"]["time_zone"] = "GMT+08"
data[0]["timestamp_info"]["install_time"] = "1675920494521"
data[0]["timestamp_info"]["report_time"] = "1675920494521"
data[0]["event_info"]["event_name"] = "install"
data[0]["event_info"]["event_type"] = "preset"
data[0]["collector_info"]["collector_version"] = "1.0.0"
data[0]["collector_info"]["integration_type"] = "sdk"
data[0]["device_info"]["device_id"] = "1a34fc556a43c453"
data[0]["device_info"]["device_id_md5"] = code_nums2(32)
data[0]["device_info"]["os_version"] = code_nums2(10)
data[0]["device_info"]["os"] = "1"
data[0]["device_info"]["ipv4"] = code_nums2(10)
data[0]["device_info"]["oaid"] = "1a34fc556a43c453"
data[0]["device_info"]["oaid"] = code_nums2(32)
data[0]["device_info"]["imei1"] = "1a34fc556a43c453"
data[0]["device_info"]["imei1_md5"] = code_nums2(32)
data[0]["device_info"]["imei2"] = "1a34fc556a43c453"
data[0]["device_info"]["imei2_md5"] = code_nums2(32)
data[0]["device_info"]["gaid"] = code_nums2(36)
data[0]["device_info"]["gaid_md5"] = code_nums2(32)
data[0]["device_info"]["mac"] = code_nums2(17)
data[0]["device_info"]["mac_md5"] = code_nums2(32)
data[0]["device_info"]["androidid"] = "1a34fc556a43c453"
data[0]["device_info"]["androidid_md5"] = code_nums2(32)
response = send_request()
assert response["status"] == "0"
# Device_info全部参数不符合规则
def test_event_15():
data[0]["application_info"]["appkey"] = "344234354"
data[0]["application_info"]["bundleid"] = "grere34543f4r4"
data[0]["application_info"]["channel_name"] = "google"
data[0]["timestamp_info"]["time_zone"] = "GMT+08"
data[0]["timestamp_info"]["install_time"] = "1675920494521"
data[0]["timestamp_info"]["report_time"] = "1675920494521"
data[0]["event_info"]["event_name"] = "install"
data[0]["event_info"]["event_type"] = "preset"
data[0]["collector_info"]["collector_version"] = "1.0.0"
data[0]["collector_info"]["integration_type"] = "sdk"
data[0]["device_info"]["os_version"] = "1"
data[0]["device_info"]["os"] = "1"
data[0]["device_info"]["device_id"] = code_nums2(12)
data[0]["device_info"]["device_id_md5"] = code_nums2(32)
data[0]["device_info"]["ipv4"] = code_nums2(129)
data[0]["device_info"]["oaid"] = code_nums2(513)
data[0]["device_info"]["oaid_md5"] = code_nums2(33)
data[0]["device_info"]["imei1"] = code_nums2(33)
data[0]["device_info"]["imei1_md5"] = code_nums2(33)
data[0]["device_info"]["imei2"] = code_nums2(33)
data[0]["device_info"]["imei2_md5"] = code_nums2(33)
data[0]["device_info"]["gaid"] = code_nums2(37)
data[0]["device_info"]["gaid_md5"] = code_nums2(33)
data[0]["device_info"]["mac"] = code_nums2(33)
data[0]["device_info"]["mac_md5"] = code_nums2(33)
data[0]["device_info"]["android_id"] = code_nums2(33)
data[0]["device_info"]["android_id_md5"] = code_nums2(33)
response = send_request()
assert response["status"] == "221"
# Device_info中只有ipv4符合规则
def test_event_16():
data[0]["application_info"]["appkey"] = "344234354"
data[0]["application_info"]["bundleid"] = "grere34543f4r4"
data[0]["application_info"]["channel_name"] = "google"
data[0]["timestamp_info"]["time_zone"] = "GMT+08"
data[0]["timestamp_info"]["install_time"] = "1675920494521"
data[0]["timestamp_info"]["report_time"] = "1675920494521"
data[0]["event_info"]["event_name"] = "install"
data[0]["event_info"]["event_type"] = "preset"
data[0]["collector_info"]["collector_version"] = "1.0.0"
data[0]["collector_info"]["integration_type"] = "sdk"
data[0]["device_info"]["os_version"] = "1"
data[0]["device_info"]["os"] = "1"
data[0]["device_info"]["device_id"] = code_nums2(12)
data[0]["device_info"]["device_id_md5"] = code_nums2(32)
data[0]["device_info"]["ipv4"] = code_nums2(128)
data[0]["device_info"]["oaid"] = code_nums2(513)
data[0]["device_info"]["oaid_md5"] = code_nums2(33)
data[0]["device_info"]["imei1"] = code_nums2(33)
data[0]["device_info"]["imei1_md5"] = code_nums2(33)
data[0]["device_info"]["imei2"] = code_nums2(33)
data[0]["device_info"]["imei2_md5"] = code_nums2(33)
data[0]["device_info"]["gaid"] = code_nums2(37)
data[0]["device_info"]["gaid_md5"] = code_nums2(33)
data[0]["device_info"]["mac"] = code_nums2(33)
data[0]["device_info"]["mac_md5"] = code_nums2(33)
data[0]["device_info"]["android_id"] = code_nums2(33)
data[0]["device_info"]["android_id_md5"] = code_nums2(33)
response = send_request()
assert response["status"] == "0"
# Device_info中只有oaid符合规则
def test_event_17():
data[0]["application_info"]["appkey"] = "344234354"
data[0]["application_info"]["bundleid"] = "grere34543f4r4"
data[0]["application_info"]["channel_name"] = "google"
data[0]["timestamp_info"]["time_zone"] = "GMT+08"
data[0]["timestamp_info"]["install_time"] = "1675920494521"
data[0]["timestamp_info"]["report_time"] = "1675920494521"
data[0]["event_info"]["event_name"] = "install"
data[0]["event_info"]["event_type"] = "preset"
data[0]["collector_info"]["collector_version"] = "1.0.0"
data[0]["collector_info"]["integration_type"] = "sdk"
data[0]["device_info"]["os_version"] = "1"
data[0]["device_info"]["os"] = "1"
data[0]["device_info"]["device_id"] = code_nums2(12)
data[0]["device_info"]["device_id_md5"] = code_nums2(32)
data[0]["device_info"]["ipv4"] = code_nums2(129)
data[0]["device_info"]["oaid"] = code_nums2(512)
data[0]["device_info"]["oaid_md5"] = code_nums2(33)
data[0]["device_info"]["imei1"] = code_nums2(33)
data[0]["device_info"]["imei1_md5"] = code_nums2(33)
data[0]["device_info"]["imei2"] = code_nums2(33)
data[0]["device_info"]["imei2_md5"] = code_nums2(33)
data[0]["device_info"]["gaid"] = code_nums2(37)
data[0]["device_info"]["gaid_md5"] = code_nums2(33)
data[0]["device_info"]["mac"] = code_nums2(33)
data[0]["device_info"]["mac_md5"] = code_nums2(33)
data[0]["device_info"]["android_id"] = code_nums2(33)
data[0]["device_info"]["android_id_md5"] = code_nums2(33)
response = send_request()
assert response["status"] == "0"
# Device_info中只有 oaid_md5 符合规则
def test_event_18():
data[0]["application_info"]["appkey"] = "344234354"
data[0]["application_info"]["bundleid"] = "grere34543f4r4"
data[0]["application_info"]["channel_name"] = "google"
data[0]["timestamp_info"]["time_zone"] = "GMT+08"
data[0]["timestamp_info"]["install_time"] = "1675920494521"
data[0]["timestamp_info"]["report_time"] = "1675920494521"
data[0]["event_info"]["event_name"] = "install"
data[0]["event_info"]["event_type"] = "preset"
data[0]["collector_info"]["collector_version"] = "1.0.0"
data[0]["collector_info"]["integration_type"] = "sdk"
data[0]["device_info"]["os_version"] = "1"
data[0]["device_info"]["os"] = "1"
data[0]["device_info"]["device_id"] = code_nums2(12)
data[0]["device_info"]["device_id_md5"] = code_nums2(32)
data[0]["device_info"]["ipv4"] = code_nums2(129)
data[0]["device_info"]["oaid"] = code_nums2(513)
data[0]["device_info"]["oaid_md5"] = code_nums2(32)
data[0]["device_info"]["imei1"] = code_nums2(33)
data[0]["device_info"]["imei1_md5"] = code_nums2(33)
data[0]["device_info"]["imei2"] = code_nums2(33)
data[0]["device_info"]["imei2_md5"] = code_nums2(33)
data[0]["device_info"]["gaid"] = code_nums2(37)
data[0]["device_info"]["gaid_md5"] = code_nums2(33)
data[0]["device_info"]["mac"] = code_nums2(33)
data[0]["device_info"]["mac_md5"] = code_nums2(33)
data[0]["device_info"]["android_id"] = code_nums2(33)
data[0]["device_info"]["android_id_md5"] = code_nums2(33)
response = send_request()
assert response["status"] == "0"
# Device_info中只有 imei1 符合规则
def test_event_19():
data[0]["application_info"]["appkey"] = "344234354"
data[0]["application_info"]["bundleid"] = "grere34543f4r4"
data[0]["application_info"]["channel_name"] = "google"
data[0]["timestamp_info"]["time_zone"] = "GMT+08"
data[0]["timestamp_info"]["install_time"] = "1675920494521"
data[0]["timestamp_info"]["report_time"] = "1675920494521"
data[0]["event_info"]["event_name"] = "install"
data[0]["event_info"]["event_type"] = "preset"
data[0]["collector_info"]["collector_version"] = "1.0.0"
data[0]["collector_info"]["integration_type"] = "sdk"
data[0]["device_info"]["os_version"] = "1"
data[0]["device_info"]["os"] = "1"
data[0]["device_info"]["device_id"] = code_nums2(12)
data[0]["device_info"]["device_id_md5"] = code_nums2(32)
data[0]["device_info"]["ipv4"] = code_nums2(129)
data[0]["device_info"]["oaid"] = code_nums2(513)
data[0]["device_info"]["oaid_md5"] = code_nums2(33)
data[0]["device_info"]["imei1"] = code_nums2(32)
data[0]["device_info"]["imei1_md5"] = code_nums2(33)
data[0]["device_info"]["imei2"] = code_nums2(33)
data[0]["device_info"]["imei2_md5"] = code_nums2(33)
data[0]["device_info"]["gaid"] = code_nums2(37)
data[0]["device_info"]["gaid_md5"] = code_nums2(33)
data[0]["device_info"]["mac"] = code_nums2(33)
data[0]["device_info"]["mac_md5"] = code_nums2(33)
data[0]["device_info"]["android_id"] = code_nums2(33)
data[0]["device_info"]["android_id_md5"] = code_nums2(33)
response = send_request()
assert response["status"] == "0"
# Device_info中只有 imei1_md5 符合规则
def test_event_20():
data[0]["application_info"]["appkey"] = "344234354"
data[0]["application_info"]["bundleid"] = "grere34543f4r4"
data[0]["application_info"]["channel_name"] = "google"
data[0]["timestamp_info"]["time_zone"] = "GMT+08"
data[0]["timestamp_info"]["install_time"] = "1675920494521"
data[0]["timestamp_info"]["report_time"] = "1675920494521"
data[0]["event_info"]["event_name"] = "install"
data[0]["event_info"]["event_type"] = "preset"
data[0]["collector_info"]["collector_version"] = "1.0.0"
data[0]["collector_info"]["integration_type"] = "sdk"
data[0]["device_info"]["os_version"] = "1"
data[0]["device_info"]["os"] = "1"
data[0]["device_info"]["device_id"] = code_nums2(12)
data[0]["device_info"]["device_id_md5"] = code_nums2(32)
data[0]["device_info"]["ipv4"] = code_nums2(129)
data[0]["device_info"]["oaid"] = code_nums2(513)
data[0]["device_info"]["oaid_md5"] = code_nums2(33)
data[0]["device_info"]["imei1"] = code_nums2(33)
data[0]["device_info"]["imei1_md5"] = code_nums2(32)
data[0]["device_info"]["imei2"] = code_nums2(33)
data[0]["device_info"]["imei2_md5"] = code_nums2(33)
data[0]["device_info"]["gaid"] = code_nums2(37)
data[0]["device_info"]["gaid_md5"] = code_nums2(33)
data[0]["device_info"]["mac"] = code_nums2(33)
data[0]["device_info"]["mac_md5"] = code_nums2(33)
data[0]["device_info"]["android_id"] = code_nums2(33)
data[0]["device_info"]["android_id_md5"] = code_nums2(33)
response = send_request()
assert response["status"] == "0"
# Device_info中只有 imei2 符合规则
def test_event_21():
data[0]["application_info"]["appkey"] = "344234354"
data[0]["application_info"]["bundleid"] = "grere34543f4r4"
data[0]["application_info"]["channel_name"] = "google"
data[0]["timestamp_info"]["time_zone"] = "GMT+08"
data[0]["timestamp_info"]["install_time"] = "1675920494521"
data[0]["timestamp_info"]["report_time"] = "1675920494521"
data[0]["event_info"]["event_name"] = "install"
data[0]["event_info"]["event_type"] = "preset"
data[0]["collector_info"]["collector_version"] = "1.0.0"
data[0]["collector_info"]["integration_type"] = "sdk"
data[0]["device_info"]["os_version"] = "1"
data[0]["device_info"]["os"] = "1"
data[0]["device_info"]["device_id"] = code_nums2(12)
data[0]["device_info"]["device_id_md5"] = code_nums2(32)
data[0]["device_info"]["ipv4"] = code_nums2(129)
data[0]["device_info"]["oaid"] = code_nums2(513)
data[0]["device_info"]["oaid_md5"] = code_nums2(33)
data[0]["device_info"]["imei1"] = code_nums2(33)
data[0]["device_info"]["imei1_md5"] = code_nums2(33)
data[0]["device_info"]["imei2"] = code_nums2(32)
data[0]["device_info"]["imei2_md5"] = code_nums2(33)
data[0]["device_info"]["gaid"] = code_nums2(37)
data[0]["device_info"]["gaid_md5"] = code_nums2(33)
data[0]["device_info"]["mac"] = code_nums2(33)
data[0]["device_info"]["mac_md5"] = code_nums2(33)
data[0]["device_info"]["android_id"] = code_nums2(33)
data[0]["device_info"]["android_id_md5"] = code_nums2(33)
response = send_request()
assert response["status"] == "0"
# Device_info中只有 imei2_md5 符合规则
def test_event_22():
data[0]["application_info"]["appkey"] = "344234354"
data[0]["application_info"]["bundleid"] = "grere34543f4r4"
data[0]["application_info"]["channel_name"] = "google"
data[0]["timestamp_info"]["time_zone"] = "GMT+08"
data[0]["timestamp_info"]["install_time"] = "1675920494521"
data[0]["timestamp_info"]["report_time"] = "1675920494521"
data[0]["event_info"]["event_name"] = "install"
data[0]["event_info"]["event_type"] = "preset"
data[0]["collector_info"]["collector_version"] = "1.0.0"
data[0]["collector_info"]["integration_type"] = "sdk"
data[0]["device_info"]["os_version"] = "1"
data[0]["device_info"]["os"] = "1"
data[0]["device_info"]["device_id"] = code_nums2(12)
data[0]["device_info"]["device_id_md5"] = code_nums2(32)
data[0]["device_info"]["ipv4"] = code_nums2(129)
data[0]["device_info"]["oaid"] = code_nums2(513)
data[0]["device_info"]["oaid_md5"] = code_nums2(33)
data[0]["device_info"]["imei1"] = code_nums2(33)
data[0]["device_info"]["imei1_md5"] = code_nums2(33)
data[0]["device_info"]["imei2"] = code_nums2(33)
data[0]["device_info"]["imei2_md5"] = code_nums2(32)
data[0]["device_info"]["gaid"] = code_nums2(37)
data[0]["device_info"]["gaid_md5"] = code_nums2(33)
data[0]["device_info"]["mac"] = code_nums2(33)
data[0]["device_info"]["mac_md5"] = code_nums2(33)
data[0]["device_info"]["android_id"] = code_nums2(33)
data[0]["device_info"]["android_id_md5"] = code_nums2(33)
response = send_request()
assert response["status"] == "0"
# Device_info中只有 gaid 符合规则
def test_event_23():
data[0]["application_info"]["appkey"] = "344234354"
data[0]["application_info"]["bundleid"] = "grere34543f4r4"
data[0]["application_info"]["channel_name"] = "google"
data[0]["timestamp_info"]["time_zone"] = "GMT+08"
data[0]["timestamp_info"]["install_time"] = "1675920494521"
data[0]["timestamp_info"]["report_time"] = "1675920494521"
data[0]["event_info"]["event_name"] = "install"
data[0]["event_info"]["event_type"] = "preset"
data[0]["collector_info"]["collector_version"] = "1.0.0"
data[0]["collector_info"]["integration_type"] = "sdk"
data[0]["device_info"]["os_version"] = "1"
data[0]["device_info"]["os"] = "1"
data[0]["device_info"]["device_id"] = code_nums2(12)
data[0]["device_info"]["device_id_md5"] = code_nums2(32)
data[0]["device_info"]["ipv4"] = code_nums2(129)
data[0]["device_info"]["oaid"] = code_nums2(513)
data[0]["device_info"]["oaid_md5"] = code_nums2(33)
data[0]["device_info"]["imei1"] = code_nums2(33)
data[0]["device_info"]["imei1_md5"] = code_nums2(33)
data[0]["device_info"]["imei2"] = code_nums2(33)
data[0]["device_info"]["imei2_md5"] = code_nums2(33)
data[0]["device_info"]["gaid"] = code_nums2(36)
data[0]["device_info"]["gaid_md5"] = code_nums2(33)
data[0]["device_info"]["mac"] = code_nums2(33)
data[0]["device_info"]["mac_md5"] = code_nums2(33)
data[0]["device_info"]["android_id"] = code_nums2(33)
data[0]["device_info"]["android_id_md5"] = code_nums2(33)
response = send_request()
assert response["status"] == "0"
# Device_info中只有 gaid_md5 符合规则
def test_event_24():
data[0]["application_info"]["appkey"] = "344234354"
data[0]["application_info"]["bundleid"] = "grere34543f4r4"
data[0]["application_info"]["channel_name"] = "google"
data[0]["timestamp_info"]["time_zone"] = "GMT+08"
data[0]["timestamp_info"]["install_time"] = "1675920494521"
data[0]["timestamp_info"]["report_time"] = "1675920494521"
data[0]["event_info"]["event_name"] = "install"
data[0]["event_info"]["event_type"] = "preset"
data[0]["collector_info"]["collector_version"] = "1.0.0"
data[0]["collector_info"]["integration_type"] = "sdk"
data[0]["device_info"]["os_version"] = "1"
data[0]["device_info"]["os"] = "1"
data[0]["device_info"]["device_id"] = code_nums2(12)
data[0]["device_info"]["device_id_md5"] = code_nums2(32)
data[0]["device_info"]["ipv4"] = code_nums2(129)
data[0]["device_info"]["oaid"] = code_nums2(513)
data[0]["device_info"]["oaid_md5"] = code_nums2(33)
data[0]["device_info"]["imei1"] = code_nums2(33)
data[0]["device_info"]["imei1_md5"] = code_nums2(33)
data[0]["device_info"]["imei2"] = code_nums2(33)
data[0]["device_info"]["imei2_md5"] = code_nums2(33)
data[0]["device_info"]["gaid"] = code_nums2(37)
data[0]["device_info"]["gaid_md5"] = code_nums2(32)
data[0]["device_info"]["mac"] = code_nums2(33)
data[0]["device_info"]["mac_md5"] = code_nums2(33)
data[0]["device_info"]["android_id"] = code_nums2(33)
data[0]["device_info"]["android_id_md5"] = code_nums2(33)
response = send_request()
assert response["status"] == "0"
# Device_info中只有 mac 符合规则
def test_event_25():
data[0]["application_info"]["appkey"] = "344234354"
data[0]["application_info"]["bundleid"] = "grere34543f4r4"
data[0]["application_info"]["channel_name"] = "google"
data[0]["timestamp_info"]["time_zone"] = "GMT+08"
data[0]["timestamp_info"]["install_time"] = "1675920494521"
data[0]["timestamp_info"]["report_time"] = "1675920494521"
data[0]["event_info"]["event_name"] = "install"
data[0]["event_info"]["event_type"] = "preset"
data[0]["collector_info"]["collector_version"] = "1.0.0"
data[0]["collector_info"]["integration_type"] = "sdk"
data[0]["device_info"]["os_version"] = "1"
data[0]["device_info"]["os"] = "1"
data[0]["device_info"]["device_id"] = code_nums2(12)
data[0]["device_info"]["device_id_md5"] = code_nums2(32)
data[0]["device_info"]["ipv4"] = code_nums2(129)
data[0]["device_info"]["oaid"] = code_nums2(513)
data[0]["device_info"]["oaid_md5"] = code_nums2(33)
data[0]["device_info"]["imei1"] = code_nums2(33)
data[0]["device_info"]["imei1_md5"] = code_nums2(33)
data[0]["device_info"]["imei2"] = code_nums2(33)
data[0]["device_info"]["imei2_md5"] = code_nums2(33)
data[0]["device_info"]["gaid"] = code_nums2(37)
data[0]["device_info"]["gaid_md5"] = code_nums2(33)
data[0]["device_info"]["mac"] = code_nums2(17)
data[0]["device_info"]["mac_md5"] = code_nums2(33)
data[0]["device_info"]["android_id"] = code_nums2(33)
data[0]["device_info"]["android_id_md5"] = code_nums2(33)
response = send_request()
assert response["status"] == "0"
# Device_info中只有 mac_md5 符合规则
def test_event_26():
data[0]["application_info"]["appkey"] = "344234354"
data[0]["application_info"]["bundleid"] = "grere34543f4r4"
data[0]["application_info"]["channel_name"] = "google"
data[0]["timestamp_info"]["time_zone"] = "GMT+08"
data[0]["timestamp_info"]["install_time"] = "1675920494521"
data[0]["timestamp_info"]["report_time"] = "1675920494521"
data[0]["event_info"]["event_name"] = "install"
data[0]["event_info"]["event_type"] = "preset"
data[0]["collector_info"]["collector_version"] = "1.0.0"
data[0]["collector_info"]["integration_type"] = "sdk"
data[0]["device_info"]["os_version"] = "1"
data[0]["device_info"]["os"] = "1"
data[0]["device_info"]["device_id"] = code_nums2(12)
data[0]["device_info"]["device_id_md5"] = code_nums2(32)
data[0]["device_info"]["ipv4"] = code_nums2(129)
data[0]["device_info"]["oaid"] = code_nums2(513)
data[0]["device_info"]["oaid_md5"] = code_nums2(33)
data[0]["device_info"]["imei1"] = code_nums2(33)
data[0]["device_info"]["imei1_md5"] = code_nums2(33)
data[0]["device_info"]["imei2"] = code_nums2(33)
data[0]["device_info"]["imei2_md5"] = code_nums2(33)
data[0]["device_info"]["gaid"] = code_nums2(37)
data[0]["device_info"]["gaid_md5"] = code_nums2(33)
data[0]["device_info"]["mac"] = code_nums2(33)
data[0]["device_info"]["mac_md5"] = code_nums2(32)
data[0]["device_info"]["android_id"] = code_nums2(33)
data[0]["device_info"]["android_id_md5"] = code_nums2(33)
response = send_request()
assert response["status"] == "0"
# Device_info中只有 android_id 符合规则
def test_event_27():
data[0]["application_info"]["appkey"] = "344234354"
data[0]["application_info"]["bundleid"] = "grere34543f4r4"
data[0]["application_info"]["channel_name"] = "google"
data[0]["timestamp_info"]["time_zone"] = "GMT+08"
data[0]["timestamp_info"]["install_time"] = "1675920494521"
data[0]["timestamp_info"]["report_time"] = "1675920494521"
data[0]["event_info"]["event_name"] = "install"
data[0]["event_info"]["event_type"] = "preset"
data[0]["collector_info"]["collector_version"] = "1.0.0"
data[0]["collector_info"]["integration_type"] = "sdk"
data[0]["device_info"]["os_version"] = "1"
data[0]["device_info"]["os"] = "1"
data[0]["device_info"]["device_id"] = code_nums2(12)
data[0]["device_info"]["device_id_md5"] = code_nums2(32)
data[0]["device_info"]["ipv4"] = code_nums2(129)
data[0]["device_info"]["oaid"] = code_nums2(513)
data[0]["device_info"]["oaid_md5"] = code_nums2(33)
data[0]["device_info"]["imei1"] = code_nums2(33)
data[0]["device_info"]["imei1_md5"] = code_nums2(33)
data[0]["device_info"]["imei2"] = code_nums2(33)
data[0]["device_info"]["imei2_md5"] = code_nums2(33)
data[0]["device_info"]["gaid"] = code_nums2(37)
data[0]["device_info"]["gaid_md5"] = code_nums2(33)
data[0]["device_info"]["mac"] = code_nums2(33)
data[0]["device_info"]["mac_md5"] = code_nums2(33)
data[0]["device_info"]["android_id"] = code_nums2(16)
data[0]["device_info"]["android_id_md5"] = code_nums2(33)
response = send_request()
assert response["status"] == "0"
# Device_info中只有 android_id 符合规则
def test_event_28():
data[0]["application_info"]["appkey"] = "344234354"
data[0]["application_info"]["bundleid"] = "grere34543f4r4"
data[0]["application_info"]["channel_name"] = "google"
data[0]["timestamp_info"]["time_zone"] = "GMT+08"
data[0]["timestamp_info"]["install_time"] = "1675920494521"
data[0]["timestamp_info"]["report_time"] = "1675920494521"
data[0]["event_info"]["event_name"] = "install"
data[0]["event_info"]["event_type"] = "preset"
data[0]["collector_info"]["collector_version"] = "1.0.0"
data[0]["collector_info"]["integration_type"] = "sdk"
data[0]["device_info"]["os_version"] = "1"
data[0]["device_info"]["os"] = "1"
data[0]["device_info"]["device_id"] = code_nums2(12)
data[0]["device_info"]["device_id_md5"] = code_nums2(32)
data[0]["device_info"]["ipv4"] = code_nums2(129)
data[0]["device_info"]["oaid"] = code_nums2(513)
data[0]["device_info"]["oaid_md5"] = code_nums2(33)
data[0]["device_info"]["imei1"] = code_nums2(33)
data[0]["device_info"]["imei1_md5"] = code_nums2(33)
data[0]["device_info"]["imei2"] = code_nums2(33)
data[0]["device_info"]["imei2_md5"] = code_nums2(33)
data[0]["device_info"]["gaid"] = code_nums2(37)
data[0]["device_info"]["gaid_md5"] = code_nums2(33)
data[0]["device_info"]["mac"] = code_nums2(33)
data[0]["device_info"]["mac_md5"] = code_nums2(33)
data[0]["device_info"]["android_id"] = code_nums2(33)
data[0]["device_info"]["android_id_md5"] = code_nums2(32)
response = send_request()
assert response["status"] == "0"
if __name__ == '__main__':
......
......@@ -170,9 +170,9 @@ def send_request():
# 对接se地址
# url = 'http://tmtest-se.trackingio.com/receive/tkiov2/sdk'
# 测试
url = "http://tmtest.trackingio.com/receive/tkiov2/sdk"
# url = "http://tmtest.trackingio.com/receive/tkiov2/sdk"
# 线上
# url = "http://tkio-receive.solar-engine.com/receive/tkiov2/sdk"
url = "http://tkio-receive.solar-engine.com/receive/tkiov2/sdk"
data[0]['timestamp_info']['install_time'] = int(round(time.time() * 1000))
data[0]['timestamp_info']['current_event_time'] = int(round(time.time() * 1000))
......@@ -269,7 +269,7 @@ def test_att_status1():
def test_att_status2():
data[0]['device_info']['att_status'] = "aaa"
response = send_request()
assert response["status"] == "122"
assert response["status"] == "0"
# ATT框架启用状态,为空
......@@ -292,7 +292,7 @@ def test_lat_status1():
def test_lat_status2():
data[0]['device_info']['lat_status'] = "aaa"
response = send_request()
assert response["status"] == "123"
assert response["status"] == "0"
# LAT启用状态,空
......@@ -310,18 +310,18 @@ def test_idfa1():
# idfa超长
def test_idfa2():
data[0]['device_info']['idfa'] = chaochang
response = send_request()
assert response["status"] == "124"
# def test_idfa2():
# data[0]['device_info']['idfa'] = chaochang
# response = send_request()
# assert response["status"] == "124"
# idfa为空,idfa_md5也为空
def test_idfa3():
data[0]['device_info']['idfa'] = ''
data[0]['device_info']['idfa_md5'] = ''
response = send_request()
assert response["status"] == "124"
# def test_idfa3():
# data[0]['device_info']['idfa'] = ''
# data[0]['device_info']['idfa_md5'] = ''
# response = send_request()
# assert response["status"] == "124"
# idfa不为空,idfa_md5为空
......@@ -332,10 +332,10 @@ def test_idfa_md51():
# idfa_md5超长
def test_idfa_md52():
data[0]['device_info']['idfa_md5'] = chaochang
response = send_request()
assert response["status"] == "124"
# def test_idfa_md52():
# data[0]['device_info']['idfa_md5'] = chaochang
# response = send_request()
# assert response["status"] == "124"
# device_id与device_id_type不一致
......@@ -355,18 +355,18 @@ def test_idfv1():
# idfv超长
def test_idfv2():
data[0]['device_info']['idfv'] = chaochang
response = send_request()
assert response["status"] == "125"
# def test_idfv2():
# data[0]['device_info']['idfv'] = chaochang
# response = send_request()
# assert response["status"] == "125"
# idfv为空,idfv_md5也为空
def test_idfv3():
data[0]['device_info']['idfv'] = ''
data[0]['device_info']['idfv_md5'] = ''
response = send_request()
assert response["status"] == "125"
# def test_idfv3():
# data[0]['device_info']['idfv'] = ''
# data[0]['device_info']['idfv_md5'] = ''
# response = send_request()
# assert response["status"] == "125"
# idfv不为空,idfv_md5为空
......@@ -377,10 +377,10 @@ def test_idfv_md51():
# idfv_md5超长
def test_idfv_md52():
data[0]['device_info']['idfv_md5'] = chaochang
response = send_request()
assert response["status"] == "125"
# def test_idfv_md52():
# data[0]['device_info']['idfv_md5'] = chaochang
# response = send_request()
# assert response["status"] == "125"
# asa_info为空
......@@ -408,7 +408,7 @@ def test_iad_attribution2():
def test_iad_attribution3():
data[0]['asa_info']['iad_info']['iad-attribution'] = code_nums1(17)
response = send_request()
assert response["status"] == "196"
assert response["status"] == "0"
# iad-attribution为1个字符
......@@ -443,7 +443,7 @@ def test_iad_org_name2():
def test_iad_org_name3():
data[0]['asa_info']['iad_info']['iad-org-name'] = code_nums1(129)
response = send_request()
assert response["status"] == "197"
assert response["status"] == "0"
# iad-org-name为特殊字符和中文组合
......@@ -471,7 +471,7 @@ def test_iad_org_id2():
def test_iad_org_id3():
data[0]['asa_info']['iad_info']['iad-org-id'] = code_nums1(33)
response = send_request()
assert response["status"] == "198"
assert response["status"] == "0"
# iad-org-id为特殊字符和中文组合
......@@ -499,7 +499,7 @@ def test_iad_campaign_id2():
def test_iad_campaign_id3():
data[0]['asa_info']['iad_info']['iad-campaign-id'] = code_nums1(33)
response = send_request()
assert response["status"] == "199"
assert response["status"] == "0"
# iad-campaign-id为特殊字符和中文组合
......@@ -527,7 +527,7 @@ def test_iad_campaign_name2():
def test_iad_campaign_name3():
data[0]['asa_info']['iad_info']['iad-campaign-name'] = code_nums1(129)
response = send_request()
assert response["status"] == "200"
assert response["status"] == "0"
# iad_campaign_name为特殊字符和中文组合
......@@ -555,7 +555,7 @@ def test_iad_purchase_date2():
def test_iad_purchase_date3():
data[0]['asa_info']['iad_info']['iad-purchase-date'] = code_nums1(33)
response = send_request()
assert response["status"] == "201"
assert response["status"] == "0"
# iad_purchase-date为特殊字符和中文组合
......@@ -590,7 +590,7 @@ def test_iad_conversion_date2():
def test_iad_conversion_date3():
data[0]['asa_info']['iad_info']['iad-conversion-date'] = code_nums1(33)
response = send_request()
assert response["status"] == "202"
assert response["status"] == "0"
# iad_conversion-date为特殊字符和中文组合
......@@ -625,7 +625,7 @@ def test_iad_conversion_type2():
def test_iad_conversion_type3():
data[0]['asa_info']['iad_info']['iad-conversion-type'] = code_nums1(33)
response = send_request()
assert response["status"] == "203"
assert response["status"] == "0"
# iad_conversion-type为特殊字符和中文组合
......@@ -660,7 +660,7 @@ def test_iad_click_date2():
def test_iad_click_date3():
data[0]['asa_info']['iad_info']['iad-click-date'] = code_nums1(33)
response = send_request()
assert response["status"] == "204"
assert response["status"] == "0"
# iad_click-date为特殊字符和中文组合
......@@ -695,7 +695,7 @@ def test_iad_adgroup_id2():
def test_iad_adgroup_id3():
data[0]['asa_info']['iad_info']['iad-adgroup-id'] = code_nums1(33)
response = send_request()
assert response["status"] == "205"
assert response["status"] == "0"
# iad_adgroup-id为特殊字符和中文组合
......@@ -723,7 +723,7 @@ def test_iad_adgroup_name2():
def test_iad_adgroup_name3():
data[0]['asa_info']['iad_info']['iad-adgroup-name'] = code_nums1(129)
response = send_request()
assert response["status"] == "206"
assert response["status"] == "0"
# iad_adgroup-name为特殊字符和中文组合
......@@ -751,7 +751,7 @@ def test_iad_country_or_region2():
def test_iad_country_or_region3():
data[0]['asa_info']['iad_info']['iad-country-or-region'] = code_nums1(17)
response = send_request()
assert response["status"] == "207"
assert response["status"] == "0"
# iad-country-or-region为特殊字符和中文组合
......@@ -779,7 +779,7 @@ def test_iad_keyword2():
def test_iad_keyword3():
data[0]['asa_info']['iad_info']['iad-keyword'] = code_nums1(129)
response = send_request()
assert response["status"] == "208"
assert response["status"] == "0"
# iad-keyword为特殊字符和中文组合
......@@ -807,7 +807,7 @@ def test_iad_keyword_id2():
def test_iad_keyword_id3():
data[0]['asa_info']['iad_info']['iad-keyword-id'] = code_nums1(33)
response = send_request()
assert response["status"] == "209"
assert response["status"] == "0"
# iad-keyword-id为特殊字符和中文组合
......@@ -835,7 +835,7 @@ def test_iad_keyword_matchtype2():
def test_iad_keyword_matchtype3():
data[0]['asa_info']['iad_info']['iad-keyword-matchtype'] = code_nums1(33)
response = send_request()
assert response["status"] == "210"
assert response["status"] == "0"
# iad-keyword-matchtype为特殊字符和中文组合
......@@ -863,7 +863,7 @@ def test_iad_ad_id2():
def test_iad_ad_id3():
data[0]['asa_info']['iad_info']['iad-ad-id'] = code_nums1(33)
response = send_request()
assert response["status"] == "211"
assert response["status"] == "0"
# iad-ad-id为特殊字符和中文组合
......@@ -891,7 +891,7 @@ def test_iad_lineitem_id2():
def test_iad_lineitem_id3():
data[0]['asa_info']['iad_info']['iad-lineitem-id'] = code_nums1(33)
response = send_request()
assert response["status"] == "212"
assert response["status"] == "0"
# iad-lineitem-id为特殊字符和中文组合
......@@ -919,7 +919,7 @@ def test_iad_lineitem_name2():
def test_iad_lineitem_name3():
data[0]['asa_info']['iad_info']['iad-lineitem-name'] = code_nums1(129)
response = send_request()
assert response["status"] == "213"
assert response["status"] == "0"
# iad-lineitem-name为特殊字符和中文组合
......@@ -947,7 +947,7 @@ def test_iad_retry_times2():
def test_iad_retry_times3():
data[0]['asa_info']['iad_info']['iad_retry_times'] = code_nums2(3)
response = send_request()
assert response["status"] == "214"
assert response["status"] == "0"
# iad_retry_times为特殊字符
......@@ -1025,7 +1025,7 @@ def test_adservices_retry_times3():
def test_adservices_retry_times4():
data[0]['asa_info']['adservices_info']['adservices_retry_times'] = code_nums2(3)
response = send_request()
assert response["status"] == "215"
assert response["status"] == "0"
# adservices_retry_times为中文和字符
......@@ -1049,5 +1049,157 @@ def test_adservices_error_info2():
assert response["status"] == "0"
# ---------------------------事件数据入库规则优化-------------------------
# *******************Device_info参数校验测试用例*******************
# 前提条件
# 1.event_name为install事件,install_time不为空
# 2:appkey、report_time、boudleid、event_name、event_type、channel_name、collector_version、integration_type、time_zone 全部符合规则
# Device_info中的参数全部符合校验
def test_event_1():
data[0]["application_info"]["appkey"] = "222"
data[0]["application_info"]["bundleid"] = "grere34543f4r4"
data[0]["timestamp_info"]["time_zone"] = "GMT+08"
data[0]["timestamp_info"]["install_time"] = "1675920494521"
data[0]["timestamp_info"]["report_time"] = "1675920494521"
data[0]["event_info"]["event_name"] = "install"
data[0]["event_info"]["event_type"] = "preset"
data[0]["collector_info"]["collector_version"] = "1.0.0"
data[0]["collector_info"]["integration_type"] = "sdk"
data[0]["device_info"]["device_id"] = "1a34fc556a43c453"
data[0]["device_info"]["device_id_md5"] = code_nums2(32)
data[0]["device_info"]["os_version"] = code_nums2(10)
data[0]["device_info"]["os"] = "2"
data[0]["device_info"]["idfa"] = code_nums2(36)
data[0]["device_info"]["idfa_md5"] = code_nums2(32)
data[0]["device_info"]["idfv"] = code_nums2(36)
data[0]["device_info"]["idfv_md5"] = code_nums2(32)
response = send_request()
assert response["status"] == "0"
# Device_info全部参数不符合规则
def test_event_2():
data[0]["application_info"]["appkey"] = "222"
data[0]["application_info"]["bundleid"] = "grere34543f4r4"
data[0]["timestamp_info"]["time_zone"] = "GMT+08"
data[0]["timestamp_info"]["install_time"] = "1675920494521"
data[0]["timestamp_info"]["report_time"] = "1675920494521"
data[0]["event_info"]["event_name"] = "install"
data[0]["event_info"]["event_type"] = "preset"
data[0]["collector_info"]["collector_version"] = "1.0.0"
data[0]["collector_info"]["integration_type"] = "sdk"
data[0]["device_info"]["device_id"] = "1a34fc556a43c453"
data[0]["device_info"]["device_id_md5"] = code_nums2(32)
data[0]["device_info"]["os_version"] = code_nums2(10)
data[0]["device_info"]["os"] = "2"
data[0]["device_info"]["idfa"] = code_nums2(37)
data[0]["device_info"]["idfa_md5"] = code_nums2(33)
data[0]["device_info"]["idfv"] = code_nums2(37)
data[0]["device_info"]["idfv_md5"] = code_nums2(33)
data[0]["device_info"]["ipv4"] = code_nums2(129)
response = send_request()
assert response["status"] == "221"
# Device_info中只有 idfa 符合规则
def test_event_3():
data[0]["application_info"]["appkey"] = "222"
data[0]["application_info"]["bundleid"] = "grere34543f4r4"
data[0]["timestamp_info"]["time_zone"] = "GMT+08"
data[0]["timestamp_info"]["install_time"] = "1675920494521"
data[0]["timestamp_info"]["report_time"] = "1675920494521"
data[0]["event_info"]["event_name"] = "install"
data[0]["event_info"]["event_type"] = "preset"
data[0]["collector_info"]["collector_version"] = "1.0.0"
data[0]["collector_info"]["integration_type"] = "sdk"
data[0]["device_info"]["device_id"] = "1a34fc556a43c453"
data[0]["device_info"]["device_id_md5"] = code_nums2(32)
data[0]["device_info"]["os_version"] = code_nums2(10)
data[0]["device_info"]["os"] = "2"
data[0]["device_info"]["idfa"] = code_nums2(36)
data[0]["device_info"]["idfa_md5"] = code_nums2(33)
data[0]["device_info"]["idfv"] = code_nums2(37)
data[0]["device_info"]["idfv_md5"] = code_nums2(33)
data[0]["device_info"]["ipv4"] = code_nums2(128)
response = send_request()
assert response["status"] == "0"
# Device_info中只有 idfa_md5 符合规则
def test_event_4():
data[0]["application_info"]["appkey"] = "222"
data[0]["application_info"]["bundleid"] = "grere34543f4r4"
data[0]["timestamp_info"]["time_zone"] = "GMT+08"
data[0]["timestamp_info"]["install_time"] = "1675920494521"
data[0]["timestamp_info"]["report_time"] = "1675920494521"
data[0]["event_info"]["event_name"] = "install"
data[0]["event_info"]["event_type"] = "preset"
data[0]["collector_info"]["collector_version"] = "1.0.0"
data[0]["collector_info"]["integration_type"] = "sdk"
data[0]["device_info"]["device_id"] = "1a34fc556a43c453"
data[0]["device_info"]["device_id_md5"] = code_nums2(32)
data[0]["device_info"]["os_version"] = code_nums2(10)
data[0]["device_info"]["os"] = "2"
data[0]["device_info"]["idfa"] = code_nums2(37)
data[0]["device_info"]["idfa_md5"] = code_nums2(32)
data[0]["device_info"]["idfv"] = code_nums2(37)
data[0]["device_info"]["idfv_md5"] = code_nums2(33)
data[0]["device_info"]["ipv4"] = code_nums2(128)
response = send_request()
assert response["status"] == "0"
# Device_info中只有 idfv 符合规则
def test_event_5():
data[0]["application_info"]["appkey"] = "222"
data[0]["application_info"]["bundleid"] = "grere34543f4r4"
data[0]["timestamp_info"]["time_zone"] = "GMT+08"
data[0]["timestamp_info"]["install_time"] = "1675920494521"
data[0]["timestamp_info"]["report_time"] = "1675920494521"
data[0]["event_info"]["event_name"] = "install"
data[0]["event_info"]["event_type"] = "preset"
data[0]["collector_info"]["collector_version"] = "1.0.0"
data[0]["collector_info"]["integration_type"] = "sdk"
data[0]["device_info"]["device_id"] = "1a34fc556a43c453"
data[0]["device_info"]["device_id_md5"] = code_nums2(32)
data[0]["device_info"]["os_version"] = code_nums2(10)
data[0]["device_info"]["os"] = "2"
data[0]["device_info"]["idfa"] = code_nums2(37)
data[0]["device_info"]["idfa_md5"] = code_nums2(33)
data[0]["device_info"]["idfv"] = code_nums2(36)
data[0]["device_info"]["idfv_md5"] = code_nums2(33)
data[0]["device_info"]["ipv4"] = code_nums2(128)
response = send_request()
assert response["status"] == "0"
# Device_info中只有 idfv_md5 符合规则
def test_event_6():
data[0]["application_info"]["appkey"] = "222"
data[0]["application_info"]["bundleid"] = "grere34543f4r4"
data[0]["timestamp_info"]["time_zone"] = "GMT+08"
data[0]["timestamp_info"]["install_time"] = "1675920494521"
data[0]["timestamp_info"]["report_time"] = "1675920494521"
data[0]["event_info"]["event_name"] = "install"
data[0]["event_info"]["event_type"] = "preset"
data[0]["collector_info"]["collector_version"] = "1.0.0"
data[0]["collector_info"]["integration_type"] = "sdk"
data[0]["device_info"]["device_id"] = "1a34fc556a43c453"
data[0]["device_info"]["device_id_md5"] = code_nums2(32)
data[0]["device_info"]["os_version"] = code_nums2(10)
data[0]["device_info"]["os"] = "2"
data[0]["device_info"]["idfa"] = code_nums2(37)
data[0]["device_info"]["idfa_md5"] = code_nums2(33)
data[0]["device_info"]["idfv"] = code_nums2(37)
data[0]["device_info"]["idfv_md5"] = code_nums2(32)
data[0]["device_info"]["ipv4"] = code_nums2(128)
response = send_request()
assert response["status"] == "0"
if __name__ == '__main__':
pytest.main()
......@@ -144,9 +144,9 @@ def send_request2():
def send_request3(cs):
global parms
# 测试
url1 = 'http://tmtest.trackingio.com/receive/turl/myyAJza' + cs
# url1 = 'http://tmtest.trackingio.com/receive/turl/myyAJza' + cs
# 线上
# url1 = 'http://tkio-redirect.solar-engine.com/receive/turl/FFNn2aa' + cs
url1 = 'http://tkio-redirect.solar-engine.com/receive/turl/aie6vya' + cs
parms['ts'] = int(round(time.time() * 1000))
# parms['ts'] = int(round(time.time()))
......
......@@ -104,9 +104,9 @@ def send_request(cs):
def send_request3(cs):
global parms
# 测试
url1 = 'http://tmtest.trackingio.com/receive/turl/vMjIBza' + cs
# url1 = 'http://tmtest.trackingio.com/receive/turl/vMjIBza' + cs
# 线上
# url1 = 'http://tkio-redirect.solar-engine.com/receive/turl/6Z3Yrya' + cs
url1 = 'http://tkio-redirect.solar-engine.com/receive/turl/6Z3Yrya' + cs
parms['ts'] = int(round(time.time() * 1000))
response = requests.get(url=url1, params=parms, timeout=10, verify=False)
print(response.url)
......
......@@ -892,6 +892,22 @@ def test_tapcaid():
# 百度凤巢
def test_baiducaid():
i = idfacode()
ip1 = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
clickios.parms['idfa'] = i
clickios.parms['ip'] = ip1
clickios.parms['caid'] = '%5B%7B%22caid%22%3A%5B%7B%22caid%22%3A%2200_B7BCDEBF65DC7891EF044070744B8A66_1DA6AC3170E277A9E76AB0CB4D3E9761%22%2C%22version%22%3A%2200%22%7D%5D%2C%22generateTime%22%3A%221675385532%22%2C%22vendor%22%3A%220%22%7D%2C%7B%22caid%22%3A%5B%7B%22caid%22%3A%22bb789ed6548f50905ffc1957585053f1%22%2C%22version%22%3A%2220220111%22%7D%5D%2C%22generateTime%22%3A%221675385532%22%2C%22vendor%22%3A%221%22%7D%5D'
clickios.send_requestandroid('')
print('点击')
print(i)
# 点击存储
def test_at30():
mget = 'b21d0385ad8371de9e90b3e969a5d0c6:'
......
......@@ -32,8 +32,8 @@ parms = {
def send_requestandroid(hc):
# url1 = 'http://52.80.137.106:8083/tkio/zyMRnea?noredirect=true' + hc
url1 = 'http://uri6.com/tkio/rUJ3uea?noredirect=true' + hc
# url1 = 'http://52.80.137.106:8083/tkio/VFnQFja?noredirect=true' + hc
url1 = 'http://uri6.com/tkio/zArQRza?noredirect=true' + hc
response = requests.get(url=url1, params=parms, timeout=10, verify=False)
print(response.text)
print(url1)
......
......@@ -5,27 +5,27 @@ import random
import time
import requests
appkey = '380292be6ea70e2d44ad466ad77c9d6d'
appkey = 'afbb574bc0e1d7326fc92140399509ef'
# cid
cid = '21059'
cid = '21075'
# surl
surl = 'BB7juya'
surl = 'MNreUfa'
# URL = 'http://52.80.137.106:8083/tkio/Ur2MFra?noredirect=true&callback=www.baidu.com&request_id=111111&promoted_object_id=111'
URL = 'http://uri6.com/tkio/Ur2MFra?noredirect=true&callback=www.baidu.com&request_id=111111&promoted_object_id=111'
impressionid = ''.join(str(random.choice(range(10))) for _ in range(12))
requestid = ''.join(str(random.choice(range(10))) for _ in range(12))
s = 0
# for index in range(1):
# # 随机生成12为数组
# i = ''.join(str(random.choice(range(10))) for _ in range(28))
# # i = '2539452844786738942022514936'
# # 随机生成ip
# ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
#
# # 打开
# allEvent().openxiaochengxu(i, ip, cid, surl, appkey, impressionid, requestid)
# # # time.sleep(5)
for index in range(5):
# 随机生成12为数组
# i = ''.join(str(random.choice(range(10))) for _ in range(28))
i = '64532454323234223'
# 随机生成ip
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
# 打开
allEvent().openxiaochengxu(i, ip, cid, surl, appkey, impressionid)
time.sleep(2)
# # # #pv
# # # allEvent().pviaochengxu(i,ip,cid,surl,appkey)
# # # # # #离开
......@@ -42,59 +42,59 @@ s = 0
# allEvent().eventchengxu(i,ip,cid,surl,appkey,event)
for index in range(1):
i = ''.join(str(random.choice(range(10))) for _ in range(28))
# i = '1761453021140876860117396099'
# print("开始时间"+datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S'))
# 随机生成12为数组
# impressionid = ''.join(str(random.choice(range(10))) for _ in range(12))
impressionid = '97867544365643'
# requestid = ''.join(str(random.choice(range(10))) for _ in range(12))
requestid = '231231232111'
accountid = ''.join(str(random.choice(range(10))) for _ in range(12))
# 随机生成ip
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
# ip = '156.119.456.190'
try:
parms = {
'click_time': str(round(time.time() * 1000)),
# 'click_time': '1667308011000',
# 'wechat_openid': i,
'click_id':'123456789',
'accountid': accountid,
'ip': ip,
'impression_id': impressionid,
# 'request_id': requestid,
'_ry_adgroup_id': '222',
'_ry_adplan_id': "222",
'_ry_adcreative_id': '222'
}
# timeout可以超时四秒
# verify = False
p = requests.get(url=URL, params=parms, timeout=10, verify=False)
print('imei:', i)
print("ip:", ip)
# print("accountid:", accountid)
print(p.text)
print(p.url)
# print("oaid:",o)
print('success:', s)
print(p.status_code)
print(p.content)
# print('androidid:',a)
# print(nowTime)
s = s + 1
except Exception as err:
print(err)
print('wrong:', w)
print('imei:', i)
print("ip:", ip)
# print(p.status_code)
# print('androidid', a)
w = w + 1
# for index in range(1):
# i = ''.join(str(random.choice(range(10))) for _ in range(28))
# # i = '1761453021140876860117396099'
#
#
# # print("开始时间"+datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S'))
# # 随机生成12为数组
# # impressionid = ''.join(str(random.choice(range(10))) for _ in range(12))
# impressionid = '97867544365643'
# # requestid = ''.join(str(random.choice(range(10))) for _ in range(12))
# requestid = '231231232111'
# accountid = ''.join(str(random.choice(range(10))) for _ in range(12))
# # 随机生成ip
# ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
# # ip = '156.119.456.190'
# try:
# parms = {
# 'click_time': str(round(time.time() * 1000)),
# # 'click_time': '1667308011000',
# # 'wechat_openid': i,
# 'click_id':'123456789',
# 'accountid': accountid,
# 'ip': ip,
# 'impression_id': impressionid,
# # 'request_id': requestid,
# '_ry_adgroup_id': '222',
# '_ry_adplan_id': "222",
# '_ry_adcreative_id': '222'
# }
# # timeout可以超时四秒
# # verify = False
# p = requests.get(url=URL, params=parms, timeout=10, verify=False)
# print('imei:', i)
#
# print("ip:", ip)
# # print("accountid:", accountid)
# print(p.text)
# print(p.url)
# # print("oaid:",o)
# print('success:', s)
# print(p.status_code)
# print(p.content)
# # print('androidid:',a)
# # print(nowTime)
# s = s + 1
# except Exception as err:
# print(err)
# print('wrong:', w)
# print('imei:', i)
# print("ip:", ip)
# # print(p.status_code)
# # print('androidid', a)
# w = w + 1
# time.sleep(2)
# try:
......
......@@ -5,11 +5,11 @@ import random
headers = {'Content-Type': 'application/json'}
# 测试环境
# URL = 'http://52.80.137.106:8080/receive/tkio/event'
URL = 'http://52.80.137.106:8080/receive/tkio/event'
# 线上环境
# URL = 'http://tlog.trackingio.com/receive/tkio/event'
URL = 'http://log.trackingio.com/receive/tkio/event'
# URL = 'http://log.trackingio.com/receive/tkio/event'
# URL = 'http://jisulog.sortda.com/receive/tkio/event'
# 时间和日期
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment