Skip to content
Snippets Groups Projects
Commit e7dfbc3e authored by Daniel Salzman's avatar Daniel Salzman
Browse files

func-tests: remove deprecated stdout parameter from log functions

parent 2542bf81
No related branches found
No related tags found
No related merge requests found
......@@ -28,30 +28,26 @@ def test_info():
else:
return "dnstest"
def check_log(text, stdout=False):
def check_log(text):
'''Log message header'''
msg = "(%s) %s (%s)" % (time.strftime("%H:%M:%S"), str(text), test_info())
params.case_log.write(msg + "\n")
params.case_log.flush()
if stdout and params.debug:
print(msg)
def detail_log(text, stdout=False):
def detail_log(text):
'''Log message body'''
msg = str(text)
params.case_log.write(msg + "\n")
params.case_log.flush()
if stdout and params.debug:
print(msg)
def err(text):
'''Log error'''
check_log("ERROR", True)
detail_log(text, True)
detail_log(SEP, True)
check_log("ERROR")
detail_log(text)
detail_log(SEP)
def set_err(msg):
'''Set error state'''
......@@ -65,18 +61,18 @@ def isset(value, name):
if not value:
set_err("IS SET " + name)
check_log("IS SET " + name, True)
detail_log(" False", True)
detail_log(SEP, True)
check_log("IS SET " + name)
detail_log(" False")
detail_log(SEP)
def compare(value, expected, name):
'''Compare two values'''
if value != expected:
set_err("COMPARE " + name)
check_log("COMPARE " + name, True)
detail_log(" (" + str(value) + ") != (" + str(expected) + ")", True)
detail_log(SEP, True)
check_log("COMPARE " + name)
detail_log(" (" + str(value) + ") != (" + str(expected) + ")")
detail_log(SEP)
def compare_sections(section1, srv1name, section2, srv2name, name):
'''Compare two message sections'''
......@@ -85,16 +81,16 @@ def compare_sections(section1, srv1name, section2, srv2name, name):
return
set_err("COMPARE sections " + name)
check_log("COMPARE %s SECTIONS" % name, True)
check_log("COMPARE %s SECTIONS" % name)
for rrset in section1:
if rrset not in section2:
detail_log("%s has extra rrset:" % srv1name, True)
detail_log(" %s" % rrset, True)
detail_log("%s has extra rrset:" % srv1name)
detail_log(" %s" % rrset)
for rrset in section2:
if rrset not in section1:
detail_log("%s has extra rrset:" % srv2name, True)
detail_log(" %s" % rrset, True)
detail_log("%s has extra rrset:" % srv2name)
detail_log(" %s" % rrset)
detail_log(SEP, True)
detail_log(SEP)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment