Blob


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