From: Volker Lendecke Date: Wed, 1 Nov 2023 14:39:12 +0000 (+0100) Subject: tests: Convert the regression test for bug15505 to python X-Git-Tag: talloc-2.4.2~869 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=687b1b993149de0785ad1134366a7917b2d1f57a;p=thirdparty%2Fsamba.git tests: Convert the regression test for bug15505 to python The shell version is flapping, but I can't really figure out why. Maybe this version is not flapping, and it also shows the failure if you revert 952d6c2cf48. Signed-off-by: Volker Lendecke Reviewed-by: Andrew Bartlett --- diff --git a/python/samba/tests/smb2symlink.py b/python/samba/tests/smb2symlink.py index 3ac35e52c09..5fca138e82a 100644 --- a/python/samba/tests/smb2symlink.py +++ b/python/samba/tests/smb2symlink.py @@ -198,6 +198,29 @@ class Smb2SymlinkTests(samba.tests.libsmb.LibsmbTests): self.assertEqual(syml, ('bar', 'bar', 0, 1)); + def test_bug15505(self): + """Test an absolute intermediate symlink inside the share""" + (smb1,smb2) = self.connections(smb1share="tmp",smb2share="tmp") + symlink="syml" + + localpath=samba.tests.env_get_var_value("LOCAL_PATH") + + smb1.mkdir("sub") + self.addCleanup(self.clean_file, smb1, "sub") + + self.create_symlink(smb1, f'{localpath}/sub1', "sub/lnk") + self.addCleanup(self.clean_file, smb1, "sub/lnk") + + smb1.mkdir("sub1") + self.addCleanup(self.clean_file, smb1, "sub1") + + fd = smb1.create("sub1/x", CreateDisposition=libsmb.FILE_CREATE); + smb1.close(fd) + self.addCleanup(self.clean_file, smb1, "sub1/x") + + fd = smb2.create("sub\\lnk\\x") + smb2.close(fd) + if __name__ == '__main__': import unittest unittest.main() diff --git a/source3/script/tests/test_smbclient_s3.sh b/source3/script/tests/test_smbclient_s3.sh index e4b05b12dfa..cbff5026ee7 100755 --- a/source3/script/tests/test_smbclient_s3.sh +++ b/source3/script/tests/test_smbclient_s3.sh @@ -1492,17 +1492,6 @@ EOF return fi - # Create a file to be accessed behind the symlink - touch $local_slink_target_dir/x - ret=$? - if [ $ret -ne 0 ]; then - echo "$out" - echo "failed - unable to create file" - ls -la $local_test_dir - false - return - fi - # Can we cd into the symlink name and ls ? tmpfile=$PREFIX/smbclient_interactive_prompt_commands cat >$tmpfile <$tmpfile <