From de41b3ce0845f1456aa95a6de1e610b88cfa49c0 Mon Sep 17 00:00:00 2001
From: Pierre LALET <pierre.lalet@cea.fr>
Date: Thu, 21 Jan 2016 01:01:54 +0100
Subject: [PATCH] Add unit tests for Sebek

---
 scapy/contrib/sebek.uts | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 scapy/contrib/sebek.uts

diff --git a/scapy/contrib/sebek.uts b/scapy/contrib/sebek.uts
new file mode 100644
index 00000000..de1be6b9
--- /dev/null
+++ b/scapy/contrib/sebek.uts
@@ -0,0 +1,30 @@
+# Sebek layer unit tests
+#
+# Type the following command to launch start the tests:
+# $ test/run_tests -P "load_contrib('sebek')" -t scapy/contrib/sebek.uts
+
++ Sebek protocol
+
+= Layer binding 1
+pkt = IP() / UDP() / SebekHead() / SebekV1()
+pkt.sport == pkt.dport == 1101 and pkt[SebekHead].version == 1
+
+= Packet dissection 1
+pkt = IP(str(pkt))
+pkt.sport == pkt.dport == 1101 and pkt[SebekHead].version == 1
+
+= Layer binding 2
+pkt = IP() / UDP() / SebekHead() / SebekV2Sock()
+pkt.sport == pkt.dport == 1101 and pkt[SebekHead].version == 2 and pkt[SebekHead].type ==2
+
+= Packet dissection 2
+pkt = IP(str(pkt))
+pkt.sport == pkt.dport == 1101 and pkt[SebekHead].version == 2 and pkt[SebekHead].type ==2
+
+= Layer binding 3
+pkt = IPv6()/UDP()/SebekHead()/SebekV3()
+pkt.sport == pkt.dport == 1101 and pkt[SebekHead].version == 3
+
+= Packet dissection 3
+pkt = IPv6(str(pkt))
+pkt.sport == pkt.dport == 1101 and pkt[SebekHead].version == 3
-- 
GitLab