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 a47c234b 2021-12-14 op 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 }