From 0e5b17adb004ea26c0747719f096297709f7cf7f Mon Sep 17 00:00:00 2001 From: Douglas Bagnall Date: Fri, 30 May 2025 11:27:30 +1200 Subject: [PATCH] pytests: samba_dnsupdate --use-samba-tool versus existing records BUG: https://bugzilla.samba.org/show_bug.cgi?id=13613 Signed-off-by: Douglas Bagnall Reviewed-by: Jennifer Sutton Reviewed-by: Rowland Penny --- python/samba/tests/blackbox/samba_dnsupdate.py | 13 +++++++++++++ selftest/knownfail.d/samba_dnsupdate | 1 + 2 files changed, 14 insertions(+) create mode 100644 selftest/knownfail.d/samba_dnsupdate diff --git a/python/samba/tests/blackbox/samba_dnsupdate.py b/python/samba/tests/blackbox/samba_dnsupdate.py index e2c1e1450ee..65cb703a3c7 100644 --- a/python/samba/tests/blackbox/samba_dnsupdate.py +++ b/python/samba/tests/blackbox/samba_dnsupdate.py @@ -123,3 +123,16 @@ class SambaDnsUpdateTests(samba.tests.BlackboxTestCase): errf=StringIO()) if result is not None: self.fail("Error deleting site") + + def test_samba_dnsupdate_samba_tool_all_names(self): + """We ask it to update all names, which should all already + exist and cause no errors.""" + try: + out = self.check_output(["samba_dnsupdate", + "--verbose", + "--use-samba-tool", + "--all-names"]) + except samba.tests.BlackboxProcessError as e: + self.fail(f"samba_dnsupdate returned an error: {e}") + self.assertIn(b"Record already exists", out) + self.assertNotIn(b"ERROR", out) diff --git a/selftest/knownfail.d/samba_dnsupdate b/selftest/knownfail.d/samba_dnsupdate new file mode 100644 index 00000000000..5d7dd2836c2 --- /dev/null +++ b/selftest/knownfail.d/samba_dnsupdate @@ -0,0 +1 @@ +^samba.tests.blackbox.samba_dnsupdate.+SambaDnsUpdateTests.test_samba_dnsupdate_samba_tool_all_names -- 2.47.2