Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_netcat_stdio():
with archr.targets.DockerImageTarget('archr-test:cat').build().start() as t:
b = archr.arsenal.NetCatBow(t)
r = b.fire()
r.send(b"hello!")
assert r.readuntil(b"hello!", timeout=5) == b"hello!"
def netcat_checks(t):
b = archr.arsenal.NetCatBow(t)
try:
r = b.fire()
except nclib.NetcatError:
time.sleep(5)
r = b.fire()
r.send(b"hello!")
assert r.readuntil(b"hello!", timeout=5) == b"hello!"