From ed088d553965069755d34bb39cae5b15c339bb4b Mon Sep 17 00:00:00 2001 From: Marc Date: Fri, 10 Oct 2014 14:55:48 +0000 Subject: [PATCH] improved domain tests --- orchestra/apps/domains/backends.py | 1 - .../apps/domains/tests/functional_tests/tests.py | 12 ++++++++++-- orchestra/apps/orchestration/middlewares.py | 4 ---- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/orchestra/apps/domains/backends.py b/orchestra/apps/domains/backends.py index fbad6d0a..f00360f3 100644 --- a/orchestra/apps/domains/backends.py +++ b/orchestra/apps/domains/backends.py @@ -26,7 +26,6 @@ class Bind9MasterDomainBackend(ServiceController): def save(self, domain): context = self.get_context(domain) domain.refresh_serial() - print domain.render_zone() context['zone'] = ';; %(banner)s\n' % context context['zone'] += domain.render_zone() self.append("{ echo -e '%(zone)s' | diff -N -I'^;;' %(zone_path)s - ; } ||" diff --git a/orchestra/apps/domains/tests/functional_tests/tests.py b/orchestra/apps/domains/tests/functional_tests/tests.py index ebb21e25..da5ecce4 100644 --- a/orchestra/apps/domains/tests/functional_tests/tests.py +++ b/orchestra/apps/domains/tests/functional_tests/tests.py @@ -124,7 +124,6 @@ class DomainTestMixin(object): self.assertNotEqual(hostmaster, soa[5]) def validate_update(self, server_addr, domain_name): - Domain.objects.get(name=domain_name) context = { 'domain_name': domain_name, 'server_addr': server_addr @@ -163,6 +162,11 @@ class DomainTestMixin(object): self.assertIn(mx[4], ['30', '40']) self.assertIn(mx[5], ['mail3.orchestra.lan.', 'mail4.orchestra.lan.']) + def validate_www_update(self, server_addr, domain_name): + context = { + 'domain_name': domain_name, + 'server_addr': server_addr + } dig_cname = 'dig @%(server_addr)s www.%(domain_name)s CNAME | grep "\sCNAME\s"' cname = run(dig_cname % context).stdout.split() # testdomain.org. 3600 IN MX 10 orchestra.lan. @@ -196,11 +200,15 @@ class DomainTestMixin(object): self.add(self.domain_name, self.domain_records) self.addCleanup(partial(self.delete, self.domain_name)) self.update(self.domain_name, self.domain_update_records) - self.add(self.www_name, self.www_records) time.sleep(0.5) self.validate_update(self.MASTER_SERVER_ADDR, self.domain_name) time.sleep(5) self.validate_update(self.SLAVE_SERVER_ADDR, self.domain_name) + self.add(self.www_name, self.www_records) + time.sleep(0.5) + self.validate_www_update(self.MASTER_SERVER_ADDR, self.domain_name) + time.sleep(5) + self.validate_www_update(self.SLAVE_SERVER_ADDR, self.domain_name) def test_add_add_delete_delete(self): self.add(self.ns1_name, self.ns1_records) diff --git a/orchestra/apps/orchestration/middlewares.py b/orchestra/apps/orchestration/middlewares.py index 410c235c..dcc67262 100644 --- a/orchestra/apps/orchestration/middlewares.py +++ b/orchestra/apps/orchestration/middlewares.py @@ -92,10 +92,6 @@ class OperationsMiddleware(object): # except when we are deleting it pending_operations.discard(operation) pending_operations.add(operation) - try: - print kwargs['instance'], good_action - except: - pass def process_request(self, request): """ Store request on a thread local variable """