summaryrefslogtreecommitdiffstats
path: root/scripts/automation/trex_control_plane/stl/services/scapy_server/unit_tests/test_scapy_service.py
diff options
context:
space:
mode:
authorHanoh Haim <hhaim@cisco.com>2016-12-19 16:06:38 +0200
committerHanoh Haim <hhaim@cisco.com>2016-12-19 16:06:38 +0200
commit5741208336a7ff0262eefd82a80551cf37bf576a (patch)
treed56bf6651085f369276804fcfab89437b22c6ea1 /scripts/automation/trex_control_plane/stl/services/scapy_server/unit_tests/test_scapy_service.py
parent4d81618514ca2a22d777abe22ff49d44e70569e0 (diff)
parentb75910ef6bb781b0d28eb253758bbe65d573b768 (diff)
Merge branch 'payload_gen_total_size_ether_chksum' of git://github.com/kisel/trex-core into field_engine
Diffstat (limited to 'scripts/automation/trex_control_plane/stl/services/scapy_server/unit_tests/test_scapy_service.py')
-rw-r--r--scripts/automation/trex_control_plane/stl/services/scapy_server/unit_tests/test_scapy_service.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/scripts/automation/trex_control_plane/stl/services/scapy_server/unit_tests/test_scapy_service.py b/scripts/automation/trex_control_plane/stl/services/scapy_server/unit_tests/test_scapy_service.py
index 7491ccb4..e1094a79 100644
--- a/scripts/automation/trex_control_plane/stl/services/scapy_server/unit_tests/test_scapy_service.py
+++ b/scripts/automation/trex_control_plane/stl/services/scapy_server/unit_tests/test_scapy_service.py
@@ -6,6 +6,7 @@ import re
from basetest import *
RE_MAC = "^([0-9A-Fa-f]{2}:){5}([0-9A-Fa-f]{2})$"
+ether_chksum_sz = 4 # this chksum will be added automatically(outside of scapy/packet editor)
TEST_MAC_1 = "10:10:10:10:10:10"
# Test scapy structure
@@ -78,7 +79,7 @@ def test_build_Raw():
])
assert(str(pkt[Raw].load == "hi"))
-def test_build_fixed_pkt_size_bytes_gen():
+def test_build_fixed_pkt_size_template_gen_64():
pkt = build_pkt_get_scapy([
layer_def("Ether"),
layer_def("IP"),
@@ -91,9 +92,9 @@ def test_build_fixed_pkt_size_bytes_gen():
})
])
print(len(pkt))
- assert(len(pkt) == 64)
+ assert(len(pkt) == 64 - ether_chksum_sz)
-def test_build_fixed_pkt_size_bytes_gen():
+def test_build_fixed_pkt_size_bytes_gen_256():
pkt = build_pkt_get_scapy([
layer_def("Ether"),
layer_def("IP"),
@@ -105,7 +106,7 @@ def test_build_fixed_pkt_size_bytes_gen():
})
])
print(len(pkt))
- assert(len(pkt) == 256)
+ assert(len(pkt) == 256 - ether_chksum_sz)
def test_get_all():
service.get_all(v_handler)