summaryrefslogtreecommitdiff
path: root/grade-lab-net
diff options
context:
space:
mode:
authorMole Shang <[email protected]>2024-02-16 10:20:27 +0800
committerMole Shang <[email protected]>2024-02-16 10:20:27 +0800
commita98c56a811142e5ede3332a7a444cca45f628769 (patch)
treec93ff7090da7b6ef911932be283818c2f6a03784 /grade-lab-net
parent0d65be5d1d880afafbf08c2adb605cf9f72216e2 (diff)
parent99015f3a985b2fd051606636743a2a2969b216e8 (diff)
downloadxv6-labs-a98c56a811142e5ede3332a7a444cca45f628769.tar.gz
xv6-labs-a98c56a811142e5ede3332a7a444cca45f628769.tar.bz2
xv6-labs-a98c56a811142e5ede3332a7a444cca45f628769.zip
Merge branch 'lock' into thread
Conflicts: .gitignore Makefile conf/lab.mk
Diffstat (limited to 'grade-lab-net')
-rwxr-xr-xgrade-lab-net43
1 files changed, 43 insertions, 0 deletions
diff --git a/grade-lab-net b/grade-lab-net
new file mode 100755
index 0000000..dd193e6
--- /dev/null
+++ b/grade-lab-net
@@ -0,0 +1,43 @@
+#!/usr/bin/env python3
+
+import re
+import subprocess
+from gradelib import *
+
+r = Runner(save("xv6.out"))
+
+@test(0, "running nettests")
+def test_nettest():
+ server = subprocess.Popen(["make", "server"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ r.run_qemu(shell_script([
+ 'nettests'
+ ]), timeout=30)
+ server.terminate()
+ server.communicate()
+
+@test(40, "nettest: ping", parent=test_nettest)
+def test_nettest_():
+ r.match('^testing ping: OK$')
+
+@test(20, "nettest: single process", parent=test_nettest)
+def test_nettest_():
+ r.match('^testing single-process pings: OK$')
+
+@test(20, "nettest: multi-process", parent=test_nettest)
+def test_nettest_fork_test():
+ r.match('^testing multi-process pings: OK$')
+
+@test(19, "nettest: DNS", parent=test_nettest)
+def test_nettest_dns_test():
+ r.match('^DNS OK$')
+
+#@test(10, "answers-net.txt")
+#def test_answers():
+# # just a simple sanity check, will be graded manually
+# check_answers("answers-net.txt")
+
+@test(1, "time")
+def test_time():
+ check_time()
+
+run_tests()