From: Volker Lendecke Date: Sun, 7 Jul 2024 18:21:12 +0000 (+0200) Subject: tests: Factor out do_test_nfs_reparse X-Git-Tag: tdb-1.4.11~143 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fb7a7cd73ba44f72f412128033ae061382b1bd87;p=thirdparty%2Fsamba.git tests: Factor out do_test_nfs_reparse Will be used for sockets next Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- diff --git a/python/samba/tests/reparsepoints.py b/python/samba/tests/reparsepoints.py index 19d710adf74..3a8702d7b29 100644 --- a/python/samba/tests/reparsepoints.py +++ b/python/samba/tests/reparsepoints.py @@ -382,14 +382,13 @@ class ReparsePoints(samba.tests.libsmb.LibsmbTests): conn.delete_on_close(fd, 1) conn.close(fd) - def test_fifo_reparse(self): - """Test FIFO reparse tag""" - filename = 'fifo' + def do_test_nfs_reparse(self, filename, filetype, nfstype): + """Test special file reparse tag""" smb2 = self.connection() smb1 = self.connection_posix() self.clean_file(smb2, filename) - smb1.mknod(filename, stat.S_IFIFO | 0o755) + smb1.mknod(filename, filetype | 0o755) fd = smb2.create( filename, @@ -403,7 +402,11 @@ class ReparsePoints(samba.tests.libsmb.LibsmbTests): reparse = smb2.fsctl(fd, libsmb.FSCTL_GET_REPARSE_POINT, b'', 1024) (tag, ) = reparse_symlink.get(reparse) - self.assertEqual(tag, 'NFS_SPECFILE_FIFO') + self.assertEqual(tag, nfstype) + + def test_fifo_reparse(self): + """Test FIFO reparse tag""" + self.do_test_nfs_reparse('fifo', stat.S_IFIFO, 'NFS_SPECFILE_FIFO') if __name__ == '__main__': import unittest