From: Ralph Boehme Date: Thu, 14 Aug 2025 15:18:08 +0000 (+0200) Subject: CI: add Python test samba.tests.dcerpc.dfs.DfsTests.test_dfs_reparse_tag X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=43ee86c0c757e95712ed52bd336d2085485498ba;p=thirdparty%2Fsamba.git CI: add Python test samba.tests.dcerpc.dfs.DfsTests.test_dfs_reparse_tag BUG: https://bugzilla.samba.org/show_bug.cgi?id=15843 Signed-off-by: Ralph Boehme Reviewed-by: Volker Lendecke --- diff --git a/python/samba/tests/dcerpc/dfs.py b/python/samba/tests/dcerpc/dfs.py new file mode 100644 index 00000000000..0fcce324e55 --- /dev/null +++ b/python/samba/tests/dcerpc/dfs.py @@ -0,0 +1,48 @@ +# +# Unix SMB/CIFS implementation. +# Copyright Ralph Boehme 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 . +# + +"""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 index 00000000000..8d64a4a3dd8 --- /dev/null +++ b/selftest/knownfail.d/samba.tests.dcerpc @@ -0,0 +1 @@ +^samba.tests.dcerpc.dfs.samba.tests.dcerpc.dfs.DfsTests.test_dfs_reparse_tag\(fileserver\) diff --git a/source4/selftest/tests.py b/source4/selftest/tests.py index 50cabb903bb..0cd0a822c94 100755 --- a/source4/selftest/tests.py +++ b/source4/selftest/tests.py @@ -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")