测试: bypass 标志测试统一串行闸
途经 is_authorized 的测试统一持锁,消除并行偶发红
This commit is contained in:
@@ -181,6 +181,8 @@ mod tests {
|
||||
/// bypass 关:黑名单行为不变(Denied 基线,与改造前一致)。
|
||||
#[test]
|
||||
fn test_bypass_off_blacklist_still_denied() {
|
||||
// 途经 is_authorized 读进程级 bypass 标志,持串行闸防与写标志的测试并行互踩
|
||||
let _guard = BLACKLIST_BYPASS_TEST_LOCK.lock().unwrap_or_else(|e| e.into_inner());
|
||||
let allowed = crate::state::AllowedDirs::default_with_root();
|
||||
let args = serde_json::json!({ "path": "/home/user/.ssh/config" });
|
||||
match check_file_tool_auth("read_file", &args, &allowed, false) {
|
||||
|
||||
Reference in New Issue
Block a user