/
grade-lab7.sh
57 lines (47 loc) · 1.4 KB
/
grade-lab7.sh
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
#!/bin/sh
qemuopts="-hda obj/kern/kernel.img -hdb obj/fs/fs.img -net user -net nic,model=i82559er"
. ./grade-functions.sh
# Break on cons_getc instead of readline. This will trap if we either
# enter the kernel monitor or the shell prompt.
brkfn=cons_getc
$make
# 10 points - run-testpteshare
pts=10
runtest1 -tag 'PTE_SHARE [testpteshare]' testpteshare \
'fork handles PTE_SHARE right' \
'spawn handles PTE_SHARE right' \
# 10 points - run-testfdsharing
pts=10
runtest1 -tag 'fd sharing [testfdsharing]' testfdsharing \
'read in parent succeeded' \
'read in child succeeded' \
'write to file succeeded'
# 20 points - run-icode
pts=20
runtest1 -tag 'start the shell [icode]' icode \
'icode: read /motd' \
'This is /motd, the message of the day.' \
'icode: spawn /init' \
'init: running' \
'init: data seems okay' \
'icode: exiting' \
'init: bss seems okay' \
"init: args: 'init' 'initarg1' 'initarg2'" \
'init: running sh' \
'\$ '
# 20 points - run-testshell
pts=20
timeout=60
runtest1 -tag 'shell [testshell]' testshell \
'shell ran correctly' \
# 10 points - run-primespipe
pts=10
timeout=120
echo 'The primespipe test has up to 2 minutes to complete. Be patient.'
runtest1 -tag 'primespipe' primespipe \
! 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 \
541 1009 1097
showfinal