]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
CI: add Python test samba.tests.dcerpc.dfs.DfsTests.test_dfs_reparse_tag
authorRalph Boehme <slow@samba.org>
Thu, 14 Aug 2025 15:18:08 +0000 (17:18 +0200)
committerVolker Lendecke <vl@samba.org>
Fri, 15 Aug 2025 14:36:34 +0000 (14:36 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15843

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
python/samba/tests/dcerpc/dfs.py [new file with mode: 0644]
selftest/knownfail.d/samba.tests.dcerpc [new file with mode: 0644]
source4/selftest/tests.py

diff --git a/python/samba/tests/dcerpc/dfs.py b/python/samba/tests/dcerpc/dfs.py
new file mode 100644 (file)
index 0000000..0fcce32
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# Unix SMB/CIFS implementation.
+# Copyright Ralph Boehme <slow@samba.org> 2025
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+
+"""Tests for samba.dcerpc.dfs"""
+
+import os
+import logging
+import samba
+from samba.dcerpc import dfs
+from samba.tests import RpcInterfaceTestCase
+from samba.logger import get_samba_logger
+from samba.credentials import Credentials
+from samba.samba3 import libsmb_samba_internal as libsmb
+import samba.tests.libsmb
+from samba.samba3 import param as s3param
+
+logger = get_samba_logger(name=__name__)
+
+class DfsTests(samba.tests.libsmb.LibsmbTests):
+    def setUp(self):
+        super().setUp()
+        self.dfs = dfs.netdfs('ncacn_np:%s[/pipe/netdfs]' % self.server, self.lp, self.creds)
+        self.c = libsmb.Conn(self.server_ip, "msdfs-share", self.lp, self.creds)
+
+    def tearDown(self):
+        super().tearDown()
+
+    def test_dfs_reparse_tag(self):
+        self.dfs.Add('\\\\%s\\msdfs-share\\dfslink' % self.server, self.server, 'tmp', 'comment', 0)
+        l = self.c.list('', info_level=libsmb.SMB2_FIND_ID_BOTH_DIRECTORY_INFO)
+        files = {i['name']: i for i in l}
+        self.assertEqual(files['dfslink']['reparse_tag'], libsmb.IO_REPARSE_TAG_DFS)
+        self.dfs.Remove('\\\\%s\\msdfs-share\\dfslink' % self.server, self.server, 'tmp')
diff --git a/selftest/knownfail.d/samba.tests.dcerpc b/selftest/knownfail.d/samba.tests.dcerpc
new file mode 100644 (file)
index 0000000..8d64a4a
--- /dev/null
@@ -0,0 +1 @@
+^samba.tests.dcerpc.dfs.samba.tests.dcerpc.dfs.DfsTests.test_dfs_reparse_tag\(fileserver\)
index 50cabb903bba774487ac6097e1004ffd47b8f845..0cd0a822c942320790bddf48db1cd15e29caa599 100755 (executable)
@@ -2237,6 +2237,7 @@ planoldpythontestsuite("proclimitdc",
 
 planoldpythontestsuite("none", "samba.tests.usage")
 planpythontestsuite("fileserver", "samba.tests.dcerpc.mdssvc")
+planpythontestsuite("fileserver", "samba.tests.dcerpc.dfs")
 planoldpythontestsuite("none", "samba.tests.compression")
 planpythontestsuite("none", "samba.tests.security_descriptors")