Separate persistence tests from the extended filesys tests.
authorBen Pfaff <blp@cs.stanford.edu>
Thu, 4 Jan 2007 15:13:49 +0000 (15:13 +0000)
committerBen Pfaff <blp@cs.stanford.edu>
Thu, 4 Jan 2007 15:13:49 +0000 (15:13 +0000)
Suggested by Godmar Back.

52 files changed:
src/tests/Make.tests
src/tests/filesys/Grading.no-vm
src/tests/filesys/Grading.with-vm
src/tests/filesys/extended/Make.tests
src/tests/filesys/extended/Rubric.persistence [new file with mode: 0644]
src/tests/filesys/extended/dir-empty-name-persistence.ck [new file with mode: 0644]
src/tests/filesys/extended/dir-empty-name.ck
src/tests/filesys/extended/dir-mk-tree-persistence.ck [new file with mode: 0644]
src/tests/filesys/extended/dir-mk-tree.ck
src/tests/filesys/extended/dir-mkdir-persistence.ck [new file with mode: 0644]
src/tests/filesys/extended/dir-mkdir.ck
src/tests/filesys/extended/dir-open-persistence.ck [new file with mode: 0644]
src/tests/filesys/extended/dir-open.ck
src/tests/filesys/extended/dir-over-file-persistence.ck [new file with mode: 0644]
src/tests/filesys/extended/dir-over-file.ck
src/tests/filesys/extended/dir-rm-cwd-persistence.ck [new file with mode: 0644]
src/tests/filesys/extended/dir-rm-cwd.ck
src/tests/filesys/extended/dir-rm-parent-persistence.ck [new file with mode: 0644]
src/tests/filesys/extended/dir-rm-parent.ck
src/tests/filesys/extended/dir-rm-root-persistence.ck [new file with mode: 0644]
src/tests/filesys/extended/dir-rm-root.ck
src/tests/filesys/extended/dir-rm-tree-persistence.ck [new file with mode: 0644]
src/tests/filesys/extended/dir-rm-tree.ck
src/tests/filesys/extended/dir-rmdir-persistence.ck [new file with mode: 0644]
src/tests/filesys/extended/dir-rmdir.ck
src/tests/filesys/extended/dir-under-file-persistence.ck [new file with mode: 0644]
src/tests/filesys/extended/dir-under-file.ck
src/tests/filesys/extended/dir-vine-persistence.ck [new file with mode: 0644]
src/tests/filesys/extended/dir-vine.ck
src/tests/filesys/extended/grow-create-persistence.ck [new file with mode: 0644]
src/tests/filesys/extended/grow-create.ck
src/tests/filesys/extended/grow-dir-lg-persistence.ck [new file with mode: 0644]
src/tests/filesys/extended/grow-dir-lg.ck
src/tests/filesys/extended/grow-file-size-persistence.ck [new file with mode: 0644]
src/tests/filesys/extended/grow-file-size.ck
src/tests/filesys/extended/grow-root-lg-persistence.ck [new file with mode: 0644]
src/tests/filesys/extended/grow-root-lg.ck
src/tests/filesys/extended/grow-root-sm-persistence.ck [new file with mode: 0644]
src/tests/filesys/extended/grow-root-sm.ck
src/tests/filesys/extended/grow-seq-lg-persistence.ck [new file with mode: 0644]
src/tests/filesys/extended/grow-seq-lg.ck
src/tests/filesys/extended/grow-seq-sm-persistence.ck [new file with mode: 0644]
src/tests/filesys/extended/grow-seq-sm.ck
src/tests/filesys/extended/grow-sparse-persistence.ck [new file with mode: 0644]
src/tests/filesys/extended/grow-sparse.ck
src/tests/filesys/extended/grow-tell-persistence.ck [new file with mode: 0644]
src/tests/filesys/extended/grow-tell.ck
src/tests/filesys/extended/grow-two-files-persistence.ck [new file with mode: 0644]
src/tests/filesys/extended/grow-two-files.ck
src/tests/filesys/extended/syn-rw-persistence.ck [new file with mode: 0644]
src/tests/filesys/extended/syn-rw.ck
src/tests/tests.pm

index 6595b468eeb7c04d90def8f781396b89a650f8ee..94367f69ed790b6415af002b4ca9048c84828efe 100644 (file)
@@ -4,10 +4,11 @@ include $(patsubst %,$(SRCDIR)/%/Make.tests,$(TEST_SUBDIRS))
 
 PROGS = $(foreach subdir,$(TEST_SUBDIRS),$($(subdir)_PROGS))
 TESTS = $(foreach subdir,$(TEST_SUBDIRS),$($(subdir)_TESTS))
+EXTRA_GRADES = $(foreach subdir,$(TEST_SUBDIRS),$($(subdir)_EXTRA_GRADES))
 
-OUTPUTS = $(addsuffix .output,$(TESTS))
-ERRORS = $(addsuffix .errors,$(TESTS))
-RESULTS = $(addsuffix .result,$(TESTS))
+OUTPUTS = $(addsuffix .output,$(TESTS) $(EXTRA_GRADES))
+ERRORS = $(addsuffix .errors,$(TESTS) $(EXTRA_GRADES))
+RESULTS = $(addsuffix .result,$(TESTS) $(EXTRA_GRADES))
 
 ifdef PROGS
 include ../../Makefile.userprog
@@ -33,7 +34,7 @@ check:: results
        fi
 
 results: $(RESULTS)
-       @for d in $(TESTS); do                                  \
+       @for d in $(TESTS) $(EXTRA_GRADES); do                  \
                if echo PASS | cmp -s $$d.result -; then        \
                        echo "pass $$d";                        \
                else                                            \
index c116fbd88416242414e697bc878e56df062d06b8..d7c39449e90f858f7e17fb8fe8b25a326a228e5e 100644 (file)
@@ -5,9 +5,12 @@
 # all the previous functionality should work too.  It's not too easy
 # to screw it up, thus the emphasis.
 
-# 75% for file system.
-33.3%  tests/filesys/extended/Rubric.functionality
+# 50% for extended file system features.
+16.7%  tests/filesys/extended/Rubric.functionality
 16.7%  tests/filesys/extended/Rubric.robustness
+16.6%  tests/filesys/extended/Rubric.persistence
+
+# 25% to not break the provided file system features.
 25%    tests/filesys/base/Rubric
 
 # 25% for the rest.
index 8a440e67625a3a1b883bca2f3e5409cdec094b84..c93069916c4da15fc6e5f0aea613a98389708d1f 100644 (file)
@@ -5,9 +5,12 @@
 # all the previous functionality should work too.  It's not too easy
 # to screw it up, thus the emphasis.
 
-# 75% for file system.
-33.3%  tests/filesys/extended/Rubric.functionality
+# 50% for extended file system features.
+16.7%  tests/filesys/extended/Rubric.functionality
 16.7%  tests/filesys/extended/Rubric.robustness
+16.6%  tests/filesys/extended/Rubric.persistence
+
+# 25% to not break the provided file system features.
 25%    tests/filesys/base/Rubric
 
 # 25% for the rest.
index 72539a5e8ddfaad2f841486de0108afce8e1e84c..389965af890b30b9cdf0e148baf42f248c72aa45 100644 (file)
@@ -1,13 +1,15 @@
 # -*- makefile -*-
 
-tests/filesys/extended_TESTS = $(addprefix                             \
-tests/filesys/extended/,dir-empty-name dir-mk-tree dir-mkdir dir-open  \
+raw_tests = dir-empty-name dir-mk-tree dir-mkdir dir-open              \
 dir-over-file dir-rm-cwd dir-rm-parent dir-rm-root dir-rm-tree         \
 dir-rmdir dir-under-file dir-vine grow-create grow-dir-lg              \
 grow-file-size grow-root-lg grow-root-sm grow-seq-lg grow-seq-sm       \
-grow-sparse grow-tell grow-two-files syn-rw)
+grow-sparse grow-tell grow-two-files syn-rw
 
-tests/filesys/extended_PROGS = $(tests/filesys/extended_TESTS) \
+tests/filesys/extended_TESTS = $(patsubst %,tests/filesys/extended/%,$(raw_tests))
+tests/filesys/extended_EXTRA_GRADES = $(patsubst %,tests/filesys/extended/%-persistence,$(raw_tests))
+
+tests/filesys/extended_PROGS = $(tests/filesys/extended_TESTS) \
 tests/filesys/extended/child-syn-rw tests/filesys/extended/tar
 
 $(foreach prog,$(tests/filesys/extended_PROGS),                        \
@@ -25,7 +27,6 @@ tests/filesys/extended/dir-rm-tree_SRC += tests/filesys/extended/mk-tree.c
 
 tests/filesys/extended/syn-rw_PUTFILES += tests/filesys/extended/child-syn-rw
 
-
 GETTIMEOUT = 60
 
 GETCMD = pintos -v -k -T $(GETTIMEOUT)
@@ -40,7 +41,7 @@ GETCMD += -- -q
 GETCMD += $(KERNELFLAGS)
 GETCMD += run 'tar fs.tar /'
 GETCMD += < /dev/null
-GETCMD += 2> $(TEST).get-errors $(if $(VERBOSE),|tee,>) $(TEST).get-output
+GETCMD += 2> $(TEST)-persistence.errors $(if $(VERBOSE),|tee,>) $(TEST)-persistence.output
 
 tests/filesys/extended/%.output: os.dsk
        rm -f tmp.dsk
@@ -48,10 +49,11 @@ tests/filesys/extended/%.output: os.dsk
        $(TESTCMD)
        $(GETCMD)
        rm -f tmp.dsk
+$(foreach raw_test,$(raw_tests),$(eval tests/filesys/extended/$(raw_test)-persistence.output: tests/filesys/extended/$(raw_test).output; ))
+$(foreach raw_test,$(raw_tests),$(eval tests/filesys/extended/$(raw_test)-persistence.result: tests/filesys/extended/$(raw_test).result))
 
 TARS = $(addsuffix .tar,$(tests/filesys/extended_TESTS))
-GET_OUTPUTS = $(addsuffix .get-output,$(tests/filesys/extended_TESTS))
-GET_ERRORS = $(addsuffix .get-errors,$(tests/filesys/extended_TESTS))
 
 clean::
-       rm -f $(TARS) $(GET_OUTPUTS) $(GET_ERRORS)
+       rm -f $(TARS)
+       rm -f tests/filesys/extended/can-rmdir-cwd
diff --git a/src/tests/filesys/extended/Rubric.persistence b/src/tests/filesys/extended/Rubric.persistence
new file mode 100644 (file)
index 0000000..405620a
--- /dev/null
@@ -0,0 +1,24 @@
+Persistence of file system:
+1      dir-empty-name-persistence
+1      dir-mk-tree-persistence
+1      dir-mkdir-persistence
+1      dir-open-persistence
+1      dir-over-file-persistence
+1      dir-rm-cwd-persistence
+1      dir-rm-parent-persistence
+1      dir-rm-root-persistence
+1      dir-rm-tree-persistence
+1      dir-rmdir-persistence
+1      dir-under-file-persistence
+1      dir-vine-persistence
+1      grow-create-persistence
+1      grow-dir-lg-persistence
+1      grow-file-size-persistence
+1      grow-root-lg-persistence
+1      grow-root-sm-persistence
+1      grow-seq-lg-persistence
+1      grow-seq-sm-persistence
+1      grow-sparse-persistence
+1      grow-tell-persistence
+1      grow-two-files-persistence
+1      syn-rw-persistence
diff --git a/src/tests/filesys/extended/dir-empty-name-persistence.ck b/src/tests/filesys/extended/dir-empty-name-persistence.ck
new file mode 100644 (file)
index 0000000..562c451
--- /dev/null
@@ -0,0 +1,6 @@
+# -*- perl -*-
+use strict;
+use warnings;
+use tests::tests;
+check_archive ({});
+pass;
index 5e4c56e5eb49352fe19ecb2cdd92ed98f9b36cf5..d6c5621eb5ff0147606384a3a08d1054a85d56a0 100644 (file)
@@ -7,5 +7,4 @@ check_expected (IGNORE_EXIT_CODES => 1, [<<'EOF']);
 (dir-empty-name) mkdir "" (must return false)
 (dir-empty-name) end
 EOF
-check_archive ({});
 pass;
diff --git a/src/tests/filesys/extended/dir-mk-tree-persistence.ck b/src/tests/filesys/extended/dir-mk-tree-persistence.ck
new file mode 100644 (file)
index 0000000..fb16afd
--- /dev/null
@@ -0,0 +1,16 @@
+# -*- perl -*-
+use strict;
+use warnings;
+use tests::tests;
+my ($tree);
+for my $a (0...3) {
+    for my $b (0...2) {
+       for my $c (0...2) {
+           for my $d (0...3) {
+               $tree->{$a}{$b}{$c}{$d} = [''];
+           }
+       }
+    }
+}
+check_archive ($tree);
+pass;
index 046e50941827714f8c1266d15f62b7e030d444ad..a8507e23fc68d2482e17b478a26bf59e7357f59b 100644 (file)
@@ -9,15 +9,4 @@ check_expected (IGNORE_EXIT_CODES => 1, [<<'EOF']);
 (dir-mk-tree) close "/0/2/0/3"
 (dir-mk-tree) end
 EOF
-my ($tree);
-for my $a (0...3) {
-    for my $b (0...2) {
-       for my $c (0...2) {
-           for my $d (0...3) {
-               $tree->{$a}{$b}{$c}{$d} = [''];
-           }
-       }
-    }
-}
-check_archive ($tree);
 pass;
diff --git a/src/tests/filesys/extended/dir-mkdir-persistence.ck b/src/tests/filesys/extended/dir-mkdir-persistence.ck
new file mode 100644 (file)
index 0000000..7682900
--- /dev/null
@@ -0,0 +1,6 @@
+# -*- perl -*-
+use strict;
+use warnings;
+use tests::tests;
+check_archive ({'a' => {'b' => ["\0" x 512]}});
+pass;
index 7cde055dd5d1778e8f29916c1c3759ba1c241e1d..4644f802387c21cae6a486294cd765aeab22911d 100644 (file)
@@ -10,5 +10,4 @@ check_expected (IGNORE_EXIT_CODES => 1, [<<'EOF']);
 (dir-mkdir) open "b"
 (dir-mkdir) end
 EOF
-check_archive ({'a' => {'b' => ["\0" x 512]}});
 pass;
diff --git a/src/tests/filesys/extended/dir-open-persistence.ck b/src/tests/filesys/extended/dir-open-persistence.ck
new file mode 100644 (file)
index 0000000..26ff2f1
--- /dev/null
@@ -0,0 +1,6 @@
+# -*- perl -*-
+use strict;
+use warnings;
+use tests::tests;
+check_archive ({"xyzzy" => {}});
+pass;
index 01eccbafa22f241a10bfd83b8a3133e83e2047a2..fccc56352fc7b6bc9f299b66e818c6c168a7f613 100644 (file)
@@ -17,5 +17,4 @@ EOF
 (dir-open) write "xyzzy"
 dir-open: exit(-1)
 EOF
-check_archive ({"xyzzy" => {}});
 pass;
diff --git a/src/tests/filesys/extended/dir-over-file-persistence.ck b/src/tests/filesys/extended/dir-over-file-persistence.ck
new file mode 100644 (file)
index 0000000..56b4ed2
--- /dev/null
@@ -0,0 +1,6 @@
+# -*- perl -*-
+use strict;
+use warnings;
+use tests::tests;
+check_archive ({"abc" => {}});
+pass;
index 52084292a698a589a3bf6c6f3ecc7ec9f4fd769d..aae1c1e8589d8c04ec4186517752feac5d7ede2c 100644 (file)
@@ -8,5 +8,4 @@ check_expected (IGNORE_EXIT_CODES => 1, [<<'EOF']);
 (dir-over-file) create "abc" (must return false)
 (dir-over-file) end
 EOF
-check_archive ({"abc" => {}});
 pass;
diff --git a/src/tests/filesys/extended/dir-rm-cwd-persistence.ck b/src/tests/filesys/extended/dir-rm-cwd-persistence.ck
new file mode 100644 (file)
index 0000000..7533570
--- /dev/null
@@ -0,0 +1,8 @@
+# -*- perl -*-
+use strict;
+use warnings;
+use tests::tests;
+my ($cwd_removable) = read_text_file ("tests/filesys/extended/can-rmdir-cwd");
+$cwd_removable eq 'YES' || $cwd_removable eq 'NO' or die;
+check_archive ($cwd_removable eq 'YES' ? {} : {"a" => {}});
+pass;
index 8821f0d767c24f43f671220eedf9dea5fc23933c..6fa47395f62338c98878d178b93ffae0351b8dda 100644 (file)
@@ -44,6 +44,8 @@ EOF
 (dir-rm-cwd) verify "/a" is empty
 (dir-rm-cwd) end
 EOF
-  
-check_archive ($cwd_removable eq 'YES' ? {} : {"a" => {}});
+open (CAN_RMDIR_CWD, ">tests/filesys/extended/can-rmdir-cwd")
+  or die "tests/filesys/extended/can-rmdir-cwd: create: $!\n";
+print CAN_RMDIR_CWD "$cwd_removable";
+close (CAN_RMDIR_CWD);
 pass;
diff --git a/src/tests/filesys/extended/dir-rm-parent-persistence.ck b/src/tests/filesys/extended/dir-rm-parent-persistence.ck
new file mode 100644 (file)
index 0000000..f30b04a
--- /dev/null
@@ -0,0 +1,6 @@
+# -*- perl -*-
+use strict;
+use warnings;
+use tests::tests;
+check_archive ({"a" => {"b" => {}}});
+pass;
index acbacc12db155a1d2bfdc07b732b9cc5cb651b45..9fea8f23c79348a51c8804b2d582a79619f56257 100644 (file)
@@ -11,5 +11,4 @@ check_expected (IGNORE_EXIT_CODES => 1, [<<'EOF']);
 (dir-rm-parent) remove "/a" (must fail)
 (dir-rm-parent) end
 EOF
-check_archive ({"a" => {"b" => {}}});
 pass;
diff --git a/src/tests/filesys/extended/dir-rm-root-persistence.ck b/src/tests/filesys/extended/dir-rm-root-persistence.ck
new file mode 100644 (file)
index 0000000..6315107
--- /dev/null
@@ -0,0 +1,6 @@
+# -*- perl -*-
+use strict;
+use warnings;
+use tests::tests;
+check_archive ({"a" => ["\0" x 243]});
+pass;
index b203cc6394aaa1758814f2b36c12e6cf787c9664..8a69ff3c1f943b167bb18480ddcf390bd69007c5 100644 (file)
@@ -8,5 +8,4 @@ check_expected (IGNORE_EXIT_CODES => 1, [<<'EOF']);
 (dir-rm-root) create "/a"
 (dir-rm-root) end
 EOF
-check_archive ({"a" => ["\0" x 243]});
 pass;
diff --git a/src/tests/filesys/extended/dir-rm-tree-persistence.ck b/src/tests/filesys/extended/dir-rm-tree-persistence.ck
new file mode 100644 (file)
index 0000000..562c451
--- /dev/null
@@ -0,0 +1,6 @@
+# -*- perl -*-
+use strict;
+use warnings;
+use tests::tests;
+check_archive ({});
+pass;
index 7e3ae6e1f46b84233c25131294c4908c6cb7a52f..587b4935a52accb5fd2683c2f5dd7e054c12b4fa 100644 (file)
@@ -11,5 +11,4 @@ check_expected (IGNORE_EXIT_CODES => 1, [<<'EOF']);
 (dir-rm-tree) open "/3/0/2/0" (must return -1)
 (dir-rm-tree) end
 EOF
-check_archive ({});
 pass;
diff --git a/src/tests/filesys/extended/dir-rmdir-persistence.ck b/src/tests/filesys/extended/dir-rmdir-persistence.ck
new file mode 100644 (file)
index 0000000..562c451
--- /dev/null
@@ -0,0 +1,6 @@
+# -*- perl -*-
+use strict;
+use warnings;
+use tests::tests;
+check_archive ({});
+pass;
index e1c89167d716cc6f04fde32815d3ff09acf2c0af..e0d892251e02c4573000e56f11e56ac11b422eb0 100644 (file)
@@ -9,5 +9,4 @@ check_expected (IGNORE_EXIT_CODES => 1, [<<'EOF']);
 (dir-rmdir) chdir "a" (must return false)
 (dir-rmdir) end
 EOF
-check_archive ({});
 pass;
diff --git a/src/tests/filesys/extended/dir-under-file-persistence.ck b/src/tests/filesys/extended/dir-under-file-persistence.ck
new file mode 100644 (file)
index 0000000..67ca528
--- /dev/null
@@ -0,0 +1,6 @@
+# -*- perl -*-
+use strict;
+use warnings;
+use tests::tests;
+check_archive ({"abc" => ['']});
+pass;
index 8123d19b0d7d8d9a9f62aa6caae5d4624d7a868e..cce23b42e2a052dd502e9e0dc264d269b41568bc 100644 (file)
@@ -8,5 +8,4 @@ check_expected (IGNORE_EXIT_CODES => 1, [<<'EOF']);
 (dir-under-file) mkdir "abc" (must return false)
 (dir-under-file) end
 EOF
-check_archive ({"abc" => ['']});
 pass;
diff --git a/src/tests/filesys/extended/dir-vine-persistence.ck b/src/tests/filesys/extended/dir-vine-persistence.ck
new file mode 100644 (file)
index 0000000..698ef01
--- /dev/null
@@ -0,0 +1,37 @@
+# -*- perl -*-
+use strict;
+use warnings;
+use tests::tests;
+# The archive should look like this:
+#
+# 40642 dir-vine
+# 42479 tar
+#     0 start
+#    11 start/file0
+#     0 start/dir0
+#    11 start/dir0/file1
+#     0 start/dir0/dir1
+#    11 start/dir0/dir1/file2
+#     0 start/dir0/dir1/dir2
+#    11 start/dir0/dir1/dir2/file3
+#     0 start/dir0/dir1/dir2/dir3
+#    11 start/dir0/dir1/dir2/dir3/file4
+#     0 start/dir0/dir1/dir2/dir3/dir4
+#    11 start/dir0/dir1/dir2/dir3/dir4/file5
+#     0 start/dir0/dir1/dir2/dir3/dir4/dir5
+#    11 start/dir0/dir1/dir2/dir3/dir4/dir5/file6
+#     0 start/dir0/dir1/dir2/dir3/dir4/dir5/dir6
+#    11 start/dir0/dir1/dir2/dir3/dir4/dir5/dir6/file7
+#     0 start/dir0/dir1/dir2/dir3/dir4/dir5/dir6/dir7
+#    11 start/dir0/dir1/dir2/dir3/dir4/dir5/dir6/dir7/file8
+#     0 start/dir0/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8
+#    11 start/dir0/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/file9
+#     0 start/dir0/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/dir9
+my ($dir) = {};
+my ($root) = {"start" => $dir};
+for (my ($i) = 0; $i < 10; $i++) {
+    $dir->{"file$i"} = ["contents $i\n"];
+    $dir = $dir->{"dir$i"} = {};
+}
+check_archive ($root);
+pass;
index 42754f9400a0bd8acffe844f64cab958264e6534..db452b0917621798578d14c3f2115943969c37eb 100644 (file)
@@ -8,37 +8,4 @@ check_expected (IGNORE_EXIT_CODES => 1, [<<'EOF']);
 (dir-vine) removing all but top 10 levels of files and directories...
 (dir-vine) end
 EOF
-
-# The archive should look like this:
-#
-# 40642 dir-vine
-# 42479 tar
-#     0 start
-#    11 start/file0
-#     0 start/dir0
-#    11 start/dir0/file1
-#     0 start/dir0/dir1
-#    11 start/dir0/dir1/file2
-#     0 start/dir0/dir1/dir2
-#    11 start/dir0/dir1/dir2/file3
-#     0 start/dir0/dir1/dir2/dir3
-#    11 start/dir0/dir1/dir2/dir3/file4
-#     0 start/dir0/dir1/dir2/dir3/dir4
-#    11 start/dir0/dir1/dir2/dir3/dir4/file5
-#     0 start/dir0/dir1/dir2/dir3/dir4/dir5
-#    11 start/dir0/dir1/dir2/dir3/dir4/dir5/file6
-#     0 start/dir0/dir1/dir2/dir3/dir4/dir5/dir6
-#    11 start/dir0/dir1/dir2/dir3/dir4/dir5/dir6/file7
-#     0 start/dir0/dir1/dir2/dir3/dir4/dir5/dir6/dir7
-#    11 start/dir0/dir1/dir2/dir3/dir4/dir5/dir6/dir7/file8
-#     0 start/dir0/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8
-#    11 start/dir0/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/file9
-#     0 start/dir0/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/dir9
-my ($dir) = {};
-my ($root) = {"start" => $dir};
-for (my ($i) = 0; $i < 10; $i++) {
-    $dir->{"file$i"} = ["contents $i\n"];
-    $dir = $dir->{"dir$i"} = {};
-}
-check_archive ($root);
 pass;
diff --git a/src/tests/filesys/extended/grow-create-persistence.ck b/src/tests/filesys/extended/grow-create-persistence.ck
new file mode 100644 (file)
index 0000000..bbcb24f
--- /dev/null
@@ -0,0 +1,6 @@
+# -*- perl -*-
+use strict;
+use warnings;
+use tests::tests;
+check_archive ({"blargle" => ['']});
+pass;
index c20ca4c34aaae267f4c9f309e49f40e035353711..b2e69d1cf35e0a91d8ec0d0dad1a1b12167dc86f 100644 (file)
@@ -10,5 +10,4 @@ check_expected (IGNORE_EXIT_CODES => 1, [<<'EOF']);
 (grow-create) close "blargle"
 (grow-create) end
 EOF
-check_archive ({"blargle" => ['']});
 pass;
diff --git a/src/tests/filesys/extended/grow-dir-lg-persistence.ck b/src/tests/filesys/extended/grow-dir-lg-persistence.ck
new file mode 100644 (file)
index 0000000..989a322
--- /dev/null
@@ -0,0 +1,9 @@
+# -*- perl -*-
+use strict;
+use warnings;
+use tests::tests;
+use tests::random;
+my ($fs);
+$fs->{'x'}{"file$_"} = [random_bytes (512)] foreach 0...49;
+check_archive ($fs);
+pass;
index 635e1bee185127b7f47eb00a97fe47ae09822eb5..ec58bd3fd2187140641e67d2a1aa9fa984c14fc7 100644 (file)
@@ -58,7 +58,4 @@ check_expected (IGNORE_EXIT_CODES => 1, [<<'EOF']);
 (grow-dir-lg) creating and checking "/x/file49"
 (grow-dir-lg) end
 EOF
-my ($fs);
-$fs->{'x'}{"file$_"} = [random_bytes (512)] foreach 0...49;
-check_archive ($fs);
 pass;
diff --git a/src/tests/filesys/extended/grow-file-size-persistence.ck b/src/tests/filesys/extended/grow-file-size-persistence.ck
new file mode 100644 (file)
index 0000000..150f383
--- /dev/null
@@ -0,0 +1,7 @@
+# -*- perl -*-
+use strict;
+use warnings;
+use tests::tests;
+use tests::random;
+check_archive ({"testfile" => [random_bytes (2134)]});
+pass;
index 057bb2e3380d7ffea2917b82bfc0a68b8732563e..d81feff594fa9d5dcfc7fba54c53d0a3ec465eef 100644 (file)
@@ -14,6 +14,4 @@ check_expected (IGNORE_EXIT_CODES => 1, [<<'EOF']);
 (grow-file-size) close "testfile"
 (grow-file-size) end
 EOF
-my ($string);
-check_archive ({"testfile" => [random_bytes (2134)]});
 pass;
diff --git a/src/tests/filesys/extended/grow-root-lg-persistence.ck b/src/tests/filesys/extended/grow-root-lg-persistence.ck
new file mode 100644 (file)
index 0000000..1692f46
--- /dev/null
@@ -0,0 +1,9 @@
+# -*- perl -*-
+use strict;
+use warnings;
+use tests::tests;
+use tests::random;
+my ($fs);
+$fs->{"file$_"} = [random_bytes (512)] foreach 0...49;
+check_archive ($fs);
+pass;
index 2affdddddc2e639156b231820f7e01f6ae9b2fb4..b174bc9c0332ef514561b5d94b0f9a072e4bbfa3 100644 (file)
@@ -57,7 +57,4 @@ check_expected (IGNORE_EXIT_CODES => 1, [<<'EOF']);
 (grow-root-lg) creating and checking "file49"
 (grow-root-lg) end
 EOF
-my ($fs);
-$fs->{"file$_"} = [random_bytes (512)] foreach 0...49;
-check_archive ($fs);
 pass;
diff --git a/src/tests/filesys/extended/grow-root-sm-persistence.ck b/src/tests/filesys/extended/grow-root-sm-persistence.ck
new file mode 100644 (file)
index 0000000..2b0b8ab
--- /dev/null
@@ -0,0 +1,9 @@
+# -*- perl -*-
+use strict;
+use warnings;
+use tests::tests;
+use tests::random;
+my ($fs);
+$fs->{"file$_"} = [random_bytes (512)] foreach 0...19;
+check_archive ($fs);
+pass;
index 8eb59e4dc9a1c92092ec3a6eb541fa9d38296f51..1aac7e9cac77c8f7d6a6c279c8631fe59c3641a7 100644 (file)
@@ -27,7 +27,4 @@ check_expected (IGNORE_EXIT_CODES => 1, [<<'EOF']);
 (grow-root-sm) creating and checking "file19"
 (grow-root-sm) end
 EOF
-my ($fs);
-$fs->{"file$_"} = [random_bytes (512)] foreach 0...19;
-check_archive ($fs);
 pass;
diff --git a/src/tests/filesys/extended/grow-seq-lg-persistence.ck b/src/tests/filesys/extended/grow-seq-lg-persistence.ck
new file mode 100644 (file)
index 0000000..41aaae0
--- /dev/null
@@ -0,0 +1,7 @@
+# -*- perl -*-
+use strict;
+use warnings;
+use tests::tests;
+use tests::random;
+check_archive ({"testme" => [random_bytes (72943)]});
+pass;
index 6276c79712a6a38c857ffd63c30a20c1d4fabeba..90fcd8cceadf478b1272cf6ece651747497e8bb7 100644 (file)
@@ -14,5 +14,4 @@ check_expected (IGNORE_EXIT_CODES => 1, [<<'EOF']);
 (grow-seq-lg) close "testme"
 (grow-seq-lg) end
 EOF
-check_archive ({"testme" => [random_bytes (72943)]});
 pass;
diff --git a/src/tests/filesys/extended/grow-seq-sm-persistence.ck b/src/tests/filesys/extended/grow-seq-sm-persistence.ck
new file mode 100644 (file)
index 0000000..6cb0bd8
--- /dev/null
@@ -0,0 +1,7 @@
+# -*- perl -*-
+use strict;
+use warnings;
+use tests::tests;
+use tests::random;
+check_archive ({"testme" => [random_bytes (5678)]});
+pass;
index 8dd2c26e0d7f4aa0d1282f1e6a07560de195c82e..5cf451850addaf0edb83e2b422beded39687a5cf 100644 (file)
@@ -14,5 +14,4 @@ check_expected (IGNORE_EXIT_CODES => 1, [<<'EOF']);
 (grow-seq-sm) close "testme"
 (grow-seq-sm) end
 EOF
-check_archive ({"testme" => [random_bytes (5678)]});
 pass;
diff --git a/src/tests/filesys/extended/grow-sparse-persistence.ck b/src/tests/filesys/extended/grow-sparse-persistence.ck
new file mode 100644 (file)
index 0000000..3f06a5b
--- /dev/null
@@ -0,0 +1,6 @@
+# -*- perl -*-
+use strict;
+use warnings;
+use tests::tests;
+check_archive ({"testfile" => ["\0" x 76543]});
+pass;
index 9c6315f796080eb4798642a46b0073405f08d3d6..379ba2c7e2552b594f3eb2cffb8dbb381d2e056e 100644 (file)
@@ -14,5 +14,4 @@ check_expected (IGNORE_EXIT_CODES => 1, [<<'EOF']);
 (grow-sparse) close "testfile"
 (grow-sparse) end
 EOF
-check_archive ({"testfile" => ["\0" x 76543]});
 pass;
diff --git a/src/tests/filesys/extended/grow-tell-persistence.ck b/src/tests/filesys/extended/grow-tell-persistence.ck
new file mode 100644 (file)
index 0000000..d93a422
--- /dev/null
@@ -0,0 +1,7 @@
+# -*- perl -*-
+use strict;
+use warnings;
+use tests::tests;
+use tests::random;
+check_archive ({"foobar" => [random_bytes (2134)]});
+pass;
index cd03efbd8477157a60362f69996bada034931177..fe94707cbbbbbf7c69987cb3a4b4163d76a9fb08 100644 (file)
@@ -14,5 +14,4 @@ check_expected (IGNORE_EXIT_CODES => 1, [<<'EOF']);
 (grow-tell) close "foobar"
 (grow-tell) end
 EOF
-check_archive ({"foobar" => [random_bytes (2134)]});
 pass;
diff --git a/src/tests/filesys/extended/grow-two-files-persistence.ck b/src/tests/filesys/extended/grow-two-files-persistence.ck
new file mode 100644 (file)
index 0000000..1c4ced1
--- /dev/null
@@ -0,0 +1,9 @@
+# -*- perl -*-
+use strict;
+use warnings;
+use tests::tests;
+use tests::random;
+my ($a) = random_bytes (8143);
+my ($b) = random_bytes (8143);
+check_archive ({"a" => [$a], "b" => [$b]});
+pass;
index b238d80f7fc0b182a6b5a3530ca4f712781f4704..b5e754ab42be6a36820e76f889f34373a29fee61 100644 (file)
@@ -20,7 +20,4 @@ check_expected (IGNORE_EXIT_CODES => 1, [<<'EOF']);
 (grow-two-files) close "b"
 (grow-two-files) end
 EOF
-my ($a) = random_bytes (8143);
-my ($b) = random_bytes (8143);
-check_archive ({"a" => [$a], "b" => [$b]});
 pass;
diff --git a/src/tests/filesys/extended/syn-rw-persistence.ck b/src/tests/filesys/extended/syn-rw-persistence.ck
new file mode 100644 (file)
index 0000000..62d57ee
--- /dev/null
@@ -0,0 +1,8 @@
+# -*- perl -*-
+use strict;
+use warnings;
+use tests::tests;
+use tests::random;
+check_archive ({"child-syn-rw" => "tests/filesys/extended/child-syn-rw",
+               "logfile" => [random_bytes (8 * 512)]});
+pass;
index 7a70299266e45982da330c50e1dd4ef040e52fd6..ac82aa8c77915d9b21499cac7287100b1f0338cd 100644 (file)
@@ -17,6 +17,4 @@ check_expected (IGNORE_EXIT_CODES => 1, [<<'EOF']);
 (syn-rw) wait for child 4 of 4 returned 3 (expected 3)
 (syn-rw) end
 EOF
-check_archive ({"child-syn-rw" => "tests/filesys/extended/child-syn-rw",
-               "logfile" => [random_bytes (8 * 512)]});
 pass;
index b12066640015c52def36b7e5e76bff11a758acde..0cc6c7ad2325f0fd294274940d117fd3ebc3f52e 100644 (file)
@@ -10,6 +10,15 @@ sub pass;
 die if @ARGV != 2;
 our ($test, $src_dir) = @ARGV;
 
+our (@prereq_tests) = ();
+if ($test =~ /^(.*)-persistence$/) {
+    push (@prereq_tests, $1);
+}
+for my $prereq_test (@prereq_tests) {
+    my (@result) = read_text_file ("$prereq_test.result");
+    fail "Prerequisite test $prereq_test failed.\n" if $result[0] ne 'PASS';
+}
+
 my ($msg_file) = tempfile ();
 select ($msg_file);
 \f
@@ -235,7 +244,8 @@ sub compare_output {
 #         recursively.
 sub check_archive {
     my ($expected_hier) = @_;
-    my (@output) = read_text_file ("$test.get-output");
+
+    my (@output) = read_text_file ("$test.output");
     common_checks ("file system extraction run", @output);
 
     @output = get_core_output ("file system extraction run", @output);
@@ -244,11 +254,12 @@ sub check_archive {
 
     my ($test_base_name) = $test;
     $test_base_name =~ s%.*/%%;
-    $expected_hier->{$test_base_name} = $test;
+    $test_base_name =~ s%-persistence$%%;
+    $expected_hier->{$test_base_name} = $prereq_tests[0];
     $expected_hier->{'tar'} = 'tests/filesys/extended/tar';
 
     my (%expected) = normalize_fs (flatten_hierarchy ($expected_hier, ""));
-    my (%actual) = read_tar ("$test.tar");
+    my (%actual) = read_tar ("$prereq_tests[0].tar");
 
     my ($errors) = 0;
     foreach my $name (sort keys %expected) {
@@ -273,7 +284,7 @@ sub check_archive {
                my ($esc_name) = $name;
                $esc_name =~ s/[^[:print:]]/./g;
                print <<EOF;
-$esc_name exists in the file system but should not.  (The expected name
+$esc_name exists in the file system but should not.  (The name
 of this file contains unusual characters that were printed as `.'.)
 EOF
            }