summaryrefslogtreecommitdiff
path: root/lib9p/tests
diff options
context:
space:
mode:
Diffstat (limited to 'lib9p/tests')
-rwxr-xr-xlib9p/tests/runtest8
-rw-r--r--lib9p/tests/test_compile.c192
-rw-r--r--lib9p/tests/test_compile_config/config.h28
-rw-r--r--lib9p/tests/test_server/config/config.h24
-rw-r--r--lib9p/tests/test_server/main.c8
5 files changed, 202 insertions, 58 deletions
diff --git a/lib9p/tests/runtest b/lib9p/tests/runtest
index a745f12..379ea6d 100755
--- a/lib9p/tests/runtest
+++ b/lib9p/tests/runtest
@@ -26,13 +26,13 @@ while [[ -d /proc/$server_pid && "$(readlink /proc/$server_pid/fd/4 2>/dev/null)
out=$("${client[@]}" ls -l '')
expect_lines \
- 'd-r-xr-xr-x M 0 root root 0 Oct 7 15:51 Documentation' \
- '--r--r--r-- M 0 root root 166 Oct 7 15:51 README.md' \
- '---w--w--w- M 0 root root 0 Oct 7 15:51 shutdown'
+ 'd-r-xr-xr-x M 0 root root 0 Oct 7 2024 Documentation' \
+ '--r--r--r-- M 0 root root 166 Oct 7 2024 README.md' \
+ '---w--w--w- M 0 root root 0 Oct 7 2024 shutdown'
out=$("${client[@]}" ls -l 'Documentation/')
expect_lines \
- '--r--r--r-- M 0 root root 166 Oct 7 15:51 x'
+ '--r--r--r-- M 0 root root 166 Oct 7 2024 x'
out=$("${client[@]}" read 'README.md')
expect_lines \
diff --git a/lib9p/tests/test_compile.c b/lib9p/tests/test_compile.c
index 6abee05..8f2445d 100644
--- a/lib9p/tests/test_compile.c
+++ b/lib9p/tests/test_compile.c
@@ -8,14 +8,26 @@ int main(void) {
x = LIB9P_DM_DIR;
x = LIB9P_DM_APPEND;
x = LIB9P_DM_EXCL;
- x = _LIB9P_DM_RESERVED_PLAN9_MOUNT;
+ x = _LIB9P_DM_PLAN9_MOUNT;
x = LIB9P_DM_AUTH;
x = LIB9P_DM_TMP;
+ x = _LIB9P_DM_UNUSED_25;
+ x = _LIB9P_DM_UNUSED_24;
x = LIB9P_DM_DEVICE;
- x = LIB9P_DM_NAMEDPIPE;
+ x = _LIB9P_DM_UNUSED_22;
+ x = LIB9P_DM_PIPE;
x = LIB9P_DM_SOCKET;
x = LIB9P_DM_SETUID;
x = LIB9P_DM_SETGID;
+ x = _LIB9P_DM_UNUSED_17;
+ x = _LIB9P_DM_UNUSED_16;
+ x = _LIB9P_DM_UNUSED_15;
+ x = _LIB9P_DM_UNUSED_14;
+ x = _LIB9P_DM_UNUSED_13;
+ x = _LIB9P_DM_UNUSED_12;
+ x = _LIB9P_DM_UNUSED_11;
+ x = _LIB9P_DM_UNUSED_10;
+ x = _LIB9P_DM_UNUSED_9;
x = LIB9P_DM_OWNER_R;
x = LIB9P_DM_OWNER_W;
x = LIB9P_DM_OWNER_X;
@@ -29,25 +41,38 @@ int main(void) {
x = LIB9P_QT_DIR;
x = LIB9P_QT_APPEND;
x = LIB9P_QT_EXCL;
- x = _LIB9P_QT_RESERVED_PLAN9_MOUNT;
+ x = _LIB9P_QT_PLAN9_MOUNT;
x = LIB9P_QT_AUTH;
x = LIB9P_QT_TMP;
x = LIB9P_QT_SYMLINK;
+ x = _LIB9P_QT_UNUSED_0;
x = LIB9P_QT_FILE;
x = LIB9P_NUID_NONUID;
+ x = _LIB9P_O_UNUSED_7;
x = LIB9P_O_RCLOSE;
x = _LIB9P_O_RESERVED_CEXEC;
x = LIB9P_O_TRUNC;
- x = _LIB9P_O_mode_1;
- x = _LIB9P_O_mode_0;
- x = LIB9P_O_READ;
- x = LIB9P_O_WRITE;
- x = LIB9P_O_RDWR;
- x = LIB9P_O_EXEC;
- x = LIB9P_O_MODE_MASK;
+ x = _LIB9P_O_UNUSED_3;
+ x = _LIB9P_O_UNUSED_2;
x = LIB9P_O_FLAG_MASK;
+ x = LIB9P_O_MODE_READ;
+ x = LIB9P_O_MODE_WRITE;
+ x = LIB9P_O_MODE_RDWR;
+ x = LIB9P_O_MODE_EXEC;
+ x = LIB9P_O_MODE_MASK;
x = LIB9P_ERRNO_NOERROR;
x = LIB9P_SUPER_MAGIC_V9FS_MAGIC;
+ x = _LIB9P_LO_UNUSED_31;
+ x = _LIB9P_LO_UNUSED_30;
+ x = _LIB9P_LO_UNUSED_29;
+ x = _LIB9P_LO_UNUSED_28;
+ x = _LIB9P_LO_UNUSED_27;
+ x = _LIB9P_LO_UNUSED_26;
+ x = _LIB9P_LO_UNUSED_25;
+ x = _LIB9P_LO_UNUSED_24;
+ x = _LIB9P_LO_UNUSED_23;
+ x = _LIB9P_LO_UNUSED_22;
+ x = _LIB9P_LO_UNUSED_21;
x = LIB9P_LO_SYNC;
x = LIB9P_LO_CLOEXEC;
x = LIB9P_LO_NOATIME;
@@ -63,27 +88,41 @@ int main(void) {
x = LIB9P_LO_NOCTTY;
x = LIB9P_LO_EXCL;
x = LIB9P_LO_CREATE;
- x = _LIB9P_LO_mode_1;
- x = _LIB9P_LO_mode_0;
- x = LIB9P_LO_RDONLY;
- x = LIB9P_LO_WRONLY;
- x = LIB9P_LO_RDWR;
- x = LIB9P_LO_NOACCESS;
- x = LIB9P_LO_MODE_MASK;
+ x = _LIB9P_LO_UNUSED_5;
+ x = _LIB9P_LO_UNUSED_4;
+ x = _LIB9P_LO_UNUSED_3;
+ x = _LIB9P_LO_UNUSED_2;
x = LIB9P_LO_FLAG_MASK;
+ x = LIB9P_LO_MODE_RDONLY;
+ x = LIB9P_LO_MODE_WRONLY;
+ x = LIB9P_LO_MODE_RDWR;
+ x = LIB9P_LO_MODE_NOACCESS;
+ x = LIB9P_LO_MODE_MASK;
x = LIB9P_DT_UNKNOWN;
- x = LIB9P_DT_NAMED_PIPE;
+ x = LIB9P_DT_PIPE;
x = LIB9P_DT_CHAR_DEV;
x = LIB9P_DT_DIRECTORY;
x = LIB9P_DT_BLOCK_DEV;
x = LIB9P_DT_REGULAR;
x = LIB9P_DT_SYMLINK;
x = LIB9P_DT_SOCKET;
- x = LIB9P_DT_WHITEOUT;
- x = _LIB9P_MODE_fmt_3;
- x = _LIB9P_MODE_fmt_2;
- x = _LIB9P_MODE_fmt_1;
- x = _LIB9P_MODE_fmt_0;
+ x = _LIB9P_DT_WHITEOUT;
+ x = _LIB9P_MODE_UNUSED_31;
+ x = _LIB9P_MODE_UNUSED_30;
+ x = _LIB9P_MODE_UNUSED_29;
+ x = _LIB9P_MODE_UNUSED_28;
+ x = _LIB9P_MODE_UNUSED_27;
+ x = _LIB9P_MODE_UNUSED_26;
+ x = _LIB9P_MODE_UNUSED_25;
+ x = _LIB9P_MODE_UNUSED_24;
+ x = _LIB9P_MODE_UNUSED_23;
+ x = _LIB9P_MODE_UNUSED_22;
+ x = _LIB9P_MODE_UNUSED_21;
+ x = _LIB9P_MODE_UNUSED_20;
+ x = _LIB9P_MODE_UNUSED_19;
+ x = _LIB9P_MODE_UNUSED_18;
+ x = _LIB9P_MODE_UNUSED_17;
+ x = _LIB9P_MODE_UNUSED_16;
x = LIB9P_MODE_PERM_SETGROUP;
x = LIB9P_MODE_PERM_SETUSER;
x = LIB9P_MODE_PERM_STICKY;
@@ -96,17 +135,67 @@ int main(void) {
x = LIB9P_MODE_PERM_OTHER_R;
x = LIB9P_MODE_PERM_OTHER_W;
x = LIB9P_MODE_PERM_OTHER_X;
- x = LIB9P_MODE_FMT_NAMED_PIPE;
+ x = LIB9P_MODE_PERM_MASK;
+ x = LIB9P_MODE_FMT_PIPE;
x = LIB9P_MODE_FMT_CHAR_DEV;
x = LIB9P_MODE_FMT_DIRECTORY;
x = LIB9P_MODE_FMT_BLOCK_DEV;
x = LIB9P_MODE_FMT_REGULAR;
x = LIB9P_MODE_FMT_SYMLINK;
x = LIB9P_MODE_FMT_SOCKET;
- x = LIB9P_MODE_PERM_MASK;
x = LIB9P_MODE_FMT_MASK;
x = LIB9P_B4_FALSE;
x = LIB9P_B4_TRUE;
+ x = _LIB9P_GETATTR_UNUSED_63;
+ x = _LIB9P_GETATTR_UNUSED_62;
+ x = _LIB9P_GETATTR_UNUSED_61;
+ x = _LIB9P_GETATTR_UNUSED_60;
+ x = _LIB9P_GETATTR_UNUSED_59;
+ x = _LIB9P_GETATTR_UNUSED_58;
+ x = _LIB9P_GETATTR_UNUSED_57;
+ x = _LIB9P_GETATTR_UNUSED_56;
+ x = _LIB9P_GETATTR_UNUSED_55;
+ x = _LIB9P_GETATTR_UNUSED_54;
+ x = _LIB9P_GETATTR_UNUSED_53;
+ x = _LIB9P_GETATTR_UNUSED_52;
+ x = _LIB9P_GETATTR_UNUSED_51;
+ x = _LIB9P_GETATTR_UNUSED_50;
+ x = _LIB9P_GETATTR_UNUSED_49;
+ x = _LIB9P_GETATTR_UNUSED_48;
+ x = _LIB9P_GETATTR_UNUSED_47;
+ x = _LIB9P_GETATTR_UNUSED_46;
+ x = _LIB9P_GETATTR_UNUSED_45;
+ x = _LIB9P_GETATTR_UNUSED_44;
+ x = _LIB9P_GETATTR_UNUSED_43;
+ x = _LIB9P_GETATTR_UNUSED_42;
+ x = _LIB9P_GETATTR_UNUSED_41;
+ x = _LIB9P_GETATTR_UNUSED_40;
+ x = _LIB9P_GETATTR_UNUSED_39;
+ x = _LIB9P_GETATTR_UNUSED_38;
+ x = _LIB9P_GETATTR_UNUSED_37;
+ x = _LIB9P_GETATTR_UNUSED_36;
+ x = _LIB9P_GETATTR_UNUSED_35;
+ x = _LIB9P_GETATTR_UNUSED_34;
+ x = _LIB9P_GETATTR_UNUSED_33;
+ x = _LIB9P_GETATTR_UNUSED_32;
+ x = _LIB9P_GETATTR_UNUSED_31;
+ x = _LIB9P_GETATTR_UNUSED_30;
+ x = _LIB9P_GETATTR_UNUSED_29;
+ x = _LIB9P_GETATTR_UNUSED_28;
+ x = _LIB9P_GETATTR_UNUSED_27;
+ x = _LIB9P_GETATTR_UNUSED_26;
+ x = _LIB9P_GETATTR_UNUSED_25;
+ x = _LIB9P_GETATTR_UNUSED_24;
+ x = _LIB9P_GETATTR_UNUSED_23;
+ x = _LIB9P_GETATTR_UNUSED_22;
+ x = _LIB9P_GETATTR_UNUSED_21;
+ x = _LIB9P_GETATTR_UNUSED_20;
+ x = _LIB9P_GETATTR_UNUSED_19;
+ x = _LIB9P_GETATTR_UNUSED_18;
+ x = _LIB9P_GETATTR_UNUSED_17;
+ x = _LIB9P_GETATTR_UNUSED_16;
+ x = _LIB9P_GETATTR_UNUSED_15;
+ x = _LIB9P_GETATTR_UNUSED_14;
x = LIB9P_GETATTR_DATA_VERSION;
x = LIB9P_GETATTR_GEN;
x = LIB9P_GETATTR_BTIME;
@@ -123,6 +212,29 @@ int main(void) {
x = LIB9P_GETATTR_MODE;
x = LIB9P_GETATTR_BASIC;
x = LIB9P_GETATTR_ALL;
+ x = _LIB9P_SETATTR_UNUSED_31;
+ x = _LIB9P_SETATTR_UNUSED_30;
+ x = _LIB9P_SETATTR_UNUSED_29;
+ x = _LIB9P_SETATTR_UNUSED_28;
+ x = _LIB9P_SETATTR_UNUSED_27;
+ x = _LIB9P_SETATTR_UNUSED_26;
+ x = _LIB9P_SETATTR_UNUSED_25;
+ x = _LIB9P_SETATTR_UNUSED_24;
+ x = _LIB9P_SETATTR_UNUSED_23;
+ x = _LIB9P_SETATTR_UNUSED_22;
+ x = _LIB9P_SETATTR_UNUSED_21;
+ x = _LIB9P_SETATTR_UNUSED_20;
+ x = _LIB9P_SETATTR_UNUSED_19;
+ x = _LIB9P_SETATTR_UNUSED_18;
+ x = _LIB9P_SETATTR_UNUSED_17;
+ x = _LIB9P_SETATTR_UNUSED_16;
+ x = _LIB9P_SETATTR_UNUSED_15;
+ x = _LIB9P_SETATTR_UNUSED_14;
+ x = _LIB9P_SETATTR_UNUSED_13;
+ x = _LIB9P_SETATTR_UNUSED_12;
+ x = _LIB9P_SETATTR_UNUSED_11;
+ x = _LIB9P_SETATTR_UNUSED_10;
+ x = _LIB9P_SETATTR_UNUSED_9;
x = LIB9P_SETATTR_MTIME_SET;
x = LIB9P_SETATTR_ATIME_SET;
x = LIB9P_SETATTR_CTIME;
@@ -135,6 +247,36 @@ int main(void) {
x = LIB9P_LOCK_TYPE_RDLCK;
x = LIB9P_LOCK_TYPE_WRLCK;
x = LIB9P_LOCK_TYPE_UNLCK;
+ x = _LIB9P_LOCK_FLAGS_UNUSED_31;
+ x = _LIB9P_LOCK_FLAGS_UNUSED_30;
+ x = _LIB9P_LOCK_FLAGS_UNUSED_29;
+ x = _LIB9P_LOCK_FLAGS_UNUSED_28;
+ x = _LIB9P_LOCK_FLAGS_UNUSED_27;
+ x = _LIB9P_LOCK_FLAGS_UNUSED_26;
+ x = _LIB9P_LOCK_FLAGS_UNUSED_25;
+ x = _LIB9P_LOCK_FLAGS_UNUSED_24;
+ x = _LIB9P_LOCK_FLAGS_UNUSED_23;
+ x = _LIB9P_LOCK_FLAGS_UNUSED_22;
+ x = _LIB9P_LOCK_FLAGS_UNUSED_21;
+ x = _LIB9P_LOCK_FLAGS_UNUSED_20;
+ x = _LIB9P_LOCK_FLAGS_UNUSED_19;
+ x = _LIB9P_LOCK_FLAGS_UNUSED_18;
+ x = _LIB9P_LOCK_FLAGS_UNUSED_17;
+ x = _LIB9P_LOCK_FLAGS_UNUSED_16;
+ x = _LIB9P_LOCK_FLAGS_UNUSED_15;
+ x = _LIB9P_LOCK_FLAGS_UNUSED_14;
+ x = _LIB9P_LOCK_FLAGS_UNUSED_13;
+ x = _LIB9P_LOCK_FLAGS_UNUSED_12;
+ x = _LIB9P_LOCK_FLAGS_UNUSED_11;
+ x = _LIB9P_LOCK_FLAGS_UNUSED_10;
+ x = _LIB9P_LOCK_FLAGS_UNUSED_9;
+ x = _LIB9P_LOCK_FLAGS_UNUSED_8;
+ x = _LIB9P_LOCK_FLAGS_UNUSED_7;
+ x = _LIB9P_LOCK_FLAGS_UNUSED_6;
+ x = _LIB9P_LOCK_FLAGS_UNUSED_5;
+ x = _LIB9P_LOCK_FLAGS_UNUSED_4;
+ x = _LIB9P_LOCK_FLAGS_UNUSED_3;
+ x = _LIB9P_LOCK_FLAGS_UNUSED_2;
x = LIB9P_LOCK_FLAGS_RECLAIM;
x = LIB9P_LOCK_FLAGS_BLOCK;
x = LIB9P_LOCK_STATUS_SUCCESS;
diff --git a/lib9p/tests/test_compile_config/config.h b/lib9p/tests/test_compile_config/config.h
index 38ab0c0..cc8eec1 100644
--- a/lib9p/tests/test_compile_config/config.h
+++ b/lib9p/tests/test_compile_config/config.h
@@ -9,20 +9,20 @@
/* 9P *************************************************************************/
-#define CONFIG_9P_MAX_MSG_SIZE ((4*1024)+24)
-#define CONFIG_9P_MAX_HOSTMSG_SIZE CONFIG_9P_MAX_MSG_SIZE+16
-#define CONFIG_9P_MAX_ERR_SIZE 128
-#define CONFIG_9P_MAX_9P2000_e_WELEM 16
-
-#define CONFIG_9P_SRV_MAX_FIDS 16
-#define CONFIG_9P_SRV_MAX_REQS 2
-#define CONFIG_9P_SRV_MAX_DEPTH 3
-
-#define CONFIG_9P_ENABLE_9P2000 1 /* bool */
-#define CONFIG_9P_ENABLE_9P2000_u 1 /* bool */
-#define CONFIG_9P_ENABLE_9P2000_e 1 /* bool */
-#define CONFIG_9P_ENABLE_9P2000_L 1 /* bool */
-#define CONFIG_9P_ENABLE_9P2000_p9p 1 /* bool */
+#define CONFIG_9P_MAX_ERR_SIZE 128
+#define CONFIG_9P_MAX_9P2000_e_WELEM 16
+
+#define CONFIG_9P_SRV_MAX_MSG_SIZE ((4*1024)+24)
+#define CONFIG_9P_SRV_MAX_HOSTMSG_SIZE CONFIG_9P_SRV_MAX_MSG_SIZE+16
+#define CONFIG_9P_SRV_MAX_FIDS 16
+#define CONFIG_9P_SRV_MAX_REQS 2
+#define CONFIG_9P_SRV_MAX_DEPTH 3
+
+#define CONFIG_9P_ENABLE_9P2000 1 /* bool */
+#define CONFIG_9P_ENABLE_9P2000_u 1 /* bool */
+#define CONFIG_9P_ENABLE_9P2000_e 1 /* bool */
+#define CONFIG_9P_ENABLE_9P2000_L 1 /* bool */
+#define CONFIG_9P_ENABLE_9P2000_p9p 1 /* bool */
/* COROUTINE ******************************************************************/
diff --git a/lib9p/tests/test_server/config/config.h b/lib9p/tests/test_server/config/config.h
index afe6dc0..03143e1 100644
--- a/lib9p/tests/test_server/config/config.h
+++ b/lib9p/tests/test_server/config/config.h
@@ -12,6 +12,8 @@
/* 9P *************************************************************************/
+#define CONFIG_9P_MAX_ERR_SIZE 128 /* 128 is what Plan 9 4e uses */
+
/**
* This max-msg-size is sized so that a Twrite message can return
* 8KiB of data.
@@ -29,22 +31,22 @@
* negotiated. In Plan 9 1e it was (8*1024)+128, and was bumped to
* (8*1024)+160 in 2e and 3e.
*/
-#define CONFIG_9P_MAX_MSG_SIZE ((4*1024)+24)
+#define CONFIG_9P_SRV_MAX_MSG_SIZE ((4*1024)+24)
/**
* Maximum host-data-structure size. A message may be larger in
* unmarshaled-host-structures than marshaled-net-bytes due to (1)
* struct padding, (2) array pointers.
*/
-#define CONFIG_9P_MAX_HOSTMSG_SIZE CONFIG_9P_MAX_MSG_SIZE+16
-#define CONFIG_9P_MAX_ERR_SIZE 128 /* 128 is what Plan 9 4e uses */
-#define CONFIG_9P_SRV_MAX_FIDS 16
-#define CONFIG_9P_SRV_MAX_REQS 2
-#define CONFIG_9P_SRV_MAX_DEPTH 3
-#define CONFIG_9P_ENABLE_9P2000 1 /* bool */
-#define CONFIG_9P_ENABLE_9P2000_u 1 /* bool */
-#define CONFIG_9P_ENABLE_9P2000_e 0 /* bool */
-#define CONFIG_9P_ENABLE_9P2000_L 0 /* bool */
-#define CONFIG_9P_ENABLE_9P2000_p9p 0 /* bool */
+#define CONFIG_9P_SRV_MAX_HOSTMSG_SIZE CONFIG_9P_SRV_MAX_MSG_SIZE+16
+#define CONFIG_9P_SRV_MAX_FIDS 16
+#define CONFIG_9P_SRV_MAX_REQS 2
+#define CONFIG_9P_SRV_MAX_DEPTH 3
+
+#define CONFIG_9P_ENABLE_9P2000 1 /* bool */
+#define CONFIG_9P_ENABLE_9P2000_u 1 /* bool */
+#define CONFIG_9P_ENABLE_9P2000_e 0 /* bool */
+#define CONFIG_9P_ENABLE_9P2000_L 0 /* bool */
+#define CONFIG_9P_ENABLE_9P2000_p9p 0 /* bool */
/* COROUTINE ******************************************************************/
diff --git a/lib9p/tests/test_server/main.c b/lib9p/tests/test_server/main.c
index c759029..a31c083 100644
--- a/lib9p/tests/test_server/main.c
+++ b/lib9p/tests/test_server/main.c
@@ -47,11 +47,11 @@ struct {
struct api_file {
uint64_t pathnum;
};
-LO_IMPLEMENTATION_H(lib9p_srv_file, struct api_file, api)
-LO_IMPLEMENTATION_H(lib9p_srv_fio, struct api_file, api)
+LO_IMPLEMENTATION_H(lib9p_srv_file, struct api_file, api);
+LO_IMPLEMENTATION_H(lib9p_srv_fio, struct api_file, api);
-LO_IMPLEMENTATION_C(lib9p_srv_file, struct api_file, api, static)
-LO_IMPLEMENTATION_C(lib9p_srv_fio, struct api_file, api, static)
+LO_IMPLEMENTATION_C(lib9p_srv_file, struct api_file, api, static);
+LO_IMPLEMENTATION_C(lib9p_srv_fio, struct api_file, api, static);
static void api_free(struct api_file *self) {
assert(self);