mirror of
https://github.com/ivre/masscanned.git
synced 2025-10-02 06:38:21 +00:00
Tests: update addr to use a real network address
This commit is contained in:
parent
db75ffb9c5
commit
1619261ebf
2 changed files with 4 additions and 5 deletions
|
@ -776,7 +776,7 @@ def test_ipv4_udp_stun(iface):
|
||||||
tid == b"\x00" * 12
|
tid == b"\x00" * 12
|
||||||
), "expected tid 0x000000000000000000000000, got {:x}".format(tid)
|
), "expected tid 0x000000000000000000000000, got {:x}".format(tid)
|
||||||
expected_data = b"\x00\x01\x00\x08\x00\x01" + struct.pack(
|
expected_data = b"\x00\x01\x00\x08\x00\x01" + struct.pack(
|
||||||
">HBBBB", sport, 192, 0, 0, 2
|
">HBBBB", sport, 192, 0, 0, 0
|
||||||
)
|
)
|
||||||
assert (
|
assert (
|
||||||
data == expected_data
|
data == expected_data
|
||||||
|
@ -856,7 +856,7 @@ def test_ipv4_udp_stun_change_port(iface):
|
||||||
"expected tid 0x03a3b9464dd8eb75e19481474293845c, got %r" % tid
|
"expected tid 0x03a3b9464dd8eb75e19481474293845c, got %r" % tid
|
||||||
)
|
)
|
||||||
expected_data = b"\x00\x01\x00\x08\x00\x01" + struct.pack(
|
expected_data = b"\x00\x01\x00\x08\x00\x01" + struct.pack(
|
||||||
">HBBBB", sport, 192, 0, 0, 2
|
">HBBBB", sport, 192, 0, 0, 0
|
||||||
)
|
)
|
||||||
assert (
|
assert (
|
||||||
data == expected_data
|
data == expected_data
|
||||||
|
|
|
@ -55,10 +55,9 @@ tap = TunTapInterface(IFACE)
|
||||||
conf.iface = resolve_iface(IFACE)
|
conf.iface = resolve_iface(IFACE)
|
||||||
|
|
||||||
# set interface
|
# 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", "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", "via", IPV4_ADDR])
|
||||||
subprocess.check_call(["ip", "route", "add", "1.2.3.4/32", "dev", IFACE])
|
|
||||||
conf.route.resync()
|
conf.route.resync()
|
||||||
|
|
||||||
# start capture
|
# start capture
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue