From f807dac45a653c378b26fa7b08e1341a1153887d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Altu=C4=9F=20Bakan?= Date: Wed, 13 Mar 2024 19:44:48 +0100 Subject: [PATCH] Add integration test for single port with options --- tests/integration_test.rs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/tests/integration_test.rs b/tests/integration_test.rs index f497688..95f3097 100644 --- a/tests/integration_test.rs +++ b/tests/integration_test.rs @@ -184,6 +184,32 @@ fn test_receive_ipv6() { assert!(status.success()); } +#[test] +fn test_send_single_port_options() { + let file_name = "send_single_port_options"; + let port = "6975"; + initialize(format!("{SERVER_DIR}/{file_name}").as_str()); + + let _server = CommandRunner::new("target/debug/tftpd", &["-p", port, "-d", SERVER_DIR, "-s"]); + let mut client = CommandRunner::new( + "atftp", + &[ + "-g", + "-r", + file_name, + "-l", + format!("{CLIENT_DIR}/{file_name}").as_str(), + "--option", + "windowsize 10", + "127.0.0.1", + port, + ], + ); + + let status = client.wait(); + assert!(status.success()); +} + fn initialize(file_name: &str) { create_folders(); create_file(file_name);