def test_update_zone(self, dig): slappy = SlappyClient(dig) self._add_zone_to_master(dig) self._add_zone_to_target_via_slappy(dig, slappy) # bump the serial of the zone on the master # note: rndc reload needs to see the zone file timestamp has changed time.sleep(1) self.zone.serial += 1 self._update_zone_on_master(dig) # notify slappy to pull down the new zone query = slappy.notify(name=self.zone.name) self.assertEqual(query.rcode(), NOERROR) # if slappy hasn't added the zone within a second, this test will fail time.sleep(1) query = dig( zone_name=self.zone.name, nameserver=cfg.CONF.slappy.host, rdatatype=ANY, port=53, ) self._check_serial(query, expected=self.zone.serial)
def test_delete_zone(self, dig): slappy = SlappyClient(dig) self._add_zone_to_master(dig) self._add_zone_to_target_via_slappy(dig, slappy) query = slappy.delete_zone(name=self.zone.name) self.assertEqual(query.rcode(), NOERROR) query = dig( zone_name=self.zone.name, nameserver=cfg.CONF.slappy.host, port=53, rdatatype=ANY, ) self.assertEqual(query.rcode(), REFUSED)