if [ "$(id -u)" -ne 0 ]
then
- echo "SKIPPED: chgrp (not root)"
+ echo "$SHOWSKIP: chgrp (not root)"
continue 2>/dev/null
exit
fi
if [ "$(id -u)" -ne 0 ]
then
- echo "SKIPPED: chown (not root)"
+ echo "$SHOWSKIP: chown (not root)"
continue 2>/dev/null
exit
fi
# the relevant bit should be here:
# 110*5 + 4*3 + 2 + 6*3 = 550 + 12 + 20 = 582
# files are padded to n*4, names are padded to 2 + n*4 due to the header length
-testing "cpio archive length" "cpio -o -H newc|dd ibs=2 skip=291 count=5" "TRAILER!!!" "" "a\nbb\nccc\ndddd\n"
-testing "cpio archive magic" "cpio -o -H newc|dd ibs=2 count=3" "070701" "" "a\n"
+testing "cpio archive length" "cpio -o -H newc|dd ibs=2 skip=291 count=5 2>/dev/null" "TRAILER!!!" "" "a\nbb\nccc\ndddd\n"
+testing "cpio archive magic" "cpio -o -H newc|dd ibs=2 count=3 2>/dev/null" "070701" "" "a\n"
# check name length (8 bytes before the empty "crc")
-testing "cpio name length" "cpio -o -H newc|dd ibs=2 skip=47 count=4" "00000002" "" "a\n"
+testing "cpio name length" "cpio -o -H newc|dd ibs=2 skip=47 count=4 2>/dev/null" "00000002" "" "a\n"
rm a bb ccc dddd
# archive dangling symlinks and empty files even if we cannot open them
if [ "$(id -u)" -ne 0 ]
then
- echo "SKIPPED: ifconfig (not root)"
+ echo "$SHOWSKIP: ifconfig (not root)"
continue 2>/dev/null
exit
fi
if [ "$(id -u)" -ne 0 ]
then
- echo "SKIPPED: losetup (not root)"
+ echo "$SHOWSKIP: losetup (not root)"
continue 2>/dev/null
exit
fi
# Test -f format filtering
for i in %f %e %g "boo %f yah" "% f" %-1.2f %+-f "%+ - f" %.2f %3.f "%'.2f" \
- %%%f%% %%%f%%%
+ %%%f%%
do
testing "seq filter -f \"$i\"" "seq -f \"$i\" 1 3 > /dev/null && echo yes" \
"yes\n" "" ""
done
# Test -f format filtering failures
for i in %d %s "" "boo %f %f yah" "%*f" %-1.2.3f '%2$f' %1-f "%1 f" \
- %2..2f
+ %2..2f %%%f%%%
do
testing "seq filter reject -f '$i'" \
"seq -f '$i' 1 3 2>/dev/null || echo no" "no\n" "" ""
if [ "$(id -u)" -ne 0 ]
then
- echo "SKIPPED: useradd (not root)"
+ echo "$SHOWSKIP: useradd (not root)"
continue 2>/dev/null
exit
fi