From 7fa97457a189249c824a2bcf9df723eb4ccc182e Mon Sep 17 00:00:00 2001 From: Geoffrey Challen Date: Tue, 1 Mar 2016 11:44:44 -0500 Subject: [PATCH] Working on ASST2 targets. --- kern/compile/.gitkeep | 0 test161/targets/asst2.tt | 73 +++++++++---------- test161/tests/asst2/fs/closetest.t | 8 -- test161/tests/asst2/fs/fileonlytest.t | 13 ---- test161/tests/asst2/fs/opentest.t | 8 -- test161/tests/asst2/fs/readwritetest.t | 9 --- test161/tests/asst2/fs/redirect.t | 11 --- test161/tests/asst2/fs/sparsefile.t | 11 --- .../stability/badcall/badcall-close.t | 0 .../stability/badcall/badcall-dup2.t | 0 .../stability/badcall/badcall-execv.t | 0 .../stability/badcall/badcall-lseek.t | 0 .../stability/badcall/badcall-open.t | 0 .../stability/badcall/badcall-read.t | 0 .../stability/badcall/badcall-waitpid.t | 0 .../stability/badcall/badcall-write.t | 0 .../{asst2 => }/stability/crash/crash-allS.t | 0 .../stability/crash/crash-template | 0 .../{asst2 => }/stability/crash/script.py | 0 test161/tests/{asst2 => }/stability/faulter.t | 0 .../tests/{asst2 => }/stability/forkbomb.t | 0 .../stability/forktest-stability.t | 0 .../tests/{asst2 => }/stability/randcall.t | 0 .../tests/{asst2/process => syscalls}/add.t | 0 .../{asst2/process => syscalls}/argtest.t | 0 .../{asst2/process => syscalls}/bigexec.t | 0 test161/tests/syscalls/closetest.t | 10 +++ .../{asst2/fs => syscalls}/consoletest.t | 4 +- .../{asst2/process => syscalls}/factorial.t | 0 test161/tests/syscalls/fileonlytest.t | 13 ++++ .../{asst2/process => syscalls}/forktest.t | 4 +- test161/tests/syscalls/opentest.t | 10 +++ test161/tests/syscalls/readwritetest.t | 10 +++ test161/tests/syscalls/redirect.t | 11 +++ .../tests/{asst2/process => syscalls}/shell.t | 2 +- test161/tests/syscalls/sparsefile.t | 11 +++ 36 files changed, 107 insertions(+), 101 deletions(-) delete mode 100644 kern/compile/.gitkeep delete mode 100644 test161/tests/asst2/fs/closetest.t delete mode 100644 test161/tests/asst2/fs/fileonlytest.t delete mode 100644 test161/tests/asst2/fs/opentest.t delete mode 100644 test161/tests/asst2/fs/readwritetest.t delete mode 100644 test161/tests/asst2/fs/redirect.t delete mode 100644 test161/tests/asst2/fs/sparsefile.t rename test161/tests/{asst2 => }/stability/badcall/badcall-close.t (100%) rename test161/tests/{asst2 => }/stability/badcall/badcall-dup2.t (100%) rename test161/tests/{asst2 => }/stability/badcall/badcall-execv.t (100%) rename test161/tests/{asst2 => }/stability/badcall/badcall-lseek.t (100%) rename test161/tests/{asst2 => }/stability/badcall/badcall-open.t (100%) rename test161/tests/{asst2 => }/stability/badcall/badcall-read.t (100%) rename test161/tests/{asst2 => }/stability/badcall/badcall-waitpid.t (100%) rename test161/tests/{asst2 => }/stability/badcall/badcall-write.t (100%) rename test161/tests/{asst2 => }/stability/crash/crash-allS.t (100%) rename test161/tests/{asst2 => }/stability/crash/crash-template (100%) rename test161/tests/{asst2 => }/stability/crash/script.py (100%) rename test161/tests/{asst2 => }/stability/faulter.t (100%) rename test161/tests/{asst2 => }/stability/forkbomb.t (100%) rename test161/tests/{asst2 => }/stability/forktest-stability.t (100%) rename test161/tests/{asst2 => }/stability/randcall.t (100%) rename test161/tests/{asst2/process => syscalls}/add.t (100%) rename test161/tests/{asst2/process => syscalls}/argtest.t (100%) rename test161/tests/{asst2/process => syscalls}/bigexec.t (100%) create mode 100644 test161/tests/syscalls/closetest.t rename test161/tests/{asst2/fs => syscalls}/consoletest.t (59%) rename test161/tests/{asst2/process => syscalls}/factorial.t (100%) create mode 100644 test161/tests/syscalls/fileonlytest.t rename test161/tests/{asst2/process => syscalls}/forktest.t (61%) create mode 100644 test161/tests/syscalls/opentest.t create mode 100644 test161/tests/syscalls/readwritetest.t create mode 100644 test161/tests/syscalls/redirect.t rename test161/tests/{asst2/process => syscalls}/shell.t (89%) create mode 100644 test161/tests/syscalls/sparsefile.t diff --git a/kern/compile/.gitkeep b/kern/compile/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/test161/targets/asst2.tt b/test161/targets/asst2.tt index 1ace305..6a5b4a3 100644 --- a/test161/targets/asst2.tt +++ b/test161/targets/asst2.tt @@ -5,72 +5,69 @@ type: asst kconfig: ASST2 userland: true tests: -# FS tests - - id: asst2/fs/consoletest.t +# Make sure the console works + - id: syscalls/consoletest.t points: 2 - - id: asst2/fs/opentest.t +# File system system calls (48 points) + - id: syscalls/opentest.t points: 5 - - id: asst2/fs/closetest.t + - id: syscalls/closetest.t points: 3 - - id: asst2/fs/readwritetest.t + - id: syscalls/readwritetest.t points: 10 - - id: asst2/fs/fileonlytest.t + - id: syscalls/fileonlytest.t points: 15 - - id: asst2/fs/redirect.t + - id: syscalls/redirect.t points: 10 - - id: asst2/fs/sparsefile.t + - id: syscalls/sparsefile.t points: 5 - -# Process tests - - id: asst2/process/forktest.t +# Process system call tests (50 points) + - id: syscalls/forktest.t points: 15 - - id: asst2/process/shell.t + - id: syscalls/shell.t points: 10 - - id: asst2/process/argtest.t + - id: syscalls/argtest.t points: 5 - - id: asst2/process/bigexec.t + - id: syscalls/bigexec.t points: 10 - - id: asst2/process/factorial.t + - id: syscalls/factorial.t points: 5 - - id: asst2/process/add.t + - id: syscalls/add.t points: 5 - -# All tests below this point are stability tests - -# badcalls - - id: asst2/stability/badcall/badcall-open.t +# Stability tests (50 points) +# Bad calls + - id: stability/badcall/badcall-open.t points: 3 - - id: asst2/stability/badcall/badcall-close.t + - id: stability/badcall/badcall-close.t points: 3 - - id: asst2/stability/badcall/badcall-read.t + - id: stability/badcall/badcall-read.t points: 3 - - id: asst2/stability/badcall/badcall-write.t + - id: stability/badcall/badcall-write.t points: 3 - - id: asst2/stability/badcall/badcall-lseek.t + - id: stability/badcall/badcall-lseek.t points: 3 - - id: asst2/stability/badcall/badcall-dup2.t + - id: stability/badcall/badcall-dup2.t points: 3 - - id: asst2/stability/badcall/badcall-execv.t + - id: stability/badcall/badcall-execv.t points: 5 - - id: asst2/stability/badcall/badcall-waitpid.t + - id: stability/badcall/badcall-waitpid.t points: 5 - - - id: asst2/stability/crash/crash-allS.t +# crash + - id: stability/crash/crash-allS.t points: 2 - - - id: asst2/stability/randcall.t +# randcall + - id: stability/randcall.t points: 5 commands: - id: /testbin/randcall args: - "-f" - - "-c 1000" + - "-c 100" - "-r {{randInt 1 4294967295}}" - "2" - - - id: asst2/stability/forkbomb.t +# forkbomb + - id: stability/forkbomb.t points: 10 - - - id: asst2/stability/forktest-stability.t +# forktest + - id: stability/forktest-stability.t points: 5 - diff --git a/test161/tests/asst2/fs/closetest.t b/test161/tests/asst2/fs/closetest.t deleted file mode 100644 index 85fc67d..0000000 --- a/test161/tests/asst2/fs/closetest.t +++ /dev/null @@ -1,8 +0,0 @@ ---- -name: "Close Test" -description: - Tests close syscall. Attempts to close stdin and a normal file. -tags: [fs] -depends: [boot, /asst2/fs/opentest.t] ---- -p /testbin/closetest diff --git a/test161/tests/asst2/fs/fileonlytest.t b/test161/tests/asst2/fs/fileonlytest.t deleted file mode 100644 index 34f2309..0000000 --- a/test161/tests/asst2/fs/fileonlytest.t +++ /dev/null @@ -1,13 +0,0 @@ ---- -name: "Fileonly Test" -description: - Tests open/close/read/write/lseek system calls. Opens file, writes 512 - bytes, skips 512 bytes and writes another 512 bytes(odd steps). Then seeks - back to beginning, and writes the even steps. Then seeks back to the - beginning and verifies that the contents are correct. -tags: [fs] -depends: [console, /asst2/fs/readwritetest.t,] -sys161: - ram: 4M ---- -p /testbin/fileonlytest diff --git a/test161/tests/asst2/fs/opentest.t b/test161/tests/asst2/fs/opentest.t deleted file mode 100644 index ae4db90..0000000 --- a/test161/tests/asst2/fs/opentest.t +++ /dev/null @@ -1,8 +0,0 @@ ---- -name: "Open Test" -description: - Tests open syscall. Attempts to open a file that is known to exist. -tags: [fs] -depends: [boot] ---- -p /testbin/opentest diff --git a/test161/tests/asst2/fs/readwritetest.t b/test161/tests/asst2/fs/readwritetest.t deleted file mode 100644 index 37107fc..0000000 --- a/test161/tests/asst2/fs/readwritetest.t +++ /dev/null @@ -1,9 +0,0 @@ ---- -name: "Read-Write Test" -description: - Tests read and write syscalls. Attempts to write a file and then - read it back. -tags: [fs] -depends: [/asst2/fs/opentest.t] ---- -p /testbin/readwritetest diff --git a/test161/tests/asst2/fs/redirect.t b/test161/tests/asst2/fs/redirect.t deleted file mode 100644 index 8a17a58..0000000 --- a/test161/tests/asst2/fs/redirect.t +++ /dev/null @@ -1,11 +0,0 @@ ---- -name: "Redirect Test" -description: - Tests dup2. Opens a file handle, forks a new process and manipulates the file - table using dup2. -tags: [fs] -depends: [/asst2/process/forktest.t] -sys161: - ram: 4M ---- -p /testbin/redirect diff --git a/test161/tests/asst2/fs/sparsefile.t b/test161/tests/asst2/fs/sparsefile.t deleted file mode 100644 index 20a8609..0000000 --- a/test161/tests/asst2/fs/sparsefile.t +++ /dev/null @@ -1,11 +0,0 @@ ---- -name: "Sparsefile Test" -description: - Tests lseek to write one byte of data after skipping the first x bytes - in an empty file. Then attempts to read this byte. -tags: [fs] -depends: [shell, /asst2/fs/fileonlytest.t] -sys161: - ram: 2M ---- -$ /testbin/sparsefile test 1048 diff --git a/test161/tests/asst2/stability/badcall/badcall-close.t b/test161/tests/stability/badcall/badcall-close.t similarity index 100% rename from test161/tests/asst2/stability/badcall/badcall-close.t rename to test161/tests/stability/badcall/badcall-close.t diff --git a/test161/tests/asst2/stability/badcall/badcall-dup2.t b/test161/tests/stability/badcall/badcall-dup2.t similarity index 100% rename from test161/tests/asst2/stability/badcall/badcall-dup2.t rename to test161/tests/stability/badcall/badcall-dup2.t diff --git a/test161/tests/asst2/stability/badcall/badcall-execv.t b/test161/tests/stability/badcall/badcall-execv.t similarity index 100% rename from test161/tests/asst2/stability/badcall/badcall-execv.t rename to test161/tests/stability/badcall/badcall-execv.t diff --git a/test161/tests/asst2/stability/badcall/badcall-lseek.t b/test161/tests/stability/badcall/badcall-lseek.t similarity index 100% rename from test161/tests/asst2/stability/badcall/badcall-lseek.t rename to test161/tests/stability/badcall/badcall-lseek.t diff --git a/test161/tests/asst2/stability/badcall/badcall-open.t b/test161/tests/stability/badcall/badcall-open.t similarity index 100% rename from test161/tests/asst2/stability/badcall/badcall-open.t rename to test161/tests/stability/badcall/badcall-open.t diff --git a/test161/tests/asst2/stability/badcall/badcall-read.t b/test161/tests/stability/badcall/badcall-read.t similarity index 100% rename from test161/tests/asst2/stability/badcall/badcall-read.t rename to test161/tests/stability/badcall/badcall-read.t diff --git a/test161/tests/asst2/stability/badcall/badcall-waitpid.t b/test161/tests/stability/badcall/badcall-waitpid.t similarity index 100% rename from test161/tests/asst2/stability/badcall/badcall-waitpid.t rename to test161/tests/stability/badcall/badcall-waitpid.t diff --git a/test161/tests/asst2/stability/badcall/badcall-write.t b/test161/tests/stability/badcall/badcall-write.t similarity index 100% rename from test161/tests/asst2/stability/badcall/badcall-write.t rename to test161/tests/stability/badcall/badcall-write.t diff --git a/test161/tests/asst2/stability/crash/crash-allS.t b/test161/tests/stability/crash/crash-allS.t similarity index 100% rename from test161/tests/asst2/stability/crash/crash-allS.t rename to test161/tests/stability/crash/crash-allS.t diff --git a/test161/tests/asst2/stability/crash/crash-template b/test161/tests/stability/crash/crash-template similarity index 100% rename from test161/tests/asst2/stability/crash/crash-template rename to test161/tests/stability/crash/crash-template diff --git a/test161/tests/asst2/stability/crash/script.py b/test161/tests/stability/crash/script.py similarity index 100% rename from test161/tests/asst2/stability/crash/script.py rename to test161/tests/stability/crash/script.py diff --git a/test161/tests/asst2/stability/faulter.t b/test161/tests/stability/faulter.t similarity index 100% rename from test161/tests/asst2/stability/faulter.t rename to test161/tests/stability/faulter.t diff --git a/test161/tests/asst2/stability/forkbomb.t b/test161/tests/stability/forkbomb.t similarity index 100% rename from test161/tests/asst2/stability/forkbomb.t rename to test161/tests/stability/forkbomb.t diff --git a/test161/tests/asst2/stability/forktest-stability.t b/test161/tests/stability/forktest-stability.t similarity index 100% rename from test161/tests/asst2/stability/forktest-stability.t rename to test161/tests/stability/forktest-stability.t diff --git a/test161/tests/asst2/stability/randcall.t b/test161/tests/stability/randcall.t similarity index 100% rename from test161/tests/asst2/stability/randcall.t rename to test161/tests/stability/randcall.t diff --git a/test161/tests/asst2/process/add.t b/test161/tests/syscalls/add.t similarity index 100% rename from test161/tests/asst2/process/add.t rename to test161/tests/syscalls/add.t diff --git a/test161/tests/asst2/process/argtest.t b/test161/tests/syscalls/argtest.t similarity index 100% rename from test161/tests/asst2/process/argtest.t rename to test161/tests/syscalls/argtest.t diff --git a/test161/tests/asst2/process/bigexec.t b/test161/tests/syscalls/bigexec.t similarity index 100% rename from test161/tests/asst2/process/bigexec.t rename to test161/tests/syscalls/bigexec.t diff --git a/test161/tests/syscalls/closetest.t b/test161/tests/syscalls/closetest.t new file mode 100644 index 0000000..e7f84a7 --- /dev/null +++ b/test161/tests/syscalls/closetest.t @@ -0,0 +1,10 @@ +--- +name: "Close Test" +description: > + Tests sys_close by closing STDIN and a normal file. +tags: [syscalls,filesyscalls] +depends: [boot, /asst2/fs/opentest.t] +sys161: + ram: 512K +--- +p /testbin/closetest diff --git a/test161/tests/asst2/fs/consoletest.t b/test161/tests/syscalls/consoletest.t similarity index 59% rename from test161/tests/asst2/fs/consoletest.t rename to test161/tests/syscalls/consoletest.t index e12af0a..bd644bd 100644 --- a/test161/tests/asst2/fs/consoletest.t +++ b/test161/tests/syscalls/consoletest.t @@ -1,8 +1,10 @@ --- name: "Console Test" +description: > + Make sure that the console works. tags: [console] depends: [boot] sys161: - ram: 4M + ram: 512K --- p /testbin/consoletest diff --git a/test161/tests/asst2/process/factorial.t b/test161/tests/syscalls/factorial.t similarity index 100% rename from test161/tests/asst2/process/factorial.t rename to test161/tests/syscalls/factorial.t diff --git a/test161/tests/syscalls/fileonlytest.t b/test161/tests/syscalls/fileonlytest.t new file mode 100644 index 0000000..9e6d796 --- /dev/null +++ b/test161/tests/syscalls/fileonlytest.t @@ -0,0 +1,13 @@ +--- +name: "Fileonly Test" +description: > + Tests sys_{open,close,read,write,lseek}. Opens a file, writes 512 + bytes, skips 512 bytes and writes another 512 bytes (odd steps). Seeks + back to beginning and writes the even steps. Then seeks back to the + beginning and verifies that the contents are correct. +tags: [syscalls,filesyscalls] +depends: [console, /asst2/fs/readwritetest.t,] +sys161: + ram: 512K +--- +p /testbin/fileonlytest diff --git a/test161/tests/asst2/process/forktest.t b/test161/tests/syscalls/forktest.t similarity index 61% rename from test161/tests/asst2/process/forktest.t rename to test161/tests/syscalls/forktest.t index 2d1a808..7c7705a 100644 --- a/test161/tests/asst2/process/forktest.t +++ b/test161/tests/syscalls/forktest.t @@ -1,6 +1,8 @@ --- name: "Fork Test" -tags: [proc] +description: > + Test that fork works. +tags: [syscalls,procsyscalls] depends: [console, /asst2/fs/readwritetest.t] sys161: ram: 4M diff --git a/test161/tests/syscalls/opentest.t b/test161/tests/syscalls/opentest.t new file mode 100644 index 0000000..da1993d --- /dev/null +++ b/test161/tests/syscalls/opentest.t @@ -0,0 +1,10 @@ +--- +name: "Open Test" +description: > + Tests sys_open by attempting to open an existing file. +tags: [syscalls,filesyscalls] +depends: [boot] +sys161: + ram: 512K +--- +p /testbin/opentest diff --git a/test161/tests/syscalls/readwritetest.t b/test161/tests/syscalls/readwritetest.t new file mode 100644 index 0000000..6ef808c --- /dev/null +++ b/test161/tests/syscalls/readwritetest.t @@ -0,0 +1,10 @@ +--- +name: "Read and Write Test" +description: > + Tests sys_read and sys_write by reading and writing to a file. +tags: [syscalls,filesyscalls] +depends: [/asst2/fs/opentest.t] +sys161: + ram: 512K +--- +p /testbin/readwritetest diff --git a/test161/tests/syscalls/redirect.t b/test161/tests/syscalls/redirect.t new file mode 100644 index 0000000..a22c749 --- /dev/null +++ b/test161/tests/syscalls/redirect.t @@ -0,0 +1,11 @@ +--- +name: "Redirect Test" +description: > + Tests sys_dup2. Opens a file handle, then forks a new process which + manipulates the file table. +tags: [syscalls,filesyscalls] +depends: [/asst2/process/forktest.t] +sys161: + ram: 512K +--- +p /testbin/redirect diff --git a/test161/tests/asst2/process/shell.t b/test161/tests/syscalls/shell.t similarity index 89% rename from test161/tests/asst2/process/shell.t rename to test161/tests/syscalls/shell.t index ea9cac8..5284039 100644 --- a/test161/tests/asst2/process/shell.t +++ b/test161/tests/syscalls/shell.t @@ -4,7 +4,7 @@ description: Tests whether the shell works by running /testbin/consoletest in the shell. The shell test tries to identify a race condition between the shell and the program that the shell is trying to run. -tags: [proc, shell] +tags: [syscalls,procsyscalls,shell] depends: [console] sys161: ram: 2M diff --git a/test161/tests/syscalls/sparsefile.t b/test161/tests/syscalls/sparsefile.t new file mode 100644 index 0000000..ccd2326 --- /dev/null +++ b/test161/tests/syscalls/sparsefile.t @@ -0,0 +1,11 @@ +--- +name: "Sparsefile Test" +description: > + Tests sys_lseek by writing one byte of data after skipping the beginning of + an empty file and then attempting to read this byte. +tags: [syscalls,filesyscalls] +depends: [shell, /asst2/fs/fileonlytest.t] +sys161: + ram: 512K +--- +$ /testbin/sparsefile test 1048