From: Andrew Bartlett Date: Fri, 19 Dec 2014 02:14:22 +0000 (+1300) Subject: dns.py: Always remove the test zone in tearDown() X-Git-Url: http://git.samba.org/?p=obnox%2Fsamba%2Fsamba-obnox.git;a=commitdiff_plain;h=ad074795e33b676595aa7fb1b0129a0b5b8cbf24 dns.py: Always remove the test zone in tearDown() Change-Id: Ic6d6c51579f8859b4e396179123974382c253bf7 Signed-off-by: Garming Sam Pair-programmed-with: Garming Sam Signed-off-by: Andrew Bartlett Autobuild-User(master): Garming Sam Autobuild-Date(master): Mon Dec 22 08:21:22 CET 2014 on sn-devel-104 --- diff --git a/python/samba/tests/dns.py b/python/samba/tests/dns.py index ac946af4591..92ac876ff35 100644 --- a/python/samba/tests/dns.py +++ b/python/samba/tests/dns.py @@ -888,6 +888,14 @@ class TestZones(DNSTest): self.rpc_conn = dnsserver.dnsserver("ncacn_ip_tcp:%s" % (self.server), self.lp, self.creds) + def tearDown(self): + super(TestZones, self).tearDown() + try: + self.delete_zone(self.zone) + except RuntimeError, (num, string): + if num != 9601: #WERR_DNS_ERROR_ZONE_DOES_NOT_EXIST + raise + def create_zone(self, zone): zone_create = dnsserver.DNS_RPC_ZONE_CREATE_INFO_LONGHORN() zone_create.pszZoneName = zone