File: metawatch.uts

package info (click to toggle)
scapy 2.6.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 13,956 kB
  • sloc: python: 163,618; sh: 90; makefile: 11
file content (19 lines) | stat: -rw-r--r-- 607 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# Arista Metawatch unit tests
#
# Type the following command to launch start the tests:
# $ test/run_tests -P "load_contrib('metawatch')" -t test/contrib/metawatch.uts

+ Metawatch

= MetawatchEther, basic instantiation

m = MetawatchEther()
assert m.type == 0x9000

= MetawatchEther, build & dissect

r = raw(MetawatchEther(dst="00:01:02:03:04:05", src="06:07:08:09:10:11"))
assert r == b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\x10\x11\x90\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'

m = MetawatchEther(r)
assert m.dst == "00:01:02:03:04:05" and m.src == "06:07:08:09:10:11" and m.type == 0x9000