• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Arista Metawatch unit tests
2#
3# Type the following command to launch start the tests:
4# $ test/run_tests -P "load_contrib('metawatch')" -t test/contrib/metawatch.uts
5
6+ Metawatch
7
8= MetawatchEther, basic instantiation
9
10m = MetawatchEther()
11assert m.type == 0x9000
12
13= MetawatchEther, build & dissect
14
15r = raw(MetawatchEther(dst="00:01:02:03:04:05", src="06:07:08:09:10:11"))
16assert 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'
17
18m = MetawatchEther(r)
19assert m.dst == "00:01:02:03:04:05" and m.src == "06:07:08:09:10:11" and m.type == 0x9000
20