Blame


1 ce3d3a8f 2021-08-12 op include "lib.9ps"
2 ce3d3a8f 2021-08-12 op
3 ce3d3a8f 2021-08-12 op testing "if version works" dir "./root" {
4 ce3d3a8f 2021-08-12 op send(Tversion, notag, msize, np2000)
5 ce3d3a8f 2021-08-12 op m = recv()
6 ce3d3a8f 2021-08-12 op assert m.type == Rversion
7 ce3d3a8f 2021-08-12 op }
8 ce3d3a8f 2021-08-12 op
9 ce3d3a8f 2021-08-12 op testing "fails when sending a R-message" dir "./root" {
10 ce3d3a8f 2021-08-12 op send(Rversion, notag, msize, np2000)
11 ce3d3a8f 2021-08-12 op should-fail recv() : "the connection should have been closed"
12 ce3d3a8f 2021-08-12 op }
13 a47c234b 2021-12-14 op
14 a47c234b 2021-12-14 op testing "multiple attach" dir "./root" {
15 a47c234b 2021-12-14 op version(msize, np2000)
16 a47c234b 2021-12-14 op
17 a47c234b 2021-12-14 op m = recv()
18 a47c234b 2021-12-14 op assert (
19 a47c234b 2021-12-14 op m.type == Rversion
20 a47c234b 2021-12-14 op m.tag == notag
21 423f02f5 2021-12-28 cage m.msize <= msize
22 a47c234b 2021-12-14 op )
23 a47c234b 2021-12-14 op
24 a47c234b 2021-12-14 op fid1 = 0
25 a47c234b 2021-12-14 op fid2 = 1
26 a47c234b 2021-12-14 op
27 a47c234b 2021-12-14 op # attach the first fid
28 a47c234b 2021-12-14 op attach(fid1, nofid, "op", "/")
29 a47c234b 2021-12-14 op m = recv()
30 a47c234b 2021-12-14 op assert (
31 a47c234b 2021-12-14 op m.type == Rattach
32 a47c234b 2021-12-14 op m.qid.type == QTDIR
33 a47c234b 2021-12-14 op )
34 a47c234b 2021-12-14 op
35 a47c234b 2021-12-14 op # attach the second fid
36 a47c234b 2021-12-14 op attach(fid2, nofid, "op", "/")
37 a47c234b 2021-12-14 op m = recv()
38 a47c234b 2021-12-14 op assert (
39 a47c234b 2021-12-14 op m.type == Rattach
40 a47c234b 2021-12-14 op m.qid.type == QTDIR
41 a47c234b 2021-12-14 op )
42 a47c234b 2021-12-14 op }
43 fbf5d101 2021-12-21 op
44 fbf5d101 2021-12-21 op testing "don't close used qids" dir "./root" {
45 fbf5d101 2021-12-21 op mount(0, "/")
46 fbf5d101 2021-12-21 op
47 fbf5d101 2021-12-21 op walk(0, 2, "dir")
48 fbf5d101 2021-12-21 op expect(Rwalk)
49 fbf5d101 2021-12-21 op
50 fbf5d101 2021-12-21 op clunk(0)
51 fbf5d101 2021-12-21 op expect(Rclunk)
52 fbf5d101 2021-12-21 op
53 fbf5d101 2021-12-21 op walk(2, 3, "a-file")
54 fbf5d101 2021-12-21 op expect(Rwalk)
55 fbf5d101 2021-12-21 op
56 fbf5d101 2021-12-21 op clunk(2)
57 fbf5d101 2021-12-21 op expect(Rclunk)
58 fbf5d101 2021-12-21 op
59 fbf5d101 2021-12-21 op open(3, OREAD)
60 fbf5d101 2021-12-21 op expect(Ropen)
61 fbf5d101 2021-12-21 op }