summaryrefslogtreecommitdiff
path: root/lib9p/tests
diff options
context:
space:
mode:
Diffstat (limited to 'lib9p/tests')
-rw-r--r--lib9p/tests/test_server/fs_shutdown.c7
-rwxr-xr-xlib9p/tests/testclient-p9p2
-rw-r--r--lib9p/tests/testclient-p9p.explog4
-rw-r--r--lib9p/tests/testclient-sess.explog4
4 files changed, 9 insertions, 8 deletions
diff --git a/lib9p/tests/test_server/fs_shutdown.c b/lib9p/tests/test_server/fs_shutdown.c
index e7375ef..af2a989 100644
--- a/lib9p/tests/test_server/fs_shutdown.c
+++ b/lib9p/tests/test_server/fs_shutdown.c
@@ -24,7 +24,7 @@ static void shutdown_file_free(struct shutdown_file *self) {
static struct lib9p_qid shutdown_file_qid(struct shutdown_file *self) {
assert(self);
return (struct lib9p_qid){
- .type = LIB9P_QT_FILE,
+ .type = LIB9P_QT_FILE | LIB9P_QT_APPEND,
.vers = 1,
.path = self->pathnum,
};
@@ -37,7 +37,7 @@ static struct lib9p_stat shutdown_file_stat(struct shutdown_file *self, struct l
.kern_type = 0,
.kern_dev = 0,
.file_qid = shutdown_file_qid(self),
- .file_mode = 0222,
+ .file_mode = 0222 | LIB9P_DM_APPEND,
.file_atime = UTIL9P_ATIME,
.file_mtime = UTIL9P_MTIME,
.file_size = 0,
@@ -91,10 +91,11 @@ static uint32_t shutdown_fio_iounit(struct shutdown_fio *self) {
return 0;
}
-static uint32_t shutdown_fio_pwrite(struct shutdown_fio *self, struct lib9p_srv_ctx *ctx, void *buf, uint32_t byte_count, uint64_t LM_UNUSED(offset)) {
+static uint32_t shutdown_fio_pwrite(struct shutdown_fio *self, struct lib9p_srv_ctx *ctx, void *buf, uint32_t byte_count, uint64_t offset) {
assert(self);
assert(ctx);
assert(buf);
+ assert(offset == 0);
if (byte_count == 0)
return 0;
for (size_t i = 0; i < self->parent->nlisteners; i++)
diff --git a/lib9p/tests/testclient-p9p b/lib9p/tests/testclient-p9p
index 9c9f9f2..09ce746 100755
--- a/lib9p/tests/testclient-p9p
+++ b/lib9p/tests/testclient-p9p
@@ -30,7 +30,7 @@ expect_lines \
'--r--r--r-- M 0 root root 6 Oct 7 2024 flush-silent' \
'--r--r--r-- M 0 root root 6 Oct 7 2024 flush-slowread' \
'--r--r--r-- M 0 root root 6 Oct 7 2024 flush-slowsilent' \
- '---w--w--w- M 0 root root 0 Oct 7 2024 shutdown' \
+ 'a--w--w--w- M 0 root root 0 Oct 7 2024 shutdown' \
'--r--r--r-- M 0 root root 9 Oct 7 2024 whoami'
out=$("${client[@]}" ls -l 'Documentation/')
diff --git a/lib9p/tests/testclient-p9p.explog b/lib9p/tests/testclient-p9p.explog
index 7f3953d..8216297 100644
--- a/lib9p/tests/testclient-p9p.explog
+++ b/lib9p/tests/testclient-p9p.explog
@@ -97,9 +97,9 @@
> Tattach { tag=0 fid=0 afid=NOFID uname="nobody" aname="" n_uid=0 }
< Rattach { tag=0 qid={ type=(DIR) vers=1 path=1 } }
> Twalk { tag=0 fid=0 newfid=1 nwname=1 wname=[ "shutdown" ] }
-< Rwalk { tag=0 nwqid=1 wqid=[ { type=(0) vers=1 path=5 } ] }
+< Rwalk { tag=0 nwqid=1 wqid=[ { type=(APPEND) vers=1 path=5 } ] }
> Topen { tag=0 fid=1 mode=(TRUNC|MODE_WRITE) }
-< Ropen { tag=0 qid={ type=(0) vers=1 path=5 } iounit=0 }
+< Ropen { tag=0 qid={ type=(APPEND) vers=1 path=5 } iounit=0 }
> Twrite { tag=0 fid=1 offset=0 count=2 data="1\n" }
< Rwrite { tag=0 count=2 }
> Tclunk { tag=0 fid=1 }
diff --git a/lib9p/tests/testclient-sess.explog b/lib9p/tests/testclient-sess.explog
index 74a2cd7..f686045 100644
--- a/lib9p/tests/testclient-sess.explog
+++ b/lib9p/tests/testclient-sess.explog
@@ -149,8 +149,8 @@
> Tattach { tag=0 fid=0 afid=NOFID uname="nobody" aname="" n_uid=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=(0) vers=1 path=5 } ] }
+< 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=(0) vers=1 path=5 } iounit=0 }
+< 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 }