test add teredo example, fix scapy ipv6 header
authorHanoh Haim <[email protected]>
Sun, 14 Feb 2016 09:34:03 +0000 (11:34 +0200)
committerHanoh Haim <[email protected]>
Sun, 14 Feb 2016 09:34:03 +0000 (11:34 +0200)
scripts/automation/regression/unit_tests/functional_tests/scapy_pkt_builder_test.py
scripts/automation/regression/unit_tests/functional_tests/stl_basic_tests.py
scripts/external_libs/scapy-2.3.1/scapy/layers/inet6.py

index dcebecd..147b3ad 100644 (file)
@@ -72,6 +72,21 @@ class CTRexPktBuilderSanitySCapy_Test(pkt_bld_general_test.CGeneralPktBld_Test):
                     'split_by_var': ''}
         )
 
+
+
+    def test_simple_teredo(self):
+
+        pkt =  Ether()/IP(src="16.0.0.1",dst="48.0.0.1")/UDP(dport=3797,sport=3544)/IPv6(src="2001:0:4137:9350:8000:f12a:b9c8:2815",dst="2001:4860:0:2001::68")/UDP(dport=12,sport=1025)/ICMPv6Unknown()
+
+        pkt.build();
+        p_utl=CTRexScapyPktUtl(pkt);
+
+        assert_equal( p_utl.get_field_offet_by_str("IPv6.src"), (50,16) )
+        assert_equal( p_utl.get_field_offet_by_str("IPv6.dst"), (66,16) )
+
+
+
+
     def test_simple_scapy_vlan(self):
 
         py='5'*(9)
index 1aec417..fd372ae 100644 (file)
@@ -148,7 +148,7 @@ class CStlBasic_Test(functional_general_test.CGeneralFunctional_Test):
 
     def test_stl_profiles (self):
 
-        p0 = [ 
+        p = [ 
             ["udp_1pkt_1mac_override.py","-m 1 -l 50",True],
             ["syn_attack.py","-m 1 -l 50",False],               # can't compare random now 
             ["udp_1pkt_1mac.py","-m 1 -l 50",True],
@@ -177,11 +177,12 @@ class CStlBasic_Test(functional_general_test.CGeneralFunctional_Test):
             ["udp_1pkt_pcap_relative_path.py","-m 1 -l 3",True],
             ["udp_1pkt_tuple_gen_split.py","-m 1 -c 2 -l 100",True],
             ["udp_1pkt_range_clients_split.py","-m 1 -c 2 -l 100",True],
-            ["udp_1pkt_vxlan.py","-m 1 -c 1 -l 17",True]
+            ["udp_1pkt_vxlan.py","-m 1 -c 1 -l 17",True],
+            ["udp_1pkt_ipv6_in_ipv4.py","-m 1 -c 1 -l 17",True]
           ];
 
 
-        p1  = [ ["udp_1pkt_vxlan.py","-m 1 -c 1 -l 17",True] ]
+        p1  = [ ["udp_1pkt_ipv6_in_ipv4.py","-m 1 -c 1 -l 17",True] ]
         
 
         for obj in p:
index 19dda97..46cd85e 100644 (file)
@@ -355,9 +355,9 @@ class IPv6(_IPv6GuessPayload, Packet, IPTools):
                     ShortField("plen", None),
                     ByteEnumField("nh", 59, ipv6nh),
                     ByteField("hlim", 64),
-                    IP6Field("dst", "::2"),
+                    IP6Field("src", "::2"),
                     #SourceIP6Field("src", "dst"), # dst is for src @ selection
-                    IP6Field("src", "::1") ]
+                    IP6Field("dst", "::1") ]
 
     def route(self):
         dst = self.dst