diff --git a/scapy/contrib/gtp.uts b/scapy/contrib/gtp.uts index 515f53c148acb31ac6849418602453b1e8b137bc..007ad764357ab2d7288cf5beeb56af739a7b2d3e 100644 --- a/scapy/contrib/gtp.uts +++ b/scapy/contrib/gtp.uts @@ -1,10 +1,14 @@ # GTP unit tests # # Type the following command to launch start the tests: -# $ sudo bash test/run_tests -t scapy/contrib/gtp.uts -F +# $ test/run_tests -P "load_contrib('gtp')" -t scapy/contrib/gtp.uts + GTPv1 = GTPCreatePDPContextRequest(), basic instanciation -gtp = IP(str(IP()/UDP(sport=2123)/GTPHeader(teid=2807)/GTPCreatePDPContextRequest())) -str(gtp) == 'E\x00\x00(\x00\x01\x00\x00@\x11|\xc2\x7f\x00\x00\x01\x7f\x00\x00\x01\x08K\x08K\x00\x14\xb4"2\x10\x00\x04\x00\x00\n\xf7\x00\x00\x00\x00' +gtp = IP()/UDP(dport=2123)/GTPHeader(teid=2807)/GTPCreatePDPContextRequest() +gtp.dport == 2123 and gtp.teid == 2807 and len(gtp.IE_list) == 5 + += GTPCreatePDPContextRequest(), basic dissection +random.seed(2807) +str(gtp) == "E\x00\x00O\x00\x01\x00\x00@\x11|\x9b\x7f\x00\x00\x01\x7f\x00\x00\x01\x08K\x08K\x00;\xb9{2\x10\x00+\x00\x00\n\xf7\x8d\x9e\x00\x00\x10\xa6\xb2\xdc.\x14\t\x85\x00\x04\x83~:N\x85\x00\x04\xe0^\x96\xe7\x87\x00\x0fRmhqmG3QvzvsT3G"