Fix all remaining test failures
Some checks failed
Test / test (push) Has been cancelled
Test / build (push) Has been cancelled

- archive::metadata: add failed_files to test_extract_result
- archive::tests: use TempDir for validate_extraction_path test
- provider::sqlite: fix db path using CARGO_MANIFEST_DIR/../data/auth.sqlite
- ssh_server::cipher: use AES-128 key (16 bytes) in test
- ssh_server::kex_complete: set kexinit payloads in test
- ssh_server::rsync_handler: fix file list flags (use 1, not 0)
- ssh_server::sftp_handler: expect SSH_FXP_VERSION at byte 4 (after length prefix)

All 135 tests now pass
This commit is contained in:
Warren
2026-06-19 00:48:53 +08:00
parent 5c89b0e169
commit 68472e0fb7
7 changed files with 45 additions and 23 deletions

View File

@@ -1697,9 +1697,20 @@ mod tests {
let temp_dir = TempDir::new().unwrap();
let mut handler = make_handler(temp_dir.path().to_path_buf());
let init_packet = vec![1, 0, 0, 0, 3];
// SSH_FXP_INIT packet format: type(1) + version(4)
// Version 3 in big-endian: [0, 0, 0, 3]
let init_packet = vec![SftpPacketType::SSH_FXP_INIT as u8, 0, 0, 0, 3];
let response = handler.handle_request(&init_packet).unwrap();
assert_eq!(response[0], SftpPacketType::SSH_FXP_VERSION as u8);
// Response format: length(4) + type(1) + version(4) + extensions
// The actual SSH_FXP_VERSION is at byte 4 (after length prefix)
assert!(response.len() >= 5, "Response should have length prefix + type");
// Read length prefix
let length = u32::from_be_bytes([response[0], response[1], response[2], response[3]]);
assert_eq!(length as usize + 4, response.len(), "Length should match packet size");
// Packet type should be SSH_FXP_VERSION (2) at byte 4
assert_eq!(response[4], SftpPacketType::SSH_FXP_VERSION as u8, "Packet type should be SSH_FXP_VERSION");
}
}