From 4f670845ff9ab6c48bcb5f7bf4d4ef6dc3c3064b Mon Sep 17 00:00:00 2001 From: manuel Date: Tue, 27 Mar 2012 11:51:08 +0200 Subject: reorganize file structure to match the upstream requirements --- pintos-progos/tests/filesys/base/Make.tests | 18 ------- pintos-progos/tests/filesys/base/Rubric | 19 -------- pintos-progos/tests/filesys/base/child-syn-read.c | 44 ----------------- pintos-progos/tests/filesys/base/child-syn-wrt.c | 35 -------------- pintos-progos/tests/filesys/base/full.inc | 20 -------- pintos-progos/tests/filesys/base/lg-create.c | 5 -- pintos-progos/tests/filesys/base/lg-create.ck | 13 ----- pintos-progos/tests/filesys/base/lg-full.c | 6 --- pintos-progos/tests/filesys/base/lg-full.ck | 16 ------ pintos-progos/tests/filesys/base/lg-random.c | 7 --- pintos-progos/tests/filesys/base/lg-random.ck | 14 ------ pintos-progos/tests/filesys/base/lg-seq-block.c | 7 --- pintos-progos/tests/filesys/base/lg-seq-block.ck | 16 ------ pintos-progos/tests/filesys/base/lg-seq-random.c | 6 --- pintos-progos/tests/filesys/base/lg-seq-random.ck | 16 ------ pintos-progos/tests/filesys/base/random.inc | 59 ----------------------- pintos-progos/tests/filesys/base/seq-block.inc | 20 -------- pintos-progos/tests/filesys/base/seq-random.inc | 22 --------- pintos-progos/tests/filesys/base/sm-create.c | 5 -- pintos-progos/tests/filesys/base/sm-create.ck | 13 ----- pintos-progos/tests/filesys/base/sm-full.c | 6 --- pintos-progos/tests/filesys/base/sm-full.ck | 16 ------ pintos-progos/tests/filesys/base/sm-random.c | 7 --- pintos-progos/tests/filesys/base/sm-random.ck | 14 ------ pintos-progos/tests/filesys/base/sm-seq-block.c | 7 --- pintos-progos/tests/filesys/base/sm-seq-block.ck | 16 ------ pintos-progos/tests/filesys/base/sm-seq-random.c | 6 --- pintos-progos/tests/filesys/base/sm-seq-random.ck | 16 ------ pintos-progos/tests/filesys/base/syn-read.c | 31 ------------ pintos-progos/tests/filesys/base/syn-read.ck | 33 ------------- pintos-progos/tests/filesys/base/syn-read.h | 7 --- pintos-progos/tests/filesys/base/syn-remove.c | 30 ------------ pintos-progos/tests/filesys/base/syn-remove.ck | 16 ------ pintos-progos/tests/filesys/base/syn-write.c | 31 ------------ pintos-progos/tests/filesys/base/syn-write.ck | 32 ------------ pintos-progos/tests/filesys/base/syn-write.h | 9 ---- 36 files changed, 638 deletions(-) delete mode 100644 pintos-progos/tests/filesys/base/Make.tests delete mode 100644 pintos-progos/tests/filesys/base/Rubric delete mode 100644 pintos-progos/tests/filesys/base/child-syn-read.c delete mode 100644 pintos-progos/tests/filesys/base/child-syn-wrt.c delete mode 100644 pintos-progos/tests/filesys/base/full.inc delete mode 100644 pintos-progos/tests/filesys/base/lg-create.c delete mode 100644 pintos-progos/tests/filesys/base/lg-create.ck delete mode 100644 pintos-progos/tests/filesys/base/lg-full.c delete mode 100644 pintos-progos/tests/filesys/base/lg-full.ck delete mode 100644 pintos-progos/tests/filesys/base/lg-random.c delete mode 100644 pintos-progos/tests/filesys/base/lg-random.ck delete mode 100644 pintos-progos/tests/filesys/base/lg-seq-block.c delete mode 100644 pintos-progos/tests/filesys/base/lg-seq-block.ck delete mode 100644 pintos-progos/tests/filesys/base/lg-seq-random.c delete mode 100644 pintos-progos/tests/filesys/base/lg-seq-random.ck delete mode 100644 pintos-progos/tests/filesys/base/random.inc delete mode 100644 pintos-progos/tests/filesys/base/seq-block.inc delete mode 100644 pintos-progos/tests/filesys/base/seq-random.inc delete mode 100644 pintos-progos/tests/filesys/base/sm-create.c delete mode 100644 pintos-progos/tests/filesys/base/sm-create.ck delete mode 100644 pintos-progos/tests/filesys/base/sm-full.c delete mode 100644 pintos-progos/tests/filesys/base/sm-full.ck delete mode 100644 pintos-progos/tests/filesys/base/sm-random.c delete mode 100644 pintos-progos/tests/filesys/base/sm-random.ck delete mode 100644 pintos-progos/tests/filesys/base/sm-seq-block.c delete mode 100644 pintos-progos/tests/filesys/base/sm-seq-block.ck delete mode 100644 pintos-progos/tests/filesys/base/sm-seq-random.c delete mode 100644 pintos-progos/tests/filesys/base/sm-seq-random.ck delete mode 100644 pintos-progos/tests/filesys/base/syn-read.c delete mode 100644 pintos-progos/tests/filesys/base/syn-read.ck delete mode 100644 pintos-progos/tests/filesys/base/syn-read.h delete mode 100644 pintos-progos/tests/filesys/base/syn-remove.c delete mode 100644 pintos-progos/tests/filesys/base/syn-remove.ck delete mode 100644 pintos-progos/tests/filesys/base/syn-write.c delete mode 100644 pintos-progos/tests/filesys/base/syn-write.ck delete mode 100644 pintos-progos/tests/filesys/base/syn-write.h (limited to 'pintos-progos/tests/filesys/base') diff --git a/pintos-progos/tests/filesys/base/Make.tests b/pintos-progos/tests/filesys/base/Make.tests deleted file mode 100644 index e475222..0000000 --- a/pintos-progos/tests/filesys/base/Make.tests +++ /dev/null @@ -1,18 +0,0 @@ -# -*- makefile -*- - -tests/filesys/base_TESTS = $(addprefix tests/filesys/base/,lg-create \ -lg-full lg-random lg-seq-block lg-seq-random sm-create sm-full \ -sm-random sm-seq-block sm-seq-random syn-read syn-remove syn-write) - -tests/filesys/base_PROGS = $(tests/filesys/base_TESTS) $(addprefix \ -tests/filesys/base/,child-syn-read child-syn-wrt) - -$(foreach prog,$(tests/filesys/base_PROGS), \ - $(eval $(prog)_SRC += $(prog).c tests/lib.c tests/filesys/seq-test.c)) -$(foreach prog,$(tests/filesys/base_TESTS), \ - $(eval $(prog)_SRC += tests/main.c)) - -tests/filesys/base/syn-read_PUTFILES = tests/filesys/base/child-syn-read -tests/filesys/base/syn-write_PUTFILES = tests/filesys/base/child-syn-wrt - -tests/filesys/base/syn-read.output: TIMEOUT = 300 diff --git a/pintos-progos/tests/filesys/base/Rubric b/pintos-progos/tests/filesys/base/Rubric deleted file mode 100644 index 49a9d15..0000000 --- a/pintos-progos/tests/filesys/base/Rubric +++ /dev/null @@ -1,19 +0,0 @@ -Functionality of base file system: -- Test basic support for small files. -1 sm-create -2 sm-full -2 sm-random -2 sm-seq-block -3 sm-seq-random - -- Test basic support for large files. -1 lg-create -2 lg-full -2 lg-random -2 lg-seq-block -3 lg-seq-random - -- Test synchronized multiprogram access to files. -4 syn-read -4 syn-write -2 syn-remove diff --git a/pintos-progos/tests/filesys/base/child-syn-read.c b/pintos-progos/tests/filesys/base/child-syn-read.c deleted file mode 100644 index 77a5e26..0000000 --- a/pintos-progos/tests/filesys/base/child-syn-read.c +++ /dev/null @@ -1,44 +0,0 @@ -/* Child process for syn-read test. - Reads the contents of a test file a byte at a time, in the - hope that this will take long enough that we can get a - significant amount of contention in the kernel file system - code. */ - -#include -#include -#include -#include -#include "tests/lib.h" -#include "tests/filesys/base/syn-read.h" - -const char *test_name = "child-syn-read"; - -static char buf[BUF_SIZE]; - -int -main (int argc, const char *argv[]) -{ - int child_idx; - int fd; - size_t i; - - quiet = true; - - CHECK (argc == 2, "argc must be 2, actually %d", argc); - child_idx = atoi (argv[1]); - - random_init (0); - random_bytes (buf, sizeof buf); - - CHECK ((fd = open (file_name)) > 1, "open \"%s\"", file_name); - for (i = 0; i < sizeof buf; i++) - { - char c; - CHECK (read (fd, &c, 1) > 0, "read \"%s\"", file_name); - compare_bytes (&c, buf + i, 1, i, file_name); - } - close (fd); - - return child_idx; -} - diff --git a/pintos-progos/tests/filesys/base/child-syn-wrt.c b/pintos-progos/tests/filesys/base/child-syn-wrt.c deleted file mode 100644 index 1b52584..0000000 --- a/pintos-progos/tests/filesys/base/child-syn-wrt.c +++ /dev/null @@ -1,35 +0,0 @@ -/* Child process for syn-read test. - Writes into part of a test file. Other processes will be - writing into other parts at the same time. */ - -#include -#include -#include -#include "tests/lib.h" -#include "tests/filesys/base/syn-write.h" - -char buf[BUF_SIZE]; - -int -main (int argc, char *argv[]) -{ - int child_idx; - int fd; - - quiet = true; - - CHECK (argc == 2, "argc must be 2, actually %d", argc); - child_idx = atoi (argv[1]); - - random_init (0); - random_bytes (buf, sizeof buf); - - CHECK ((fd = open (file_name)) > 1, "open \"%s\"", file_name); - seek (fd, CHUNK_SIZE * child_idx); - CHECK (write (fd, buf + CHUNK_SIZE * child_idx, CHUNK_SIZE) > 0, - "write \"%s\"", file_name); - msg ("close \"%s\"", file_name); - close (fd); - - return child_idx; -} diff --git a/pintos-progos/tests/filesys/base/full.inc b/pintos-progos/tests/filesys/base/full.inc deleted file mode 100644 index 38a0396..0000000 --- a/pintos-progos/tests/filesys/base/full.inc +++ /dev/null @@ -1,20 +0,0 @@ -/* -*- c -*- */ - -#include "tests/filesys/seq-test.h" -#include "tests/main.h" - -static char buf[TEST_SIZE]; - -static size_t -return_test_size (void) -{ - return TEST_SIZE; -} - -void -test_main (void) -{ - seq_test ("quux", - buf, sizeof buf, sizeof buf, - return_test_size, NULL); -} diff --git a/pintos-progos/tests/filesys/base/lg-create.c b/pintos-progos/tests/filesys/base/lg-create.c deleted file mode 100644 index 5c45eee..0000000 --- a/pintos-progos/tests/filesys/base/lg-create.c +++ /dev/null @@ -1,5 +0,0 @@ -/* Tests that create properly zeros out the contents of a fairly - large file. */ - -#define TEST_SIZE 75678 -#include "tests/filesys/create.inc" diff --git a/pintos-progos/tests/filesys/base/lg-create.ck b/pintos-progos/tests/filesys/base/lg-create.ck deleted file mode 100644 index 86b2c51..0000000 --- a/pintos-progos/tests/filesys/base/lg-create.ck +++ /dev/null @@ -1,13 +0,0 @@ -# -*- perl -*- -use strict; -use warnings; -use tests::tests; -check_expected (IGNORE_EXIT_CODES => 1, [<<'EOF']); -(lg-create) begin -(lg-create) create "blargle" -(lg-create) open "blargle" for verification -(lg-create) verified contents of "blargle" -(lg-create) close "blargle" -(lg-create) end -EOF -pass; diff --git a/pintos-progos/tests/filesys/base/lg-full.c b/pintos-progos/tests/filesys/base/lg-full.c deleted file mode 100644 index 5f7234d..0000000 --- a/pintos-progos/tests/filesys/base/lg-full.c +++ /dev/null @@ -1,6 +0,0 @@ -/* Writes out the contents of a fairly large file all at once, - and then reads it back to make sure that it was written - properly. */ - -#define TEST_SIZE 75678 -#include "tests/filesys/base/full.inc" diff --git a/pintos-progos/tests/filesys/base/lg-full.ck b/pintos-progos/tests/filesys/base/lg-full.ck deleted file mode 100644 index ee6c7f9..0000000 --- a/pintos-progos/tests/filesys/base/lg-full.ck +++ /dev/null @@ -1,16 +0,0 @@ -# -*- perl -*- -use strict; -use warnings; -use tests::tests; -check_expected (IGNORE_EXIT_CODES => 1, [<<'EOF']); -(lg-full) begin -(lg-full) create "quux" -(lg-full) open "quux" -(lg-full) writing "quux" -(lg-full) close "quux" -(lg-full) open "quux" for verification -(lg-full) verified contents of "quux" -(lg-full) close "quux" -(lg-full) end -EOF -pass; diff --git a/pintos-progos/tests/filesys/base/lg-random.c b/pintos-progos/tests/filesys/base/lg-random.c deleted file mode 100644 index b6f8873..0000000 --- a/pintos-progos/tests/filesys/base/lg-random.c +++ /dev/null @@ -1,7 +0,0 @@ -/* Writes out the content of a fairly large file in random order, - then reads it back in random order to verify that it was - written properly. */ - -#define BLOCK_SIZE 512 -#define TEST_SIZE (512 * 150) -#include "tests/filesys/base/random.inc" diff --git a/pintos-progos/tests/filesys/base/lg-random.ck b/pintos-progos/tests/filesys/base/lg-random.ck deleted file mode 100644 index dd9f1dd..0000000 --- a/pintos-progos/tests/filesys/base/lg-random.ck +++ /dev/null @@ -1,14 +0,0 @@ -# -*- perl -*- -use strict; -use warnings; -use tests::tests; -check_expected (IGNORE_EXIT_CODES => 1, [<<'EOF']); -(lg-random) begin -(lg-random) create "bazzle" -(lg-random) open "bazzle" -(lg-random) write "bazzle" in random order -(lg-random) read "bazzle" in random order -(lg-random) close "bazzle" -(lg-random) end -EOF -pass; diff --git a/pintos-progos/tests/filesys/base/lg-seq-block.c b/pintos-progos/tests/filesys/base/lg-seq-block.c deleted file mode 100644 index 580c30b..0000000 --- a/pintos-progos/tests/filesys/base/lg-seq-block.c +++ /dev/null @@ -1,7 +0,0 @@ -/* Writes out a fairly large file sequentially, one fixed-size - block at a time, then reads it back to verify that it was - written properly. */ - -#define TEST_SIZE 75678 -#define BLOCK_SIZE 513 -#include "tests/filesys/base/seq-block.inc" diff --git a/pintos-progos/tests/filesys/base/lg-seq-block.ck b/pintos-progos/tests/filesys/base/lg-seq-block.ck deleted file mode 100644 index b789081..0000000 --- a/pintos-progos/tests/filesys/base/lg-seq-block.ck +++ /dev/null @@ -1,16 +0,0 @@ -# -*- perl -*- -use strict; -use warnings; -use tests::tests; -check_expected (IGNORE_EXIT_CODES => 1, [<<'EOF']); -(lg-seq-block) begin -(lg-seq-block) create "noodle" -(lg-seq-block) open "noodle" -(lg-seq-block) writing "noodle" -(lg-seq-block) close "noodle" -(lg-seq-block) open "noodle" for verification -(lg-seq-block) verified contents of "noodle" -(lg-seq-block) close "noodle" -(lg-seq-block) end -EOF -pass; diff --git a/pintos-progos/tests/filesys/base/lg-seq-random.c b/pintos-progos/tests/filesys/base/lg-seq-random.c deleted file mode 100644 index fbb6bba..0000000 --- a/pintos-progos/tests/filesys/base/lg-seq-random.c +++ /dev/null @@ -1,6 +0,0 @@ -/* Writes out a fairly large file sequentially, one random-sized - block at a time, then reads it back to verify that it was - written properly. */ - -#define TEST_SIZE 75678 -#include "tests/filesys/base/seq-random.inc" diff --git a/pintos-progos/tests/filesys/base/lg-seq-random.ck b/pintos-progos/tests/filesys/base/lg-seq-random.ck deleted file mode 100644 index 6b2dc82..0000000 --- a/pintos-progos/tests/filesys/base/lg-seq-random.ck +++ /dev/null @@ -1,16 +0,0 @@ -# -*- perl -*- -use strict; -use warnings; -use tests::tests; -check_expected (IGNORE_EXIT_CODES => 1, [<<'EOF']); -(lg-seq-random) begin -(lg-seq-random) create "nibble" -(lg-seq-random) open "nibble" -(lg-seq-random) writing "nibble" -(lg-seq-random) close "nibble" -(lg-seq-random) open "nibble" for verification -(lg-seq-random) verified contents of "nibble" -(lg-seq-random) close "nibble" -(lg-seq-random) end -EOF -pass; diff --git a/pintos-progos/tests/filesys/base/random.inc b/pintos-progos/tests/filesys/base/random.inc deleted file mode 100644 index eeeea68..0000000 --- a/pintos-progos/tests/filesys/base/random.inc +++ /dev/null @@ -1,59 +0,0 @@ -/* -*- c -*- */ - -#include -#include -#include -#include -#include "tests/lib.h" -#include "tests/main.h" - -#if TEST_SIZE % BLOCK_SIZE != 0 -#error TEST_SIZE must be a multiple of BLOCK_SIZE -#endif - -#define BLOCK_CNT (TEST_SIZE / BLOCK_SIZE) - -char buf[TEST_SIZE]; -int order[BLOCK_CNT]; - -void -test_main (void) -{ - const char *file_name = "bazzle"; - int fd; - size_t i; - - random_init (57); - random_bytes (buf, sizeof buf); - - for (i = 0; i < BLOCK_CNT; i++) - order[i] = i; - - CHECK (create (file_name, TEST_SIZE), "create \"%s\"", file_name); - CHECK ((fd = open (file_name)) > 1, "open \"%s\"", file_name); - - msg ("write \"%s\" in random order", file_name); - shuffle (order, BLOCK_CNT, sizeof *order); - for (i = 0; i < BLOCK_CNT; i++) - { - size_t ofs = BLOCK_SIZE * order[i]; - seek (fd, ofs); - if (write (fd, buf + ofs, BLOCK_SIZE) != BLOCK_SIZE) - fail ("write %d bytes at offset %zu failed", (int) BLOCK_SIZE, ofs); - } - - msg ("read \"%s\" in random order", file_name); - shuffle (order, BLOCK_CNT, sizeof *order); - for (i = 0; i < BLOCK_CNT; i++) - { - char block[BLOCK_SIZE]; - size_t ofs = BLOCK_SIZE * order[i]; - seek (fd, ofs); - if (read (fd, block, BLOCK_SIZE) != BLOCK_SIZE) - fail ("read %d bytes at offset %zu failed", (int) BLOCK_SIZE, ofs); - compare_bytes (block, buf + ofs, BLOCK_SIZE, ofs, file_name); - } - - msg ("close \"%s\"", file_name); - close (fd); -} diff --git a/pintos-progos/tests/filesys/base/seq-block.inc b/pintos-progos/tests/filesys/base/seq-block.inc deleted file mode 100644 index d4c1f57..0000000 --- a/pintos-progos/tests/filesys/base/seq-block.inc +++ /dev/null @@ -1,20 +0,0 @@ -/* -*- c -*- */ - -#include "tests/filesys/seq-test.h" -#include "tests/main.h" - -static char buf[TEST_SIZE]; - -static size_t -return_block_size (void) -{ - return BLOCK_SIZE; -} - -void -test_main (void) -{ - seq_test ("noodle", - buf, sizeof buf, sizeof buf, - return_block_size, NULL); -} diff --git a/pintos-progos/tests/filesys/base/seq-random.inc b/pintos-progos/tests/filesys/base/seq-random.inc deleted file mode 100644 index a4da4c5..0000000 --- a/pintos-progos/tests/filesys/base/seq-random.inc +++ /dev/null @@ -1,22 +0,0 @@ -/* -*- c -*- */ - -#include -#include "tests/filesys/seq-test.h" -#include "tests/main.h" - -static char buf[TEST_SIZE]; - -static size_t -return_random (void) -{ - return random_ulong () % 1031 + 1; -} - -void -test_main (void) -{ - random_init (-1); - seq_test ("nibble", - buf, sizeof buf, sizeof buf, - return_random, NULL); -} diff --git a/pintos-progos/tests/filesys/base/sm-create.c b/pintos-progos/tests/filesys/base/sm-create.c deleted file mode 100644 index 6b97ac1..0000000 --- a/pintos-progos/tests/filesys/base/sm-create.c +++ /dev/null @@ -1,5 +0,0 @@ -/* Tests that create properly zeros out the contents of a fairly - small file. */ - -#define TEST_SIZE 5678 -#include "tests/filesys/create.inc" diff --git a/pintos-progos/tests/filesys/base/sm-create.ck b/pintos-progos/tests/filesys/base/sm-create.ck deleted file mode 100644 index 8ca80dc..0000000 --- a/pintos-progos/tests/filesys/base/sm-create.ck +++ /dev/null @@ -1,13 +0,0 @@ -# -*- perl -*- -use strict; -use warnings; -use tests::tests; -check_expected (IGNORE_EXIT_CODES => 1, [<<'EOF']); -(sm-create) begin -(sm-create) create "blargle" -(sm-create) open "blargle" for verification -(sm-create) verified contents of "blargle" -(sm-create) close "blargle" -(sm-create) end -EOF -pass; diff --git a/pintos-progos/tests/filesys/base/sm-full.c b/pintos-progos/tests/filesys/base/sm-full.c deleted file mode 100644 index 23ff3d4..0000000 --- a/pintos-progos/tests/filesys/base/sm-full.c +++ /dev/null @@ -1,6 +0,0 @@ -/* Writes out the contents of a fairly small file all at once, - and then reads it back to make sure that it was written - properly. */ - -#define TEST_SIZE 5678 -#include "tests/filesys/base/full.inc" diff --git a/pintos-progos/tests/filesys/base/sm-full.ck b/pintos-progos/tests/filesys/base/sm-full.ck deleted file mode 100644 index 2e0eb36..0000000 --- a/pintos-progos/tests/filesys/base/sm-full.ck +++ /dev/null @@ -1,16 +0,0 @@ -# -*- perl -*- -use strict; -use warnings; -use tests::tests; -check_expected (IGNORE_EXIT_CODES => 1, [<<'EOF']); -(sm-full) begin -(sm-full) create "quux" -(sm-full) open "quux" -(sm-full) writing "quux" -(sm-full) close "quux" -(sm-full) open "quux" for verification -(sm-full) verified contents of "quux" -(sm-full) close "quux" -(sm-full) end -EOF -pass; diff --git a/pintos-progos/tests/filesys/base/sm-random.c b/pintos-progos/tests/filesys/base/sm-random.c deleted file mode 100644 index 42d670f..0000000 --- a/pintos-progos/tests/filesys/base/sm-random.c +++ /dev/null @@ -1,7 +0,0 @@ -/* Writes out the content of a fairly small file in random order, - then reads it back in random order to verify that it was - written properly. */ - -#define BLOCK_SIZE 13 -#define TEST_SIZE (13 * 123) -#include "tests/filesys/base/random.inc" diff --git a/pintos-progos/tests/filesys/base/sm-random.ck b/pintos-progos/tests/filesys/base/sm-random.ck deleted file mode 100644 index bda049d..0000000 --- a/pintos-progos/tests/filesys/base/sm-random.ck +++ /dev/null @@ -1,14 +0,0 @@ -# -*- perl -*- -use strict; -use warnings; -use tests::tests; -check_expected (IGNORE_EXIT_CODES => 1, [<<'EOF']); -(sm-random) begin -(sm-random) create "bazzle" -(sm-random) open "bazzle" -(sm-random) write "bazzle" in random order -(sm-random) read "bazzle" in random order -(sm-random) close "bazzle" -(sm-random) end -EOF -pass; diff --git a/pintos-progos/tests/filesys/base/sm-seq-block.c b/pintos-progos/tests/filesys/base/sm-seq-block.c deleted file mode 100644 index e368327..0000000 --- a/pintos-progos/tests/filesys/base/sm-seq-block.c +++ /dev/null @@ -1,7 +0,0 @@ -/* Writes out a fairly small file sequentially, one fixed-size - block at a time, then reads it back to verify that it was - written properly. */ - -#define TEST_SIZE 5678 -#define BLOCK_SIZE 513 -#include "tests/filesys/base/seq-block.inc" diff --git a/pintos-progos/tests/filesys/base/sm-seq-block.ck b/pintos-progos/tests/filesys/base/sm-seq-block.ck deleted file mode 100644 index 0e2939d..0000000 --- a/pintos-progos/tests/filesys/base/sm-seq-block.ck +++ /dev/null @@ -1,16 +0,0 @@ -# -*- perl -*- -use strict; -use warnings; -use tests::tests; -check_expected (IGNORE_EXIT_CODES => 1, [<<'EOF']); -(sm-seq-block) begin -(sm-seq-block) create "noodle" -(sm-seq-block) open "noodle" -(sm-seq-block) writing "noodle" -(sm-seq-block) close "noodle" -(sm-seq-block) open "noodle" for verification -(sm-seq-block) verified contents of "noodle" -(sm-seq-block) close "noodle" -(sm-seq-block) end -EOF -pass; diff --git a/pintos-progos/tests/filesys/base/sm-seq-random.c b/pintos-progos/tests/filesys/base/sm-seq-random.c deleted file mode 100644 index 89e5b71..0000000 --- a/pintos-progos/tests/filesys/base/sm-seq-random.c +++ /dev/null @@ -1,6 +0,0 @@ -/* Writes out a fairly large file sequentially, one random-sized - block at a time, then reads it back to verify that it was - written properly. */ - -#define TEST_SIZE 5678 -#include "tests/filesys/base/seq-random.inc" diff --git a/pintos-progos/tests/filesys/base/sm-seq-random.ck b/pintos-progos/tests/filesys/base/sm-seq-random.ck deleted file mode 100644 index 2fb368b..0000000 --- a/pintos-progos/tests/filesys/base/sm-seq-random.ck +++ /dev/null @@ -1,16 +0,0 @@ -# -*- perl -*- -use strict; -use warnings; -use tests::tests; -check_expected (IGNORE_EXIT_CODES => 1, [<<'EOF']); -(sm-seq-random) begin -(sm-seq-random) create "nibble" -(sm-seq-random) open "nibble" -(sm-seq-random) writing "nibble" -(sm-seq-random) close "nibble" -(sm-seq-random) open "nibble" for verification -(sm-seq-random) verified contents of "nibble" -(sm-seq-random) close "nibble" -(sm-seq-random) end -EOF -pass; diff --git a/pintos-progos/tests/filesys/base/syn-read.c b/pintos-progos/tests/filesys/base/syn-read.c deleted file mode 100644 index 7c36a42..0000000 --- a/pintos-progos/tests/filesys/base/syn-read.c +++ /dev/null @@ -1,31 +0,0 @@ -/* Spawns 10 child processes, all of which read from the same - file and make sure that the contents are what they should - be. */ - -#include -#include -#include -#include "tests/lib.h" -#include "tests/main.h" -#include "tests/filesys/base/syn-read.h" - -static char buf[BUF_SIZE]; - -#define CHILD_CNT 10 - -void -test_main (void) -{ - pid_t children[CHILD_CNT]; - int fd; - - CHECK (create (file_name, sizeof buf), "create \"%s\"", file_name); - CHECK ((fd = open (file_name)) > 1, "open \"%s\"", file_name); - random_bytes (buf, sizeof buf); - CHECK (write (fd, buf, sizeof buf) > 0, "write \"%s\"", file_name); - msg ("close \"%s\"", file_name); - close (fd); - - exec_children ("child-syn-read", children, CHILD_CNT); - wait_children (children, CHILD_CNT); -} diff --git a/pintos-progos/tests/filesys/base/syn-read.ck b/pintos-progos/tests/filesys/base/syn-read.ck deleted file mode 100644 index e2f68e8..0000000 --- a/pintos-progos/tests/filesys/base/syn-read.ck +++ /dev/null @@ -1,33 +0,0 @@ -# -*- perl -*- -use strict; -use warnings; -use tests::tests; -check_expected (IGNORE_EXIT_CODES => 1, [<<'EOF']); -(syn-read) begin -(syn-read) create "data" -(syn-read) open "data" -(syn-read) write "data" -(syn-read) close "data" -(syn-read) exec child 1 of 10: "child-syn-read 0" -(syn-read) exec child 2 of 10: "child-syn-read 1" -(syn-read) exec child 3 of 10: "child-syn-read 2" -(syn-read) exec child 4 of 10: "child-syn-read 3" -(syn-read) exec child 5 of 10: "child-syn-read 4" -(syn-read) exec child 6 of 10: "child-syn-read 5" -(syn-read) exec child 7 of 10: "child-syn-read 6" -(syn-read) exec child 8 of 10: "child-syn-read 7" -(syn-read) exec child 9 of 10: "child-syn-read 8" -(syn-read) exec child 10 of 10: "child-syn-read 9" -(syn-read) wait for child 1 of 10 returned 0 (expected 0) -(syn-read) wait for child 2 of 10 returned 1 (expected 1) -(syn-read) wait for child 3 of 10 returned 2 (expected 2) -(syn-read) wait for child 4 of 10 returned 3 (expected 3) -(syn-read) wait for child 5 of 10 returned 4 (expected 4) -(syn-read) wait for child 6 of 10 returned 5 (expected 5) -(syn-read) wait for child 7 of 10 returned 6 (expected 6) -(syn-read) wait for child 8 of 10 returned 7 (expected 7) -(syn-read) wait for child 9 of 10 returned 8 (expected 8) -(syn-read) wait for child 10 of 10 returned 9 (expected 9) -(syn-read) end -EOF -pass; diff --git a/pintos-progos/tests/filesys/base/syn-read.h b/pintos-progos/tests/filesys/base/syn-read.h deleted file mode 100644 index bff8082..0000000 --- a/pintos-progos/tests/filesys/base/syn-read.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef TESTS_FILESYS_BASE_SYN_READ_H -#define TESTS_FILESYS_BASE_SYN_READ_H - -#define BUF_SIZE 1024 -static const char file_name[] = "data"; - -#endif /* tests/filesys/base/syn-read.h */ diff --git a/pintos-progos/tests/filesys/base/syn-remove.c b/pintos-progos/tests/filesys/base/syn-remove.c deleted file mode 100644 index c9ba110..0000000 --- a/pintos-progos/tests/filesys/base/syn-remove.c +++ /dev/null @@ -1,30 +0,0 @@ -/* Verifies that a deleted file may still be written to and read - from. */ - -#include -#include -#include -#include "tests/lib.h" -#include "tests/main.h" - -char buf1[1234]; -char buf2[1234]; - -void -test_main (void) -{ - const char *file_name = "deleteme"; - int fd; - - CHECK (create (file_name, sizeof buf1), "create \"%s\"", file_name); - CHECK ((fd = open (file_name)) > 1, "open \"%s\"", file_name); - CHECK (remove (file_name), "remove \"%s\"", file_name); - random_bytes (buf1, sizeof buf1); - CHECK (write (fd, buf1, sizeof buf1) > 0, "write \"%s\"", file_name); - msg ("seek \"%s\" to 0", file_name); - seek (fd, 0); - CHECK (read (fd, buf2, sizeof buf2) > 0, "read \"%s\"", file_name); - compare_bytes (buf2, buf1, sizeof buf1, 0, file_name); - msg ("close \"%s\"", file_name); - close (fd); -} diff --git a/pintos-progos/tests/filesys/base/syn-remove.ck b/pintos-progos/tests/filesys/base/syn-remove.ck deleted file mode 100644 index 16ff11e..0000000 --- a/pintos-progos/tests/filesys/base/syn-remove.ck +++ /dev/null @@ -1,16 +0,0 @@ -# -*- perl -*- -use strict; -use warnings; -use tests::tests; -check_expected (IGNORE_EXIT_CODES => 1, [<<'EOF']); -(syn-remove) begin -(syn-remove) create "deleteme" -(syn-remove) open "deleteme" -(syn-remove) remove "deleteme" -(syn-remove) write "deleteme" -(syn-remove) seek "deleteme" to 0 -(syn-remove) read "deleteme" -(syn-remove) close "deleteme" -(syn-remove) end -EOF -pass; diff --git a/pintos-progos/tests/filesys/base/syn-write.c b/pintos-progos/tests/filesys/base/syn-write.c deleted file mode 100644 index 1439862..0000000 --- a/pintos-progos/tests/filesys/base/syn-write.c +++ /dev/null @@ -1,31 +0,0 @@ -/* Spawns several child processes to write out different parts of - the contents of a file and waits for them to finish. Then - reads back the file and verifies its contents. */ - -#include -#include -#include -#include -#include "tests/filesys/base/syn-write.h" -#include "tests/lib.h" -#include "tests/main.h" - -char buf1[BUF_SIZE]; -char buf2[BUF_SIZE]; - -void -test_main (void) -{ - pid_t children[CHILD_CNT]; - int fd; - - CHECK (create (file_name, sizeof buf1), "create \"%s\"", file_name); - - exec_children ("child-syn-wrt", children, CHILD_CNT); - wait_children (children, CHILD_CNT); - - CHECK ((fd = open (file_name)) > 1, "open \"%s\"", file_name); - CHECK (read (fd, buf1, sizeof buf1) > 0, "read \"%s\"", file_name); - random_bytes (buf2, sizeof buf2); - compare_bytes (buf1, buf2, sizeof buf1, 0, file_name); -} diff --git a/pintos-progos/tests/filesys/base/syn-write.ck b/pintos-progos/tests/filesys/base/syn-write.ck deleted file mode 100644 index 629a7a2..0000000 --- a/pintos-progos/tests/filesys/base/syn-write.ck +++ /dev/null @@ -1,32 +0,0 @@ -# -*- perl -*- -use strict; -use warnings; -use tests::tests; -check_expected (IGNORE_EXIT_CODES => 1, [<<'EOF']); -(syn-write) begin -(syn-write) create "stuff" -(syn-write) exec child 1 of 10: "child-syn-wrt 0" -(syn-write) exec child 2 of 10: "child-syn-wrt 1" -(syn-write) exec child 3 of 10: "child-syn-wrt 2" -(syn-write) exec child 4 of 10: "child-syn-wrt 3" -(syn-write) exec child 5 of 10: "child-syn-wrt 4" -(syn-write) exec child 6 of 10: "child-syn-wrt 5" -(syn-write) exec child 7 of 10: "child-syn-wrt 6" -(syn-write) exec child 8 of 10: "child-syn-wrt 7" -(syn-write) exec child 9 of 10: "child-syn-wrt 8" -(syn-write) exec child 10 of 10: "child-syn-wrt 9" -(syn-write) wait for child 1 of 10 returned 0 (expected 0) -(syn-write) wait for child 2 of 10 returned 1 (expected 1) -(syn-write) wait for child 3 of 10 returned 2 (expected 2) -(syn-write) wait for child 4 of 10 returned 3 (expected 3) -(syn-write) wait for child 5 of 10 returned 4 (expected 4) -(syn-write) wait for child 6 of 10 returned 5 (expected 5) -(syn-write) wait for child 7 of 10 returned 6 (expected 6) -(syn-write) wait for child 8 of 10 returned 7 (expected 7) -(syn-write) wait for child 9 of 10 returned 8 (expected 8) -(syn-write) wait for child 10 of 10 returned 9 (expected 9) -(syn-write) open "stuff" -(syn-write) read "stuff" -(syn-write) end -EOF -pass; diff --git a/pintos-progos/tests/filesys/base/syn-write.h b/pintos-progos/tests/filesys/base/syn-write.h deleted file mode 100644 index 07a6d5a..0000000 --- a/pintos-progos/tests/filesys/base/syn-write.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef TESTS_FILESYS_BASE_SYN_WRITE_H -#define TESTS_FILESYS_BASE_SYN_WRITE_H - -#define CHILD_CNT 10 -#define CHUNK_SIZE 512 -#define BUF_SIZE (CHILD_CNT * CHUNK_SIZE) -static const char file_name[] = "stuff"; - -#endif /* tests/filesys/base/syn-write.h */ -- cgit v1.2.3