aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Nikolaus Rath <Nikolaus@rath.org>2016-03-29 16:16:01 -0700
committerGravatar Nikolaus Rath <Nikolaus@rath.org>2016-03-29 16:16:01 -0700
commit2aa1f6b1381611a3f73c7a1db61a629aa2e28324 (patch)
treeafe090b57385ae2b1d46a4c49f406603ab3a29a7
parent0db5bc69ea511eb1009f68775209ae8b58d6c553 (diff)
Added test_fsel
-rwxr-xr-xexample/fselclient.c4
-rwxr-xr-xtest/test_examples.py15
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: