aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--example/hello_ll.c6
-rwxr-xr-xtest/test_examples.py5
2 files changed, 6 insertions, 5 deletions
diff --git a/example/hello_ll.c b/example/hello_ll.c
index 0299ffb..803528d 100644
--- a/example/hello_ll.c
+++ b/example/hello_ll.c
@@ -157,7 +157,7 @@ static void hello_ll_getxattr(fuse_req_t req, fuse_ino_t ino, const char *name,
size_t size)
{
(void)size;
- assert(ino == 2);
+ assert(ino == 1 || ino == 2);
if (strcmp(name, "hello_ll_getxattr_name") == 0)
{
const char *buf = "hello_ll_getxattr_value";
@@ -174,7 +174,7 @@ static void hello_ll_setxattr(fuse_req_t req, fuse_ino_t ino, const char *name,
{
(void)flags;
(void)size;
- assert(ino == 2);
+ assert(ino == 1 || ino == 2);
const char* exp_val = "hello_ll_setxattr_value";
if (strcmp(name, "hello_ll_setxattr_name") == 0 &&
strlen(exp_val) == size &&
@@ -190,7 +190,7 @@ static void hello_ll_setxattr(fuse_req_t req, fuse_ino_t ino, const char *name,
static void hello_ll_removexattr(fuse_req_t req, fuse_ino_t ino, const char *name)
{
- assert(ino == 2);
+ assert(ino == 1 || ino == 2);
if (strcmp(name, "hello_ll_removexattr_name") == 0)
{
fuse_reply_err(req, 0);
diff --git a/test/test_examples.py b/test/test_examples.py
index 96e4108..a597f55 100755
--- a/test/test_examples.py
+++ b/test/test_examples.py
@@ -106,6 +106,8 @@ def test_hello(tmpdir, name, options, cmdline_builder, output_checker):
assert exc_info.value.errno == errno.ENOENT
if name == 'hello_ll':
tst_xattr(mnt_dir)
+ path = os.path.join(mnt_dir, 'hello')
+ tst_xattr(path)
except:
cleanup(mount_process, mnt_dir)
raise
@@ -855,8 +857,7 @@ def tst_passthrough(src_dir, mnt_dir):
assert os.stat(src_name) == os.stat(mnt_name)
-def tst_xattr(mnt_dir):
- path = os.path.join(mnt_dir, 'hello')
+def tst_xattr(path):
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')