mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-10 07:06:53 +00:00
feat(admin): add audit target APIs and harden target source handling (#2350)
Signed-off-by: houseme <housemecn@gmail.com> Co-authored-by: 安正超 <anzhengchao@gmail.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: houseme <4829346+houseme@users.noreply.github.com>
This commit is contained in:
@@ -1907,7 +1907,6 @@ mod test {
|
||||
|
||||
#[tokio::test]
|
||||
async fn test_read_xl_meta_no_data() {
|
||||
use tokio::fs;
|
||||
use tokio::fs::File;
|
||||
use tokio::io::AsyncWriteExt;
|
||||
|
||||
@@ -1926,13 +1925,15 @@ async fn test_read_xl_meta_no_data() {
|
||||
|
||||
buff.resize(buff.len() + 100, 0);
|
||||
|
||||
let filepath = "./test_xl.meta";
|
||||
// Use tempfile to avoid conflicts with parallel tests or previous runs
|
||||
let dir = tempfile::tempdir().unwrap();
|
||||
let filepath = dir.path().join("test_xl.meta");
|
||||
|
||||
let mut file = File::create(filepath).await.unwrap();
|
||||
let mut file = File::create(&filepath).await.unwrap();
|
||||
// Write string data
|
||||
file.write_all(&buff).await.unwrap();
|
||||
|
||||
let mut f = File::open(filepath).await.unwrap();
|
||||
let mut f = File::open(&filepath).await.unwrap();
|
||||
|
||||
let stat = f.metadata().await.unwrap();
|
||||
|
||||
@@ -1941,7 +1942,5 @@ async fn test_read_xl_meta_no_data() {
|
||||
let mut newfm = FileMeta::default();
|
||||
newfm.unmarshal_msg(&data).unwrap();
|
||||
|
||||
fs::remove_file(filepath).await.unwrap();
|
||||
|
||||
assert_eq!(fm, newfm)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user