diff options
author | Nikolaus Rath <Nikolaus@rath.org> | 2016-05-13 13:13:18 -0700 |
---|---|---|
committer | Nikolaus Rath <Nikolaus@rath.org> | 2016-05-13 13:13:18 -0700 |
commit | 6682914d237890fceda98f25f9d5582b7ebc86b8 (patch) | |
tree | 5753b443fdf45b51fc25df4008bf165288b1e30b /test/test_examples.py | |
parent | 842b59b996e3db5f92011c269649ca29f144d35e (diff) | |
parent | d516c72aaff077dc9f5a56af8023849dd54e1aa3 (diff) | |
download | libfuse-6682914d237890fceda98f25f9d5582b7ebc86b8.tar.gz |
Merge branch 'ioctl-test'
Diffstat (limited to 'test/test_examples.py')
-rwxr-xr-x | test/test_examples.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/test_examples.py b/test/test_examples.py index 02d3409..31d2fae 100755 --- a/test/test_examples.py +++ b/test/test_examples.py @@ -83,6 +83,30 @@ def test_fusexmp_fh(tmpdir, name): else: umount(mount_process, mnt_dir) +def test_fioc(tmpdir): + mnt_dir = str(tmpdir) + testfile = os.path.join(mnt_dir, 'fioc') + cmdline = [os.path.join(basename, 'example', 'fioc'), + '-f', mnt_dir ] + mount_process = subprocess.Popen(cmdline) + try: + wait_for_mount(mount_process, mnt_dir) + + base_cmd = [ os.path.join(basename, 'example', 'fioclient'), + testfile ] + assert subprocess.check_output(base_cmd) == b'0\n' + with open(testfile, 'wb') as fh: + fh.write(b'foobar') + assert subprocess.check_output(base_cmd) == b'6\n' + subprocess.check_call(base_cmd + [ '3' ]) + with open(testfile, 'rb') as fh: + assert fh.read()== b'foo' + except: + cleanup(mnt_dir) + raise + else: + umount(mount_process, mnt_dir) + def test_fsel(tmpdir): mnt_dir = str(tmpdir) cmdline = [os.path.join(basename, 'example', 'fsel'), |