mirror of
https://github.com/ivre/masscanned.git
synced 2025-10-02 06:38:21 +00:00
Run Black
This commit is contained in:
parent
9fdecf5be7
commit
f696afa45d
3 changed files with 10 additions and 22 deletions
|
@ -47,10 +47,10 @@ def test(f):
|
|||
def w(m):
|
||||
try:
|
||||
# check that masscanned is still running
|
||||
assert(m.poll() is None), "masscanned not running"
|
||||
assert m.poll() is None, "masscanned not running"
|
||||
f()
|
||||
# check that masscanned is still running
|
||||
assert(m.poll() is None), "masscanned terminated unexpectedly"
|
||||
assert m.poll() is None, "masscanned terminated unexpectedly"
|
||||
LOG.info("{}{}".format(fname, OK))
|
||||
except AssertionError as e:
|
||||
LOG.error("{}{}: {}".format(fname, KO, e))
|
||||
|
|
|
@ -24,28 +24,23 @@ from scapy.volatile import RandInt
|
|||
from ..conf import IPV4_ADDR, IPV6_ADDR, MAC_ADDR
|
||||
from ..core import test, check_ip_checksum, check_ipv6_checksum
|
||||
|
||||
|
||||
@test
|
||||
def test_ipv4_tcp_empty():
|
||||
for p in [0, 80, 443]:
|
||||
req = (
|
||||
Ether(dst=MAC_ADDR)
|
||||
/ IP(dst=IPV4_ADDR, proto=6) # UDP
|
||||
/ Raw()
|
||||
)
|
||||
req = Ether(dst=MAC_ADDR) / IP(dst=IPV4_ADDR, proto=6) / Raw() # UDP
|
||||
repl = srp1(req, timeout=1)
|
||||
assert repl is None, "expecting no answer, got one"
|
||||
|
||||
|
||||
@test
|
||||
def test_ipv6_tcp_empty():
|
||||
for p in [0, 80, 443]:
|
||||
req = (
|
||||
Ether(dst=MAC_ADDR)
|
||||
/ IPv6(dst=IPV6_ADDR, nh=6) # UDP
|
||||
/ Raw()
|
||||
)
|
||||
req = Ether(dst=MAC_ADDR) / IPv6(dst=IPV6_ADDR, nh=6) / Raw() # UDP
|
||||
repl = srp1(req, timeout=1)
|
||||
assert repl is None, "expecting no answer, got one"
|
||||
|
||||
|
||||
@test
|
||||
def test_tcp_syn():
|
||||
##### SYN-ACK #####
|
||||
|
|
|
@ -28,21 +28,14 @@ from ..core import test, check_ip_checksum, check_ipv6_checksum
|
|||
@test
|
||||
def test_ipv4_udp_empty():
|
||||
for p in [0, 53, 1000]:
|
||||
req = (
|
||||
Ether(dst=MAC_ADDR)
|
||||
/ IP(dst=IPV4_ADDR, proto=17) # UDP
|
||||
/ Raw()
|
||||
)
|
||||
req = Ether(dst=MAC_ADDR) / IP(dst=IPV4_ADDR, proto=17) / Raw() # UDP
|
||||
repl = srp1(req, timeout=1)
|
||||
assert repl is None, "expecting no answer, got one"
|
||||
|
||||
|
||||
@test
|
||||
def test_ipv6_udp_empty():
|
||||
for p in [0, 53, 1000]:
|
||||
req = (
|
||||
Ether(dst=MAC_ADDR)
|
||||
/ IPv6(dst=IPV6_ADDR, nh=17) # UDP
|
||||
/ Raw()
|
||||
)
|
||||
req = Ether(dst=MAC_ADDR) / IPv6(dst=IPV6_ADDR, nh=17) / Raw() # UDP
|
||||
repl = srp1(req, timeout=1)
|
||||
assert repl is None, "expecting no answer, got one"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue