Thanks to visit codestin.com
Credit goes to github.com

Skip to content

failed test of test_passthrough_hp in test_example.py which fuse_passthrough is enabled by default #1048

@yangyun50

Description

@yangyun50

The test_passthrough_hp::[False] is failed in the newest linux kernel which support fuse passthrough in my environment.

root@yy:/home/yy/libfuse/build# python3 -m pytest test/test_examples.py::test_passthrough_hp[False]
============================================================== test session starts ==============================================================
platform linux -- Python 3.12.3, pytest-7.4.4, pluggy-1.4.0 -- /usr/bin/python3
cachedir: .pytest_cache
rootdir: /home/yy/libfuse/build/test
configfile: pytest.ini
collected 1 item                                                                                                                                

test/test_examples.py::test_passthrough_hp[False] FAILED                                                                                  [100%]

=================================================================== FAILURES ====================================================================
__________________________________________________________ test_passthrough_hp[False] ___________________________________________________________
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/_pytest/runner.py", line 341, in from_call
    result: Optional[TResult] = func()
                                ^^^^^^
  File "/usr/lib/python3/dist-packages/_pytest/runner.py", line 262, in <lambda>
    lambda: ihook(item=item, **kwds), when=when, reraise=reraise
            ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 501, in __call__
    return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 119, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 181, in _multicall
    return outcome.get_result()
           ^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/pluggy/_result.py", line 99, in get_result
    raise exc.with_traceback(exc.__traceback__)
  File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 102, in _multicall
    res = hook_impl.function(*args)
          ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/_pytest/runner.py", line 177, in pytest_runtest_call
    raise e
  File "/usr/lib/python3/dist-packages/_pytest/runner.py", line 169, in pytest_runtest_call
    item.runtest()
  File "/usr/lib/python3/dist-packages/_pytest/python.py", line 1792, in runtest
    self.ihook.pytest_pyfunc_call(pyfuncitem=self)
  File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 501, in __call__
    return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 119, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 181, in _multicall
    return outcome.get_result()
           ^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/pluggy/_result.py", line 99, in get_result
    raise exc.with_traceback(exc.__traceback__)
  File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 102, in _multicall
    res = hook_impl.function(*args)
          ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/_pytest/python.py", line 194, in pytest_pyfunc_call
    result = testfunction(**testargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/yy/libfuse/build/test/test_examples.py", line 256, in test_passthrough_hp
    subprocess.check_call(syscall_test_cmd)
  File "/usr/lib/python3.12/subprocess.py", line 413, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/home/yy/libfuse/build/test/../test/test_syscalls', '/tmp/tmpm_c81ban/mnt', ':/tmp/tmpm_c81ban/src', '-u']' returned non-zero exit status 1.
------------------------------------------------------------- Captured stderr call --------------------------------------------------------------
  1 [create] OK
  2 [create+unlink] OK
  3 [symlink] OK
  4 [link] OK
  5 [link-unlink-link] OK
  6 [mknod] OK
  7 [mkfifo] OK
  8 [mkdir] OK
  9 [rename file] OK
 10 [rename dir] OK
 11 [rename dir loop] OK
 12 [seekdir] OK
 13 [socket] OK
 14 [utime] OK
 15 [truncate(0)] OK
 16 [truncate(13)] OK
 17 [truncate(26)] OK
 18 [truncate(126)] OK
 19 [ftruncate(0) mode: 0600] OK
 20 [ftruncate(13) mode: 0600] OK
 21 [ftruncate(26) mode: 0600] OK
 22 [ftruncate(126) mode: 0600] OK
 23 [ftruncate(0) mode: 0400] OK
 24 [ftruncate(0) mode: 0200] OK
 25 [ftruncate(0) mode: 0000] OK
 26 [open(-, O_RDONLY, 0000)] OK
 27 [open(+, O_RDONLY, 0000)] OK
 28 [open(+, O_RDWR, 0000)] OK
 29 [open(+, O_WRONLY, 0000)] OK
 30 [open(-, O_RDWR | O_CREAT, 0600)] OK
 31 [open(+, O_RDWR | O_CREAT, 0600)] OK
 32 [open(-, O_RDWR | O_CREAT | O_TRUNC, 0600)] OK
 33 [open(+, O_RDWR | O_CREAT | O_TRUNC, 0600)] OK
 34 [open(-, O_RDONLY | O_CREAT, 0600)] OK
 35 [open(-, O_RDONLY | O_CREAT, 0400)] OK
 36 [open(-, O_RDONLY | O_CREAT, 0200)] OK
 37 [open(-, O_RDONLY | O_CREAT, 0000)] OK
 38 [open(-, O_WRONLY | O_CREAT, 0600)] OK
 39 [open(-, O_WRONLY | O_CREAT, 0400)] OK
 40 [open(-, O_WRONLY | O_CREAT, 0200)] OK
 41 [open(-, O_WRONLY | O_CREAT, 0000)] OK
 42 [open(-, O_RDWR | O_CREAT, 0400)] OK
 43 [open(-, O_RDWR | O_CREAT, 0200)] OK
 44 [open(-, O_RDWR | O_CREAT, 0000)] OK
 45 [open(-, O_RDWR | O_CREAT | O_EXCL, 0600)] OK
 46 [open(+, O_RDWR | O_CREAT | O_EXCL, 0600)] OK
 47 [open(-, O_RDWR | O_CREAT | O_EXCL, 0000)] OK
 48 [open(+, O_RDWR | O_CREAT | O_EXCL, 0000)] OK
 49 [open_acc(O_RDONLY) mode: 0600 message: 'Success'] OK
 50 [open_acc(O_WRONLY) mode: 0600 message: 'Success'] OK
 51 [open_acc(O_RDWR) mode: 0600 message: 'Success'] OK
 52 [open_acc(O_RDONLY) mode: 0400 message: 'Success'] OK
 53 [open_acc(O_WRONLY) mode: 0200 message: 'Success'] OK
 54 [open(O_CREAT) in read-only directory] OK
 55 [open(O_CREAT | O_EXCL) in read-only directory] OK
 56 [open(O_CREAT | O_WRONLY) in read-only directory] OK
 57 [open(O_CREAT | O_TRUNC) in read-only directory] OK
 58 [copy_file_range] test_copy_file_range() - copy is short: 0 instead of 26
1 tests failed
============================================================ short test summary info ============================================================
FAILED test/test_examples.py::test_passthrough_hp[False] - subprocess.CalledProcessError: Command '['/home/yy/libfuse/build/test/../test/test_syscalls', '/tmp/tmpm_c81ban/mnt', ':/tmp/tmpm_c81ban/src...
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
=============================================================== 1 failed in 1.32s ===============================================================

The failed function is test_copy_file_range in test_syscall.c:

static int test_copy_file_range(void)
{
        const char *data = testdata;
        int datalen = testdatalen;
        int err = 0;
        int res;
        int fd_in, fd_out;
        off_t pos_in = 0, pos_out = 0;

        start_test("copy_file_range");
        unlink(testfile);
        fd_in = open(testfile, O_CREAT | O_RDWR, 0644);
        if (fd_in == -1) {
                PERROR("creat");
                return -1;
        }
        res = write(fd_in, data, datalen);
        if (res == -1) {
                PERROR("write");
                close(fd_in);
                return -1;
        }
        if (res != datalen) {
                ERROR("write is short: %u instead of %u", res, datalen);
                close(fd_in);
                return -1;
       }

        unlink(testfile2);
        fd_out = creat(testfile2, 0644);
        if (fd_out == -1) {
                PERROR("creat");
                close(fd_in);
                return -1;
        }
        res = copy_file_range(fd_in, &pos_in, fd_out, &pos_out, datalen, 0);
        if (res == -1) {
                PERROR("copy_file_range");
                close(fd_in);
                close(fd_out);
                return -1;
        }
        if (res != datalen) {
                ERROR("copy is short: %u instead of %u", res, datalen);
                close(fd_in);
                close(fd_out);
                return -1;
        }

        res = close(fd_in);
        if (res == -1) {
                PERROR("close");
                close(fd_out);
                return -1;
        }
        res = close(fd_out);
        if (res == -1) {
                PERROR("close");
                return -1;
        }

        err = check_data(testfile2, data, 0, datalen);

        res = unlink(testfile);
        if (res == -1) {
                PERROR("unlink");
                return -1;
        }
        res = check_nonexist(testfile);
        if (res == -1)
                return -1;
        if (err)
                return -1;

        res = unlink(testfile2);
        if (res == -1) {
                PERROR("unlink");
                return -1;
        }
        res = check_nonexist(testfile2);
        if (res == -1)
                return -1;
        if (err)
                return -1;

        success();
        return 0;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions