-
Notifications
You must be signed in to change notification settings - Fork 0
/
grade-lab10
executable file
·62 lines (55 loc) · 1.83 KB
/
grade-lab10
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
from gradelib import *
r = Runner(save("jos.out"),
stop_breakpoint("cons_getc"))
def matchtest(parent, name, *args, **kw):
def do_test():
r.match(*args, **kw)
test(4, name, parent=parent)(do_test)
@test(6, "internal FS tests [fs/test.c]")
def test_fs():
r.user_test("hello")
matchtest(test_fs, "fs i/o",
"FS can do I/O")
matchtest(test_fs, "check_bc",
"block cache is good")
matchtest(test_fs, "check_super",
"superblock is good")
matchtest(test_fs, "check_bitmap",
"bitmap is good")
matchtest(test_fs, "alloc_block",
"alloc_block is good")
matchtest(test_fs, "fs_consistency", "fs consistency is good")
matchtest(test_fs, "file_open",
"file_open is good")
matchtest(test_fs, "file_get_block",
"file_get_block is good")
matchtest(test_fs, "file_flush/file_truncate/file rewrite",
"file_flush is good",
"file_truncate is good",
"file rewrite is good")
@test(10, "testfile")
def test_testfile():
r.user_test("testfile", snapshot = False)
matchtest(test_testfile, "serve_open/file_stat/file_close",
"serve_open is good",
"file_stat is good",
"file_close is good",
"stale fileid is good")
matchtest(test_testfile, "file_read",
"file_read is good")
matchtest(test_testfile, "file_write",
"file_write is good")
matchtest(test_testfile, "file_read after file_write",
"file_read after file_write is good")
matchtest(test_testfile, "open",
"open is good")
matchtest(test_testfile, "large file",
"large file is good")
@test(20, "test consistency")
def test_consistency():
r.user_test("hello")
matchtest(test_consistency, "fs_consistency after tests",
"fs consistency is good")
run_tests()