summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorOle Troan <ot@cisco.com>2019-10-18 15:22:56 +0200
committerNeale Ranns <nranns@cisco.com>2019-10-21 10:51:00 +0000
commit127fbec4d3ec1c3d8d09c753dd7644155a7e63d5 (patch)
tree12797d3b70d3838c28935fc1bf068566b4dcfe94 /test
parent79ba25d40248ceba3efb232952282678b5a7f910 (diff)
ip: reassembly tests python3 support
Type: fix Signed-off-by: Ole Troan <ot@cisco.com> Change-Id: I990d8d521c128e8d4f482e30b3a49cbc11b632d1
Diffstat (limited to 'test')
-rw-r--r--test/test_reassembly.py29
1 files changed, 13 insertions, 16 deletions
diff --git a/test/test_reassembly.py b/test/test_reassembly.py
index 85fb97dee07..ace11f73d3d 100644
--- a/test/test_reassembly.py
+++ b/test/test_reassembly.py
@@ -210,12 +210,12 @@ class TestIPv4Reassembly(VppTestCase):
IP(id=1000, src=self.src_if.remote_ip4,
dst=self.dst_if.remote_ip4) /
UDP(sport=1234, dport=5678) /
- Raw("X" * 1000))
+ Raw(b"X" * 1000))
p2 = (Ether(dst=self.src_if.local_mac, src=self.src_if.remote_mac) /
IP(id=1001, src=self.src_if.remote_ip4,
dst=self.dst_if.remote_ip4) /
UDP(sport=1234, dport=5678) /
- Raw("X" * 1000))
+ Raw(b"X" * 1000))
frags = fragment_rfc791(p1, 200) + fragment_rfc791(p2, 500)
self.pg_enable_capture()
@@ -228,11 +228,9 @@ class TestIPv4Reassembly(VppTestCase):
def test_5737(self):
""" fragment length + ip header size > 65535 """
self.vapi.cli("clear errors")
- raw = ('E\x00\x00\x88,\xf8\x1f\xfe@\x01\x98\x00\xc0\xa8\n-\xc0\xa8\n'
- '\x01\x08\x00\xf0J\xed\xcb\xf1\xf5Test-group: IPv4.IPv4.ipv4-'
- 'message.Ethernet-Payload.IPv4-Packet.IPv4-Header.Fragment-Of'
- 'fset; Test-case: 5737')
-
+ raw = b'''E\x00\x00\x88,\xf8\x1f\xfe@\x01\x98\x00\xc0\xa8\n-\xc0\xa8\n\
+\x01\x08\x00\xf0J\xed\xcb\xf1\xf5Test-group: IPv4.IPv4.ipv4-message.\
+Ethernet-Payload.IPv4-Packet.IPv4-Header.Fragment-Offset; Test-case: 5737'''
malformed_packet = (Ether(dst=self.src_if.local_mac,
src=self.src_if.remote_mac) /
IP(raw))
@@ -240,20 +238,19 @@ class TestIPv4Reassembly(VppTestCase):
IP(id=1000, src=self.src_if.remote_ip4,
dst=self.dst_if.remote_ip4) /
UDP(sport=1234, dport=5678) /
- Raw("X" * 1000))
+ Raw(b"X" * 1000))
valid_fragments = fragment_rfc791(p, 400)
+ counter = "/err/ip4-full-reassembly-feature/malformed packets"
+ error_counter = self.statistics.get_err_counter(counter)
self.pg_enable_capture()
self.src_if.add_stream([malformed_packet] + valid_fragments)
self.pg_start()
self.dst_if.get_capture(1)
self.logger.debug(self.vapi.ppcli("show error"))
- self.assert_packet_counter_equal("ip4-full-reassembly-feature", 1)
- # TODO remove above, uncomment below once clearing of counters
- # is supported
- # self.assert_packet_counter_equal(
- # "/err/ip4-full-reassembly-feature/malformed packets", 1)
+ self.assertEqual(self.statistics.get_err_counter(counter),
+ error_counter + 1)
def test_44924(self):
""" compress tiny fragments """
@@ -300,14 +297,14 @@ class TestIPv4Reassembly(VppTestCase):
IP(id=7, len=21, frag=1, ttl=64,
src=self.src_if.remote_ip4,
dst=self.dst_if.remote_ip4) /
- Raw(load='\x08')),
+ Raw(load=b'\x08')),
]
p = (Ether(dst=self.src_if.local_mac, src=self.src_if.remote_mac) /
IP(id=1000, src=self.src_if.remote_ip4,
dst=self.dst_if.remote_ip4) /
UDP(sport=1234, dport=5678) /
- Raw("X" * 1000))
+ Raw(b"X" * 1000))
valid_fragments = fragment_rfc791(p, 400)
self.pg_enable_capture()
@@ -1090,7 +1087,7 @@ class TestIPv6Reassembly(VppTestCase):
IPv6(src=self.src_if.remote_ip6,
dst=self.dst_if.remote_ip6) /
UDP(sport=1234, dport=5678) /
- Raw("X" * 1000))
+ Raw(b"X" * 1000))
frags = fragment_rfc8200(p, 1, 300) + fragment_rfc8200(p, 2, 500)
self.pg_enable_capture()
teral.String.Doc */ .highlight .s2 { color: #e6db74 } /* Literal.String.Double */ .highlight .se { color: #ae81ff } /* Literal.String.Escape */ .highlight .sh { color: #e6db74 } /* Literal.String.Heredoc */ .highlight .si { color: #e6db74 } /* Literal.String.Interpol */ .highlight .sx { color: #e6db74 } /* Literal.String.Other */ .highlight .sr { color: #e6db74 } /* Literal.String.Regex */ .highlight .s1 { color: #e6db74 } /* Literal.String.Single */ .highlight .ss { color: #e6db74 } /* Literal.String.Symbol */ .highlight .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #a6e22e } /* Name.Function.Magic */ .highlight .vc { color: #f8f8f2 } /* Name.Variable.Class */ .highlight .vg { color: #f8f8f2 } /* Name.Variable.Global */ .highlight .vi { color: #f8f8f2 } /* Name.Variable.Instance */ .highlight .vm { color: #f8f8f2 } /* Name.Variable.Magic */ .highlight .il { color: #ae81ff } /* Literal.Number.Integer.Long */ } @media (prefers-color-scheme: light) { .highlight .hll { background-color: #ffffcc } .highlight .c { color: #888888 } /* Comment */ .highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */ .highlight .k { color: #008800; font-weight: bold } /* Keyword */ .highlight .ch { color: #888888 } /* Comment.Hashbang */ .highlight .cm { color: #888888 } /* Comment.Multiline */ .highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */ .highlight .cpf { color: #888888 } /* Comment.PreprocFile */ .highlight .c1 { color: #888888 } /* Comment.Single */ .highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */ .highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ .highlight .ge { font-style: italic } /* Generic.Emph */ .highlight .gr { color: #aa0000 } /* Generic.Error */ .highlight .gh { color: #333333 } /* Generic.Heading */ .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
menuentry "Install s35-t28-sut1" {
    linux    /casper/ubuntu-focal-amd64/vmlinuz ip=dhcp interface=ac:1f:6b:ac:d7:c0 url=https://releases.ubuntu.com/20.04.2/ubuntu-20.04.2-live-server-amd64.iso autoinstall ds=nocloud-net\;s=http://10.30.51.28:8081/ubuntu_focal_amd64/ac:1f:6b:ac:d7:c0/ --- console=ttyS0,115200n8 quiet
    initrd   /casper/ubuntu-focal-amd64/initrd
}