[Gluster-devel] rpc-coverage.t questions

Emmanuel Dreyfus manu at netbsd.org
Fri Aug 29 05:03:41 UTC 2014


Hello

I made various not yet submitted fixes for rpc-coverage.t on NetBSD. I
have a few questions:

In test_statfs() we have this:
    size=$(stat -c -c '%s' $PFX/dir/file);
    test "x$size" != "x0" || fail "statfs"

I wiill fix the obvious double -c typo, but that error caused the
"x$size" != "x0" test to pass while it must fail: the file is empty and
its size is really zero. I suggest this change that test on mode
instead:

-    size=$(stat -c -c '%s' $PFX/dir/file);
-    test "x$size" != "x0" || fail "statfs"
+    mode=$(stat -c '%a' $PFX/dir/file);
+    test "x$mode" == "x644" || fail "statfs"

In test_fstat():
     msg=$(sh -c 'tail -f $PFX/dir/file --pid=$$ & sleep 1 && echo hooha
> $PFX/dir/file && sleep 1');

NetBSD does not have the --pid option. I propose this change, which
seems to obtain the same result with less complexity. Opinion?

-    msg=$(sh -c 'tail -f $PFX/dir/file --pid=$$ & sleep 1 && echo hooha
> $PFX/dir/file && sleep 1');
+    echo hooha > $PFX/dir/file
+    sleep 1
+    msg=$(sh -c 'tail $PFX/dir/file')


-- 
Emmanuel Dreyfus
http://hcpnet.free.fr/pubz
manu at netbsd.org


More information about the Gluster-devel mailing list