git.samba.org
/
mat
/
samba.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8b82bad
)
s4 dns: Give better test output on RCODE mismatch
author
Kai Blin
<kai@samba.org>
Fri, 16 Dec 2011 10:36:47 +0000
(11:36 +0100)
committer
Kai Blin
<kai@samba.org>
Sat, 17 Dec 2011 01:46:08 +0000
(
02:46
+0100)
source4/scripting/python/samba/tests/dns.py
patch
|
blob
|
history
diff --git
a/source4/scripting/python/samba/tests/dns.py
b/source4/scripting/python/samba/tests/dns.py
index 60003fcf7a356aa3d092d87d96c7e0cdc83ae084..ed78d56dd3034e3b1e73628e408de1d6429cbfe5 100644
(file)
--- a/
source4/scripting/python/samba/tests/dns.py
+++ b/
source4/scripting/python/samba/tests/dns.py
@@
-28,11
+28,30
@@
from samba.tests import TestCase
class DNSTest(TestCase):
class DNSTest(TestCase):
+ def errstr(self, errcode):
+ "Return a readable error code"
+ string_codes = [
+ "OK",
+ "FORMERR",
+ "SERVFAIL",
+ "NXDOMAIN",
+ "NOTIMP",
+ "REFUSED",
+ "YXDOMAIN",
+ "YXRRSET",
+ "NXRRSET",
+ "NOTAUTH",
+ "NOTZONE",
+ ]
+
+ return string_codes[errcode]
+
+
def assert_dns_rcode_equals(self, packet, rcode):
"Helper function to check return code"
p_errcode = packet.operation & 0x000F
self.assertEquals(p_errcode, rcode, "Expected RCODE %s, got %s" % \
def assert_dns_rcode_equals(self, packet, rcode):
"Helper function to check return code"
p_errcode = packet.operation & 0x000F
self.assertEquals(p_errcode, rcode, "Expected RCODE %s, got %s" % \
- (
rcode, p_errcode
))
+ (
self.errstr(rcode), self.errstr(p_errcode)
))
def assert_dns_opcode_equals(self, packet, opcode):
"Helper function to check opcode"
def assert_dns_opcode_equals(self, packet, opcode):
"Helper function to check opcode"