summaryrefslogtreecommitdiff
path: root/python/samba/tests/dns_base.py
AgeCommit message (Collapse)AuthorFilesLines
2024-06-12pytest: remove py2 str/bytes workaround in dns_baseDouglas Bagnall1-2/+2
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2024-06-06python:tests/dns_base: add get_unpriv_creds() helperStefan Metzmacher1-0/+15
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13019 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2024-06-06python:tests/dns_base: let verify_packet() work against WindowsStefan Metzmacher1-1/+10
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13019 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2024-06-06python:tests/dns_tkey: let us have ↵Stefan Metzmacher1-0/+8
test_update_gss_tsig_tkey_req_{additional,answers}() Also test using the additional record in the answers section. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13019 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2024-06-06python:tests/dns_base: maintain a dict with tkey related stateStefan Metzmacher1-14/+26
This will allow tests to backup the whole state and mix them. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13019 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2024-06-06python:tests/dns_base: let dns_transaction_udp() take ↵Stefan Metzmacher1-1/+13
allow_{remaining,truncated}=True BUG: https://bugzilla.samba.org/show_bug.cgi?id=13019 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2024-06-06python:tests/dns_base: pass tkey_trans(expected_rcode)Stefan Metzmacher1-1/+5
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13019 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2024-06-06python:tests/dns_base: let tkey_trans() take tkey_req_in_answersStefan Metzmacher1-3/+8
It's possible to put the additional into the answers section, so we should be able to test that. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13019 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2024-06-06python:tests/dns_base: let tkey_trans() and sign_packet() take ↵Stefan Metzmacher1-5/+7
algorithm_name as argument BUG: https://bugzilla.samba.org/show_bug.cgi?id=13019 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2024-06-06python:tests/dns_base: add self.assert_echoed_dns_error()Stefan Metzmacher1-0/+18
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13019 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2024-06-06python:tests/dns_base: let dns_transaction_tcp() handle short receivesStefan Metzmacher1-1/+12
With socket_wrapper we only get 1500 byte chunks... BUG: https://bugzilla.samba.org/show_bug.cgi?id=13019 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2024-06-06python:tests/dns_base: use ndr_deepcopy() and ndr_pack() in verify_packet()Stefan Metzmacher1-13/+10
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13019 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2024-06-06python:tests/dns_base: generate a real signature in bad_sign_packet()Stefan Metzmacher1-27/+21
We just destroy the signature bytes but keep the header unchanged. This makes it easier to look at it in wireshark. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13019 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-11-30python: tests: update all super calls to python 3 style in testsRob van der Linde1-2/+2
Signed-off-by: Rob van der Linde <rob@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> [abartlet@samba.org Some python2 style super() calls remain due to being an actual, even if reasonable, behaviour change]
2023-11-30python: PEP275: docstrings should always use double quotesRob van der Linde1-2/+2
Signed-off-by: Rob van der Linde <rob@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2021-06-11pytest:dns_base: make_txt_update can set arbitrary TTLDouglas Bagnall1-3/+3
Also, improve a variable name. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2021-04-28python: remove all 'from __future__ import print_function'Douglas Bagnall1-1/+0
This made Python 2's print behave like Python 3's print(). In some cases, where we had: from __future__ import print_function """Intended module documentation...""" this will have the side effect of making the intended module documentation work as the actual module documentation (i.e. becoming __doc__), because it is once again the first statement in the module. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2021-03-17pytests: dns_base: remove a py2 compat thingDouglas Bagnall1-4/+1
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Jeremy Allison <jra@samba.org>
2020-08-11python compat: remove binary_typeDouglas Bagnall1-4/+3
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Noel Power <npower@samba.org>
2020-02-07pytests: heed assertEquals deprecation warning en-masseDouglas Bagnall1-6/+6
TestCase.assertEquals() is an alias for TestCase.assertEqual() and has been deprecated since Python 2.7. When we run our tests with in python developer mode (`PYTHONDEVMODE=1 make test`) we get 580 DeprecationWarnings about this. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Noel Power <npower@samba.org>
2019-01-29python/tests/dns*: make use of dns.DNS_RCODE/dns.DNS_OPCODEStefan Metzmacher1-2/+2
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2018-09-15python/samba/tests: py_gensec_update takes bytes as paramNoel Power1-1/+1
Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-07-13python/samba/tests: various py3 porting for ord/chrNoel Power1-11/+17
various messages are lists of ints that need converting to str or bytes depending on py2/py3, others are str/bytes that need modification and are converted to lists or string char or ints for modificate (and then reconstructed as str/bytes again) Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2018-07-12tests dns: dns_base.py remove flake8 warningsGary Lockyer1-4/+8
Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-07-12dns: record aging testsAaron Haslett1-5/+5
First basic DNS record aging tests. These check that we can turn aging on and off, and that timestamps are written on DNS add and update calls, but not RPC calls. BUG: https://bugzilla.samba.org/show_bug.cgi?id=10812 Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-03-23samba python tests: convert print func to be py2/py3 compatibleNoel Power1-4/+5
Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2017-06-10selftest: Use TestCaseInTempDir as base class in dns testsAndrew Bartlett1-2/+2
This will help when we add a new join test based on this code Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2017-06-10selftest: Create new common base class for dns.py and dns_tkey.pyAndrew Bartlett1-0/+431
This will allow more DNS tests to be written in the future with less code duplication.