summaryrefslogtreecommitdiffstats
path: root/tests/py/nft-test.py
diff options
context:
space:
mode:
authorMáté Eckl <ecklm94@gmail.com>2018-05-17 09:37:00 +0200
committerFlorian Westphal <fw@strlen.de>2018-05-17 15:35:36 +0200
commit77c067f9361413bfa9d703f09a68e6f510743e7d (patch)
treee746b5f5e9cb669a2eb3641eaa7e0ac298647466 /tests/py/nft-test.py
parentf3c2492fe00440af05805eed539b1a6f972b64ef (diff)
tests: py: print path of the logfile
It is good to know that a log is generated even without browsing the nft-test.py source code. Also print_info function is introduced. Signed-off-by: Máté Eckl <ecklm94@gmail.com> Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'tests/py/nft-test.py')
-rwxr-xr-xtests/py/nft-test.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/py/nft-test.py b/tests/py/nft-test.py
index 2be47004..b536e9cd 100755
--- a/tests/py/nft-test.py
+++ b/tests/py/nft-test.py
@@ -124,6 +124,8 @@ def print_error(reason, filename=None, lineno=None):
def print_warning(reason, filename=None, lineno=None):
print_msg(reason, "WARNING:", filename, lineno, Colors.YELLOW)
+def print_info(reason, filename=None, lineno=None):
+ print_msg(reason, "INFO:", filename, lineno, Colors.GREEN)
def color_differences(rule, other, color):
rlen = len(rule)
@@ -1350,8 +1352,9 @@ def main():
global log_file
try:
log_file = open(LOGFILE, 'w')
+ print_info("Log will be available at %s" % LOGFILE)
except IOError:
- print "Cannot open log file %s" % LOGFILE
+ print_error("Cannot open log file %s" % LOGFILE)
return
file_list = []