From 463189cd121ce9a9f79d24c207e7c6c31898ea06 Mon Sep 17 00:00:00 2001 From: Nikolaus Rath Date: Sun, 9 Oct 2016 19:22:57 -0700 Subject: Renamed some examples to make their function more obvious Also, added more comments for the same purpose. --- test/test_examples.py | 45 +++++++++------------------------------------ 1 file changed, 9 insertions(+), 36 deletions(-) (limited to 'test/test_examples.py') diff --git a/test/test_examples.py b/test/test_examples.py index ef4932c..6deaff1 100755 --- a/test/test_examples.py +++ b/test/test_examples.py @@ -60,53 +60,26 @@ def test_hello(tmpdir, name, options): else: umount(mount_process, mnt_dir) +@pytest.mark.parametrize("name", ('passthrough', 'passthrough_fh', + 'passthrough_ll')) @pytest.mark.parametrize("options", LL_OPTIONS) -def test_fuse_lo_plus(tmpdir, options): +def test_passthrough(tmpdir, name, options): mnt_dir = str(tmpdir.mkdir('mnt')) src_dir = str(tmpdir.mkdir('src')) cmdline = base_cmdline + \ - [ pjoin(basename, 'example', 'fuse_lo-plus'), - '-f', '-s', mnt_dir ] + options + [ pjoin(basename, 'example', name), + '-f', mnt_dir ] + options + if not name.endswith('_ll'): + cmdline += [ '-o', 'use_ino,readdir_ino,kernel_cache' ] mount_process = subprocess.Popen(cmdline) try: wait_for_mount(mount_process, mnt_dir) work_dir = pjoin(mnt_dir, src_dir) - tst_write(work_dir) - tst_mkdir(work_dir) - tst_symlink(work_dir) - tst_mknod(work_dir) - if os.getuid() == 0: - tst_chown(work_dir) - # Underlying fs may not have full nanosecond resolution - tst_utimens(work_dir, ns_tol=1000) - tst_link(work_dir) - tst_readdir(work_dir) - tst_statvfs(work_dir) - tst_truncate_path(work_dir) - tst_truncate_fd(work_dir) - tst_unlink(work_dir) - tst_passthrough(src_dir, work_dir) - except: - cleanup(mnt_dir) - raise - else: - umount(mount_process, mnt_dir) -@pytest.mark.parametrize("name", ('fusexmp', 'fusexmp_fh')) -@pytest.mark.parametrize("options", LL_OPTIONS) -def test_fusexmp_fh(tmpdir, name, options): - mnt_dir = str(tmpdir.mkdir('mnt')) - src_dir = str(tmpdir.mkdir('src')) + subprocess.check_call([ os.path.join(basename, 'test', 'test'), + work_dir, ':' + src_dir ]) - cmdline = base_cmdline + \ - [ pjoin(basename, 'example', name), - '-f', '-o', 'use_ino,readdir_ino,kernel_cache', - mnt_dir ] + options - mount_process = subprocess.Popen(cmdline) - try: - wait_for_mount(mount_process, mnt_dir) - work_dir = pjoin(mnt_dir, src_dir) tst_write(work_dir) tst_mkdir(work_dir) tst_symlink(work_dir) -- cgit v1.2.3