def test_not_implemented_subtype(self):
     not_implemented_buf = pack(slow._PACK_STR,
                                SLOW_SUBTYPE_MARKER) + self.buf[1:]
     (instance, nexttype, last) = slow.parser(not_implemented_buf)
     assert instance is None
     assert nexttype is None
     assert last is not None
Beispiel #2
0
 def test_not_implemented_subtype(self):
     not_implemented_buf = pack(
         slow._PACK_STR, SLOW_SUBTYPE_MARKER) + self.buf[1:]
     (instance, nexttype, last) = slow.parser(not_implemented_buf)
     assert None == instance
     assert None == nexttype
     assert None != last
Beispiel #3
0
 def test_invalid_terminator_length(self):
     invalid_lacv = copy.deepcopy(self.l)
     invalid_lacv.terminator_length = self.trm_len
     invalid_buf = invalid_lacv.serialize()
     slow.parser(invalid_buf)
Beispiel #4
0
 def test_invalid_terminator_tag(self):
     invalid_lacv = copy.deepcopy(self.l)
     invalid_lacv.terminator_tag = 0x04
     invalid_buf = invalid_lacv.serialize()
     slow.parser(invalid_buf)
Beispiel #5
0
 def test_invalid_collector_length(self):
     invalid_lacv = copy.deepcopy(self.l)
     invalid_lacv.collector_length = 20
     invalid_buf = invalid_lacv.serialize()
     slow.parser(invalid_buf)
Beispiel #6
0
 def test_invalid_collector_tag(self):
     invalid_lacv = copy.deepcopy(self.l)
     invalid_lacv.collector_tag = 0x00
     invalid_buf = invalid_lacv.serialize()
     slow.parser(invalid_buf)
Beispiel #7
0
 def test_invalid_partner_length(self):
     invalid_lacv = copy.deepcopy(self.l)
     invalid_lacv.partner_length = 0
     invalid_buf = invalid_lacv.serialize()
     slow.parser(invalid_buf)
Beispiel #8
0
 def test_invalid_partner_tag(self):
     invalid_lacv = copy.deepcopy(self.l)
     invalid_lacv.partner_tag = 0x01
     invalid_buf = invalid_lacv.serialize()
     slow.parser(invalid_buf)
Beispiel #9
0
 def test_invalid_version(self):
     invalid_lacv = copy.deepcopy(self.l)
     invalid_lacv.version = 0xff
     invalid_buf = invalid_lacv.serialize()
     slow.parser(invalid_buf)
Beispiel #10
0
 def test_invalid_subtype(self):
     invalid_lacv = copy.deepcopy(self.l)
     invalid_lacv.subtype = 0xff
     invalid_buf = invalid_lacv.serialize()
     slow.parser(invalid_buf)
Beispiel #11
0
 def test_malformed_lacp(self):
     m_short_buf = self.buf[1:self.length]
     slow.parser(m_short_buf)
Beispiel #12
0
 def test_invalid_subtype(self):
     invalid_buf = "\xff" + self.buf[1:]
     (instance, nexttype, last) = slow.parser(invalid_buf)
     assert None == instance
     assert None == nexttype
     assert None != last
Beispiel #13
0
 def test_not_implemented_subtype(self):
     not_implemented_buf = str(SLOW_SUBTYPE_MARKER) + self.buf[1:]
     (instance, nexttype, last) = slow.parser(not_implemented_buf)
     assert None == instance
     assert None == nexttype
     assert None != last
Beispiel #14
0
 def test_parser(self):
     slow.parser(self.buf)
 def test_invalid_subtype(self):
     invalid_buf = b'\xff' + self.buf[1:]
     (instance, nexttype, last) = slow.parser(invalid_buf)
     assert instance is None
     assert nexttype is None
     assert last is not None