payload_log = open("%s.payload" % filename_path)
if rule[1].strip() == "ok":
- try:
+ try:
payload_expected.index(rule[0])
except (ValueError):
payload_expected = payload_find_expected(payload_log, rule[0])
if line == "":
break
gotf.write(line)
- gotf.close()
+ gotf.close()
print_warning("Wrote payload for rule %s" % rule[0], gotf.name, 1)
# Check output of nft
while True:
line = payload_log.readline()
- if not line:
- break
+ if not line:
+ break
if line[0] == "#": # rule start
rule_line = line.strip()[2:]
if not os.path.isdir("tests/regression/"):
print "You have to run nft-test.py from the repository root directory, eg.\n\n" + \
- " nftables# python tests/regression/nft-test.py\n"
+ " nftables# python tests/regression/nft-test.py\n"
return
test_files = files_ok = run_total = 0