mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-25 03:01:12 +08:00
feat: sidecar 与 Info 响应加监听地址字段
This commit is contained in:
@@ -80,11 +80,17 @@ fn control_client_end_to_end() {
|
||||
"healthy 应为真:{response:?}"
|
||||
);
|
||||
|
||||
// 信息请求:socket 路径与配置一致、进程号为当前进程号。
|
||||
// 信息请求:socket 路径与配置一致、监听地址与配置一致、进程号为当前进程号。
|
||||
let response = send_control_request_from(&config.sidecar_path, &ServerRequest::Info).expect("信息请求应成功");
|
||||
match response {
|
||||
ServerResponse::Info { socket_path, pid, .. } => {
|
||||
ServerResponse::Info {
|
||||
socket_path,
|
||||
pid,
|
||||
listen_addr,
|
||||
..
|
||||
} => {
|
||||
assert_eq!(socket_path, config.endpoint.describe(), "socket 路径应与配置一致");
|
||||
assert_eq!(listen_addr, config.endpoint.describe(), "监听地址应与配置一致(Unix 臂)");
|
||||
assert_eq!(pid, std::process::id(), "进程号应为当前进程号");
|
||||
}
|
||||
other => panic!("应得 Info 帧,实得 {other:?}"),
|
||||
@@ -148,11 +154,18 @@ fn control_client_tcp_arm_end_to_end() {
|
||||
"healthy 应为真:{response:?}"
|
||||
);
|
||||
|
||||
// 信息请求:endpoint 值与配置一致(host:port 文本形态)、进程号为当前进程号。
|
||||
// 信息请求:endpoint 值与配置一致(host:port 文本形态)、监听地址与配置一致、
|
||||
// 进程号为当前进程号。
|
||||
let response = send_control_request_from(&config.sidecar_path, &ServerRequest::Info).expect("信息请求应成功");
|
||||
match response {
|
||||
ServerResponse::Info { socket_path, pid, .. } => {
|
||||
ServerResponse::Info {
|
||||
socket_path,
|
||||
pid,
|
||||
listen_addr,
|
||||
..
|
||||
} => {
|
||||
assert_eq!(socket_path, config.endpoint.describe(), "endpoint 值应与配置一致");
|
||||
assert_eq!(listen_addr, config.endpoint.describe(), "监听地址应与配置一致(TCP 臂)");
|
||||
assert_eq!(pid, std::process::id(), "进程号应为当前进程号");
|
||||
}
|
||||
other => panic!("应得 Info 帧,实得 {other:?}"),
|
||||
|
||||
Reference in New Issue
Block a user