Tests: update addr to use a real network address

This commit is contained in:
Pierre Lalet 2021-12-09 15:01:20 +01:00
parent db75ffb9c5
commit 1619261ebf
2 changed files with 4 additions and 5 deletions

View file

@ -776,7 +776,7 @@ def test_ipv4_udp_stun(iface):
tid == b"\x00" * 12
), "expected tid 0x000000000000000000000000, got {:x}".format(tid)
expected_data = b"\x00\x01\x00\x08\x00\x01" + struct.pack(
">HBBBB", sport, 192, 0, 0, 2
">HBBBB", sport, 192, 0, 0, 0
)
assert (
data == expected_data
@ -856,7 +856,7 @@ def test_ipv4_udp_stun_change_port(iface):
"expected tid 0x03a3b9464dd8eb75e19481474293845c, got %r" % tid
)
expected_data = b"\x00\x01\x00\x08\x00\x01" + struct.pack(
">HBBBB", sport, 192, 0, 0, 2
">HBBBB", sport, 192, 0, 0, 0
)
assert (
data == expected_data

View file

@ -55,10 +55,9 @@ tap = TunTapInterface(IFACE)
conf.iface = resolve_iface(IFACE)
# set interface
subprocess.check_call(["ip", "addr", "add", "dev", IFACE, "192.0.0.2"])
subprocess.check_call(["ip", "addr", "add", "dev", IFACE, "192.0.0.0/31"])
subprocess.check_call(["ip", "link", "set", IFACE, "up"])
subprocess.check_call(["ip", "route", "add", "192.0.0.1/32", "dev", IFACE])
subprocess.check_call(["ip", "route", "add", "1.2.3.4/32", "dev", IFACE])
subprocess.check_call(["ip", "route", "add", "1.2.3.4/32", "via", IPV4_ADDR])
conf.route.resync()
# start capture