summaryrefslogtreecommitdiff
path: root/lib9p/tests/testclient-sess.explog
blob: a3838ac95066c658f978b13e196468e4cfcf1ef6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
# lib9p/tests/testclient-sess.explog - Expected 9P logfile of testclient-sess.c
#
# Copyright (C) 2025  Luke T. Shumaker <lukeshu@lukeshu.com>
# SPDX-License-Identifier: AGPL-3.0-or-later

# numeric downgrade, unknown ext ###############################################
> Tversion { tag=0 max_msg_size=57 version="9P2025.x" }
< Rversion { tag=0 max_msg_size=57 version="9P2000" }

# numeric downgrade, known ext #################################################
> Tversion { tag=0 max_msg_size=57 version="9P2025.u" }
< Rversion { tag=0 max_msg_size=57 version="9P2000.u" }

# ext version, users ###########################################################
> Tversion { tag=0 max_msg_size=8192 version="9P2000.u" }
< Rversion { tag=0 max_msg_size=4120 version="9P2000.u" }
> Tattach { tag=0 fid=0 afid=NOFID uname="alice" aname="" unum=1000 }
< Rattach { tag=0 qid={ type=(DIR) vers=1 path=1 } }
> Tattach { tag=0 fid=1 afid=NOFID uname="bob" aname="" unum=1001 }
< Rattach { tag=0 qid={ type=(DIR) vers=1 path=1 } }
> Twalk { tag=0 fid=0 newfid=2 nwname=1 wname=[ "whoami" ] }
< Rwalk { tag=0 nwqid=1 wqid=[ { type=(0) vers=1 path=8 } ] }
> Twalk { tag=0 fid=1 newfid=3 nwname=1 wname=[ "whoami" ] }
< Rwalk { tag=0 nwqid=1 wqid=[ { type=(0) vers=1 path=8 } ] }
> Topen { tag=0 fid=2 mode=(MODE_READ) }
< Ropen { tag=0 qid={ type=(0) vers=1 path=8 } iounit=0 }
> Topen { tag=0 fid=3 mode=(MODE_READ) }
< Ropen { tag=0 qid={ type=(0) vers=1 path=8 } iounit=0 }
> Tread { tag=0 fid=2 offset=0 count=100 }
< Rread { tag=0 count=11 data="1000 alice\n" }
> Tread { tag=0 fid=3 offset=0 count=100 }
< Rread { tag=0 count=9 data="1001 bob\n" }

# walk #########################################################################
> Tversion { tag=0 max_msg_size=8192 version="9P2000" }
< Rversion { tag=0 max_msg_size=4120 version="9P2000" }
> Tattach { tag=0 fid=0 afid=NOFID uname="nobody" aname="" unum=0 }
< Rattach { tag=0 qid={ type=(DIR) vers=1 path=1 } }

# dup
> Twalk { tag=0 fid=0 newfid=1 nwname=0 wname=[ ] }
< Rwalk { tag=0 nwqid=0 wqid=[ ] }

# "The walk request carries as arguments an existing fid"...
> Twalk { tag=0 fid=2 newfid=3 nwname=0 wname=[ ] }
< Rerror { tag=0 errstr="bad file number 2" errnum=L_EBADF }

# ..."and a proposed newfid"...
> Twalk { tag=0 fid=1 newfid=NOFID nwname=0 wname=[ ] }
< Rerror { tag=0 errstr="cannot assign to NOFID" errnum=L_EBADF }

# ..."(which must not be in use"...
> Twalk { tag=0 fid=1 newfid=0 nwname=0 wname=[ ] }
< Rerror { tag=0 errstr="FID already in use" errnum=L_EBADF }

# ..."unless it is the same as fid)"...
> Twalk { tag=0 fid=1 newfid=1 nwname=0 wname=[ ] }
< Rwalk { tag=0 nwqid=0 wqid=[ ] }

# ... "that the client wishes to associate with the result of
# traversing the directory hierarchy by `walking' the heierarchy using
# the successive path name elements wname."...

# ..."The fid must represent a directory"...
> Twalk { tag=0 fid=1 newfid=2 nwname=1 wname=[ "README.md" ] }
< Rwalk { tag=0 nwqid=1 wqid=[ { type=(0) vers=1 path=4 } ] }
> Twalk { tag=0 fid=2 newfid=3 nwname=1 wname=[ ".." ] }
< Rerror { tag=0 errstr="not a directory" errnum=L_ENOTDIR }

# ..."unless zero path name elements are specified."
> Twalk { tag=0 fid=2 newfid=3 nwname=0 wname=[ ] }
< Rwalk { tag=0 nwqid=0 wqid=[ ] }

# "The fid must be valid in the current session" (tested above)...

# ..."and must not have been opened for I/O by an open or create
# message."...
> Topen { tag=0 fid=3 mode=(MODE_READ) }
< Ropen { tag=0 qid={ type=(0) vers=1 path=4 } iounit=0 }
> Twalk { tag=0 fid=3 newfid=4 nwname=0 wname=[ ] }
< Rerror { tag=0 errstr="cannot walk on FID open for I/O" errnum=L_EALREADY }

# flush ########################################################################
> Tversion { tag=0 max_msg_size=8192 version="9P2000" }
< Rversion { tag=0 max_msg_size=4120 version="9P2000" }
> Tattach { tag=0 fid=0 afid=NOFID uname="nobody" aname="" unum=0 }
< Rattach { tag=0 qid={ type=(DIR) vers=1 path=1 } }

# flush, but original response comes back first
> Twalk { tag=0 fid=0 newfid=1 nwname=1 wname=[ "flush-read" ] }
< Rwalk { tag=0 nwqid=1 wqid=[ { type=(0) vers=1 path=9 } ] }
> Topen { tag=0 fid=1 mode=(MODE_READ) }
< Ropen { tag=0 qid={ type=(0) vers=1 path=9 } iounit=0 }
> Tread { tag=0 fid=1 offset=0 count=10 }
> Tflush { tag=1 oldtag=0 }
< Rread { tag=0 count=6 data="Sloth\n" }
< Rflush { tag=1 }

# flush, original request is aborted with error
> Twalk { tag=0 fid=0 newfid=2 nwname=1 wname=[ "flush-error" ] }
< Rwalk { tag=0 nwqid=1 wqid=[ { type=(0) vers=1 path=10 } ] }
> Topen { tag=0 fid=2 mode=(MODE_READ) }
< Ropen { tag=0 qid={ type=(0) vers=1 path=10 } iounit=0 }
> Tread { tag=0 fid=2 offset=0 count=10 }
> Tflush { tag=1 oldtag=0 }
< Rerror { tag=0 errstr="request canceled by flush" errnum=L_ECANCELED }
< Rflush { tag=1 }

# flush, original request is aborted without error
> Twalk { tag=0 fid=0 newfid=3 nwname=1 wname=[ "flush-silent" ] }
< Rwalk { tag=0 nwqid=1 wqid=[ { type=(0) vers=1 path=11 } ] }
> Topen { tag=0 fid=3 mode=(MODE_READ) }
< Ropen { tag=0 qid={ type=(0) vers=1 path=11 } iounit=0 }
> Tread { tag=0 fid=3 offset=0 count=10 }
> Tflush { tag=1 oldtag=0 }
< Rflush { tag=1 }

# multiflush, original request is aborted without error
> Twalk { tag=0 fid=0 newfid=4 nwname=1 wname=[ "flush-slowsilent" ] }
< Rwalk { tag=0 nwqid=1 wqid=[ { type=(0) vers=1 path=12 } ] }
> Topen { tag=0 fid=4 mode=(MODE_READ) }
< Ropen { tag=0 qid={ type=(0) vers=1 path=12 } iounit=0 }
> Tread { tag=0 fid=4 offset=0 count=10 }
> Tflush { tag=1 oldtag=0 }
> Tflush { tag=2 oldtag=0 }
< Rflush { tag=2 }

# flush, but flush is flushed
> Twalk { tag=0 fid=0 newfid=5 nwname=1 wname=[ "flush-slowread" ] }
< Rwalk { tag=0 nwqid=1 wqid=[ { type=(0) vers=1 path=13 } ] }
> Topen { tag=0 fid=5 mode=(MODE_READ) }
< Ropen { tag=0 qid={ type=(0) vers=1 path=13 } iounit=0 }
> Tread { tag=0 fid=5 offset=0 count=10 }
> Tflush { tag=1 oldtag=0 }
> Tflush { tag=2 oldtag=1 }
< Rflush { tag=2 }
< Rread { tag=0 count=6 data="Sloth\n" }

# flush, unknown tag
> Tflush { tag=0 oldtag=99 }
< Rflush { tag=0 }

# flushed by Tversion
> Tread { tag=0 fid=3 offset=0 count=10 }

# shutdown #####################################################################
> Tversion { tag=0 max_msg_size=8192 version="9P2000" }
< Rversion { tag=0 max_msg_size=4120 version="9P2000" }
> Tattach { tag=0 fid=0 afid=NOFID uname="nobody" aname="" unum=0 }
< Rattach { tag=0 qid={ type=(DIR) vers=1 path=1 } }
> Twalk { tag=0 fid=0 newfid=0 nwname=1 wname=[ "shutdown" ] }
< Rwalk { tag=0 nwqid=1 wqid=[ { type=(APPEND) vers=1 path=5 } ] }
> Topen { tag=0 fid=0 mode=(MODE_WRITE) }
< Ropen { tag=0 qid={ type=(APPEND) vers=1 path=5 } iounit=0 }
> Twrite { tag=0 fid=0 offset=0 count=2 data="1\n" }
< Rwrite { tag=0 count=2 }