diff options
author | Paul Vinciguerra <pvinci@vinciconsulting.com> | 2019-02-28 15:34:00 -0800 |
---|---|---|
committer | Neale Ranns <nranns@cisco.com> | 2019-03-01 09:25:08 +0000 |
commit | e8fece85e2b6190a1ebdc05c10cd79e43f385918 (patch) | |
tree | 0f79255b4d45811521f295c7b47b1e75bbe2255d /test/util.py | |
parent | 9e52ef6024a5f130ed542810a8b0ddb2b5fb08b7 (diff) |
Tests: Refactor duplicated code.
Naveen suggested earlier today that we should refactor duplicate code.
This commit kicks off the effort.
Change-Id: I855b0f40d41d1f3a2e673f3b254b76b596409656
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
Diffstat (limited to 'test/util.py')
-rw-r--r-- | test/util.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/test/util.py b/test/util.py index 5ce84070a87..fc0ebd73500 100644 --- a/test/util.py +++ b/test/util.py @@ -2,18 +2,19 @@ import abc import socket +from socket import AF_INET6 import six import sys import os.path -from scapy.utils6 import in6_mactoifaceid from scapy.layers.l2 import Ether -from scapy.packet import Raw from scapy.layers.inet import IP from scapy.layers.inet6 import IPv6, IPv6ExtHdrFragment, IPv6ExtHdrRouting,\ IPv6ExtHdrHopByHop +from scapy.packet import Raw from scapy.utils import hexdump -from socket import AF_INET6 +from scapy.utils6 import in6_mactoifaceid + from io import BytesIO from vpp_papi import mac_pton @@ -54,6 +55,7 @@ def ip4n_range(ip4n, s, e): for ip in ip4_range(ip4, s, e)) +# wrapper around scapy library function. def mk_ll_addr(mac): euid = in6_mactoifaceid(mac) addr = "fe80::" + euid |