diff options
author | Nikolaus Rath <Nikolaus@rath.org> | 2023-04-01 16:45:46 +0100 |
---|---|---|
committer | Nikolaus Rath <Nikolaus@rath.org> | 2023-04-01 16:49:01 +0100 |
commit | d65686ac2ca5c930372a9d141bbe185477c935f5 (patch) | |
tree | 27101426e7c422fc57c02eef212e03f468a1d0c7 /test/test_examples.py | |
parent | 0f8cb2888311868be83c208fef26d2139af41712 (diff) | |
download | libfuse-d65686ac2ca5c930372a9d141bbe185477c935f5.tar.gz |
Add unit tests for setxattr() et al
Hopefully, this will catch issues as in commit 024eccbf3
Diffstat (limited to 'test/test_examples.py')
-rwxr-xr-x | test/test_examples.py | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/test/test_examples.py b/test/test_examples.py index c63ac11..7df9ba4 100755 --- a/test/test_examples.py +++ b/test/test_examples.py @@ -104,6 +104,8 @@ def test_hello(tmpdir, name, options, cmdline_builder, output_checker): with pytest.raises(IOError) as exc_info: open(filename + 'does-not-exist', 'r+') assert exc_info.value.errno == errno.ENOENT + if name == 'hello_ll': + tst_xattr(mnt_dir) except: cleanup(mount_process, mnt_dir) raise @@ -760,7 +762,13 @@ def tst_passthrough(src_dir, mnt_dir): assert name in os.listdir(mnt_dir) assert os.stat(src_name) == os.stat(mnt_name) -# avoid warning about unused import -test_printcap - +def tst_xattr(mnt_dir): + path = os.path.join(mnt_dir, 'hello') + os.setxattr(path, b'hello_ll_setxattr_name', b'hello_ll_setxattr_value') + assert os.getxattr(path, b'hello_ll_getxattr_name') == b'hello_ll_getxattr_value' + os.removexattr(path, b'hello_ll_removexattr_name') + + +# avoid warning about unused import +assert test_printcap |