From 2aa1f6b1381611a3f73c7a1db61a629aa2e28324 Mon Sep 17 00:00:00 2001 From: Nikolaus Rath Date: Tue, 29 Mar 2016 16:16:01 -0700 Subject: Added test_fsel --- example/fselclient.c | 4 ++-- test/test_examples.py | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/example/fselclient.c b/example/fselclient.c index ac8b7b0..637cb07 100755 --- a/example/fselclient.c +++ b/example/fselclient.c @@ -40,7 +40,7 @@ int main(void) { static const char hex_map[FSEL_FILES] = "0123456789ABCDEF"; int fds[FSEL_FILES]; - int i, nfds; + int i, nfds, tries; for (i = 0; i < FSEL_FILES; i++) { char name[] = { hex_map[i], '\0' }; @@ -52,7 +52,7 @@ int main(void) } nfds = fds[FSEL_FILES - 1] + 1; - while (1) { + for(tries=0; tries < 16; tries++) { static char buf[4096]; fd_set rfds; int rc; diff --git a/test/test_examples.py b/test/test_examples.py index 9da7bb1..02d3409 100755 --- a/test/test_examples.py +++ b/test/test_examples.py @@ -83,6 +83,21 @@ def test_fusexmp_fh(tmpdir, name): else: umount(mount_process, mnt_dir) +def test_fsel(tmpdir): + mnt_dir = str(tmpdir) + cmdline = [os.path.join(basename, 'example', 'fsel'), + '-f', mnt_dir ] + mount_process = subprocess.Popen(cmdline) + try: + wait_for_mount(mount_process, mnt_dir) + cmdline = [ os.path.join(basename, 'example', 'fselclient') ] + subprocess.check_call(cmdline, cwd=mnt_dir) + except: + cleanup(mnt_dir) + raise + else: + umount(mount_process, mnt_dir) + def checked_unlink(filename, path, isdir=False): fullname = os.path.join(path, filename) if isdir: -- cgit v1.2.3