From: David van Moolenbroek Date: Mon, 25 Jan 2016 12:16:23 +0000 (+0000) Subject: tests: fixes X-Git-Url: http://zhaoyanbai.com/repos/?a=commitdiff_plain;h=99e8768deb6d3e9e4798167e690ca36ceaf0373b;p=minix.git tests: fixes - test3: support running the test set from a pseudoterminal; - test60: fix number conversion bug that caused chmod errors; - test65: remove nonworking package installation instructions; - testisofs: work around failure due to having a timezone set; - testisofs: exclude extra RR_MOVED directory from output. Change-Id: Ibfcc631de7e2f4da46bac3ad9de8d7c7cd7a6189 --- diff --git a/minix/tests/t60a.c b/minix/tests/t60a.c index 812996b87..7489555b8 100644 --- a/minix/tests/t60a.c +++ b/minix/tests/t60a.c @@ -10,7 +10,7 @@ int main(int argc, char *argv[]) if (argc < 2) return(-2); if ((newmode = atoi(argv[1])) > 0) { - snprintf(cmd, sizeof(cmd), "chmod %o %s", newmode, argv[0]); + snprintf(cmd, sizeof(cmd), "chmod %d %s", newmode, argv[0]); system(cmd); } diff --git a/minix/tests/test3.c b/minix/tests/test3.c index bcc1766ad..392b2de13 100644 --- a/minix/tests/test3.c +++ b/minix/tests/test3.c @@ -167,7 +167,8 @@ void test3d() if (strncmp(p, "/dev/tty", 8) != 0) e(3); /* MINIX convention */ if ( (p = ttyname(0)) == NULL) e(4); - if (strncmp(p, "/dev/tty", 8) != 0 && strcmp(p, "/dev/console") != 0) e(5); + if (strncmp(p, "/dev/tty", 8) != 0 && strcmp(p, "/dev/console") != 0 && + strncmp(p, "/dev/pts/", 9) != 0) e(5); if ( (p = ttyname(3)) != NULL) e(6); if (ttyname(5000) != NULL) e(7); if ( (fd = creat("T3a", 0777)) < 0) e(8); diff --git a/minix/tests/test65.c b/minix/tests/test65.c index dd610625c..a58619346 100644 --- a/minix/tests/test65.c +++ b/minix/tests/test65.c @@ -105,19 +105,14 @@ create_partition(void) void verify_tools(void) { - int status; + int status1, status2; subtest = 1; - status = system("which mkntfs > /dev/null 2>&1"); - if (WEXITSTATUS(status) != 0) { - skip("mkntfs not found. Please install ntfsprogs (pkgin in " - "ntfsprogs)"); - } - status = system("which ntfs-3g > /dev/null 2>&1"); - if (WEXITSTATUS(status) != 0) { - skip("ntfs-3g not found. Please install fuse-ntfs-3g-1.1120 " - "(pkgin in fuse-ntfs-3g-1.1120)"); - } + + status1 = system("which mkntfs > /dev/null 2>&1"); + status2 = system("which ntfs-3g > /dev/null 2>&1"); + if (WEXITSTATUS(status1) != 0 || WEXITSTATUS(status2) != 0) + skip("mkntfs or ntfs-3g not found, skipping test"); } int diff --git a/minix/tests/testisofs.sh b/minix/tests/testisofs.sh index 47ac85a8b..f1ab021eb 100755 --- a/minix/tests/testisofs.sh +++ b/minix/tests/testisofs.sh @@ -6,6 +6,10 @@ set -e echo -n "isofs test " +# Somehow timezones mess up the timestamp comparison, so unset the timezone for +# now. TODO: sort out if this is actually a bug or simply expected behavior. +unset TZ + # testing ISO 9660 Level 3 compliance isn't possible for the time being # (not possible to store a >4GB ISO file into a ramdisk) testLevel3=0 @@ -18,6 +22,7 @@ fsimage=isofsimage contents=CONTENTS out1=v1 out2=v2 +excludes=excludes create_contents_level3() { # >4GB file @@ -109,7 +114,7 @@ EOF done } -rm -rf $testdir $fsimage $out1 $out2 +rm -rf $testdir $fsimage $out1 $out2 $excludes if [ -d $testdir ] then @@ -159,7 +164,8 @@ mount -t isofs $ramdev $mp >/dev/null 2>&1 if [ "$testRockRidge" -eq 1 ] then # get rid of root directory time - /usr/sbin/mtree -c -p $testdir | sed -e "s/\. *type=dir.*/\. type=dir/" | /usr/sbin/mtree -p $mp + echo 'RR_MOVED' >$excludes + /usr/sbin/mtree -c -p $testdir | sed -e "s/\. *type=dir.*/\. type=dir/" | /usr/sbin/mtree -p $mp -X $excludes else # fixups for the fact that bare ISO 9660 isn't POSIX enough # for mtree @@ -170,7 +176,7 @@ fi umount $ramdev >/dev/null 2>&1 # cleanup -rm -rf $testdir $fsimage $out1 $out2 +rm -rf $testdir $fsimage $out1 $out2 $excludes echo ok