Commit 15ed9f4b by liuxiaoxing

数据处理与归因逻辑优化

parent 6fcb6197
...@@ -25,14 +25,14 @@ def code_nums2(n=6): ...@@ -25,14 +25,14 @@ def code_nums2(n=6):
# from jiami.md5 import get_str_sha1_secret_str # from jiami.md5 import get_str_sha1_secret_str
# 向短链发送点击数据 # 向短链发送点击数据
# 广告创意ID # 广告创意ID
# ry_adcreative_id = code_nums2(6) ry_adcreative_id = code_nums2(6)
ry_adcreative_id = '453282367872' # ry_adcreative_id = '384609'
# 广告组ID # 广告组ID
# ry_adgroup_id = code_nums2(6) ry_adgroup_id = code_nums2(6)
ry_adgroup_id = '203346609' # ry_adgroup_id = '019750'
# 广告计划ID # 广告计划ID
# ry_adplan_id = code_nums2(6) ry_adplan_id = code_nums2(6)
ry_adplan_id = '7138970403' # ry_adplan_id = '258640'
# 广告组名称 # 广告组名称
ry_adgroup_name = 'c测试1' ry_adgroup_name = 'c测试1'
# 广告计划名称 # 广告计划名称
...@@ -41,8 +41,8 @@ ry_adplan_name = 'c测试1' ...@@ -41,8 +41,8 @@ ry_adplan_name = 'c测试1'
ry_adcreative_name = 'c测试1' ry_adcreative_name = 'c测试1'
# bytedance_int 今日头条,kuaishou_int 快手,tencentams_int (新)广点通,rryingxiao_int 人人营销 # bytedance_int 今日头条,kuaishou_int 快手,tencentams_int (新)广点通,rryingxiao_int 人人营销
pid = 'rryingxiao_int' pid = 'rryingxiao_int'
# URL = 'http://uri6.com/tkio/uq2uQna?noredirect=true' URL = 'http://uri6.com/tkio/NjeQJja?noredirect=true'
URL = 'http://52.80.137.106:8083/tkio/AZRvA3a?noredirect=true' # URL = 'http://52.80.137.106:8083/tkio/aI7j6va?noredirect=true'
# 测试头条衍生事件回调时加上 # 测试头条衍生事件回调时加上
# callback= http%3A%2F%2Fad.toutiao.com%2Ftrack%2Factivate%2F%3Fcallback%3DCKP4rs-Zn4QDEKiQ6teZn4QDGN6L8Y-h9Wcg3ovxj6H1ZyiE0PjgroSEAzAOOM_X-8IDQik0YWY1NzdlOC1lZmViLTRmZDEtYmZkZC00MzE1Zjc1MmJhMGF1NTQ5M0iA0pOtA1AAiAEAkAECmAEA%26os%3D0%26muid%3D # callback= http%3A%2F%2Fad.toutiao.com%2Ftrack%2Factivate%2F%3Fcallback%3DCKP4rs-Zn4QDEKiQ6teZn4QDGN6L8Y-h9Wcg3ovxj6H1ZyiE0PjgroSEAzAOOM_X-8IDQik0YWY1NzdlOC1lZmViLTRmZDEtYmZkZC00MzE1Zjc1MmJhMGF1NTQ5M0iA0pOtA1AAiAEAkAECmAEA%26os%3D0%26muid%3D
...@@ -63,16 +63,16 @@ def computeMD5upper(message): ...@@ -63,16 +63,16 @@ def computeMD5upper(message):
return m.hexdigest().upper() return m.hexdigest().upper()
appkey = '88d7d29c4c7a49d2b5ec8d9723f70eb1' appkey = '5076ba423652a3254761d7493d9c80ad'
lst = [] lst = []
nowTime = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S') nowTime = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')
s = 0 s = 0
w = 0 w = 0
for index in range(10): for index in range(1):
# print("开始时间"+datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')) # print("开始时间"+datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S'))
# 随机生成12为数组 # 随机生成12为数组
i = ''.join(str(random.choice(range(10))) for _ in range(12)) i = ''.join(str(random.choice(range(10))) for _ in range(12))
# i = '%*%5323423332233' # i = 'A1E36666F0EB4C25'
o = ''.join(str(random.choice(range(10))) for _ in range(12)) o = ''.join(str(random.choice(range(10))) for _ in range(12))
m = ''.join(str(random.choice(range(10))) for _ in range(12)) m = ''.join(str(random.choice(range(10))) for _ in range(12))
se = ''.join(str(random.choice(range(10))) for _ in range(12)) se = ''.join(str(random.choice(range(10))) for _ in range(12))
...@@ -80,7 +80,7 @@ for index in range(10): ...@@ -80,7 +80,7 @@ for index in range(10):
# adid = '5011813780042235' # adid = '5011813780042235'
p1 = ''.join(str(random.choice(range(10))) for _ in range(12)) p1 = ''.join(str(random.choice(range(10))) for _ in range(12))
accountid = ''.join(str(random.choice(range(10))) for _ in range(12)) accountid = ''.join(str(random.choice(range(10))) for _ in range(12))
# accountid = '37655892' # accountid = '383218638957'
# p1 = '测试一下' # p1 = '测试一下'
# "idfa": 'B5588C9C-4534-43FB-935D-F17C91622C83', # "idfa": 'B5588C9C-4534-43FB-935D-F17C91622C83',
# "idfa": '00000000-0000-0000-0000-000000000000', # "idfa": '00000000-0000-0000-0000-000000000000',
...@@ -134,8 +134,8 @@ for index in range(10): ...@@ -134,8 +134,8 @@ for index in range(10):
"ry_adgroup_id": ry_adgroup_id, "ry_adgroup_id": ry_adgroup_id,
"ry_adplan_id": ry_adplan_id, "ry_adplan_id": ry_adplan_id,
"ry_adcreative_id": ry_adcreative_id, "ry_adcreative_id": ry_adcreative_id,
# # # 账户id # # # # 账户id
"accountid": accountid "accountid": accountid,
# 'imei2': 'null', # 'imei2': 'null',
# 'meid': i # 'meid': i
# 'bd_vid': i # 'bd_vid': i
...@@ -188,6 +188,7 @@ for index in range(10): ...@@ -188,6 +188,7 @@ for index in range(10):
print('success:', s) print('success:', s)
print(p.status_code) print(p.status_code)
print(p.content) print(p.content)
print("计划id:"+ry_adplan_id)
# print('androidid:',a) # print('androidid:',a)
# print(nowTime) # print(nowTime)
s = s + 1 s = s + 1
...@@ -200,18 +201,18 @@ for index in range(10): ...@@ -200,18 +201,18 @@ for index in range(10):
# print('androidid', a) # print('androidid', a)
w = w + 1 w = w + 1
# time.sleep(6) time.sleep(6)
# try: try:
# allEvent().installUpload(i, ip, appkey) allEvent().installUpload(i, ip, appkey)
# # allEvent().formevent(i, ip, appkey) # allEvent().formevent(i, ip, appkey)
#
# except Exception: except Exception:
# print('install_wrong:', w) print('install_wrong:', w)
# w = w + 1 w = w + 1
# # # # # # # # # #
# # # # # # # # # #
# time.sleep(10) # time.sleep(6)
# try: # try:
# allEvent().invoke_test(i, ip, appkey) # allEvent().invoke_test(i, ip, appkey)
# except Exception: # except Exception:
...@@ -268,7 +269,7 @@ for index in range(10): ...@@ -268,7 +269,7 @@ for index in range(10):
# try: # try:
# allEvent().appduration(i, ip, appkey,se) # allEvent().appduration(i, ip, appkey,se)
# # allEvent().formevent(i, ip, appkey) # # allEvent().formevent(i, ip, appkey)
# print("session:"+se) # # print("session:"+se)
# except Exception: # except Exception:
# print('install_wrong:', w) # print('install_wrong:', w)
# w = w + 1 # w = w + 1
...@@ -287,16 +288,16 @@ for index in range(10): ...@@ -287,16 +288,16 @@ for index in range(10):
# print('install_wrong:', w) # print('install_wrong:', w)
# w = w + 1 # w = w + 1
# #
# num = index + 1 num = index + 1
# # event = 'event_' + str(num) event = 'event_' + str(num)
# event = 'event_28' # event = 'event_28'
# time.sleep(3) time.sleep(2)
# try: try:
# allEvent().ziding_event(i, ip, appkey, event) allEvent().ziding_event(i, ip, appkey, event)
# print(event) print(event)
# except Exception as err: except Exception as err:
# print(err) print(err)
# print('自定义_wrong:', w) print('自定义_wrong:', w)
# time.sleep(6) # time.sleep(6)
# try: # try:
......
...@@ -10,8 +10,8 @@ headers = {'Content-Type': 'application/json', 'X-RY-Access-Token': 'test_access ...@@ -10,8 +10,8 @@ headers = {'Content-Type': 'application/json', 'X-RY-Access-Token': 'test_access
# 测试环境 # 测试环境
URL_batch = 'http://10.3.20.42:8080/receive/batch' URL_batch = 'http://10.3.20.42:8080/receive/batch'
# URL = 'http://52.80.137.106:8080/receive/tkio/' # URL = 'http://52.80.137.106:8080/receive/tkio/'
# URL = 'http://log.trackingio.com/receive/tkio/' URL = 'http://log.trackingio.com/receive/tkio/'
URL = 'http://jisulog.sortda.com/receive/tkio/' # URL = 'http://jisulog.sortda.com/receive/tkio/'
# URL = 'http://172.31.21.207:8080/receive/tkio/' # URL = 'http://172.31.21.207:8080/receive/tkio/'
# URL = 'http://120.53.212.71/receive/tkio/' # URL = 'http://120.53.212.71/receive/tkio/'
# 腾迅云tkio http协议的生产地址: # 腾迅云tkio http协议的生产地址:
...@@ -80,8 +80,8 @@ class allEvent: ...@@ -80,8 +80,8 @@ class allEvent:
# "_campaignid": 'default', # "_campaignid": 'default',
"_deviceid": i, "_deviceid": i,
"_imei": i, "_imei": i,
"_meid":'UNKNOWN', # "_meid":i,
"mobdna_info": "{\"mobdna_oid\":\"95820f88217ec8cbdf621919bb81c0a5\",\"mobdna_appkey\":\"16dc0cb882d3dbec4f7f66251a84d6dd\",\"mobdna_rdid\":\"96AD0BC02C70D0BA5C446C12580E3800\",\"mobdna_requestid\":\"463cfd5564d24d30a607a18a1e8ae2d8\"}", # "mobdna_info": "{\"mobdna_oid\":\"95820f88217ec8cbdf621919bb81c0a5\",\"mobdna_appkey\":\"16dc0cb882d3dbec4f7f66251a84d6dd\",\"mobdna_rdid\":\"96AD0BC02C70D0BA5C446C12580E3800\",\"mobdna_requestid\":\"463cfd5564d24d30a607a18a1e8ae2d8\"}",
'_oaid': i, '_oaid': i,
# "_rdid": '09DA91D0664C33DA7BEE7294CCCCCA07', # "_rdid": '09DA91D0664C33DA7BEE7294CCCCCA07',
# 'ua': 'Mozilla/5.0 (Linux; U; Android 7.0; zh-CN; Nexus 5X Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/40.0.2214.89 UCBrowser/11.4.5.937 Mobile Safari/537.36', # 'ua': 'Mozilla/5.0 (Linux; U; Android 7.0; zh-CN; Nexus 5X Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/40.0.2214.89 UCBrowser/11.4.5.937 Mobile Safari/537.36',
......
...@@ -10,7 +10,7 @@ import hashlib ...@@ -10,7 +10,7 @@ import hashlib
#安卓常规渠道激活 #安卓常规渠道激活
appkey = '83c18356b6ab202f007565b821e43e10' appkey = '16dc0cb882d3dbec4f7f66251a84d6dd'
# 线上预约app # 线上预约app
# 7f64fbd64513bc74aa6b5bf753ae0953 # 7f64fbd64513bc74aa6b5bf753ae0953
# 16dc0cb882d3dbec4f7f66251a84d6dd # 16dc0cb882d3dbec4f7f66251a84d6dd
...@@ -30,7 +30,7 @@ appkey = '83c18356b6ab202f007565b821e43e10' ...@@ -30,7 +30,7 @@ appkey = '83c18356b6ab202f007565b821e43e10'
# allEvent().payEvent(i, ip, appkey) # allEvent().payEvent(i, ip, appkey)
# print("开始时间"+datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')) # print("开始时间"+datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S'))
for index in range(1): for index in range(40):
# 随机生成12为数组 # 随机生成12为数组
s = ''.join(str(random.choice(range(10))) for _ in range(18)) s = ''.join(str(random.choice(range(10))) for _ in range(18))
p = ''.join(str(random.choice(range(10))) for _ in range(12)) p = ''.join(str(random.choice(range(10))) for _ in range(12))
...@@ -41,7 +41,7 @@ for index in range(1): ...@@ -41,7 +41,7 @@ for index in range(1):
# p = '987654321234567' # p = '987654321234567'
# s = '2321321312h8ro321' # s = '2321321312h8ro321'
i = ''.join(str(random.choice(range(10))) for _ in range(12)) i = ''.join(str(random.choice(range(10))) for _ in range(12))
# i = '778980150907' # i = '315141921832'
# i = '00000000-0000-0000-0000-000000000000' # i = '00000000-0000-0000-0000-000000000000'
# 随机生成ipXXXX XXCB489741-0029-4A35-8E38-D142F836B623 # 随机生成ipXXXX XXCB489741-0029-4A35-8E38-D142F836B623
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff))) ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
...@@ -63,10 +63,10 @@ for index in range(1): ...@@ -63,10 +63,10 @@ for index in range(1):
# time.sleep(1) # time.sleep(1)
# allEvent().payorder(i, ip, appkey) # allEvent().payorder(i, ip, appkey)
# time.sleep(1) # time.sleep(1)
# num = index + 1 num = index + 1
# event = 'event_' + str(num) event = 'event_' + str(num)
# # event = 'event_5' # event = 'event_5'
# allEvent().ziding_event(i, ip, appkey, event) allEvent().ziding_event(i, ip, appkey, event)
# print(s) # print(s)
# s = int(s) + 1 # s = int(s) + 1
# time.sleep(3) # time.sleep(3)
...@@ -81,7 +81,7 @@ for index in range(1): ...@@ -81,7 +81,7 @@ for index in range(1):
# allEvent().batchUpload(i,ip,appkey) # allEvent().batchUpload(i,ip,appkey)
# allEvent().H5download(i,ip,appkey) # allEvent().H5download(i,ip,appkey)
# # time.sleep(1) # # time.sleep(1)
allEvent().H5pv(i,ip,appkey) # allEvent().H5pv(i,ip,appkey)
# # time.sleep(1) # # time.sleep(1)
# # # #
# allEvent().H5su(i,ip,appkey) # allEvent().H5su(i,ip,appkey)
......
...@@ -9,11 +9,11 @@ import time ...@@ -9,11 +9,11 @@ import time
#!!!!分包需要删掉https的s #!!!!分包需要删掉https的s
# URL = 'http://uri6.com/tkio/3uu6rya?noredirect=true' # URL = 'http://uri6.com/tkio/3uu6rya?noredirect=true'
URL = 'http://52.80.137.106:8083/tkio/RvYNJna?noredirect=true' URL = 'http://52.80.137.106:8083/tkio/NjiYvua?noredirect=true'
appkey = '5b0e99269160e67ef8e560716221e142' appkey = '345b0e19ef25ab3e7cc46770c2f16a3b'
# event = 'invoke' # event = 'invoke'
cmpaignid = '111' cmpaignid = '112233'
# 广告创意ID # 广告创意ID
ry_adcreative_id = '9876543' ry_adcreative_id = '9876543'
# 广告组ID # 广告组ID
...@@ -29,7 +29,7 @@ ry_adcreative_name = '广告创意' ...@@ -29,7 +29,7 @@ ry_adcreative_name = '广告创意'
s = 0 s = 0
w = 0 w = 0
for index in range(1): for index in range(40):
#随机生成12为数组 #随机生成12为数组
i = ''.join(str(random.choice(range(10))) for _ in range(12)) i = ''.join(str(random.choice(range(10))) for _ in range(12))
...@@ -103,19 +103,19 @@ for index in range(1): ...@@ -103,19 +103,19 @@ for index in range(1):
# allEvent().loginEvent(i, ip, appkey) # allEvent().loginEvent(i, ip, appkey)
# except Exception: # except Exception:
# print('登录_wrong:', w) # print('登录_wrong:', w)
time.sleep(5) # time.sleep(5)
try:
allEvent().payEvent(i, ip, appkey)
except Exception:
print('付费_wrong:', w)
# num = index + 1
# event = 'event_' + str(num)
# event = 'event_28'
# time.sleep(3)
# try: # try:
# allEvent().ziding_event(i, ip, appkey,event) # allEvent().payEvent(i, ip, appkey)
# except Exception: # except Exception:
# print('自定义_wrong:', w) # print('付费_wrong:', w)
num = index + 1
event = 'event_' + str(num)
# event = 'event_28'
time.sleep(2)
try:
allEvent().ziding_event(i, ip, appkey,event)
except Exception:
print('自定义_wrong:', w)
......
...@@ -5,23 +5,23 @@ import random ...@@ -5,23 +5,23 @@ import random
import time import time
import time import time
#安卓分包激活 #安卓分包激活
appkey = 'f461b1ab7aca6fdf3fa719bf4b6af863' appkey = '345b0e19ef25ab3e7cc46770c2f16a3b'
#57ed2dd31596bb4682471e82c0c73c1a #57ed2dd31596bb4682471e82c0c73c1a
# 4b25b8a4dc584e63e9a7b81c3adedf2f # 4b25b8a4dc584e63e9a7b81c3adedf2f
# event = 'event_10' # event = 'event_10'
cmpaignid = '1111' cmpaignid = '1122'
for index in range(1): for index in range(1):
# 随机生成12为数组 # 随机生成12为数组
i = ''.join(str(random.choice(range(10))) for _ in range(12)) # i = ''.join(str(random.choice(range(10))) for _ in range(12))
# i = 'q27dux0c9d5mv9413cp903d07a8q1ipf' i = '189894848469'
# 随机生成ip # 随机生成ip
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff))) ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
# ip = '143.205.125.236' # ip = '143.205.125.236'
allEvent().installUpload(i, ip, appkey, cmpaignid) # allEvent().installUpload(i, ip, appkey, cmpaignid)
# time.sleep(3) # time.sleep(3)
# allEvent().loginEvent(i, ip, appkey) allEvent().loginEvent(i, ip, appkey)
# allEvent().orderEvent(i, ip, appkey) # allEvent().orderEvent(i, ip, appkey)
# time.sleep(1) # time.sleep(1)
# num = index + 1 # num = index + 1
......
...@@ -100,14 +100,14 @@ for _ in range(1): ...@@ -100,14 +100,14 @@ for _ in range(1):
print('idfa:', i) print('idfa:', i)
print('ip', ip) print('ip', ip)
w = w + 1 w = w + 1
# time.sleep(10) time.sleep(10)
# try: try:
# allEvent().installUpload(i, ip, appkey) allEvent().installUpload(i, ip, appkey)
# # allEvent().formevent(i, ip, appkey) # allEvent().formevent(i, ip, appkey)
#
# except Exception: except Exception:
# print('install_wrong:', w) print('install_wrong:', w)
# w = w + 1 w = w + 1
# time.sleep(3) # time.sleep(3)
# try: # try:
# allEvent().adshow(i, ip, appkey,adid) # allEvent().adshow(i, ip, appkey,adid)
......
...@@ -8,8 +8,8 @@ import random ...@@ -8,8 +8,8 @@ import random
headers = {'Content-Type': 'application/json'} headers = {'Content-Type': 'application/json'}
# URL = 'http://10.2.20.42:8080/receive/tkio/' # URL = 'http://10.2.20.42:8080/receive/tkio/'
URL = 'http://52.80.137.106:8080/receive/tkio/' # URL = 'http://52.80.137.106:8080/receive/tkio/'
# URL = 'http://log.trackingio.com/receive/tkio/' URL = 'http://log.trackingio.com/receive/tkio/'
# URL = 'http://jisulog.sortda.com/receive/tkio/' # URL = 'http://jisulog.sortda.com/receive/tkio/'
#时间戳 #时间戳
......
...@@ -6,7 +6,7 @@ import string ...@@ -6,7 +6,7 @@ import string
import time import time
#iOS常规渠道激活 #iOS常规渠道激活
appkey = '0ecc232109dc25bfedff8aba06271539' appkey = '60763edf19602c0fa27b967c282fe805'
event = 'event_1' event = 'event_1'
for index in range(5): for index in range(5):
...@@ -40,7 +40,7 @@ for index in range(5): ...@@ -40,7 +40,7 @@ for index in range(5):
# # event = 'event_' + str(num) # # event = 'event_' + str(num)
# event = 'event_1' # event = 'event_1'
# allEvent().ziding_event(i, ip, appkey, event) # allEvent().ziding_event(i, ip, appkey, event)
print(event) # print(event)
# allEvent().adshow(i,ip,appkey,adid) # allEvent().adshow(i,ip,appkey,adid)
# allEvent().adclick(i,ip,appkey,adid) # allEvent().adclick(i,ip,appkey,adid)
# allEvent().pageduration(i,ip,appkey,se,p) # allEvent().pageduration(i,ip,appkey,se,p)
......
...@@ -977,6 +977,7 @@ def test_atb45(): ...@@ -977,6 +977,7 @@ def test_atb45():
i = code_nums(12) i = code_nums(12)
redirectandroid.parms['callback_url'] = 'https://www.baidu.com/?tn=98010089_dg&ch=16/' redirectandroid.parms['callback_url'] = 'https://www.baidu.com/?tn=98010089_dg&ch=16/'
redirectandroid.parms['oaid'] = i redirectandroid.parms['oaid'] = i
redirectandroid.parms['oaid_md5'] = code_nums(33)
redirectandroid.send_request3('') redirectandroid.send_request3('')
time.sleep(5) time.sleep(5)
# receiveandroid.data[0]['application_info']['appkey'] = 'b8e5e389e1223ffa16a5a9420258383d' # receiveandroid.data[0]['application_info']['appkey'] = 'b8e5e389e1223ffa16a5a9420258383d'
...@@ -992,20 +993,20 @@ def test_atb45(): ...@@ -992,20 +993,20 @@ def test_atb45():
# receiveandroid.data[0]["event_info"]['event_name'] = 'startup' # receiveandroid.data[0]["event_info"]['event_name'] = 'startup'
# receiveandroid.data[0]["event_info"]['event_type'] = 'preset' # receiveandroid.data[0]["event_info"]['event_type'] = 'preset'
# receiveandroid.send_request() # receiveandroid.send_request()
time.sleep(3) time.sleep(13)
receiveandroid.data[0]['device_info']['device_id'] = i receiveandroid.data[0]['device_info']['device_id'] = i
receiveandroid.data[0]['device_info']['oaid'] = i receiveandroid.data[0]['device_info']['oaid'] = i
receiveandroid.data[0]['device_info']['device_id_type'] = 'oaid' receiveandroid.data[0]['device_info']['device_id_type'] = 'oaid'
receiveandroid.data[0]["event_info"]['event_name'] = 'register' receiveandroid.data[0]["event_info"]['event_name'] = 'register'
receiveandroid.data[0]["event_info"]['event_type'] = 'preset' receiveandroid.data[0]["event_info"]['event_type'] = 'preset'
receiveandroid.send_request() receiveandroid.send_request()
time.sleep(3) # time.sleep(3)
receiveandroid.data[0]['device_info']['device_id'] = i # receiveandroid.data[0]['device_info']['device_id'] = i
receiveandroid.data[0]['device_info']['oaid'] = i # receiveandroid.data[0]['device_info']['oaid'] = i
receiveandroid.data[0]['device_info']['device_id_type'] = 'oaid' # receiveandroid.data[0]['device_info']['device_id_type'] = 'oaid'
receiveandroid.data[0]["event_info"]['event_name'] = 'login' # receiveandroid.data[0]["event_info"]['event_name'] = 'login'
receiveandroid.data[0]["event_info"]['event_type'] = 'preset' # receiveandroid.data[0]["event_info"]['event_type'] = 'preset'
receiveandroid.send_request() # receiveandroid.send_request()
# time.sleep(3) # time.sleep(3)
# receiveandroid.data[0]['device_info']['device_id'] = i # receiveandroid.data[0]['device_info']['device_id'] = i
# receiveandroid.data[0]['device_info']['oaid'] = i # receiveandroid.data[0]['device_info']['oaid'] = i
...@@ -1551,24 +1552,623 @@ def test_click(): ...@@ -1551,24 +1552,623 @@ def test_click():
# 单独的激活 # 单独的激活
def test_install(): def test_install():
i = 'acr4n9muc39v' # i = '23A051-DB2A-4F4F-9154-BC15EF565752'
i = code_nums(12)
receiveandroid.data[0]['device_info']['device_id'] = i receiveandroid.data[0]['device_info']['device_id'] = i
receiveandroid.data[0]['device_info']['oaid'] = i receiveandroid.data[0]['device_info']['oaid'] = i
receiveandroid.data[0]['device_info']['device_id_type'] = 'oaid' receiveandroid.data[0]['device_info']['device_id_type'] = 'oaid'
receiveandroid.send_request() receiveandroid.send_request()
print(i)
# 单独的点击
def test_click():
i = code_nums(12)
# redirectandroid.parms['touchpoint_type'] = 'impression'
redirectandroid.parms['gaid'] = '9C3FA000-DB2A-4F4F-9154-BC15EF565772'
# redirectandroid.parms['ts'] = '1668997850000'
redirectandroid.send_request3('')
print(i)
def test_atbgoogle(): def test_atbgoogle():
# i = idfacode() # i = code_nums(12)
i = '3C3FA051-DB2A-4F4F-9154-BC15EF565750' i = '9C3FA051-DB2A-4F4F-9154-BC15EF565783'
receiveandroid.data[0]['timestamp_info']['current_event_time'] = '1659148260199' receiveandroid.data[0]['timestamp_info']['current_event_time'] = '1668847756000'
receiveandroid.data[0]['device_info']['device_id'] = i receiveandroid.data[0]['device_info']['device_id'] = i
receiveandroid.data[0]['device_info']['imei1'] = '' receiveandroid.data[0]['device_info']['imei1'] = ''
receiveandroid.data[0]['device_info']['gaid'] = i receiveandroid.data[0]['device_info']['gaid'] = i
receiveandroid.data[0]['device_info']['device_id_type'] = 'gaid' receiveandroid.data[0]['device_info']['device_id_type'] = 'gaid'
receiveandroid.data[0]['device_info']['os'] = '1' receiveandroid.data[0]['device_info']['os'] = '1'
receiveandroid.send_requestgoogle() receiveandroid.send_requestgoogle()
print(i) print(i)
\ No newline at end of file
# ---------------------------ts规则修改-------------------
# ts为10/13位的归因(修改send_request3中的ts事件即可)
def test_ts10():
ts = int(round(time.time()))
i = code_nums(12)
redirectandroid.parms['oaid'] = i
redirectandroid.parms['ts'] = ts
redirectandroid.send_request3('')
time.sleep(6)
receiveandroid.data[0]['device_info']['device_id'] = i
receiveandroid.data[0]['device_info']['oaid'] = i
receiveandroid.data[0]['device_info']['device_id_type'] = 'oaid'
receiveandroid.send_request()
print(i)
# -------------------数据处理与归因逻辑优化----------------------
# 只有ipv4满足规则,其他的字段不满足,归因到ipv4
def test_at_newipv4():
redirectandroid.parms['ipv4'] = ip
redirectandroid.parms['oaid'] = code_nums(513)
redirectandroid.parms['oaid_md5'] = code_nums(33)
redirectandroid.parms['imei1'] = code_nums(33)
redirectandroid.parms['imei1_md5'] = code_nums(33)
redirectandroid.parms['imei2'] = code_nums(33)
redirectandroid.parms['imei2_md5'] = code_nums(33)
redirectandroid.parms['gaid'] = code_nums(37)
redirectandroid.parms['gaid_md5'] = code_nums(33)
redirectandroid.parms['mac'] = code_nums(18)
redirectandroid.parms['mac_md5'] = code_nums(33)
redirectandroid.parms['android_id'] = code_nums(17)
redirectandroid.parms['android_id_md5'] = code_nums(33)
redirectandroid.parms['is_s2s'] = '1'
redirectandroid.parms['touchpoint_type'] = 'click'
redirectandroid.parms['attribution_type'] = 'ua'
redirectandroid.send_request3('')
time.sleep(6)
receiveandroid.data[0]['device_info']['device_id'] = o
receiveandroid.data[0]['device_info']['oaid_md5'] = md
receiveandroid.data[0]['device_info']['imei1'] = o
receiveandroid.data[0]['device_info']['device_id_type'] = 'imei1'
receiveandroid.data[0]['device_info']['device_id_md5_type'] = 'oaid_md5'
receiveandroid.data[0]['device_info']['device_id_md5'] = md
receiveandroid.data[0]['device_info']['ipv4'] = ip
receiveandroid.send_request()
print(o)
print(md)
def test_at_newoaid():
redirectandroid.parms['ipv4'] = code_nums(129)
redirectandroid.parms['oaid'] = o
redirectandroid.parms['oaid_md5'] = code_nums(33)
redirectandroid.parms['imei1'] = code_nums(33)
redirectandroid.parms['imei1_md5'] = code_nums(33)
redirectandroid.parms['imei2'] = code_nums(33)
redirectandroid.parms['imei2_md5'] = code_nums(33)
redirectandroid.parms['gaid'] = code_nums(37)
redirectandroid.parms['gaid_md5'] = code_nums(33)
redirectandroid.parms['mac'] = code_nums(18)
redirectandroid.parms['mac_md5'] = code_nums(33)
redirectandroid.parms['android_id'] = code_nums(17)
redirectandroid.parms['android_id_md5'] = code_nums(33)
redirectandroid.parms['is_s2s'] = '1'
redirectandroid.parms['touchpoint_type'] = 'click'
redirectandroid.parms['attribution_type'] = 'ua'
redirectandroid.send_request3('')
time.sleep(6)
receiveandroid.data[0]['device_info']['device_id'] = o
receiveandroid.data[0]['device_info']['oaid_md5'] = md
receiveandroid.data[0]['device_info']['oaid'] = o
receiveandroid.data[0]['device_info']['imei1'] = ''
receiveandroid.data[0]['device_info']['device_id_type'] = 'oaid'
receiveandroid.data[0]['device_info']['device_id_md5_type'] = 'oaid_md5'
receiveandroid.data[0]['device_info']['device_id_md5'] = md
receiveandroid.data[0]['device_info']['ipv4'] = ip
receiveandroid.send_request()
time.sleep(6)
receiveandroid.data[0]['device_info']['device_id'] = o
receiveandroid.data[0]['device_info']['oaid_md5'] = md
receiveandroid.data[0]['device_info']['oaid'] = o
receiveandroid.data[0]['device_info']['imei1'] = ''
receiveandroid.data[0]['device_info']['device_id_type'] = 'oaid'
receiveandroid.data[0]['device_info']['device_id_md5_type'] = 'oaid_md5'
receiveandroid.data[0]['device_info']['device_id_md5'] = md
receiveandroid.data[0]['device_info']['ipv4'] = ip
receiveandroid.data[0]['event_info']['event_name'] = 'register'
receiveandroid.send_request()
print(o)
print(md)
def test_at_newoaid_md5():
redirectandroid.parms['ipv4'] = code_nums(129)
redirectandroid.parms['oaid'] = code_nums(513)
redirectandroid.parms['oaid_md5'] = md
redirectandroid.parms['imei1'] = code_nums(33)
redirectandroid.parms['imei1_md5'] = code_nums(33)
redirectandroid.parms['imei2'] = code_nums(33)
redirectandroid.parms['imei2_md5'] = code_nums(33)
redirectandroid.parms['gaid'] = code_nums(37)
redirectandroid.parms['gaid_md5'] = code_nums(33)
redirectandroid.parms['mac'] = code_nums(18)
redirectandroid.parms['mac_md5'] = code_nums(33)
redirectandroid.parms['android_id'] = code_nums(17)
redirectandroid.parms['android_id_md5'] = code_nums(33)
redirectandroid.parms['is_s2s'] = '1'
redirectandroid.parms['touchpoint_type'] = 'click'
redirectandroid.parms['attribution_type'] = 'ua'
redirectandroid.send_request3('')
time.sleep(6)
receiveandroid.data[0]['device_info']['device_id'] = o
receiveandroid.data[0]['device_info']['oaid_md5'] = md
receiveandroid.data[0]['device_info']['oaid'] = o
receiveandroid.data[0]['device_info']['imei1'] = ''
receiveandroid.data[0]['device_info']['device_id_type'] = 'oaid'
receiveandroid.data[0]['device_info']['device_id_md5_type'] = 'oaid_md5'
receiveandroid.data[0]['device_info']['device_id_md5'] = md
receiveandroid.data[0]['device_info']['ipv4'] = ip
receiveandroid.send_request()
print(o)
print(md)
def test_at_newimei1():
redirectandroid.parms['ipv4'] = code_nums(129)
redirectandroid.parms['oaid'] = code_nums(513)
redirectandroid.parms['oaid_md5'] = code_nums(33)
redirectandroid.parms['imei1'] = o
redirectandroid.parms['imei1_md5'] = code_nums(33)
redirectandroid.parms['imei2'] = code_nums(33)
redirectandroid.parms['imei2_md5'] = code_nums(33)
redirectandroid.parms['gaid'] = code_nums(37)
redirectandroid.parms['gaid_md5'] = code_nums(33)
redirectandroid.parms['mac'] = code_nums(18)
redirectandroid.parms['mac_md5'] = code_nums(33)
redirectandroid.parms['android_id'] = code_nums(17)
redirectandroid.parms['android_id_md5'] = code_nums(33)
redirectandroid.parms['is_s2s'] = '1'
redirectandroid.parms['touchpoint_type'] = 'click'
redirectandroid.parms['attribution_type'] = 'ua'
redirectandroid.send_request3('')
time.sleep(6)
receiveandroid.data[0]['device_info']['device_id'] = o
receiveandroid.data[0]['device_info']['oaid_md5'] = md
receiveandroid.data[0]['device_info']['oaid'] = ''
receiveandroid.data[0]['device_info']['imei1'] = o
receiveandroid.data[0]['device_info']['device_id_type'] = 'imei1'
receiveandroid.data[0]['device_info']['device_id_md5_type'] = 'oaid_md5'
receiveandroid.data[0]['device_info']['device_id_md5'] = md
receiveandroid.data[0]['device_info']['ipv4'] = ip
receiveandroid.send_request()
print(o)
print(md)
def test_at_newimei1_md5():
redirectandroid.parms['ipv4'] = code_nums(129)
redirectandroid.parms['oaid'] = code_nums(513)
redirectandroid.parms['oaid_md5'] = code_nums(33)
redirectandroid.parms['imei1'] = code_nums(33)
redirectandroid.parms['imei1_md5'] = md
redirectandroid.parms['imei2'] = code_nums(33)
redirectandroid.parms['imei2_md5'] = code_nums(33)
redirectandroid.parms['gaid'] = code_nums(37)
redirectandroid.parms['gaid_md5'] = code_nums(33)
redirectandroid.parms['mac'] = code_nums(18)
redirectandroid.parms['mac_md5'] = code_nums(33)
redirectandroid.parms['android_id'] = code_nums(17)
redirectandroid.parms['android_id_md5'] = code_nums(33)
redirectandroid.parms['is_s2s'] = '1'
redirectandroid.parms['touchpoint_type'] = 'click'
redirectandroid.parms['attribution_type'] = 'ua'
redirectandroid.send_request3('')
time.sleep(6)
receiveandroid.data[0]['device_info']['device_id'] = o
receiveandroid.data[0]['device_info']['oaid_md5'] = ''
receiveandroid.data[0]['device_info']['oaid'] = ''
receiveandroid.data[0]['device_info']['imei1'] = o
receiveandroid.data[0]['device_info']['imei1_md5'] = md
receiveandroid.data[0]['device_info']['device_id_type'] = 'imei1'
receiveandroid.data[0]['device_info']['device_id_md5_type'] = 'imei1_md5'
receiveandroid.data[0]['device_info']['ipv4'] = ip
receiveandroid.send_request()
print(o)
print(md)
def test_at_newimei2():
imei2 = code_nums(32)
redirectandroid.parms['ipv4'] = code_nums(129)
redirectandroid.parms['oaid'] = code_nums(513)
redirectandroid.parms['oaid_md5'] = code_nums(33)
redirectandroid.parms['imei1'] = code_nums(33)
redirectandroid.parms['imei1_md5'] = code_nums(33)
redirectandroid.parms['imei2'] = imei2
redirectandroid.parms['imei2_md5'] = code_nums(33)
redirectandroid.parms['gaid'] = code_nums(37)
redirectandroid.parms['gaid_md5'] = code_nums(33)
redirectandroid.parms['mac'] = code_nums(18)
redirectandroid.parms['mac_md5'] = code_nums(33)
redirectandroid.parms['android_id'] = code_nums(17)
redirectandroid.parms['android_id_md5'] = code_nums(33)
redirectandroid.parms['is_s2s'] = '1'
redirectandroid.parms['touchpoint_type'] = 'click'
redirectandroid.parms['attribution_type'] = 'ua'
redirectandroid.send_request3('')
time.sleep(6)
receiveandroid.data[0]['device_info']['device_id'] = o
receiveandroid.data[0]['device_info']['oaid_md5'] = ''
receiveandroid.data[0]['device_info']['oaid'] = ''
receiveandroid.data[0]['device_info']['imei1'] = o
receiveandroid.data[0]['device_info']['imei2'] = imei2
receiveandroid.data[0]['device_info']['imei1_md5'] = md
receiveandroid.data[0]['device_info']['device_id_type'] = 'imei1'
receiveandroid.data[0]['device_info']['device_id_md5_type'] = 'imei1_md5'
receiveandroid.data[0]['device_info']['ipv4'] = ip
receiveandroid.send_request()
print(o)
print(md)
def test_at_newimei2_md5():
imei2_md5 = code_nums(32)
redirectandroid.parms['ipv4'] = code_nums(129)
redirectandroid.parms['oaid'] = code_nums(513)
redirectandroid.parms['oaid_md5'] = code_nums(33)
redirectandroid.parms['imei1'] = code_nums(33)
redirectandroid.parms['imei1_md5'] = code_nums(33)
redirectandroid.parms['imei2'] = code_nums(33)
redirectandroid.parms['imei2_md5'] = imei2_md5
redirectandroid.parms['gaid'] = code_nums(37)
redirectandroid.parms['gaid_md5'] = code_nums(33)
redirectandroid.parms['mac'] = code_nums(18)
redirectandroid.parms['mac_md5'] = code_nums(33)
redirectandroid.parms['android_id'] = code_nums(17)
redirectandroid.parms['android_id_md5'] = code_nums(33)
redirectandroid.parms['is_s2s'] = '1'
redirectandroid.parms['touchpoint_type'] = 'click'
redirectandroid.parms['attribution_type'] = 'ua'
redirectandroid.send_request3('')
time.sleep(6)
receiveandroid.data[0]['device_info']['device_id'] = o
receiveandroid.data[0]['device_info']['oaid_md5'] = ''
receiveandroid.data[0]['device_info']['oaid'] = ''
receiveandroid.data[0]['device_info']['imei1'] = o
receiveandroid.data[0]['device_info']['imei2_md5'] = imei2_md5
receiveandroid.data[0]['device_info']['imei1_md5'] = md
receiveandroid.data[0]['device_info']['device_id_type'] = 'imei1'
receiveandroid.data[0]['device_info']['device_id_md5_type'] = 'imei1_md5'
receiveandroid.data[0]['device_info']['ipv4'] = ip
receiveandroid.send_request()
print(o)
print(md)
def test_at_newigaid():
gaid = code_nums(36)
redirectandroid.parms['ipv4'] = code_nums(129)
redirectandroid.parms['oaid'] = code_nums(513)
redirectandroid.parms['oaid_md5'] = code_nums(33)
redirectandroid.parms['imei1'] = code_nums(33)
redirectandroid.parms['imei1_md5'] = code_nums(33)
redirectandroid.parms['imei2'] = code_nums(33)
redirectandroid.parms['imei2_md5'] = code_nums(33)
redirectandroid.parms['gaid'] = gaid
redirectandroid.parms['gaid_md5'] = code_nums(33)
redirectandroid.parms['mac'] = code_nums(18)
redirectandroid.parms['mac_md5'] = code_nums(33)
redirectandroid.parms['android_id'] = code_nums(17)
redirectandroid.parms['android_id_md5'] = code_nums(33)
redirectandroid.parms['is_s2s'] = '1'
redirectandroid.parms['touchpoint_type'] = 'click'
redirectandroid.parms['attribution_type'] = 'ua'
redirectandroid.send_request3('')
time.sleep(6)
receiveandroid.data[0]['device_info']['device_id'] = o
receiveandroid.data[0]['device_info']['oaid_md5'] = ''
receiveandroid.data[0]['device_info']['oaid'] = ''
receiveandroid.data[0]['device_info']['imei1'] = o
receiveandroid.data[0]['device_info']['gaid'] = gaid
receiveandroid.data[0]['device_info']['imei1_md5'] = md
receiveandroid.data[0]['device_info']['device_id_type'] = 'imei1'
receiveandroid.data[0]['device_info']['device_id_md5_type'] = 'imei1_md5'
receiveandroid.data[0]['device_info']['ipv4'] = ip
receiveandroid.send_request()
print(o)
print(md)
def test_at_newigaid_md5():
gaid_md5 = code_nums(32)
redirectandroid.parms['ipv4'] = code_nums(129)
redirectandroid.parms['oaid'] = code_nums(513)
redirectandroid.parms['oaid_md5'] = code_nums(33)
redirectandroid.parms['imei1'] = code_nums(33)
redirectandroid.parms['imei1_md5'] = code_nums(33)
redirectandroid.parms['imei2'] = code_nums(33)
redirectandroid.parms['imei2_md5'] = code_nums(33)
redirectandroid.parms['gaid'] = code_nums(37)
redirectandroid.parms['gaid_md5'] = gaid_md5
redirectandroid.parms['mac'] = code_nums(18)
redirectandroid.parms['mac_md5'] = code_nums(33)
redirectandroid.parms['android_id'] = code_nums(17)
redirectandroid.parms['android_id_md5'] = code_nums(33)
redirectandroid.parms['is_s2s'] = '1'
redirectandroid.parms['touchpoint_type'] = 'click'
redirectandroid.parms['attribution_type'] = 'ua'
redirectandroid.send_request3('')
time.sleep(6)
receiveandroid.data[0]['device_info']['device_id'] = o
receiveandroid.data[0]['device_info']['oaid_md5'] = ''
receiveandroid.data[0]['device_info']['oaid'] = ''
receiveandroid.data[0]['device_info']['imei1'] = o
receiveandroid.data[0]['device_info']['gaid_md5'] = gaid_md5
receiveandroid.data[0]['device_info']['imei1_md5'] = md
receiveandroid.data[0]['device_info']['device_id_type'] = 'imei1'
receiveandroid.data[0]['device_info']['device_id_md5_type'] = 'imei1_md5'
receiveandroid.data[0]['device_info']['ipv4'] = ip
receiveandroid.send_request()
print(o)
print(md)
def test_at_newmac():
mac = code_nums(17)
redirectandroid.parms['ipv4'] = code_nums(129)
redirectandroid.parms['oaid'] = code_nums(513)
redirectandroid.parms['oaid_md5'] = code_nums(33)
redirectandroid.parms['imei1'] = code_nums(33)
redirectandroid.parms['imei1_md5'] = code_nums(33)
redirectandroid.parms['imei2'] = code_nums(33)
redirectandroid.parms['imei2_md5'] = code_nums(33)
redirectandroid.parms['gaid'] = code_nums(37)
redirectandroid.parms['gaid_md5'] = code_nums(33)
redirectandroid.parms['mac'] = mac
redirectandroid.parms['mac_md5'] = code_nums(33)
redirectandroid.parms['android_id'] = code_nums(17)
redirectandroid.parms['android_id_md5'] = code_nums(33)
redirectandroid.parms['is_s2s'] = '1'
redirectandroid.parms['touchpoint_type'] = 'click'
redirectandroid.parms['attribution_type'] = 'ua'
redirectandroid.send_request3('')
time.sleep(6)
receiveandroid.data[0]['device_info']['device_id'] = o
receiveandroid.data[0]['device_info']['oaid_md5'] = ''
receiveandroid.data[0]['device_info']['oaid'] = ''
receiveandroid.data[0]['device_info']['imei1'] = o
receiveandroid.data[0]['device_info']['mac'] = mac
receiveandroid.data[0]['device_info']['imei1_md5'] = md
receiveandroid.data[0]['device_info']['device_id_type'] = 'imei1'
receiveandroid.data[0]['device_info']['device_id_md5_type'] = 'imei1_md5'
receiveandroid.data[0]['device_info']['ipv4'] = ip
receiveandroid.send_request()
print(o)
print(md)
def test_at_newmac_md5():
mac_md5 = code_nums(32)
redirectandroid.parms['ipv4'] = code_nums(129)
redirectandroid.parms['oaid'] = code_nums(513)
redirectandroid.parms['oaid_md5'] = code_nums(33)
redirectandroid.parms['imei1'] = code_nums(33)
redirectandroid.parms['imei1_md5'] = code_nums(33)
redirectandroid.parms['imei2'] = code_nums(33)
redirectandroid.parms['imei2_md5'] = code_nums(33)
redirectandroid.parms['gaid'] = code_nums(37)
redirectandroid.parms['gaid_md5'] = code_nums(33)
redirectandroid.parms['mac'] = code_nums(18)
redirectandroid.parms['mac_md5'] = mac_md5
redirectandroid.parms['android_id'] = code_nums(17)
redirectandroid.parms['android_id_md5'] = code_nums(33)
redirectandroid.parms['is_s2s'] = '1'
redirectandroid.parms['touchpoint_type'] = 'click'
redirectandroid.parms['attribution_type'] = 'ua'
redirectandroid.send_request3('')
time.sleep(6)
receiveandroid.data[0]['device_info']['device_id'] = o
receiveandroid.data[0]['device_info']['oaid_md5'] = ''
receiveandroid.data[0]['device_info']['oaid'] = ''
receiveandroid.data[0]['device_info']['imei1'] = o
receiveandroid.data[0]['device_info']['mac_md5'] = mac_md5
receiveandroid.data[0]['device_info']['imei1_md5'] = md
receiveandroid.data[0]['device_info']['device_id_type'] = 'imei1'
receiveandroid.data[0]['device_info']['device_id_md5_type'] = 'imei1_md5'
receiveandroid.data[0]['device_info']['ipv4'] = ip
receiveandroid.send_request()
receiveandroid.send_request()
print(o)
print(md)
def test_at_newandroidid():
android_id = code_nums(16)
redirectandroid.parms['ipv4'] = code_nums(129)
redirectandroid.parms['oaid'] = code_nums(513)
redirectandroid.parms['oaid_md5'] = code_nums(33)
redirectandroid.parms['imei1'] = code_nums(33)
redirectandroid.parms['imei1_md5'] = code_nums(33)
redirectandroid.parms['imei2'] = code_nums(33)
redirectandroid.parms['imei2_md5'] = code_nums(33)
redirectandroid.parms['gaid'] = code_nums(37)
redirectandroid.parms['gaid_md5'] = code_nums(33)
redirectandroid.parms['mac'] = code_nums(18)
redirectandroid.parms['mac_md5'] = code_nums(33)
redirectandroid.parms['android_id'] = android_id
redirectandroid.parms['android_id_md5'] = code_nums(33)
redirectandroid.parms['is_s2s'] = '1'
redirectandroid.parms['touchpoint_type'] = 'click'
redirectandroid.parms['attribution_type'] = 'ua'
redirectandroid.send_request3('')
# -------------------------所以设备都非法-------------------------
# ts,is_s2s,turl_id,touchpoint_type,attribution_type满足校验规则,device_info中没有满足规则的字段
def test_at_newclick1():
redirectandroid.parms['ipv4'] = code_nums(129)
redirectandroid.parms['oaid'] = code_nums(513)
redirectandroid.parms['oaid_md5'] = code_nums(33)
redirectandroid.parms['imei1'] = code_nums(33)
redirectandroid.parms['imei1_md5'] = code_nums(33)
redirectandroid.parms['imei2'] = code_nums(33)
redirectandroid.parms['imei2_md5'] = code_nums(33)
redirectandroid.parms['gaid'] = code_nums(37)
redirectandroid.parms['gaid_md5'] = code_nums(33)
redirectandroid.parms['mac'] = code_nums(18)
redirectandroid.parms['mac_md5'] = code_nums(33)
redirectandroid.parms['android_id'] = code_nums(17)
redirectandroid.parms['android_id_md5'] = code_nums(33)
redirectandroid.parms['is_s2s'] = '1'
redirectandroid.parms['touchpoint_type'] = 'click'
redirectandroid.parms['attribution_type'] = 'ua'
redirectandroid.send_request3('')
# device_info,is_s2s,turl_id,touchpoint_type,attribution_type满足校验规则,ts不满足规则
def test_at_newclick2():
redirectandroid.parms['ipv4'] = ip
redirectandroid.parms['oaid'] = o
redirectandroid.parms['oaid_md5'] = code_nums(32)
redirectandroid.parms['imei1'] = code_nums(32)
redirectandroid.parms['imei1_md5'] = code_nums(32)
redirectandroid.parms['imei2'] = code_nums(32)
redirectandroid.parms['imei2_md5'] = code_nums(32)
redirectandroid.parms['gaid'] = code_nums(36)
redirectandroid.parms['gaid_md5'] = code_nums(32)
redirectandroid.parms['mac'] = code_nums(17)
redirectandroid.parms['mac_md5'] = code_nums(32)
redirectandroid.parms['android_id'] = code_nums(16)
redirectandroid.parms['android_id_md5'] = code_nums(32)
redirectandroid.parms['is_s2s'] = '1'
redirectandroid.parms['ts'] = code_nums(20)
redirectandroid.parms['touchpoint_type'] = 'click'
redirectandroid.parms['attribution_type'] = 'ua'
redirectandroid.send_request4()
# device_info,is_s2s,turl_id,touchpoint_type,attribution_type满足校验规则,ts不满足规则
def test_at_newclick3():
redirectandroid.parms['ipv4'] = ip
redirectandroid.parms['oaid'] = o
redirectandroid.parms['oaid_md5'] = code_nums(32)
redirectandroid.parms['imei1'] = code_nums(32)
redirectandroid.parms['imei1_md5'] = code_nums(32)
redirectandroid.parms['imei2'] = code_nums(32)
redirectandroid.parms['imei2_md5'] = code_nums(32)
redirectandroid.parms['gaid'] = code_nums(36)
redirectandroid.parms['gaid_md5'] = code_nums(32)
redirectandroid.parms['mac'] = code_nums(17)
redirectandroid.parms['mac_md5'] = code_nums(32)
redirectandroid.parms['android_id'] = code_nums(16)
redirectandroid.parms['android_id_md5'] = code_nums(32)
redirectandroid.parms['is_s2s'] = 'i'
redirectandroid.parms['touchpoint_type'] = 'click'
redirectandroid.parms['attribution_type'] = 'ua'
redirectandroid.send_request3('')
# device_info,is_s2s,turl_id,touchpoint_type,attribution_type满足校验规则,ts不满足规则
def test_at_newclick4():
redirectandroid.parms['ipv4'] = ip
redirectandroid.parms['oaid'] = o
redirectandroid.parms['oaid_md5'] = code_nums(32)
redirectandroid.parms['imei1'] = code_nums(32)
redirectandroid.parms['imei1_md5'] = code_nums(32)
redirectandroid.parms['imei2'] = code_nums(32)
redirectandroid.parms['imei2_md5'] = code_nums(32)
redirectandroid.parms['gaid'] = code_nums(36)
redirectandroid.parms['gaid_md5'] = code_nums(32)
redirectandroid.parms['mac'] = code_nums(17)
redirectandroid.parms['mac_md5'] = code_nums(32)
redirectandroid.parms['android_id'] = code_nums(16)
redirectandroid.parms['android_id_md5'] = code_nums(32)
redirectandroid.parms['is_s2s'] = '1'
redirectandroid.parms['touchpoint_type'] = 'click'
redirectandroid.parms['attribution_type'] = 'ua'
redirectandroid.send_request('33322', '')
# is_s2s,ts,device_info,turl_id,attribution_type,ts,device_info满足校验规则,touchpoint_type不满足规则
def test_at_newclick5():
redirectandroid.parms['ipv4'] = ip
redirectandroid.parms['oaid'] = o
redirectandroid.parms['oaid_md5'] = code_nums(32)
redirectandroid.parms['imei1'] = code_nums(32)
redirectandroid.parms['imei1_md5'] = code_nums(32)
redirectandroid.parms['imei2'] = code_nums(32)
redirectandroid.parms['imei2_md5'] = code_nums(32)
redirectandroid.parms['gaid'] = code_nums(36)
redirectandroid.parms['gaid_md5'] = code_nums(32)
redirectandroid.parms['mac'] = code_nums(17)
redirectandroid.parms['mac_md5'] = code_nums(32)
redirectandroid.parms['android_id'] = code_nums(16)
redirectandroid.parms['android_id_md5'] = code_nums(32)
redirectandroid.parms['is_s2s'] = '1'
redirectandroid.parms['touchpoint_type'] = 'click1'
redirectandroid.parms['attribution_type'] = 'ua'
redirectandroid.send_request3('')
# is_s2s,ts,device_info,turl_id,touchpoint_type,ts,device_info满足校验规则,attribution_type不满足规则
def test_at_newclick6():
redirectandroid.parms['ipv4'] = ip
redirectandroid.parms['oaid'] = o
redirectandroid.parms['oaid_md5'] = code_nums(32)
redirectandroid.parms['imei1'] = code_nums(32)
redirectandroid.parms['imei1_md5'] = code_nums(32)
redirectandroid.parms['imei2'] = code_nums(32)
redirectandroid.parms['imei2_md5'] = code_nums(32)
redirectandroid.parms['gaid'] = code_nums(36)
redirectandroid.parms['gaid_md5'] = code_nums(32)
redirectandroid.parms['mac'] = code_nums(17)
redirectandroid.parms['mac_md5'] = code_nums(32)
redirectandroid.parms['android_id'] = code_nums(16)
redirectandroid.parms['android_id_md5'] = code_nums(32)
redirectandroid.parms['is_s2s'] = '1'
redirectandroid.parms['touchpoint_type'] = 'click'
redirectandroid.parms['attribution_type'] = 'ua1'
redirectandroid.send_request3('')
# 所以设备都合法
def test_at_newclick():
redirectandroid.parms['ipv4'] = ip
redirectandroid.parms['oaid'] = o
redirectandroid.parms['oaid_md5'] = code_nums(32)
redirectandroid.parms['imei1'] = code_nums(32)
redirectandroid.parms['imei1_md5'] = code_nums(32)
redirectandroid.parms['imei2'] = code_nums(32)
redirectandroid.parms['imei2_md5'] = code_nums(32)
redirectandroid.parms['gaid'] = code_nums(36)
redirectandroid.parms['gaid_md5'] = code_nums(32)
redirectandroid.parms['mac'] = code_nums(17)
redirectandroid.parms['mac_md5'] = code_nums(32)
redirectandroid.parms['android_id'] = code_nums(16)
redirectandroid.parms['android_id_md5'] = code_nums(32)
redirectandroid.parms['is_s2s'] = '1'
redirectandroid.parms['touchpoint_type'] = 'click'
redirectandroid.parms['attribution_type'] = 'ua'
redirectandroid.send_request3('')
\ No newline at end of file
...@@ -24,6 +24,20 @@ def computeMD5upper(message): ...@@ -24,6 +24,20 @@ def computeMD5upper(message):
return m.hexdigest().upper() return m.hexdigest().upper()
n = 10
def code_nums(n=6):
ret = ''
for i in range(n):
num = random.randint(0, 9)
letter = chr(random.randint(97, 122))
s = str(random.choice([num, letter]))
ret += s
return ret
def idfacode(): def idfacode():
ret = '' ret = ''
a = "".join(random.sample(string.ascii_letters + string.digits, 8)) a = "".join(random.sample(string.ascii_letters + string.digits, 8))
...@@ -1922,6 +1936,9 @@ def test_impatb9(): ...@@ -1922,6 +1936,9 @@ def test_impatb9():
# 1.传一个激活,google自归因查询为true,2.last touch来自google渠道 # 1.传一个激活,google自归因查询为true,2.last touch来自google渠道
# 归因为google,并通知google # 归因为google,并通知google
# google归因 # google归因
...@@ -1973,8 +1990,8 @@ def test_atbgoogle2(): ...@@ -1973,8 +1990,8 @@ def test_atbgoogle2():
# asa激活 # asa激活
def test_atbgoogle3(): def test_atbgoogle3():
i = idfacode() # i = idfacode()
# i = '3C3FA051-DB2A-4F4F-9154-BC15EF565750' i = '9C3FA051-DB2A-4F4F-9154-BC15EF565773'
v = idfvcode() v = idfvcode()
receiveios.data[0]['device_info']['idfa'] = i receiveios.data[0]['device_info']['idfa'] = i
receiveios.data[0]['timestamp_info']['current_event_time'] = '1659148260199' receiveios.data[0]['timestamp_info']['current_event_time'] = '1659148260199'
...@@ -2023,6 +2040,8 @@ def test_atbgoogle4(): ...@@ -2023,6 +2040,8 @@ def test_atbgoogle4():
print(i) print(i)
#激活中idfa为空 #激活中idfa为空
def test_atbgoogle5(): def test_atbgoogle5():
i2 = idfacode() i2 = idfacode()
...@@ -2049,4 +2068,110 @@ def test_atbgoogle5(): ...@@ -2049,4 +2068,110 @@ def test_atbgoogle5():
# -------------------数据处理与归因逻辑优化----------------------
def test_at_newipv4():
i = idfacode()
v = idfvcode()
redirectios.parms['ipv4'] = ip
redirectios.parms['idfa'] = code_nums(37)
redirectios.parms['idfa_md5'] = code_nums(33)
redirectios.parms['idfv'] = code_nums(37)
redirectios.parms['idfv_md5'] = code_nums(33)
redirectios.parms['is_s2s'] = '1'
redirectios.parms['touchpoint_type'] = 'click'
redirectios.parms['attribution_type'] = 'ua'
redirectios.send_request3('')
time.sleep(3)
receiveios.data[0]['device_info']['idfa'] = i
receiveios.data[0]['device_info']['idfa_md5'] = ''
receiveios.data[0]['device_info']['idfv'] = v
receiveios.data[0]['device_info']['idfv_md5'] = computeMD5(v)
receiveios.data[0]['device_info']['device_id'] = i
receiveios.data[0]['device_info']['device_id_md5'] = ''
receiveios.data[0]['device_info']['device_id_type'] = 'idfa'
receiveios.data[0]['device_info']['device_id_md5_type'] = ''
receiveios.data[0]['device_info']['ipv4'] = ip
receiveios.send_request()
print(i)
def test_at_newidfa():
i = idfacode()
v = idfvcode()
redirectios.parms['ipv4'] = code_nums(129)
redirectios.parms['idfa'] = i
redirectios.parms['idfa_md5'] = code_nums(33)
redirectios.parms['idfv'] = code_nums(37)
redirectios.parms['idfv_md5'] = code_nums(33)
redirectios.parms['is_s2s'] = '1'
redirectios.parms['touchpoint_type'] = 'click'
redirectios.parms['attribution_type'] = 'ua'
redirectios.send_request3('')
time.sleep(3)
receiveios.data[0]['device_info']['idfa'] = i
receiveios.data[0]['device_info']['idfa_md5'] = ''
receiveios.data[0]['device_info']['idfv'] = v
receiveios.data[0]['device_info']['idfv_md5'] = computeMD5(v)
receiveios.data[0]['device_info']['device_id'] = i
receiveios.data[0]['device_info']['device_id_md5'] = ''
receiveios.data[0]['device_info']['device_id_type'] = 'idfa'
receiveios.data[0]['device_info']['device_id_md5_type'] = ''
receiveios.data[0]['device_info']['ipv4'] = ip
receiveios.send_request()
time.sleep(6)
receiveios.data[0]['device_info']['idfa'] = i
receiveios.data[0]['device_info']['idfa_md5'] = ''
receiveios.data[0]['device_info']['idfv'] = v
receiveios.data[0]['device_info']['idfv_md5'] = computeMD5(v)
receiveios.data[0]['device_info']['device_id'] = i
receiveios.data[0]['device_info']['device_id_md5'] = ''
receiveios.data[0]['device_info']['device_id_type'] = 'idfa'
receiveios.data[0]['device_info']['device_id_md5_type'] = ''
receiveios.data[0]['device_info']['ipv4'] = ip
receiveios.data[0]["event_info"]['event_name'] = 'register'
receiveios.data[0]["event_info"]['event_type'] = 'preset'
receiveios.send_request()
print(i)
def test_at_newidfa_md5():
i = idfacode()
i2 = code_nums(32)
v = idfvcode()
redirectios.parms['ipv4'] = code_nums(129)
redirectios.parms['idfa'] = code_nums(37)
redirectios.parms['idfa_md5'] = i2
redirectios.parms['idfv'] = code_nums(37)
redirectios.parms['idfv_md5'] = code_nums(33)
redirectios.parms['is_s2s'] = '1'
redirectios.parms['touchpoint_type'] = 'click'
redirectios.parms['attribution_type'] = 'ua'
redirectios.send_request3('')
time.sleep(3)
receiveios.data[0]['device_info']['idfa'] = i
receiveios.data[0]['device_info']['idfa_md5'] = i2
receiveios.data[0]['device_info']['idfv'] = v
receiveios.data[0]['device_info']['idfv_md5'] = computeMD5(v)
receiveios.data[0]['device_info']['device_id'] = i
receiveios.data[0]['device_info']['device_id_md5'] = i2
receiveios.data[0]['device_info']['device_id_type'] = 'idfa'
receiveios.data[0]['device_info']['device_id_md5_type'] = 'idfa_md5'
receiveios.data[0]['device_info']['ipv4'] = ip
receiveios.send_request()
print(i)
# -------------------------所以设备都非法-------------------------
def test_at_newclick1():
i = idfacode()
v = idfvcode()
redirectios.parms['ipv4'] = code_nums(129)
redirectios.parms['idfa'] = code_nums(37)
redirectios.parms['idfa_md5'] = code_nums(33)
redirectios.parms['idfv'] = code_nums(37)
redirectios.parms['idfv_md5'] = code_nums(33)
redirectios.parms['is_s2s'] = '1'
redirectios.parms['touchpoint_type'] = 'click'
redirectios.parms['attribution_type'] = 'ua'
redirectios.send_request3('')
...@@ -46,7 +46,7 @@ global data ...@@ -46,7 +46,7 @@ global data
data = [ data = [
{ {
"application_info": { "application_info": {
"appkey": "666", "appkey": "111",
"bundleid": "3423232", "bundleid": "3423232",
"app_version": "1", "app_version": "1",
"channel_name": "HUAWEI" "channel_name": "HUAWEI"
...@@ -137,9 +137,9 @@ def send_request(): ...@@ -137,9 +137,9 @@ def send_request():
# 对接se地址 # 对接se地址
# url = 'http://tmtest-se.trackingio.com/receive/tkiov2/sdk' # 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']['install_time'] = int(round(time.time() * 1000))
print(data) print(data)
response = requests.request("POST", url, headers=headers, data=json.dumps(data)) response = requests.request("POST", url, headers=headers, data=json.dumps(data))
...@@ -193,9 +193,9 @@ def send_requestgoogle(): ...@@ -193,9 +193,9 @@ def send_requestgoogle():
# 对接se地址 # 对接se地址
# url = 'http://tmtest-se.trackingio.com/receive/tkiov2/sdk' # 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"
print(data) print(data)
response = requests.request("POST", url, headers=headers, data=json.dumps(data)) response = requests.request("POST", url, headers=headers, data=json.dumps(data))
...@@ -1259,7 +1259,6 @@ def test_event_name1(): ...@@ -1259,7 +1259,6 @@ def test_event_name1():
# event_type为custom # event_type为custom
def test_event_name2(): def test_event_name2():
# lst = []
newList = ['222', 'wwqeWEW', 'We2_32e'] newList = ['222', 'wwqeWEW', 'We2_32e']
for event in newList: for event in newList:
data[0]["event_info"]['event_name'] = event data[0]["event_info"]['event_name'] = event
......
...@@ -193,9 +193,9 @@ def send_requestgoogle(): ...@@ -193,9 +193,9 @@ def send_requestgoogle():
# 对接se地址 # 对接se地址
# url = 'http://tmtest-se.trackingio.com/receive/tkiov2/sdk' # 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']['install_time'] = int(round(time.time() * 1000))
# data[0]['timestamp_info']['current_event_time'] = int(round(time.time() * 1000)) # data[0]['timestamp_info']['current_event_time'] = int(round(time.time() * 1000))
......
...@@ -2,6 +2,7 @@ import requests ...@@ -2,6 +2,7 @@ import requests
import json import json
import time import time
import pytest import pytest
import random
url1 = 'http://tmtest.trackingio.com/receive/turl/3r5K1h9' url1 = 'http://tmtest.trackingio.com/receive/turl/3r5K1h9'
current_time_13 = int(round(time.time() * 1000)) current_time_13 = int(round(time.time() * 1000))
zf35 = '54321422322132132131213133322323233' zf35 = '54321422322132132131213133322323233'
...@@ -12,7 +13,18 @@ zf468 = '1.2.23.3.4.4232.213123.13.23.213.123.123.213.21.321.3.213.12.321.3.21.3 ...@@ -12,7 +13,18 @@ zf468 = '1.2.23.3.4.4232.213123.13.23.213.123.123.213.21.321.3.213.12.321.3.21.3
zf668 = 'Mozilla/5.0 (Linux; U; Android 7.0; zh-cn; Nexus 5X Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko)Version/4.0 Chrome/37.0.0.0 MQQBrowser/7.3 Mobile Safari/537.36Mozilla/5.0 (Linux; U; Android 7.0; zh-cn; Nexus 5X Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko)Version/4.0 Chrome/37.0.0.0 MQQBrowser/7.3 Mobile Safari/537.36Mozilla/5.0 (Linux; U; Android 7.0; zh-cn; Nexus 5X Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko)Version/4.0 Chrome/37.0.0.0 MQQBrowser/7.3 Mobile Safari/537.36Mozilla/5.0 (Linux; U; Android 7.0; zh-cn; Nexus 5X Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko)Version/4.0 Chrome/37.0.0.0 MQQBrowser/7.3 Mobile Safari/537.36' zf668 = 'Mozilla/5.0 (Linux; U; Android 7.0; zh-cn; Nexus 5X Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko)Version/4.0 Chrome/37.0.0.0 MQQBrowser/7.3 Mobile Safari/537.36Mozilla/5.0 (Linux; U; Android 7.0; zh-cn; Nexus 5X Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko)Version/4.0 Chrome/37.0.0.0 MQQBrowser/7.3 Mobile Safari/537.36Mozilla/5.0 (Linux; U; Android 7.0; zh-cn; Nexus 5X Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko)Version/4.0 Chrome/37.0.0.0 MQQBrowser/7.3 Mobile Safari/537.36Mozilla/5.0 (Linux; U; Android 7.0; zh-cn; Nexus 5X Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko)Version/4.0 Chrome/37.0.0.0 MQQBrowser/7.3 Mobile Safari/537.36'
zf256 = '测试广告组名称,广告计划名称,广告创意名称,渠道回调id,渠道回调地址等于256字符广告组名称,广告计划名称,广告创意名称,渠道回调id,渠道回调地址等于256字符广告组名称,广告计划名称,广告创意名称,渠道回调id,渠道回调地址等于256字符广告组名称,广告计划名称fff' zf256 = '测试广告组名称,广告计划名称,广告创意名称,渠道回调id,渠道回调地址等于256字符广告组名称,广告计划名称,广告创意名称,渠道回调id,渠道回调地址等于256字符广告组名称,广告计划名称,广告创意名称,渠道回调id,渠道回调地址等于256字符广告组名称,广告计划名称fff'
global parms global parms
# 生成小写字母加数字组合
n = 10
def code_nums(n=6):
ret = ''
for i in range(n):
num = random.randint(0, 9)
letter = chr(random.randint(97, 122))
s = str(random.choice([num, letter]))
ret += s
return ret
parms = { parms = {
'ry_touchpoint_ts': int(round(time.time() * 1000)), 'ry_touchpoint_ts': int(round(time.time() * 1000)),
# 触点传参时间。is_s2s=1时必传,0时选传。不同渠道有可能传多种格式,详见需求。限制32位字符内。短链传参。 # 触点传参时间。is_s2s=1时必传,0时选传。不同渠道有可能传多种格式,详见需求。限制32位字符内。短链传参。
...@@ -109,7 +121,9 @@ data_temp = json.dumps(parms) ...@@ -109,7 +121,9 @@ data_temp = json.dumps(parms)
# 有短链及参数要求的用该方法 # 有短链及参数要求的用该方法
def send_request(dl, cs): def send_request(dl, cs):
global parms global parms
url1 = 'http://tmtest.trackingio.com/receive/turl/' + dl + cs # url1 = 'http://tmtest.trackingio.com/receive/turl/' + dl + cs
url1 = 'http://tkio-redirect.solar-engine.com/receive/turl/' + dl + cs
response = requests.get(url=url1, params=parms, timeout=10, verify=False) response = requests.get(url=url1, params=parms, timeout=10, verify=False)
print(response.url) print(response.url)
print(response.text) print(response.text)
...@@ -130,14 +144,17 @@ def send_request2(): ...@@ -130,14 +144,17 @@ def send_request2():
def send_request3(cs): def send_request3(cs):
global parms global parms
# 测试 # 测试
url1 = 'http://tmtest.trackingio.com/receive/turl/M7vIrea' + cs # url1 = 'http://tmtest.trackingio.com/receive/turl/qIjQBja' + cs
# 线上 # 线上
# url1 = 'http://tkio-redirect.solar-engine.com/receive/turl/FFNn2aa' + cs url1 = 'http://tkio-redirect.solar-engine.com/receive/turl/FFNn2aa' + cs
parms['ts'] = int(round(time.time() * 1000)) parms['ts'] = int(round(time.time() * 1000))
# parms['ts'] = int(round(time.time()))
parms['ry_touchpoint_ts'] = int(round(time.time() * 1000)) parms['ry_touchpoint_ts'] = int(round(time.time() * 1000))
response = requests.get(url=url1, params=parms, timeout=10, verify=False) response = requests.get(url=url1, params=parms, timeout=10, verify=False)
print(response.url) print(response.url)
print(response.text) print(response.text)
print(response.status_code)
parms = json.loads(data_temp) parms = json.loads(data_temp)
response = json.loads(response.text) response = json.loads(response.text)
return response return response
...@@ -146,8 +163,8 @@ def send_request3(cs): ...@@ -146,8 +163,8 @@ def send_request3(cs):
def send_request4(): def send_request4():
global parms global parms
url1 = 'http://tmtest.trackingio.com/receive/turl/QN3eQba' # url1 = 'http://tmtest.trackingio.com/receive/turl/qIjQBja'
# url1 = 'http://tkio-redirect.solar-engine.com/receive/turl/vMvqE3a' url1 = 'http://tkio-redirect.solar-engine.com/receive/turl/FFNn2aa'
response = requests.get(url=url1, params=parms, timeout=10, verify=False) response = requests.get(url=url1, params=parms, timeout=10, verify=False)
print(response.url) print(response.url)
...@@ -162,8 +179,13 @@ def test_dl(): ...@@ -162,8 +179,13 @@ def test_dl():
re = send_request('33322', '') re = send_request('33322', '')
assert re["status"] == 166 assert re["status"] == 166
# 触点传参时间等于10位
def test_ts10():
parms['ts'] = '1231234567'
re = send_request4()
assert re["status"] == 0
# 触点传参时间为正常 # 触点传参时间为正常13位
def test_ts9(): def test_ts9():
parms['ts'] = current_time_13 parms['ts'] = current_time_13
re = send_request4() re = send_request4()
...@@ -176,6 +198,11 @@ def test_ts8(): ...@@ -176,6 +198,11 @@ def test_ts8():
re = send_request4() re = send_request4()
assert re["status"] == 167 assert re["status"] == 167
# 触点传参时间小于10位
def test_ts8():
parms['ts'] = '16462'
re = send_request4()
assert re["status"] == 167
# 触点传参时间等于13字符,但是包含特殊字符 # 触点传参时间等于13字符,但是包含特殊字符
def test_ts7(): def test_ts7():
...@@ -184,7 +211,7 @@ def test_ts7(): ...@@ -184,7 +211,7 @@ def test_ts7():
assert re["status"] == 167 assert re["status"] == 167
# 触点传参时间等于13字符,但是包含汉 # 触点传参时间等于13字符,但是包含汉
def test_ts0(): def test_ts0():
parms['ts'] = '1测4690943661' parms['ts'] = '1测4690943661'
re = send_request4() re = send_request4()
...@@ -260,7 +287,7 @@ def test_os1(): ...@@ -260,7 +287,7 @@ def test_os1():
def test_os2(): def test_os2():
parms['os'] = zf35 parms['os'] = zf35
re = send_request4() re = send_request4()
assert re["status"] == 115 assert re["status"] == 0
...@@ -295,7 +322,7 @@ def test_model1(): ...@@ -295,7 +322,7 @@ def test_model1():
def test_model2(): def test_model2():
parms['model'] = zf130 parms['model'] = zf130
re = send_request4() re = send_request4()
assert re["status"] == 118 assert re["status"] == 0
# 设备型号=64字符 # 设备型号=64字符
...@@ -313,19 +340,19 @@ def test_ipv41(): ...@@ -313,19 +340,19 @@ def test_ipv41():
assert re["status"] == 0 assert re["status"] == 0
# 用户公网IP v4版本为空,is_s2s为1 # 用户公网IP v4版本为空,is_s2s为1,其他设备无数据
def test_ipv42(): def test_ipv42():
parms['ipv4'] = "" parms['ipv4'] = ""
parms['is_s2s'] = '1' parms['is_s2s'] = '1'
re = send_request4() re = send_request4()
assert re["status"] == 119 assert re["status"] == 221
# 用户公网IP v4版本超过15字符 # 用户公网IP v4版本超过128字符,其他设备无数据
def test_ipv43(): def test_ipv43():
parms['ipv4'] = zf35 parms['ipv4'] = code_nums(129)
re = send_request4() re = send_request4()
assert re["status"] == 119 assert re["status"] == 221
# 用户公网IP v4版本为空,is_s2s为0,取http header中的ip作为ipv4/ua的值 # 用户公网IP v4版本为空,is_s2s为0,取http header中的ip作为ipv4/ua的值
...@@ -343,11 +370,11 @@ def test_ipv45(): ...@@ -343,11 +370,11 @@ def test_ipv45():
send_request2() send_request2()
# 用户公网ipv6版本超过128字符 # # 用户公网ipv6版本超过128字符
def test_ipv61(): def test_ipv61():
parms['ipv6'] = zf468 parms['ipv6'] = code_nums(129)
re = send_request4() re = send_request4()
assert re["status"] == 120 assert re["status"] == 0
# 用户公网ipv6版本为空 # 用户公网ipv6版本为空
...@@ -369,7 +396,7 @@ def test_ua1(): ...@@ -369,7 +396,7 @@ def test_ua1():
parms['ua'] = "" parms['ua'] = ""
parms['is_s2s'] = '1' parms['is_s2s'] = '1'
re = send_request4() re = send_request4()
assert re["status"] == 121 assert re["status"] == 0
# 用户代理信息超过512字符 # 用户代理信息超过512字符
...@@ -377,7 +404,7 @@ def test_ua2(): ...@@ -377,7 +404,7 @@ def test_ua2():
parms['ua'] = zf668 parms['ua'] = zf668
parms['is_s2s'] = '1' parms['is_s2s'] = '1'
re = send_request4() re = send_request4()
assert re["status"] == 121 assert re["status"] == 0
# 用户代理信息为空,is_s2s=0 # 用户代理信息为空,is_s2s=0
...@@ -387,293 +414,293 @@ def test_ua3(): ...@@ -387,293 +414,293 @@ def test_ua3():
send_request2() send_request2()
# OAID超过512字符 # # OAID超过512字符
def test_oaid1(): # def test_oaid1():
parms['oaid'] = zf668 # parms['oaid'] = zf668
re = send_request4() # re = send_request4()
assert re["status"] == 126 # assert re["status"] == 126
#
#
# OAID为空 # # OAID为空
def test_oaid2(): # def test_oaid2():
parms['oaid'] = '' # parms['oaid'] = ''
re = send_request4() # re = send_request4()
assert re["status"] == 0 # assert re["status"] == 0
#
#
# OAID小于512 # # OAID小于512
def test_oaid3(): # def test_oaid3():
parms['oaid'] = '3DEA635F-B24F-434B-833F-4ED028FEAEEF' # parms['oaid'] = '3DEA635F-B24F-434B-833F-4ED028FEAEEF'
re = send_request4() # re = send_request4()
assert re["status"] == 0 # assert re["status"] == 0
#
#
# oaid_md5超过32字符 # # oaid_md5超过32字符
def test_oaid_md51(): # def test_oaid_md51():
parms['oaid_md5'] = zf35 # parms['oaid_md5'] = zf35
re = send_request4() # re = send_request4()
assert re["status"] == 127 # assert re["status"] == 127
#
#
# oaid_md5为空 # # oaid_md5为空
def test_oaid_md52(): # def test_oaid_md52():
parms['oaid_md5'] = '' # parms['oaid_md5'] = ''
re = send_request4() # re = send_request4()
assert re["status"] == 0 # assert re["status"] == 0
#
#
# oaid_md5为32字符 # # oaid_md5为32字符
def test_oaid_md53(): # def test_oaid_md53():
parms['oaid_md5'] = '8e488a40a17aed2f6752f51382a4eafc' # parms['oaid_md5'] = '8e488a40a17aed2f6752f51382a4eafc'
re = send_request4() # re = send_request4()
assert re["status"] == 0 # assert re["status"] == 0
# 各个设备的md5为32字符,大写 # 各个设备的md5为32字符,大写
def test_oaid_md54(): # def test_oaid_md54():
newlist = ['oaid_md5', 'imei1_md5', 'imei2_md5', 'gaid_md5', 'mac_md5', 'android_id_md5'] # newlist = ['oaid_md5', 'imei1_md5', 'imei2_md5', 'gaid_md5', 'mac_md5', 'android_id_md5']
for shebei_md5 in newlist: # for shebei_md5 in newlist:
parms[shebei_md5] = '8E488A40A17AED2F6752F51382A4EAFC' # parms[shebei_md5] = '8E488A40A17AED2F6752F51382A4EAFC'
re = send_request4() # re = send_request4()
assert re["status"] == 0 # assert re["status"] == 0
# imei1超过32字符 # imei1超过32字符
def test_imei11(): # def test_imei11():
parms['imei1'] = zf35 # parms['imei1'] = zf35
re = send_request4() # re = send_request4()
assert re["status"] == 128 # assert re["status"] == 128
#
#
# imei1为空 # # imei1为空
def test_imei12(): # def test_imei12():
parms['imei1'] = '' # parms['imei1'] = ''
re = send_request4() # re = send_request4()
assert re["status"] == 0 # assert re["status"] == 0
#
#
# imei1为正常 # # imei1为正常
def test_imei13(): # def test_imei13():
parms['imei1'] = '8342732742383' # parms['imei1'] = '8342732742383'
re = send_request4() # re = send_request4()
assert re["status"] == 0 # assert re["status"] == 0
#
#
# imei1_md5非32字符 # # imei1_md5非32字符
def test_imei1_md51(): # def test_imei1_md51():
parms['imei1_md5'] = zf35 # parms['imei1_md5'] = zf35
re = send_request4() # re = send_request4()
assert re["status"] == 129 # assert re["status"] == 129
#
#
# imei1_md5为32字符 # # imei1_md5为32字符
def test_imei1_md53(): # def test_imei1_md53():
parms['imei1_md5'] = '8e488a40a17aed2f6752f51382a4eafc' # parms['imei1_md5'] = '8e488a40a17aed2f6752f51382a4eafc'
re = send_request4() # re = send_request4()
assert re["status"] == 0 # assert re["status"] == 0
#
#
# imei1_md5为空 # # imei1_md5为空
def test_imei1_md52(): # def test_imei1_md52():
parms['imei1_md5'] = '' # parms['imei1_md5'] = ''
re = send_request4() # re = send_request4()
assert re["status"] == 0 # assert re["status"] == 0
#
#
# imei2超过32字符 # # imei2超过32字符
def test_imei21(): # def test_imei21():
parms['imei2'] = zf35 # parms['imei2'] = zf35
re = send_request4() # re = send_request4()
assert re["status"] == 130 # assert re["status"] == 130
#
#
# imei2为空 # # imei2为空
def test_imei22(): # def test_imei22():
parms['imei2'] = '' # parms['imei2'] = ''
re = send_request4() # re = send_request4()
assert re["status"] == 0 # assert re["status"] == 0
#
#
# imei2为32字符内 # # imei2为32字符内
def test_imei23(): # def test_imei23():
parms['imei2'] = '8342732742383' # parms['imei2'] = '8342732742383'
re = send_request4() # re = send_request4()
assert re["status"] == 0 # assert re["status"] == 0
#
#
# imei2_md5非32字符 # # imei2_md5非32字符
def test_imei2_md51(): # def test_imei2_md51():
parms['imei2_md5'] = zf35 # parms['imei2_md5'] = zf35
re = send_request4() # re = send_request4()
assert re["status"] == 131 # assert re["status"] == 131
#
#
# imei2_md5为空 # # imei2_md5为空
def test_imei2_md52(): # def test_imei2_md52():
parms['imei2_md5'] = '' # parms['imei2_md5'] = ''
re = send_request4() # re = send_request4()
assert re["status"] == 0 # assert re["status"] == 0
#
#
# imei2_md5为32字符 # # imei2_md5为32字符
def test_imei2_md53(): # def test_imei2_md53():
parms['imei2_md5'] = '8e488a40a17aed2f6752f51382a4eafc' # parms['imei2_md5'] = '8e488a40a17aed2f6752f51382a4eafc'
re = send_request4() # re = send_request4()
assert re["status"] == 0 # assert re["status"] == 0
#
#
# gaid非36字符 # # gaid非36字符
def test_gaid1(): # def test_gaid1():
parms['gaid'] = zf35 # parms['gaid'] = zf35
re = send_request4() # re = send_request4()
assert re["status"] == 132 # assert re["status"] == 132
#
#
# gaid为空 # # gaid为空
def test_gaid2(): # def test_gaid2():
parms['gaid'] = '' # parms['gaid'] = ''
re = send_request4() # re = send_request4()
assert re["status"] == 0 # assert re["status"] == 0
#
#
# gaid为36字符 # # gaid为36字符
def test_gaid3(): # def test_gaid3():
parms['gaid'] = 'B21C5EC5-9921-42FD-AAC5-07A0EB6CF1A0' # parms['gaid'] = 'B21C5EC5-9921-42FD-AAC5-07A0EB6CF1A0'
re = send_request4() # re = send_request4()
assert re["status"] == 0 # assert re["status"] == 0
#
#
# gaid_md5非32字符 # # gaid_md5非32字符
def test_gaid_md51(): # def test_gaid_md51():
parms['gaid_md5'] = zf35 # parms['gaid_md5'] = zf35
re = send_request4() # re = send_request4()
assert re["status"] == 133 # assert re["status"] == 133
#
#
# gaid_md5为空 # # gaid_md5为空
def test_gaid_md52(): # def test_gaid_md52():
parms['gaid_md5'] = '' # parms['gaid_md5'] = ''
re = send_request4() # re = send_request4()
assert re["status"] == 0 # assert re["status"] == 0
#
#
# gaid_md5为32 字符 # # gaid_md5为32 字符
def test_gaid_md53(): # def test_gaid_md53():
parms['gaid_md5'] = '8e488a40a17aed2f6752f51382a4eafc' # parms['gaid_md5'] = '8e488a40a17aed2f6752f51382a4eafc'
re = send_request4() # re = send_request4()
assert re["status"] == 0 # assert re["status"] == 0
#
#
# mac非17个字符 # # mac非17个字符
def test_mac1(): # def test_mac1():
parms['mac'] = "111111" # parms['mac'] = "111111"
re = send_request4() # re = send_request4()
assert re["status"] == 134 # assert re["status"] == 134
# mac为空 # # mac为空
def test_mac2(): # def test_mac2():
parms['mac'] = "" # parms['mac'] = ""
re = send_request4() # re = send_request4()
assert re["status"] == 0 # assert re["status"] == 0
#
#
# mac为17字符 # # mac为17字符
def test_mac3(): # def test_mac3():
parms['mac'] = "08:00:20:0A:8C:6D" # parms['mac'] = "08:00:20:0A:8C:6D"
re = send_request4() # re = send_request4()
assert re["status"] == 0 # assert re["status"] == 0
#
#
# mac_md5非32字符 # # mac_md5非32字符
def test_mac_md51(): # def test_mac_md51():
parms['mac_md5'] = zf35 # parms['mac_md5'] = zf35
re = send_request4() # re = send_request4()
assert re["status"] == 135 # assert re["status"] == 135
#
#
# mac_md5为空 # # mac_md5为空
def test_mac_md52(): # def test_mac_md52():
parms['gaid_md5'] = '' # parms['gaid_md5'] = ''
re = send_request4() # re = send_request4()
assert re["status"] == 0 # assert re["status"] == 0
#
#
# mac_md5 32字符 # # mac_md5 32字符
def test_mac_md53(): # def test_mac_md53():
parms['gaid_md5'] = '8e488a40a17aed2f6752f51382a4eafc' # parms['gaid_md5'] = '8e488a40a17aed2f6752f51382a4eafc'
re = send_request4() # re = send_request4()
assert re["status"] == 0 # assert re["status"] == 0
#
#
# android_id非16字符 # # android_id非16字符
def test_android_id1(): # def test_android_id1():
parms['android_id'] = zf35 # parms['android_id'] = zf35
re = send_request4() # re = send_request4()
assert re["status"] == 136 # assert re["status"] == 136
#
#
# android_id为空 # # android_id为空
def test_android_id2(): # def test_android_id2():
parms['android_id'] = '' # parms['android_id'] = ''
re = send_request4() # re = send_request4()
assert re["status"] == 0 # assert re["status"] == 0
#
#
# android_id为16字符 # # android_id为16字符
def test_android_id3(): # def test_android_id3():
parms['android_id'] = '1a34fc556a43c453' # parms['android_id'] = '1a34fc556a43c453'
re = send_request4() # re = send_request4()
assert re["status"] == 0 # assert re["status"] == 0
#
#
# android_id_md5非32字符 # # android_id_md5非32字符
def test_android_id_md51(): # def test_android_id_md51():
parms['android_id_md5'] = zf35 # parms['android_id_md5'] = zf35
re = send_request4() # re = send_request4()
assert re["status"] == 189 # assert re["status"] == 189
# android_id_md5为空 # # android_id_md5为空
def test_android_id_md52(): # def test_android_id_md52():
parms['android_id_md5'] = '' # parms['android_id_md5'] = ''
re = send_request4() # re = send_request4()
assert re["status"] == 0 # assert re["status"] == 0
#
#
# android_id_md5为32字符 # # android_id_md5为32字符
def test_android_id_md53(): # def test_android_id_md53():
parms['android_id_md5'] = '8e488a40a17aed2f6752f51382a4eafc' # parms['android_id_md5'] = '8e488a40a17aed2f6752f51382a4eafc'
re = send_request4() # re = send_request4()
assert re["status"] == 0 # assert re["status"] == 0
# 短链是安卓,传idfa # 短链是安卓,传idfa
def test_idfa1(): def test_idfa1():
parms['idfa'] = '3DEA635F-B24F-434B-833F-4ED028FEAEEF' parms['idfa'] = '3DEA635F-B24F-434B-833F-4ED028FEAEEF'
re = send_request4() re = send_request4()
assert re["status"] == 115 assert re["status"] == 220
# 短链是安卓,传idfa_md5 # 短链是安卓,传idfa_md5
def test_idfa_md51(): def test_idfa_md51():
parms['idfa_md5'] = '8e488a40a17aed2f6752f51382a4eafc' parms['idfa_md5'] = '8e488a40a17aed2f6752f51382a4eafc'
re = send_request4() re = send_request4()
assert re["status"] == 115 assert re["status"] == 220
# 短链是安卓,传idfv # 短链是安卓,传idfv
def test_idfv1(): def test_idfv1():
parms['idfv'] = '3DEA635F-B24F-434B-833F-4ED028FEAEEF' parms['idfv'] = '3DEA635F-B24F-434B-833F-4ED028FEAEEF'
re = send_request4() re = send_request4()
assert re["status"] == 115 assert re["status"] == 220
# 短链是安卓,传idfv_md5 # 短链是安卓,传idfv_md5
def test_idfv_md51(): def test_idfv_md51():
parms['idfv_md5'] = '8e488a40a17aed2f6752f51382a4eafc' parms['idfv_md5'] = '8e488a40a17aed2f6752f51382a4eafc'
re = send_request4() re = send_request4()
assert re["status"] == 115 assert re["status"] == 220
# oaid","oaid_md5","imei1","imei1_md5","imei2","imei2_md5","mac","mac_md5","mac1","mac1_md5","gaid","gaid_md5"全部为空 # oaid","oaid_md5","imei1","imei1_md5","imei2","imei2_md5","mac","mac_md5","mac1","mac1_md5","gaid","gaid_md5"全部为空
...@@ -718,14 +745,14 @@ def test_ads_data2(): ...@@ -718,14 +745,14 @@ def test_ads_data2():
# 广告账户id,广告组id,广告计划id,广告位id,转化id,广告点击id,广告展示id,广告请求id超过64字符 # 广告账户id,广告组id,广告计划id,广告位id,转化id,广告点击id,广告展示id,广告请求id超过64字符
def test_ads_data3(): def test_ads_data3():
newlist = [{'name': 'account_id', 'status': 168}, newlist = [{'name': 'account_id', 'status': 0},
{'name': 'adgroup_id', 'status': 169}, {'name': 'adgroup_id', 'status': 0},
{'name': 'adplan_id', 'status': 171}, {'name': 'adplan_id', 'status': 0},
{'name': 'placement_id', 'status': 179}, {'name': 'placement_id', 'status': 0},
{'name': 'conversion_id', 'status': 180}, {'name': 'conversion_id', 'status': 0},
{'name': 'click_id', 'status': 181}, {'name': 'click_id', 'status': 0},
{'name': 'impression_id', 'status': 182}, {'name': 'impression_id', 'status': 0},
{'name': 'request_id', 'status': 183}, {'name': 'request_id', 'status': 0},
] ]
for ads_data in newlist: for ads_data in newlist:
parms[ads_data['name']] = zf130 parms[ads_data['name']] = zf130
...@@ -735,11 +762,10 @@ def test_ads_data3(): ...@@ -735,11 +762,10 @@ def test_ads_data3():
# 广告组名称,广告计划名称,广告创意名称,渠道回调id,渠道回调地址超过256字符 # 广告组名称,广告计划名称,广告创意名称,渠道回调id,渠道回调地址超过256字符
def test_ads_data4(): def test_ads_data4():
newlist = [{'name': 'adgroup_name', 'status': 170}, newlist = [{'name': 'adgroup_name', 'status': 0},
{'name': 'adplan_name', 'status': 172}, {'name': 'adplan_name', 'status': 0},
{'name': 'adcreative_name', 'status': 174}, {'name': 'adcreative_name', 'status': 0},
{'name': 'callback_id', 'status': 184}, {'name': 'callback_id', 'status': 0},
{'name': 'callback_url', 'status': 185},
] ]
for ads_data in newlist: for ads_data in newlist:
parms[ads_data['name']] = zf468 parms[ads_data['name']] = zf468
...@@ -799,9 +825,9 @@ def test_ads_data8(): ...@@ -799,9 +825,9 @@ def test_ads_data8():
# 创意类型,广告类型,流量媒体id超过32字符 # 创意类型,广告类型,流量媒体id超过32字符
def test_ads_data9(): def test_ads_data9():
newlist = [{'name': 'adcreative_type', 'status': 175}, newlist = [{'name': 'adcreative_type', 'status': 0},
{'name': 'site_id', 'status': 176}, {'name': 'site_id', 'status': 0},
{'name': 'ad_type', 'status': 178}, {'name': 'ad_type', 'status': 0},
] ]
for ads_data in newlist: for ads_data in newlist:
parms[ads_data['name']] = zf35 parms[ads_data['name']] = zf35
...@@ -851,7 +877,7 @@ def test_custom_params1(): ...@@ -851,7 +877,7 @@ def test_custom_params1():
def test_custom_params2(): def test_custom_params2():
parms['custom_params_1'] = zf35 parms['custom_params_1'] = zf35
re = send_request4() re = send_request4()
assert re["status"] == 186 assert re["status"] == 0
if __name__ == '__main__': if __name__ == '__main__':
......
...@@ -104,9 +104,9 @@ def send_request(cs): ...@@ -104,9 +104,9 @@ def send_request(cs):
def send_request3(cs): def send_request3(cs):
global parms global parms
# 测试 # 测试
# url1 = 'http://tmtest.trackingio.com/receive/turl/uaa6N3a' + 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)) parms['ts'] = int(round(time.time() * 1000))
response = requests.get(url=url1, params=parms, timeout=10, verify=False) response = requests.get(url=url1, params=parms, timeout=10, verify=False)
print(response.url) print(response.url)
...@@ -149,10 +149,10 @@ def test_idfa3(): ...@@ -149,10 +149,10 @@ def test_idfa3():
# idfa非32字符 # idfa非32字符
def test_idfa4(): # def test_idfa4():
parms['idfa'] = zf35 # parms['idfa'] = zf35
re = send_request('') # re = send_request('')
assert re["status"] == 124 # assert re["status"] == 124
# idfa_md5为空 # idfa_md5为空
...@@ -177,10 +177,10 @@ def test_idfa_md53(): ...@@ -177,10 +177,10 @@ def test_idfa_md53():
# idfa_md5非32字符 # idfa_md5非32字符
def test_idfa_md54(): # def test_idfa_md54():
parms['idfa_md5'] = zf35 # parms['idfa_md5'] = zf35
re = send_request('') # re = send_request('')
assert re["status"] == 187 # assert re["status"] == 187
# idfv和idfv_md5同上 # idfv和idfv_md5同上
...@@ -206,10 +206,10 @@ def test_idfv3(): ...@@ -206,10 +206,10 @@ def test_idfv3():
# idfv非32字符 # idfv非32字符
def test_idfv4(): # def test_idfv4():
parms['idfv'] = zf35 # parms['idfv'] = zf35
re = send_request('') # re = send_request('')
assert re["status"] == 125 # assert re["status"] == 125
...@@ -235,10 +235,10 @@ def test_idfv_md53(): ...@@ -235,10 +235,10 @@ def test_idfv_md53():
# idfv_md5非32字符 # idfv_md5非32字符
def test_idfv_md54(): # def test_idfv_md54():
parms['idfv_md5'] = zf35 # parms['idfv_md5'] = zf35
re = send_request('') # re = send_request('')
assert re["status"] == 188 # assert re["status"] == 188
...@@ -246,21 +246,21 @@ def test_idfv_md54(): ...@@ -246,21 +246,21 @@ def test_idfv_md54():
def test_oaid(): def test_oaid():
parms['oaid'] = '3DEA635F-B24F-434B-833F-4ED028FEAEE' parms['oaid'] = '3DEA635F-B24F-434B-833F-4ED028FEAEE'
re = send_request('') re = send_request('')
assert re["status"] == 115 assert re["status"] == 219
# 短链是ios,传oaid_md5 # 短链是ios,传oaid_md5
def test_oaid_md5(): def test_oaid_md5():
parms['oaid_md5'] = '8e488a40a17aed2f6752f51382a4eafc' parms['oaid_md5'] = '8e488a40a17aed2f6752f51382a4eafc'
re = send_request('') re = send_request('')
assert re["status"] == 115 assert re["status"] == 219
# 短链是ios,传imei1 # 短链是ios,传imei1
def test_imei1(): def test_imei1():
parms['imei1'] = '8342732742383' parms['imei1'] = '8342732742383'
re = send_request('') re = send_request('')
assert re["status"] == 115 assert re["status"] == 219
...@@ -268,35 +268,35 @@ def test_imei1(): ...@@ -268,35 +268,35 @@ def test_imei1():
def test_imei1_md5(): def test_imei1_md5():
parms['imei1_md5'] = '8e488a40a17aed2f6752f51382a4eafc' parms['imei1_md5'] = '8e488a40a17aed2f6752f51382a4eafc'
re = send_request('') re = send_request('')
assert re["status"] == 115 assert re["status"] == 219
# 短链是ios,传imei2 # 短链是ios,传imei2
def test_imei2(): def test_imei2():
parms['imei2'] = '8342732742383' parms['imei2'] = '8342732742383'
re = send_request('') re = send_request('')
assert re["status"] == 115 assert re["status"] == 219
# 短链是ios,传imei2_md5 # 短链是ios,传imei2_md5
def test_imei2_md5(): def test_imei2_md5():
parms['imei2_md5'] = '8e488a40a17aed2f6752f51382a4eafc' parms['imei2_md5'] = '8e488a40a17aed2f6752f51382a4eafc'
re = send_request('') re = send_request('')
assert re["status"] == 115 assert re["status"] == 219
# 短链是ios,传gaid # 短链是ios,传gaid
def test_gaid(): def test_gaid():
parms['gaid'] = 'B21C5EC5-9921-42FD-AAC5-07A0EB6CF1A0' parms['gaid'] = 'B21C5EC5-9921-42FD-AAC5-07A0EB6CF1A0'
re = send_request('') re = send_request('')
assert re["status"] == 115 assert re["status"] == 219
# 短链是ios,传gaid_md5 # 短链是ios,传gaid_md5
def test_gaid_md5(): def test_gaid_md5():
parms['gaid_md5'] = '8e488a40a17aed2f6752f51382a4eafc' parms['gaid_md5'] = '8e488a40a17aed2f6752f51382a4eafc'
re = send_request('') re = send_request('')
assert re["status"] == 115 assert re["status"] == 219
...@@ -304,7 +304,7 @@ def test_gaid_md5(): ...@@ -304,7 +304,7 @@ def test_gaid_md5():
def test_mac(): def test_mac():
parms['mac'] = 'B21C5EC5-9921-42FD-AAC5-07A0EB6CF1A0' parms['mac'] = 'B21C5EC5-9921-42FD-AAC5-07A0EB6CF1A0'
re = send_request('') re = send_request('')
assert re["status"] == 115 assert re["status"] == 219
...@@ -312,14 +312,14 @@ def test_mac(): ...@@ -312,14 +312,14 @@ def test_mac():
def test_mac_md5(): def test_mac_md5():
parms['mac_md5'] = '8e488a40a17aed2f6752f51382a4eafc' parms['mac_md5'] = '8e488a40a17aed2f6752f51382a4eafc'
re = send_request('') re = send_request('')
assert re["status"] == 115 assert re["status"] == 219
# 短链是ios,传android_id # 短链是ios,传android_id
def test_android_id(): def test_android_id():
parms['android_id'] = '1a34fc556a43c453' parms['android_id'] = '1a34fc556a43c453'
re = send_request('') re = send_request('')
assert re["status"] == 115 assert re["status"] == 219
...@@ -327,7 +327,7 @@ def test_android_id(): ...@@ -327,7 +327,7 @@ def test_android_id():
def test_android_id_md5(): def test_android_id_md5():
parms['android_id'] = '8e488a40a17aed2f6752f51382a4eafc' parms['android_id'] = '8e488a40a17aed2f6752f51382a4eafc'
re = send_request('') re = send_request('')
assert re["status"] == 115 assert re["status"] == 219
......
...@@ -25,6 +25,8 @@ def computeMD5lower(message): ...@@ -25,6 +25,8 @@ def computeMD5lower(message):
# 生成小写字母加数字组合 # 生成小写字母加数字组合
n = 10 n = 10
def code_nums1(n=6): def code_nums1(n=6):
ret = '' ret = ''
for i in range(n): for i in range(n):
...@@ -34,6 +36,15 @@ def code_nums1(n=6): ...@@ -34,6 +36,15 @@ def code_nums1(n=6):
ret += s ret += s
return ret return ret
# SHA加密
def computesha(message):
sha = hashlib.sha1(message.encode('utf-8'))
encrypts = sha.hexdigest()
print(encrypts)
return encrypts
# **************************************************自定义归因测试用例开始************************************************** # **************************************************自定义归因测试用例开始**************************************************
# -----------------------------------点击激活的imei/imei_MD5,oaid,androidid,mac,ip值相同,归因到imei--------------------- # -----------------------------------点击激活的imei/imei_MD5,oaid,androidid,mac,ip值相同,归因到imei---------------------
# 点击imei=111,oaid=222,androidid=333,mac=444,ip=1.1.1.1激活imei=111,oaid=222,androidid=333,mac=444,ip=1.1.1.1 # 点击imei=111,oaid=222,androidid=333,mac=444,ip=1.1.1.1激活imei=111,oaid=222,androidid=333,mac=444,ip=1.1.1.1
...@@ -386,9 +397,9 @@ def test_ip2(): ...@@ -386,9 +397,9 @@ def test_ip2():
clickandroid.parms['mac'] = '' clickandroid.parms['mac'] = ''
clickandroid.parms['muid'] = '' clickandroid.parms['muid'] = ''
clickandroid.parms['ip'] = ip2 clickandroid.parms['ip'] = ip2
# clickandroid.send_requestandroid('') clickandroid.send_requestandroid('')
clickandroid.send_requestandroid('&preorder=true') # clickandroid.send_requestandroid('&preorder=true')
time.sleep(5) time.sleep(6)
tkioreceiveandroid.data['context']['_deviceid'] = i tkioreceiveandroid.data['context']['_deviceid'] = i
tkioreceiveandroid.data['context']['_imei'] = i tkioreceiveandroid.data['context']['_imei'] = i
tkioreceiveandroid.data['context']['_oaid'] = oaid tkioreceiveandroid.data['context']['_oaid'] = oaid
...@@ -535,9 +546,6 @@ def test_at5(): ...@@ -535,9 +546,6 @@ def test_at5():
print(i) print(i)
def test_hl(): def test_hl():
i = code_nums1(32) i = code_nums1(32)
oaid = code_nums1(15) oaid = code_nums1(15)
...@@ -620,7 +628,7 @@ def test_at6(): ...@@ -620,7 +628,7 @@ def test_at6():
# **************************************************自定义归因测试用例结束************************************************** # **************************************************自定义归因测试用例结束**************************************************
#回流 # 回流
def test_huiliu(): def test_huiliu():
i = code_nums1(32) i = code_nums1(32)
# i = 'jxmqw8bbpj706d812w6q67dfo5pf4428' # i = 'jxmqw8bbpj706d812w6q67dfo5pf4428'
...@@ -668,11 +676,6 @@ def test_huiliu(): ...@@ -668,11 +676,6 @@ def test_huiliu():
print(ip) print(ip)
# 分包 # 分包
def test_fenbao(): def test_fenbao():
i = code_nums1(32) i = code_nums1(32)
...@@ -694,7 +697,7 @@ def test_fenbao(): ...@@ -694,7 +697,7 @@ def test_fenbao():
print(ip) print(ip)
#分包分链接 # 分包分链接
def test_fbflj(): def test_fbflj():
i = code_nums1(32) i = code_nums1(32)
# i = 'jxmqw8bbpj706d812w6q67dfo5pf4428' # i = 'jxmqw8bbpj706d812w6q67dfo5pf4428'
...@@ -723,9 +726,7 @@ def test_fbflj(): ...@@ -723,9 +726,7 @@ def test_fbflj():
print(ip) print(ip)
# deeplink归因
#deeplink归因
def test_deeplink(): def test_deeplink():
i = code_nums1(32) i = code_nums1(32)
# i = 'jxmqw8bbpj706d812w6q67dfo5pf4428' # i = 'jxmqw8bbpj706d812w6q67dfo5pf4428'
...@@ -753,7 +754,7 @@ def test_deeplink(): ...@@ -753,7 +754,7 @@ def test_deeplink():
print(ip) print(ip)
#preorder预约归因 # preorder预约归因
def test_preorder(): def test_preorder():
i = code_nums1(32) i = code_nums1(32)
# i = 'jxmqw8bbpj706d812w6q67dfo5pf4428' # i = 'jxmqw8bbpj706d812w6q67dfo5pf4428'
...@@ -837,7 +838,6 @@ def test_atboaid(): ...@@ -837,7 +838,6 @@ def test_atboaid():
print(i) print(i)
# oaidmd5 # oaidmd5
def test_atboaidmd5(): def test_atboaidmd5():
i = code_nums1(32) i = code_nums1(32)
...@@ -862,8 +862,6 @@ def test_atboaidmd5(): ...@@ -862,8 +862,6 @@ def test_atboaidmd5():
print(i) print(i)
# androidid # androidid
def test_atbandroidid(): def test_atbandroidid():
i = code_nums1(32) i = code_nums1(32)
...@@ -882,7 +880,7 @@ def test_atbandroidid(): ...@@ -882,7 +880,7 @@ def test_atbandroidid():
tkioreceiveandroid.data['context']['_imei'] = i tkioreceiveandroid.data['context']['_imei'] = i
tkioreceiveandroid.data['context']['_androidid'] = androidid tkioreceiveandroid.data['context']['_androidid'] = androidid
tkioreceiveandroid.data['context']['_ip'] = ip tkioreceiveandroid.data['context']['_ip'] = ip
tkioreceiveandroid.data['context']['_apptype'] = 'quickApp' # tkioreceiveandroid.data['context']['_apptype'] = 'quickApp'
tkioreceiveandroid.send_request() tkioreceiveandroid.send_request()
print(i) print(i)
...@@ -910,13 +908,12 @@ def test_atbandroididmd5(): ...@@ -910,13 +908,12 @@ def test_atbandroididmd5():
tkioreceiveandroid.data['context']['_oaid'] = oaid tkioreceiveandroid.data['context']['_oaid'] = oaid
tkioreceiveandroid.data['context']['_androidid'] = androidid tkioreceiveandroid.data['context']['_androidid'] = androidid
tkioreceiveandroid.data['context']['_ip'] = ip tkioreceiveandroid.data['context']['_ip'] = ip
tkioreceiveandroid.data['context']['_apptype'] = 'quickApp' # tkioreceiveandroid.data['context']['_apptype'] = 'quickApp'
tkioreceiveandroid.send_request() tkioreceiveandroid.send_request()
print(i) print(i)
# mac # mac
def test_atbmac(): def test_atbmac():
i = code_nums1(32) i = code_nums1(32)
...@@ -941,7 +938,7 @@ def test_atbmac(): ...@@ -941,7 +938,7 @@ def test_atbmac():
tkioreceiveandroid.data['context']['_androidid'] = androidid tkioreceiveandroid.data['context']['_androidid'] = androidid
tkioreceiveandroid.data['context']['_mac'] = mac tkioreceiveandroid.data['context']['_mac'] = mac
tkioreceiveandroid.data['context']['_ip'] = ip tkioreceiveandroid.data['context']['_ip'] = ip
tkioreceiveandroid.data['context']['_apptype'] = 'quickApp' # tkioreceiveandroid.data['context']['_apptype'] = 'quickApp'
tkioreceiveandroid.send_request() tkioreceiveandroid.send_request()
print(i) print(i)
...@@ -971,16 +968,217 @@ def test_atbmacmd5(): ...@@ -971,16 +968,217 @@ def test_atbmacmd5():
tkioreceiveandroid.data['context']['_androidid'] = androidid tkioreceiveandroid.data['context']['_androidid'] = androidid
tkioreceiveandroid.data['context']['_mac'] = mac tkioreceiveandroid.data['context']['_mac'] = mac
tkioreceiveandroid.data['context']['_ip'] = ip tkioreceiveandroid.data['context']['_ip'] = ip
tkioreceiveandroid.data['context']['_apptype'] = 'quickApp' # tkioreceiveandroid.data['context']['_apptype'] = 'quickApp'
tkioreceiveandroid.send_request()
print(i)
# jointype-归因方式补充
# imei2 纯数字可归因,带字母的设备暂时无法归因
def test_jointypeimei2():
i = '88978987787891'
oaid = code_nums1(15)
mac = code_nums1(32)
androidid = code_nums1(16)
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
clickandroid.parms['imei'] = i
clickandroid.parms['ip'] = ip
clickandroid.send_requestandroid('')
# clickandroid.send_requestandroid('&preorder=true')
time.sleep(6)
tkioreceiveandroid.data['context']['_deviceid'] = i
tkioreceiveandroid.data['context']['_imei2'] = i
tkioreceiveandroid.data['context']['_ip'] = ip
tkioreceiveandroid.send_request()
print(i)
print(ip)
# sha_imei
def test_shaimei():
i = code_nums1(12)
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
clickandroid.parms['imei'] = computesha(i)
clickandroid.parms['ip'] = ip
clickandroid.send_requestandroid('')
time.sleep(6)
tkioreceiveandroid.data['context']['_deviceid'] = i
tkioreceiveandroid.data['context']['_imei'] = i
tkioreceiveandroid.data['context']['_ip'] = ip
tkioreceiveandroid.send_request()
print(i)
print(ip)
# md5_imei2
def test_imei2md5():
i = code_nums1(12)
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
clickandroid.parms['imei'] = computeMD5lower(i)
clickandroid.parms['ip'] = ip
clickandroid.send_requestandroid('')
time.sleep(6)
tkioreceiveandroid.data['context']['_deviceid'] = i
tkioreceiveandroid.data['context']['_imei2'] = i
tkioreceiveandroid.data['context']['_ip'] = ip
tkioreceiveandroid.send_request()
print(i)
print(ip)
# sha_imei2
def test_shaimei2():
i = code_nums1(12)
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
clickandroid.parms['imei'] = computesha(i)
clickandroid.parms['ip'] = ip
clickandroid.send_requestandroid('')
time.sleep(6)
tkioreceiveandroid.data['context']['_deviceid'] = i
tkioreceiveandroid.data['context']['_imei2'] = i
tkioreceiveandroid.data['context']['_ip'] = ip
tkioreceiveandroid.send_request()
print(i)
print(ip)
# meid
# def test_shameid():
# i = code_nums1(12)
# ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
# clickandroid.parms['imei'] = i
# clickandroid.parms['ip'] = ip
# clickandroid.send_requestandroid('')
# time.sleep(6)
# tkioreceiveandroid.data['context']['_deviceid'] = i
# tkioreceiveandroid.data['context']['_meid'] = i
# tkioreceiveandroid.data['context']['_ip'] = ip
# tkioreceiveandroid.send_request()
# print(i)
# print(ip)
# sha_oaid
def test_shaoaid():
i = code_nums1(32)
oaid = code_nums1(15)
mac = code_nums1(32)
androidid = code_nums1(16)
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
clickandroid.parms['imei'] = '111'
clickandroid.parms['imei_MD5'] = ''
clickandroid.parms['oaid'] = ''
clickandroid.parms['oaid_MD5'] = computesha(oaid)
clickandroid.parms['muid'] = ''
clickandroid.parms['ip'] = ip
clickandroid.send_requestandroid('')
time.sleep(6)
tkioreceiveandroid.data['context']['_deviceid'] = i
tkioreceiveandroid.data['context']['_imei'] = i
tkioreceiveandroid.data['context']['_oaid'] = oaid
tkioreceiveandroid.data['context']['_ip'] = ip
tkioreceiveandroid.send_request()
print(i)
# sha_android_id
def test_sha_android_id():
i = code_nums1(32)
oaid = code_nums1(15)
mac = code_nums1(32)
androidid = code_nums1(16)
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
clickandroid.parms['imei'] = '111'
clickandroid.parms['imei_MD5'] = ''
clickandroid.parms['androidid'] = computesha(androidid)
clickandroid.parms['muid'] = ''
clickandroid.parms['ip'] = ip
clickandroid.send_requestandroid('')
time.sleep(6)
tkioreceiveandroid.data['context']['_deviceid'] = i
tkioreceiveandroid.data['context']['_imei'] = i
tkioreceiveandroid.data['context']['_androidid'] = androidid
tkioreceiveandroid.data['context']['_ip'] = ip
tkioreceiveandroid.send_request() tkioreceiveandroid.send_request()
print(i)
# no_colon_mac
def test_no_colon_mac():
i = code_nums1(32)
oaid = code_nums1(15)
mac_colon = '00:09:5B:EC:EE:F3'
no_colon_mac= '00095BECEEF3'
androidid = code_nums1(16)
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
clickandroid.parms['imei'] = '111'
clickandroid.parms['imei_MD5'] = '222'
clickandroid.parms['oaid'] = ''
clickandroid.parms['oaid_MD5'] = ''
clickandroid.parms['androidid'] = ''
clickandroid.parms['androidid_MD5'] = '343'
clickandroid.parms['mac'] = no_colon_mac
clickandroid.parms['muid'] = ''
clickandroid.parms['ip'] = ip
clickandroid.send_requestandroid('')
time.sleep(6)
tkioreceiveandroid.data['context']['_deviceid'] = i
tkioreceiveandroid.data['context']['_imei'] = i
tkioreceiveandroid.data['context']['_oaid'] = oaid
tkioreceiveandroid.data['context']['_androidid'] = androidid
tkioreceiveandroid.data['context']['_mac'] = mac_colon
tkioreceiveandroid.data['context']['_ip'] = ip
# tkioreceiveandroid.data['context']['_apptype'] = 'quickApp'
tkioreceiveandroid.send_request()
print(i) print(i)
# md5_no_colon_mac
def test_md5_no_colon_mac():
i = code_nums1(32)
oaid = code_nums1(15)
mac_colon = '00:09:5B:EC:EE:F3'
no_colon_mac= '00095BECEEF3'
androidid = code_nums1(16)
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
clickandroid.parms['imei'] = '111'
clickandroid.parms['imei_MD5'] = '222'
clickandroid.parms['oaid'] = ''
clickandroid.parms['oaid_MD5'] = ''
clickandroid.parms['androidid'] = ''
clickandroid.parms['androidid_MD5'] = '343'
clickandroid.parms['mac'] = computeMD5lower(no_colon_mac)
clickandroid.parms['muid'] = ''
clickandroid.parms['ip'] = ip
clickandroid.send_requestandroid('')
time.sleep(6)
tkioreceiveandroid.data['context']['_deviceid'] = i
tkioreceiveandroid.data['context']['_imei'] = i
tkioreceiveandroid.data['context']['_oaid'] = oaid
tkioreceiveandroid.data['context']['_androidid'] = androidid
tkioreceiveandroid.data['context']['_mac'] = mac_colon
tkioreceiveandroid.data['context']['_ip'] = ip
# tkioreceiveandroid.data['context']['_apptype'] = 'quickApp'
tkioreceiveandroid.send_request()
print(i)
def test_TEST(): def test_TEST():
i = code_nums1(32) i = code_nums1(32)
oaid = code_nums1(15) oaid = code_nums1(15)
...@@ -1016,41 +1214,32 @@ def test_TEST(): ...@@ -1016,41 +1214,32 @@ def test_TEST():
print(ip) print(ip)
# 点击存储验证 # 点击存储验证
def test_click(): def test_click():
mget = 'b34100cdf5b586774e5d4dd4357c7b17:' mget = 'b34100cdf5b586774e5d4dd4357c7b17:'
# mget = '' # mget = ''
# i = code_nums1(32) # i = code_nums1(32)
i = 'CM471A7C6B21F0369B5US8J8UV8P8SVD' i = 'CM471A7C6B21F0369B5US8J8UV8P8SVD'
# mdi = '5DF50CF4C9E6BD1B5A42561C637DAEBE' # mdi = '5DF50CF4C9E6BD1B5A42561C637DAEBE'
oaid = code_nums1(15) oaid = code_nums1(15)
# oaid = 'S96Z9721656VRIP' # oaid = 'S96Z9721656VRIP'
# mdo = '8127886D006BB678853E0DC918E688CA' # mdo = '8127886D006BB678853E0DC918E688CA'
mac = code_nums1(32) mac = code_nums1(32)
# mac = 'A05Q8GGG6572D861XEIB0869S56Q1VD7' # mac = 'A05Q8GGG6572D861XEIB0869S56Q1VD7'
# androidid = code_nums1(16) # androidid = code_nums1(16)
androidid='95J247G5ZQYM81Z8' androidid = '95J247G5ZQYM81Z8'
# mda = 'EB802DB3386F1CB75975F4D58667F70F' # mda = 'EB802DB3386F1CB75975F4D58667F70F'
muid = code_nums1(16) muid = code_nums1(16)
# muid='LGSM6ND543Q9JSZU' # muid='LGSM6ND543Q9JSZU'
# ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff))) # ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
ip = '58.243.117.39' ip = '58.243.117.39'
clickandroid.parms['click_time'] = '1663309200' clickandroid.parms['click_time'] = '1663309200'
# clickandroid.parms['imei'] = i # clickandroid.parms['imei'] = i
# clickandroid.parms['imei_MD5'] = computeMD5upper(i) # clickandroid.parms['imei_MD5'] = computeMD5upper(i)
...@@ -1076,8 +1265,7 @@ def test_click(): ...@@ -1076,8 +1265,7 @@ def test_click():
# print("androidid: "+mget+androidid.upper()) # print("androidid: "+mget+androidid.upper())
# print("androidid_MD5: "+mget+computeMD5upper(androidid)) # print("androidid_MD5: "+mget+computeMD5upper(androidid))
# print("muid: "+mget+muid.upper()) # print("muid: "+mget+muid.upper())
print("ip: "+mget+ip) print("ip: " + mget + ip)
def test_install(): def test_install():
...@@ -1098,6 +1286,3 @@ def test_install(): ...@@ -1098,6 +1286,3 @@ def test_install():
tkioreceiveandroid.data['context']['_ip'] = ip tkioreceiveandroid.data['context']['_ip'] = ip
tkioreceiveandroid.send_request() tkioreceiveandroid.send_request()
print(i) print(i)
...@@ -42,17 +42,31 @@ def computeMD5upper(message): ...@@ -42,17 +42,31 @@ def computeMD5upper(message):
return m.hexdigest().upper() return m.hexdigest().upper()
# md5加密转xiao # md5加密转
def computeMD5lower(message): def computeMD5lower(message):
m = hashlib.md5() m = hashlib.md5()
m.update(message.encode(encoding='utf-8')) m.update(message.encode(encoding='utf-8'))
return m.hexdigest() return m.hexdigest()
# SHA加密
def computesha(message):
sha = hashlib.sha1(message.encode('utf-8'))
encrypts = sha.hexdigest()
print(encrypts)
return encrypts
# 生成小写字母加数字组合 # 生成小写字母加数字组合
n = 10 n = 10
def test_sha1():
computesha("111")
def code_nums1(n=6): def code_nums1(n=6):
ret = '' ret = ''
for i in range(n): for i in range(n):
...@@ -194,9 +208,9 @@ def test_at6(): ...@@ -194,9 +208,9 @@ def test_at6():
clickios.parms['ip'] = ip clickios.parms['ip'] = ip
clickios.parms['caid1'] = caid clickios.parms['caid1'] = caid
clickios.parms['caid2'] = caid2 clickios.parms['caid2'] = caid2
# clickios.send_requestandroid('') clickios.send_requestandroid('')
clickios.send_requestandroid('&preorder=true') # clickios.send_requestandroid('&preorder=true')
time.sleep(5) time.sleep(6)
tkioreceive.data['context']['_deviceid'] = i2 tkioreceive.data['context']['_deviceid'] = i2
tkioreceive.data['context']['_idfa'] = i2 tkioreceive.data['context']['_idfa'] = i2
tkioreceive.data['context']['_ip'] = ip tkioreceive.data['context']['_ip'] = ip
...@@ -218,8 +232,8 @@ def test_at7(): ...@@ -218,8 +232,8 @@ def test_at7():
clickios.parms['ip'] = ip clickios.parms['ip'] = ip
clickios.parms['caid1'] = caid clickios.parms['caid1'] = caid
clickios.parms['caid2'] = caid2 clickios.parms['caid2'] = caid2
# clickios.send_requestandroid('') clickios.send_requestandroid('')
clickios.send_requestandroid('&preorder=true') # clickios.send_requestandroid('&preorder=true')
time.sleep(5) time.sleep(5)
tkioreceive.data['context']['_deviceid'] = i2 tkioreceive.data['context']['_deviceid'] = i2
...@@ -243,8 +257,8 @@ def test_at8(): ...@@ -243,8 +257,8 @@ def test_at8():
clickios.parms['ip'] = ip clickios.parms['ip'] = ip
clickios.parms['caid1'] = caid clickios.parms['caid1'] = caid
clickios.parms['caid2'] = caid2 clickios.parms['caid2'] = caid2
# clickios.send_requestandroid('') clickios.send_requestandroid('')
clickios.send_requestandroid('&preorder=true') # clickios.send_requestandroid('&preorder=true')
time.sleep(5) time.sleep(5)
tkioreceive.data['context']['_deviceid'] = i2 tkioreceive.data['context']['_deviceid'] = i2
...@@ -268,8 +282,8 @@ def test_at9(): ...@@ -268,8 +282,8 @@ def test_at9():
clickios.parms['ip'] = ip clickios.parms['ip'] = ip
clickios.parms['caid1'] = caid clickios.parms['caid1'] = caid
clickios.parms['caid2'] = caid2 clickios.parms['caid2'] = caid2
# clickios.send_requestandroid('') clickios.send_requestandroid('')
clickios.send_requestandroid('&preorder=true') # clickios.send_requestandroid('&preorder=true')
time.sleep(6) time.sleep(6)
tkioreceive.data['context']['_deviceid'] = i2 tkioreceive.data['context']['_deviceid'] = i2
...@@ -347,7 +361,7 @@ def test_at12(): ...@@ -347,7 +361,7 @@ def test_at12():
clickios.parms['caid1'] = caid clickios.parms['caid1'] = caid
clickios.parms['caid2'] = caid2 clickios.parms['caid2'] = caid2
clickios.send_requestandroid('') clickios.send_requestandroid('')
time.sleep(5) time.sleep(6)
tkioreceive.data['context']['_deviceid'] = i2 tkioreceive.data['context']['_deviceid'] = i2
tkioreceive.data['context']['_idfa'] = i2 tkioreceive.data['context']['_idfa'] = i2
tkioreceive.data['context']['_ip'] = ip tkioreceive.data['context']['_ip'] = ip
...@@ -370,8 +384,8 @@ def test_at13(): ...@@ -370,8 +384,8 @@ def test_at13():
clickios.parms['ip'] = ip clickios.parms['ip'] = ip
clickios.parms['caid1'] = computeMD5upper(caid) clickios.parms['caid1'] = computeMD5upper(caid)
clickios.parms['caid2'] = caid2 clickios.parms['caid2'] = caid2
# clickios.send_requestandroid('') clickios.send_requestandroid('')
clickios.send_requestandroid('&preorder=true') # clickios.send_requestandroid('&preorder=true')
time.sleep(6) time.sleep(6)
tkioreceive.data['context']['_deviceid'] = i2 tkioreceive.data['context']['_deviceid'] = i2
...@@ -448,8 +462,8 @@ def test_at16(): ...@@ -448,8 +462,8 @@ def test_at16():
clickios.parms['ip'] = ip clickios.parms['ip'] = ip
clickios.parms['caid1'] = '' clickios.parms['caid1'] = ''
clickios.parms['caid2'] = caid clickios.parms['caid2'] = caid
# clickios.send_requestandroid('') clickios.send_requestandroid('')
clickios.send_requestandroid('&preorder=true') # clickios.send_requestandroid('&preorder=true')
time.sleep(6) time.sleep(6)
tkioreceive.data['context']['_deviceid'] = i2 tkioreceive.data['context']['_deviceid'] = i2
...@@ -511,7 +525,7 @@ def test_at18(): ...@@ -511,7 +525,7 @@ def test_at18():
clickios.parms['caid1'] = '' clickios.parms['caid1'] = ''
clickios.parms['caid2'] = caid clickios.parms['caid2'] = caid
clickios.send_requestandroid('') clickios.send_requestandroid('')
time.sleep(5) time.sleep(6)
tkioreceive.data['context']['_deviceid'] = i2 tkioreceive.data['context']['_deviceid'] = i2
tkioreceive.data['context']['_idfa'] = i2 tkioreceive.data['context']['_idfa'] = i2
tkioreceive.data['context']['_ip'] = ip tkioreceive.data['context']['_ip'] = ip
...@@ -541,7 +555,7 @@ def test_at19(): ...@@ -541,7 +555,7 @@ def test_at19():
clickios.parms['caid1'] = '' clickios.parms['caid1'] = ''
clickios.parms['caid2'] = caid clickios.parms['caid2'] = caid
clickios.send_requestandroid('') clickios.send_requestandroid('')
time.sleep(5) time.sleep(6)
tkioreceive.data['context']['_deviceid'] = i2 tkioreceive.data['context']['_deviceid'] = i2
tkioreceive.data['context']['_idfa'] = i2 tkioreceive.data['context']['_idfa'] = i2
tkioreceive.data['context']['_ip'] = ip tkioreceive.data['context']['_ip'] = ip
...@@ -929,4 +943,59 @@ def test_firstclick(): ...@@ -929,4 +943,59 @@ def test_firstclick():
print(i) print(i)
print(i2) print(i2)
print(ip1) print(ip1)
print(ip2) print(ip2)
\ No newline at end of file
# jointype-归因方式补充
# sha idfa 暂时无法归因
def test_sha():
i = idfacode()
i2 = idfacode()
caid = code_nums1(32)
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
clickios.parms['idfa_MD5'] = computesha(i)
clickios.parms['idfa'] = ''
clickios.parms['ip'] = ip
clickios.parms['caid1'] = caid
clickios.send_requestandroid('')
# clickios.send_requestandroid('&preorder=true')
time.sleep(6)
tkioreceive.data['context']['_deviceid'] = i
tkioreceive.data['context']['_idfa'] = i
tkioreceive.data['context']['_ip'] = ip
tkioreceive.data['context']['_caid'] = caid
tkioreceive.send_request()
print(i)
print(ip)
# no_line_idfa
def test_no_line_idfa():
i = 'ZRNDIT5KU5OHWXAUVZL5AQWOTIRB2CY2'
i2 = 'ZRNDIT5K-U5OH-WXAU-VZL5-AQWOTIRB2CY2'
caid = code_nums1(36)
ip1 = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
clickios.parms['idfa'] = i
clickios.parms['ip'] = ip1
clickios.parms['caid1'] = caid
clickios.send_requestandroid('')
# clickios.send_requestandroid('&preorder=true')
time.sleep(6)
tkioreceive.data['context']['_deviceid'] = i2
tkioreceive.data['context']['_idfa'] = i2
tkioreceive.data['context']['_ip'] = ip1
tkioreceive.data['context']['_caid'] = caid
tkioreceive.send_request()
print(i)
print(ip1)
...@@ -34,11 +34,12 @@ parms = { ...@@ -34,11 +34,12 @@ parms = {
def send_requestandroid(hc): def send_requestandroid(hc):
url1 = 'http://52.80.137.106:8083/tkio/MfyEzya?noredirect=true' + hc # url1 = 'http://52.80.137.106:8083/tkio/MfyEzya?noredirect=true' + hc
# url1 = 'http://uri6.com/tkio/26rQJza?noredirect=true' + hc url1 = 'http://uri6.com/tkio/bmEJrea?noredirect=true' + hc
response = requests.get(url=url1, params=parms, timeout=10, verify=False) response = requests.get(url=url1, params=parms, timeout=10, verify=False)
print(response.text) print(response.text)
print(url1) print(url1)
print(parms)
return response return response
......
...@@ -33,7 +33,7 @@ parms = { ...@@ -33,7 +33,7 @@ parms = {
def send_requestandroid(hc): def send_requestandroid(hc):
# url1 = 'http://52.80.137.106:8083/tkio/F3QVrqa?noredirect=true' + hc # url1 = 'http://52.80.137.106:8083/tkio/F3QVrqa?noredirect=true' + hc
url1 = 'http://uri6.com/tkio/uUFN7fa?noredirect=true' + hc url1 = 'http://uri6.com/tkio/ayERVfa?noredirect=true' + hc
response = requests.get(url=url1, params=parms, timeout=10, verify=False) response = requests.get(url=url1, params=parms, timeout=10, verify=False)
print(response.text) print(response.text)
print(url1) print(url1)
......
...@@ -8,7 +8,7 @@ import hashlib ...@@ -8,7 +8,7 @@ import hashlib
data = { data = {
"what": "install", "what": "install",
"appid": "b21d0385ad8371de9e90b3e969a5d0c6", "appid": "60763edf19602c0fa27b967c282fe805",
"context": { "context": {
"_deviceid": "", "_deviceid": "",
"_idfa": "", "_idfa": "",
...@@ -42,9 +42,9 @@ data_temp = json.dumps(data) ...@@ -42,9 +42,9 @@ data_temp = json.dumps(data)
def send_request(): def send_request():
global data global data
# 测试 # 测试
url = "http://52.80.137.106:8080/receive/tkio/install" # url = "http://52.80.137.106:8080/receive/tkio/install"
# 线上 # 线上
# url = "http://log.trackingio.com/receive/tkio/install" url = "http://log.trackingio.com/receive/tkio/install"
data['context']['install_time'] = int(round(time.time() * 1000)) data['context']['install_time'] = int(round(time.time() * 1000))
print(data) print(data)
response = requests.request("POST", url, headers=headers, data=json.dumps(data)) response = requests.request("POST", url, headers=headers, data=json.dumps(data))
......
...@@ -8,7 +8,7 @@ import hashlib ...@@ -8,7 +8,7 @@ import hashlib
data = { data = {
"what": "install", "what": "install",
"appid": "5b0e99269160e67ef8e560716221e142", "appid": "894ef23136b0a6bb039800aa217f2729",
"context": { "context": {
"_deviceid": "", "_deviceid": "",
"_imei": "", "_imei": "",
...@@ -42,11 +42,11 @@ data_temp = json.dumps(data) ...@@ -42,11 +42,11 @@ data_temp = json.dumps(data)
def send_request(): def send_request():
global data global data
# 测试 # 测试
url = "http://52.80.137.106:8080/receive/tkio/install" # url = "http://52.80.137.106:8080/receive/tkio/install"
# url = "http://52.80.137.106:8080/receive/tkio/event" # url = "http://52.80.137.106:8080/receive/tkio/event"
# 线上 # 线上
# url = "http://log.trackingio.com/receive/tkio/install" url = "http://log.trackingio.com/receive/tkio/install"
data['context']['install_time'] = int(round(time.time() * 1000)) data['context']['install_time'] = int(round(time.time() * 1000))
print(data) print(data)
response = requests.request("POST", url, headers=headers, data=json.dumps(data)) response = requests.request("POST", url, headers=headers, data=json.dumps(data))
......
...@@ -7,37 +7,39 @@ import requests ...@@ -7,37 +7,39 @@ import requests
appkey = '74131e54a444aa5a8597e73b646cba77' appkey = '74131e54a444aa5a8597e73b646cba77'
# cid # cid
cid = '21164' cid = '21075'
# surl # surl
surl = 'mAbeqaa' surl = 'J32uqia'
# URL = 'http://52.80.137.106:8083/tkio/EjABBra?noredirect=true' 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/BVjQf2a?noredirect=true' # 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)) impressionid = ''.join(str(random.choice(range(10))) for _ in range(12))
requestid = ''.join(str(random.choice(range(10))) for _ in range(12)) requestid = ''.join(str(random.choice(range(10))) for _ in range(12))
s = 0 s = 0
for _ in range(1): for index in range(40):
# 随机生成12为数组 # 随机生成12为数组
# i = ''.join(str(random.choice(range(10))) for _ in range(28)) i = ''.join(str(random.choice(range(10))) for _ in range(28))
i = '2539452844786738942022514936' # i = '2539452844786738942022514936'
# 随机生成ip # 随机生成ip
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff))) ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
# # 打开 # 打开
# allEvent().openxiaochengxu(i, ip, cid, surl, appkey, impressionid, requestid) allEvent().openxiaochengxu(i, ip, cid, surl, appkey, impressionid, requestid)
# # # time.sleep(5) # # # time.sleep(5)
# # # #pv # # # #pv
# # # allEvent().pviaochengxu(i,ip,cid,surl,appkey) # # # allEvent().pviaochengxu(i,ip,cid,surl,appkey)
# # # # # #离开 # # # # # #离开
# # # # allEvent().hidechengxu(i,ip,cid,surl,appkey) # # # # allEvent().hidechengxu(i,ip,cid,surl,appkey)
# # # time.sleep(2) # # # time.sleep(2)
allEvent().regedchengxu(i, ip, cid, surl, appkey) # allEvent().regedchengxu(i, ip, cid, surl, appkey)
# # # time.sleep(2) # # # time.sleep(2)
# allEvent().loggedinchengxu(i, ip, cid, surl, appkey) # allEvent().loggedinchengxu(i, ip, cid, surl, appkey)
# time.sleep(2) # time.sleep(2)
# allEvent().paymentchengxu(i,ip,cid,surl,appkey) # allEvent().paymentchengxu(i,ip,cid,surl,appkey)
# time.sleep(2) time.sleep(2)
# allEvent().eventchengxu(i,ip,cid,surl,appkey) num = index + 1
event = 'event_' + str(num)
allEvent().eventchengxu(i,ip,cid,surl,appkey,event)
# for index in range(1): # for index in range(1):
...@@ -48,9 +50,9 @@ for _ in range(1): ...@@ -48,9 +50,9 @@ for _ in range(1):
# # print("开始时间"+datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')) # # print("开始时间"+datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S'))
# # 随机生成12为数组 # # 随机生成12为数组
# # impressionid = ''.join(str(random.choice(range(10))) for _ in range(12)) # # impressionid = ''.join(str(random.choice(range(10))) for _ in range(12))
# impressionid = '111222334455' # impressionid = '111222334455667788'
# # requestid = ''.join(str(random.choice(range(10))) for _ in range(12)) # # requestid = ''.join(str(random.choice(range(10))) for _ in range(12))
# requestid = '1112223344' # requestid = '111222334455'
# accountid = ''.join(str(random.choice(range(10))) for _ in range(12)) # accountid = ''.join(str(random.choice(range(10))) for _ in range(12))
# # 随机生成ip # # 随机生成ip
# ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff))) # ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
...@@ -58,14 +60,16 @@ for _ in range(1): ...@@ -58,14 +60,16 @@ for _ in range(1):
# try: # try:
# parms = { # parms = {
# 'click_time': str(round(time.time() * 1000)), # 'click_time': str(round(time.time() * 1000)),
# # 'click_time': '1663309200', # # 'click_time': '1667308011000',
# 'wechat_openid': i,
# 'click_id':'123456789',
# 'accountid': accountid, # 'accountid': accountid,
# 'ip': ip, # 'ip': ip,
# 'impression_id': impressionid, # 'impression_id': impressionid,
# 'request_id': requestid, # 'request_id': requestid,
# '_ry_adgroup_id': '333', # '_ry_adgroup_id': '222',
# '_ry_adplan_id': "333", # '_ry_adplan_id': "222",
# '_ry_adcreative_id': '333' # '_ry_adcreative_id': '222'
# } # }
# # timeout可以超时四秒 # # timeout可以超时四秒
# # verify = False # # verify = False
...@@ -106,7 +110,7 @@ for _ in range(1): ...@@ -106,7 +110,7 @@ for _ in range(1):
# # #离开 # # #离开
# time.sleep(2) # time.sleep(2)
# allEvent().hidechengxu(i,ip,cid,surl,appkey) # allEvent().hidechengxu(i,ip,cid,surl,appkey)
# time.sleep(200) # time.sleep(2)
# allEvent().regedchengxu(i, ip, cid, surl, appkey) # allEvent().regedchengxu(i, ip, cid, surl, appkey)
# time.sleep(2) # time.sleep(2)
# allEvent().loggedinchengxu(i,ip,cid,surl,appkey) # allEvent().loggedinchengxu(i,ip,cid,surl,appkey)
......
...@@ -44,18 +44,19 @@ class allEvent: ...@@ -44,18 +44,19 @@ class allEvent:
"_openid": i, "_openid": i,
"_campaignid": surl, "_campaignid": surl,
"_sceneid": "434444", "_sceneid": "434444",
"gdt_vid": '1112223344', "gdt_vid": '1112223344556677',
# "ry_adgroup_id": "111", "_ry_adgroup_id": "111",
# "ry_adplan_id": "111", "_ry_adplan_id": "111",
# "ry_adcreative_id": "111", "_ry_adcreative_id": "111",
# "accountid":"123456", "accountid":"123456",
'impression_id': impressionid, 'impression_id': impressionid,
'request_id': requestid, 'request_id': requestid,
# 投放广告详情-头条 # 投放广告详情-头条
"advertiser_id": "ccc", "advertiser_id": "ccc",
"ad_id": "ccc", "ad_id": "ccc",
"creative_id": "ccc", "creative_id": "ccc",
"_apptype": "wx" "_apptype": "wg"
}, },
"where": "launch", "where": "launch",
# "when": when, # "when": when,
...@@ -102,7 +103,7 @@ class allEvent: ...@@ -102,7 +103,7 @@ class allEvent:
"_openid": i, "_openid": i,
"_campaignid": surl, "_campaignid": surl,
"_sceneid": "unknown", "_sceneid": "unknown",
"_apptype": "wx", "_apptype": "wg",
"_num_pages": "5", "_num_pages": "5",
"_duration": "10" "_duration": "10"
}, },
...@@ -126,7 +127,8 @@ class allEvent: ...@@ -126,7 +127,8 @@ class allEvent:
"_openid": i, "_openid": i,
"_campaignid": surl, "_campaignid": surl,
"_sceneid": "unknown", "_sceneid": "unknown",
"_apptype": "wx", # wg-小游戏
"_apptype": "wg",
"_num_pages": "5", "_num_pages": "5",
"_duration": "10" "_duration": "10"
}, },
...@@ -153,7 +155,7 @@ class allEvent: ...@@ -153,7 +155,7 @@ class allEvent:
"_openid": i, "_openid": i,
"_campaignid": surl, "_campaignid": surl,
"_sceneid": "unknown", "_sceneid": "unknown",
"_apptype": "wx", "_apptype": "wg",
"_num_pages": "5", "_num_pages": "5",
'_transactionid': transactionid, '_transactionid': transactionid,
'_paymenttype': paymenttype, '_paymenttype': paymenttype,
...@@ -198,9 +200,9 @@ class allEvent: ...@@ -198,9 +200,9 @@ class allEvent:
print(p.text) print(p.text)
# 自定义事件 # 自定义事件
def eventchengxu(self, i, IP, cid, surl, appid): def eventchengxu(self, i, IP, cid, surl, appid,event):
s = json.dumps({ s = json.dumps({
"what": "event_10", "what": event,
"appid": appid, "appid": appid,
"context": { "context": {
"_cid": cid, "_cid": cid,
......
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