Blob
1 include "consts.9ps"3 # 9p protocol5 proc version(msize, version) {6 send(Tversion, notag, msize:u32, version:str)7 }9 proc attach(fid, afid, uname, aname) {10 send(Tattach, iota(), fid:u32, afid:u32, uname:str, aname:str)11 }13 proc walk(fid, newfid, ...) {14 send(Twalk, iota(), fid:u32, newfid:u32, vargs:u16, ...)15 }19 # useful functions21 proc mount(fid, path) {22 version(msize, np2000)24 m = recv()25 assert (26 m.type == Rversion27 m.tag == notag28 m.msize == msize29 # m.version == version30 )32 attach(fid, nofid, "op", path)34 m = recv()35 assert (36 m.type == Rattach37 m.qid.type == QTDIR38 )39 }41 proc expect-error() {42 m = recv()43 assert m.type == Rerror44 debug("got expected error", m)45 }