测试错误后,直通
This commit is contained in:
@@ -7,10 +7,10 @@ if __name__ == '__main__':
|
|||||||
detect.tc1()
|
detect.tc1()
|
||||||
detect.tc2()
|
detect.tc2()
|
||||||
|
|
||||||
errorPkt.tc1()
|
#add_tc_2_runlist(errorPkt.tc1())
|
||||||
add_tc_2_runlist(errorPkt.tc2())
|
#add_tc_2_runlist(errorPkt.tc2())
|
||||||
errorPkt.tc3()
|
errorPkt.tc3()
|
||||||
errorPkt.tc4()
|
add_tc_2_runlist(errorPkt.tc4())
|
||||||
|
|
||||||
base.tc1()
|
base.tc1()
|
||||||
base.tc2()
|
base.tc2()
|
||||||
@@ -20,7 +20,7 @@ if __name__ == '__main__':
|
|||||||
base.tc6()
|
base.tc6()
|
||||||
base.tc7()
|
base.tc7()
|
||||||
base.tc8()
|
base.tc8()
|
||||||
add_tc_2_runlist(base.tc9())
|
#add_tc_2_runlist(base.tc9())
|
||||||
|
|
||||||
broadcast.tc1()
|
broadcast.tc1()
|
||||||
broadcast.tc2()
|
broadcast.tc2()
|
||||||
|
|||||||
@@ -5,16 +5,17 @@ import random
|
|||||||
def tc1():
|
def tc1():
|
||||||
random.seed(int(time.time() * 1000))
|
random.seed(int(time.time() * 1000))
|
||||||
genPkt = GenPkt()
|
genPkt = GenPkt()
|
||||||
|
|
||||||
|
gen_file_def = "error_pkt_tc01"
|
||||||
|
sm_idx = 0
|
||||||
|
tc_des = "发送错误的数据包,导致设备出问题,出问题的设备在没有恢复的情况下,采取直通状态。\\n" \
|
||||||
|
+ "清除中断后,错误消失,出问题的设备恢复正常。"
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#>>>>>>错误的数据包1
|
#>>>>>>错误的数据包1
|
||||||
genPkt.clean()
|
genPkt.clean()
|
||||||
|
|
||||||
data = list()
|
data = [0x57, 0x17, 0xfd, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x40]
|
||||||
'''
|
|
||||||
for i in range(128):
|
|
||||||
data.append(random.randint(0, 255))
|
|
||||||
'''
|
|
||||||
data = data + [0x57, 0x17, 0xfd, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x40]
|
|
||||||
for i in range(64):
|
for i in range(64):
|
||||||
data.append(random.randint(0, 255))
|
data.append(random.randint(0, 255))
|
||||||
data = data + [0, 0, 0x00, 0x0c, 0x00, 0xc0, 0x00, 0x40]
|
data = data + [0, 0, 0x00, 0x0c, 0x00, 0xc0, 0x00, 0x40]
|
||||||
@@ -23,14 +24,49 @@ def tc1():
|
|||||||
data = data + [0, 0]
|
data = data + [0, 0]
|
||||||
|
|
||||||
genPkt.setPkt(2, data)
|
genPkt.setPkt(2, data)
|
||||||
gen_file_def = "err_pkt1"
|
|
||||||
sm_idx = 0
|
genPkt.addBeforeExc(genTcStartFrameCode(gen_file_def, tc_des))
|
||||||
|
|
||||||
genPkt.addAfterExc(genWriteTransLenCode(gen_file_def, sm_idx)
|
genPkt.addAfterExc(genWriteTransLenCode(gen_file_def, sm_idx)
|
||||||
+genWriteTransPktCode(gen_file_def, sm_idx)
|
+genWriteTransPktCode(gen_file_def, sm_idx)
|
||||||
+genTrgTransPktCode(gen_file_def, sm_idx)
|
+genTrgTransPktCode(gen_file_def, sm_idx)
|
||||||
+genReadAckPktCode(gen_file_def, sm_idx))
|
+genReadAckPktCode(gen_file_def, sm_idx)
|
||||||
|
)
|
||||||
genPkt.gen("./generated/shin/%s.vh"%(gen_file_def, ), 1)
|
genPkt.gen("./generated/shin/%s.vh"%(gen_file_def, ), 1)
|
||||||
|
|
||||||
|
genPkt.clean()
|
||||||
|
gen_file_def_ap = gen_file_def + "_rw"
|
||||||
|
sm_idx = 0
|
||||||
|
|
||||||
|
data = [0, ] * 32
|
||||||
|
genPkt.addSubPkt(0, 0, 0, 0xd, 32, data)
|
||||||
|
|
||||||
|
clear_int = [0xff, 0xff, 0xff, 0xff]
|
||||||
|
|
||||||
|
genPkt.addAfterExc(genWriteTransLenCode(gen_file_def_ap, sm_idx)
|
||||||
|
+genWriteTransPktCode(gen_file_def_ap, sm_idx)
|
||||||
|
+genTrgTransPktCode(gen_file_def_ap, sm_idx)
|
||||||
|
+genReadAckPktCode(gen_file_def_ap, sm_idx)
|
||||||
|
|
||||||
|
+genIFRwDataCode(1, 0x74, False, 4)
|
||||||
|
+genIFRwDataCode(2, 0x74, False, 4)
|
||||||
|
+genIFRwDataCode(3, 0x74, False, 4)
|
||||||
|
+genIFRwDataCode(4, 0x74, False, 4)
|
||||||
|
|
||||||
|
+genIFRwDataCode(1, 0x78, True, 4, clear_int)
|
||||||
|
+genIFRwDataCode(2, 0x78, True, 4, clear_int)
|
||||||
|
+genIFRwDataCode(3, 0x78, True, 4, clear_int)
|
||||||
|
+genIFRwDataCode(4, 0x78, True, 4, clear_int)
|
||||||
|
|
||||||
|
+genIFRwDataCode(1, 0x74, False, 4)
|
||||||
|
+genIFRwDataCode(2, 0x74, False, 4)
|
||||||
|
+genIFRwDataCode(3, 0x74, False, 4)
|
||||||
|
+genIFRwDataCode(4, 0x74, False, 4)
|
||||||
|
|
||||||
|
+genTcEndFrameCode(gen_file_def))
|
||||||
|
|
||||||
|
genPkt.gen("./generated/shin/%s.vh"%(gen_file_def, ), 1, True, gen_file_def_ap)
|
||||||
|
|
||||||
return gen_file_def
|
return gen_file_def
|
||||||
|
|
||||||
|
|
||||||
@@ -38,10 +74,10 @@ def tc2():
|
|||||||
random.seed(int(time.time() * 1000))
|
random.seed(int(time.time() * 1000))
|
||||||
genPkt = GenPkt()
|
genPkt = GenPkt()
|
||||||
|
|
||||||
gen_file_def = "errorpkt_tc02"
|
gen_file_def = "error_pkt_tc02"
|
||||||
sm_idx = 0
|
sm_idx = 0
|
||||||
tc_des = "发送错误的数据包\\n" \
|
tc_des = "发送错误的数据包,导致设备出问题,出问题的设备在没有恢复的情况下,采取直通状态。\\n" \
|
||||||
+ "通过嗅探包、设置顺序地址命令等重新建立网络。"
|
+ "清除中断后,错误消失,出问题的设备恢复正常。"
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#>>>>>>错误的数据包2
|
#>>>>>>错误的数据包2
|
||||||
@@ -134,15 +170,55 @@ def tc4():
|
|||||||
genPkt = GenPkt()
|
genPkt = GenPkt()
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#>>>>>>错误的嗅探数据包
|
#>>>>>>错误的嗅探数据包
|
||||||
|
gen_file_def = "error_pkt_tc04"
|
||||||
|
sm_idx = 0
|
||||||
|
tc_des = "发送错误的数据包,导致设备出问题,出问题的设备在没有恢复的情况下,采取直通状态。\\n" \
|
||||||
|
+ "清除中断后,错误消失,出问题的设备恢复正常。"
|
||||||
|
|
||||||
genPkt.clean()
|
genPkt.clean()
|
||||||
genPkt.setPkt(2, [0, 0, 0, 0])
|
genPkt.setPkt(2, [0, 0, 0, 0])
|
||||||
gen_file_def = "detect_err_pkt"
|
|
||||||
sm_idx = 0
|
sm_idx = 0
|
||||||
|
|
||||||
|
genPkt.addBeforeExc(genTcStartFrameCode(gen_file_def, tc_des))
|
||||||
|
|
||||||
genPkt.addAfterExc(genWriteTransLenCode(gen_file_def, sm_idx)
|
genPkt.addAfterExc(genWriteTransLenCode(gen_file_def, sm_idx)
|
||||||
+genWriteTransPktCode(gen_file_def, sm_idx)
|
+genWriteTransPktCode(gen_file_def, sm_idx)
|
||||||
+genTrgTransPktCode(gen_file_def, sm_idx)
|
+genTrgTransPktCode(gen_file_def, sm_idx)
|
||||||
+genReadAckPktCode(gen_file_def, sm_idx))
|
+genReadAckPktCode(gen_file_def, sm_idx))
|
||||||
|
|
||||||
genPkt.gen("./generated/shin/%s.vh"%(gen_file_def, ), 1)
|
genPkt.gen("./generated/shin/%s.vh"%(gen_file_def, ), 1)
|
||||||
|
|
||||||
|
genPkt.clean()
|
||||||
|
|
||||||
|
gen_file_def_ap = gen_file_def + "_rw"
|
||||||
|
sm_idx = 0
|
||||||
|
|
||||||
|
data = [0,] * 32
|
||||||
|
genPkt.addSubPkt(0, 0, 0, 0xd, 32, data)
|
||||||
|
|
||||||
|
clear_int = [0xff, 0xff, 0xff, 0xff]
|
||||||
|
|
||||||
|
genPkt.addAfterExc(genWriteTransLenCode(gen_file_def_ap, sm_idx)
|
||||||
|
+genWriteTransPktCode(gen_file_def_ap, sm_idx)
|
||||||
|
+genTrgTransPktCode(gen_file_def_ap, sm_idx)
|
||||||
|
+genReadAckPktCode(gen_file_def_ap, sm_idx)
|
||||||
|
+genIFRwDataCode(1, 0x74, False, 4)
|
||||||
|
+genIFRwDataCode(2, 0x74, False, 4)
|
||||||
|
+genIFRwDataCode(3, 0x74, False, 4)
|
||||||
|
+genIFRwDataCode(4, 0x74, False, 4)
|
||||||
|
|
||||||
|
+genIFRwDataCode(1, 0x78, True, 4, clear_int)
|
||||||
|
+genIFRwDataCode(2, 0x78, True, 4, clear_int)
|
||||||
|
+genIFRwDataCode(3, 0x78, True, 4, clear_int)
|
||||||
|
+genIFRwDataCode(4, 0x78, True, 4, clear_int)
|
||||||
|
|
||||||
|
+genIFRwDataCode(1, 0x74, False, 4)
|
||||||
|
+genIFRwDataCode(2, 0x74, False, 4)
|
||||||
|
+genIFRwDataCode(3, 0x74, False, 4)
|
||||||
|
+genIFRwDataCode(4, 0x74, False, 4)
|
||||||
|
|
||||||
|
+genTcEndFrameCode(gen_file_def))
|
||||||
|
genPkt.gen("./generated/shin/%s.vh"%(gen_file_def, ), 1, True, gen_file_def_ap)
|
||||||
|
|
||||||
return gen_file_def
|
return gen_file_def
|
||||||
|
|||||||
Reference in New Issue
Block a user