Added test_fsel
authorNikolaus Rath <Nikolaus@rath.org>
Tue, 29 Mar 2016 23:16:01 +0000 (16:16 -0700)
committerNikolaus Rath <Nikolaus@rath.org>
Tue, 29 Mar 2016 23:16:01 +0000 (16:16 -0700)
example/fselclient.c
test/test_examples.py

index ac8b7b0486d44d3006ff5badab840bc11c9c2a79..637cb07fcb6a4144b75425b82d0ddc4c972d082e 100755 (executable)
@@ -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;
index 9da7bb1b27c891b1cc682afd4bf34b6c0e8a7efb..02d3409ca13ff5011e313fb383a57a70b4b0b32f 100755 (executable)
@@ -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: