• Home
  • Raw
  • Download

Lines Matching +full:python3 +full:- +full:pytest

1 #!/usr/bin/env python3
4 import pytest
6 sys.exit(pytest.main([__file__] + sys.argv[1:]))
12 import pytest
46 '-f', mnt_dir, '-o', ','.join(options) ]
48 # supports single-threading only
49 cmdline.append('-s')
55 name, mnt_dir, '-o', ','.join(options) ]
59 pytest.skip('drop_privileges requires root, skipping.')
73 @pytest.fixture
86 @pytest.mark.parametrize("cmdline_builder", (invoke_directly, invoke_mount_fuse,
88 @pytest.mark.parametrize("options", powerset(options))
89 @pytest.mark.parametrize("name", ('hello', 'hello_ll'))
101 with pytest.raises(IOError) as exc_info:
104 with pytest.raises(IOError) as exc_info:
105 open(filename + 'does-not-exist', 'r+')
115 @pytest.mark.parametrize("writeback", (False, True))
116 @pytest.mark.parametrize("name", ('passthrough', 'passthrough_plus',
118 @pytest.mark.parametrize("debug", (False, True))
122 output_checker.register_output(r'^ unique: [0-9]+, error: -[0-9]+ .+$',
135 '--plus', '-f', mnt_dir ]
139 '-f', mnt_dir ]
141 cmdline.append('-d')
145 pytest.skip('example does not support writeback caching')
146 cmdline.append('-o')
185 syscall_test_cmd.append('-53')
193 @pytest.mark.parametrize("cache", (False, True))
202 cmdline.append('--foreground')
205 cmdline.append('--nocache')
251 # so opt-in for this test from kernel 5.14
253 syscall_test_cmd.append('-u')
262 @pytest.mark.skipif(fuse_proto < (7,11),
267 pytest.skip('%s not built' % os.path.basename(progname))
271 cmdline = base_cmdline + [progname, '-f', mnt_dir ]
296 '-f', mnt_dir ]
313 pytest.skip('%s not built' % os.path.basename(progname))
318 cmdline = base_cmdline + [ progname, '-f', mnt_file ]
336 @pytest.mark.skipif(fuse_proto < (7,12),
338 @pytest.mark.parametrize("only_expire", ("invalidate_entries", "expire_entries"))
339 @pytest.mark.parametrize("notify", (True, False))
344 '-f', '--update-interval=1',
345 '--timeout=5', mnt_dir ]
347 cmdline.append('--no-notify')
349 cmdline.append('--only-expire')
351 pytest.skip('only-expire not supported by running kernel')
369 with pytest.raises(FileNotFoundError):
377 @pytest.mark.parametrize("intended_user", ('root', 'non_root'))
380 (but non-root cannot).
381 Split into root vs non-root, so that the output of pytest
384 pytest.skip('needs to run as non-root')
386 pytest.skip('needs to run as root')
391 '-o', f'source={src_dir},dev,auto_unmount',
392 '-f', mnt_dir ]
400 with pytest.raises(PermissionError):
408 @pytest.mark.skipif(os.getuid() != 0,
413 output_checker.register_output(r'^==([0-9]+).+unhandled ioctl.+\n'
417 devname = 'cuse-test-%d' % os.getpid()
421 '-f', '--name=%s' % devname ]
474 "-f", fuse_mountpoint]
527 with pytest.raises(OSError) as exc_info:
552 with pytest.raises(OSError) as exc_info:
570 with pytest.raises(OSError) as exc_info:
592 os.chown(filename, uid_new, -1)
598 os.chown(filename, -1, gid_new)
655 with pytest.raises(OSError) as exc_info:
686 # and (since -o hard_remove is not used) renames it instead of
692 with pytest.raises(FileNotFoundError):
742 'fill up the buffer - ' * 3) + str(i)
783 os.truncate(filename, size - 1024)
784 assert os.stat(filename).st_size == size - 1024
786 assert fh.read(size) == TEST_DATA[:size-1024]
807 os.ftruncate(fd, size - 1024)
808 assert os.fstat(fd).st_size == size - 1024
810 assert fh.read(size) == TEST_DATA[:size-1024]
818 mtime = fstat.st_mtime - 42.23
823 mtime_ns = fstat.st_mtime_ns - int(42.23*1e9)
828 assert abs(fstat.st_atime - atime) < 1
829 assert abs(fstat.st_mtime - mtime) < 1
831 assert abs(fstat.st_atime_ns - atime_ns) <= ns_tol
832 assert abs(fstat.st_mtime_ns - mtime_ns) <= ns_tol