Blob
1 # constants3 const notag = -1:u164 const msize = 4194304:u32 # 4*1024*10245 const np2000 = "9P2000"9 # 9p protocol11 proc version(msize, version) {12 send(Tversion, notag, msize:u32, version:str)13 }15 proc attach(fid, afid, uname, aname) {16 send(Tversion, iota, fid:u32, afid:u32, uname:str, aname:str)17 }19 proc walk(fid, newfid, ...) {20 send(Twalk, iota, fid:u32, newfid:u32, ...:str)21 }25 # useful functions27 proc mount(fid, path) {28 version(msize, np2000)30 m = recv()31 assert(32 m.type == Tversion,33 m.tag == notag,34 m.msize == msize,35 m.version == version,36 )38 attach(fid, nofid, testuser, path)40 m = recv()41 assert (42 m.type == Rattach43 m.qid.type == QTDIR44 )45 }47 proc should-fail() {48 m = recv()49 assert m.type == Rerror50 debug("got expected error %s", m)51 }