rpc-coverage.t questions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx
_______________________________________________
Gluster-devel mailing list
Gluster-devel@xxxxxxxxxxx
http://supercolony.gluster.org/mailman/listinfo/gluster-devel




[Index of Archives]     [Gluster Users]     [Ceph Users]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux