fix: avoid creating output file on missing RRQ
This commit is contained in:
@@ -98,6 +98,25 @@ fn netascii_roundtrip_preserves_newlines_and_cr() {
|
||||
stop_server(&shutdown, handle);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn missing_remote_file_does_not_create_local_file() {
|
||||
let server_root = TempDir::new("pfs_tftp_server_root_missing");
|
||||
let local_root = TempDir::new("pfs_tftp_local_root_missing");
|
||||
|
||||
let (addr, shutdown, handle) = start_server(server_root.path(), true);
|
||||
let client = Client::new(addr, test_client_config());
|
||||
|
||||
let out = local_root.path().join("should_not_exist.bin");
|
||||
assert!(!out.exists());
|
||||
|
||||
let _err = client
|
||||
.get("does_not_exist.bin", &out, Mode::Octet)
|
||||
.unwrap_err();
|
||||
assert!(!out.exists());
|
||||
|
||||
stop_server(&shutdown, handle);
|
||||
}
|
||||
|
||||
fn test_client_config() -> ClientConfig {
|
||||
ClientConfig {
|
||||
timeout: Duration::from_millis(200),
|
||||
|
||||
Reference in New Issue
Block a user