"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "python/samba/tests/dns.py" between
samba-4.12.3.tar.gz and samba-4.12.5.tar.gz

About: Samba is the standard Windows interoperability suite of programs for Linux and Unix providing secure, stable and fast file and print services for all clients using the SMB/CIFS protocol. 4.12 series.

dns.py  (samba-4.12.3):dns.py  (samba-4.12.5)
skipping to change at line 1699 skipping to change at line 1699
self.assertEquals(response.ancount, 1) self.assertEquals(response.ancount, 1)
self.assertEquals(response.answers[0].rr_type, dns.DNS_QTYPE_SOA) self.assertEquals(response.answers[0].rr_type, dns.DNS_QTYPE_SOA)
self.delete_zone(zone) self.delete_zone(zone)
(response, response_packet) =\ (response, response_packet) =\
self.dns_transaction_udp(p, host=server_ip) self.dns_transaction_udp(p, host=server_ip)
self.assert_dns_rcode_equals(response, dns.DNS_RCODE_NXDOMAIN) self.assert_dns_rcode_equals(response, dns.DNS_RCODE_NXDOMAIN)
self.assert_dns_opcode_equals(response, dns.DNS_OPCODE_QUERY) self.assert_dns_opcode_equals(response, dns.DNS_OPCODE_QUERY)
self.assertEquals(response.ancount, 0) self.assertEquals(response.ancount, 0)
def set_dnsProperty_zero_length(self, dnsproperty_id):
records = self.samdb.search(base=self.zone_dn, scope=ldb.SCOPE_BASE,
expression="(&(objectClass=dnsZone)" +
"(name={0}))".format(self.zone),
attrs=["dNSProperty"])
self.assertEqual(len(records), 1)
props = [ndr_unpack(dnsp.DnsProperty, r)
for r in records[0].get('dNSProperty')]
new_props = [ndr.ndr_pack(p) for p in props if p.id == dnsproperty_id]
zero_length_p = dnsp.DnsProperty_short()
zero_length_p.id = dnsproperty_id
zero_length_p.namelength = 1
zero_length_p.name = 1
new_props += [ndr.ndr_pack(zero_length_p)]
dn = records[0].dn
update_dict = {'dn': dn, 'dnsProperty': new_props}
self.samdb.modify(ldb.Message.from_dict(self.samdb,
update_dict,
ldb.FLAG_MOD_REPLACE))
def test_update_while_dnsProperty_zero_length(self):
self.create_zone(self.zone)
self.set_dnsProperty_zero_length(dnsp.DSPROPERTY_ZONE_ALLOW_UPDATE)
rec = self.dns_update_record('dnspropertytest', ['test txt'])
self.assertNotEqual(rec.dwTimeStamp, 0)
def test_enum_zones_while_dnsProperty_zero_length(self):
self.create_zone(self.zone)
self.set_dnsProperty_zero_length(dnsp.DSPROPERTY_ZONE_ALLOW_UPDATE)
client_version = dnsserver.DNS_CLIENT_VERSION_LONGHORN
request_filter = dnsserver.DNS_ZONE_REQUEST_PRIMARY
tid = dnsserver.DNSSRV_TYPEID_DWORD
typeid, res = self.rpc_conn.DnssrvComplexOperation2(client_version,
0,
self.server_ip,
None,
'EnumZones',
tid,
request_filter)
def test_rpc_zone_update_while_dnsProperty_zero_length(self):
self.create_zone(self.zone)
self.set_dnsProperty_zero_length(dnsp.DSPROPERTY_ZONE_ALLOW_UPDATE)
self.set_params(zone=self.zone, AllowUpdate=dnsp.DNS_ZONE_UPDATE_SECURE)
def test_rpc_zone_update_while_other_dnsProperty_zero_length(self):
self.create_zone(self.zone)
self.set_dnsProperty_zero_length(dnsp.DSPROPERTY_ZONE_MASTER_SERVERS_DA)
self.set_params(zone=self.zone, AllowUpdate=dnsp.DNS_ZONE_UPDATE_SECURE)
class TestRPCRoundtrip(DNSTest): class TestRPCRoundtrip(DNSTest):
def setUp(self): def setUp(self):
super(TestRPCRoundtrip, self).setUp() super(TestRPCRoundtrip, self).setUp()
global server, server_ip, lp, creds global server, server_ip, lp, creds
self.server = server_name self.server = server_name
self.server_ip = server_ip self.server_ip = server_ip
self.lp = lp self.lp = lp
self.creds = creds self.creds = creds
self.rpc_conn = dnsserver.dnsserver("ncacn_ip_tcp:%s[sign]" % self.rpc_conn = dnsserver.dnsserver("ncacn_ip_tcp:%s[sign]" %
(self.server_ip), (self.server_ip),
 End of changes. 1 change blocks. 
0 lines changed or deleted 52 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)