summaryrefslogtreecommitdiff
path: root/python/samba
diff options
context:
space:
mode:
authorBjörn Baumbach <bb@sernet.de>2025-02-12 17:15:37 +0100
committerBjörn Baumbach <bb@sernet.de>2025-02-14 15:20:36 +0000
commit334f621e4b74e9cda735982e223aefc7eefb4631 (patch)
tree42c9e316f6c07ded836f6a2c44f7e24a2e41b6fa /python/samba
parent0a9946258eb4587f5c132805d7c44062c377f375 (diff)
downloadsamba-334f621e4b74e9cda735982e223aefc7eefb4631.tar.gz
samba-334f621e4b74e9cda735982e223aefc7eefb4631.tar.bz2
samba-334f621e4b74e9cda735982e223aefc7eefb4631.zip
pytests: test pysmbd with non-existent file
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15807 Signed-off-by: Björn Baumbach <bb@sernet.de> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Diffstat (limited to 'python/samba')
-rw-r--r--python/samba/tests/samba_tool/ntacl.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/python/samba/tests/samba_tool/ntacl.py b/python/samba/tests/samba_tool/ntacl.py
index 11731011e95..414ff982bf7 100644
--- a/python/samba/tests/samba_tool/ntacl.py
+++ b/python/samba/tests/samba_tool/ntacl.py
@@ -22,6 +22,7 @@ import os
from samba.tests.samba_tool.base import SambaToolCmdTest
from samba.tests import env_loadparm
import random
+import secrets
class NtACLCmdSysvolTestCase(SambaToolCmdTest):
@@ -123,6 +124,24 @@ class NtACLCmdGetSetTestCase(SambaToolCmdTest):
self.assertEqual(err, "", "Shouldn't be any error messages")
self.assertEqual(out, "", "Shouldn't be any output messages")
+ def test_set_expect_file_not_found(self):
+ path = os.environ['SELFTEST_PREFIX']
+ tempf_basename = f"{self.unique_name()}-{secrets.token_hex(10)}"
+ tempf = os.path.join(path, tempf_basename)
+
+ for fs_arg in ["--use-s3fs", "--use-ntvfs"]:
+ (result, out, err) = self.runsubcmd("ntacl",
+ "set",
+ self.acl,
+ tempf_basename,
+ fs_arg)
+
+ self.assertCmdFail(result, "succeeded with non-existent file")
+ self.assertIn("No such file or directory",
+ err,
+ "No such file or directory expected")
+ self.assertEqual(out, "", "Shouldn't be any output messages")
+
def test_ntvfs_check(self):
path = os.environ['SELFTEST_PREFIX']
tempf = os.path.join(path, "pytests" + str(int(100000 * random.random())))