fix: address rsync info review findings
CI / lint (pull_request) Successful in 12s
CI / sanitizers (undefined) (pull_request) Successful in 37s
CI / sanitizers (address) (pull_request) Successful in 38s
CI / fuzz-build (pull_request) Successful in 14s
CI / coverage (pull_request) Successful in 31s
CI / build-and-test (pull_request) Successful in 1m16s
CI / valgrind (pull_request) Successful in 33s
CI / lint (pull_request) Successful in 12s
CI / sanitizers (undefined) (pull_request) Successful in 37s
CI / sanitizers (address) (pull_request) Successful in 38s
CI / fuzz-build (pull_request) Successful in 14s
CI / coverage (pull_request) Successful in 31s
CI / build-and-test (pull_request) Successful in 1m16s
CI / valgrind (pull_request) Successful in 33s
This commit is contained in:
@@ -276,13 +276,24 @@ class TestInfo:
|
||||
output = result.stdout + result.stderr
|
||||
assert "[INFO]" in output and "Transferring" in output
|
||||
|
||||
def test_info_stats_reports_multithreaded_transfer(self, shared_server):
|
||||
clean_dir(DEST_DIR)
|
||||
result, _ = run_client(
|
||||
SOURCE_DIR, DEST_DIR,
|
||||
flags=["-m", "--info=stats"],
|
||||
port=shared_server.port,
|
||||
)
|
||||
assert result.returncode == 0, f"Info stats sync failed: {(result.stderr or result.stdout)[:200]}"
|
||||
output = result.stdout + result.stderr
|
||||
assert "[INFO]" in output and "Transfer summary:" in output
|
||||
|
||||
def test_info_rejects_unknown_flag(self):
|
||||
result, _ = run_client(
|
||||
SOURCE_DIR, DEST_DIR,
|
||||
flags=["--info=unknown"],
|
||||
)
|
||||
assert result.returncode != 0
|
||||
assert "unknown --info flag" in result.stderr
|
||||
assert "unsupported --info flag" in result.stderr
|
||||
|
||||
|
||||
class TestBandwidthLimit:
|
||||
|
||||
@@ -335,6 +335,17 @@ static void test_parse_args_info_flags() {
|
||||
config_delete(cfg);
|
||||
}
|
||||
|
||||
static void test_parse_args_info_verbose_order() {
|
||||
Config* cfg = config_create();
|
||||
char* argv[] = {"fastsync", "--info=copy", "--verbose", "/src", "/dst"};
|
||||
int positional_args[2];
|
||||
int positional_count = 0;
|
||||
|
||||
EXPECT_EQ_INT(parse_args(cfg, 5, argv, positional_args, &positional_count), 0);
|
||||
EXPECT_EQ_INT(get_log_info_flags(), LOG_INFO_COPY);
|
||||
config_delete(cfg);
|
||||
}
|
||||
|
||||
static void test_parse_args_rejects_invalid_info_flag() {
|
||||
Config* cfg = config_create();
|
||||
char* argv[] = {"fastsync", "--info=copy,unknown", "/src", "/dst"};
|
||||
@@ -382,6 +393,7 @@ void test_client_cli() {
|
||||
test_parse_args_unknown_option();
|
||||
test_parse_args_rejects_unimplemented_options();
|
||||
test_parse_args_info_flags();
|
||||
test_parse_args_info_verbose_order();
|
||||
test_parse_args_rejects_invalid_info_flag();
|
||||
test_parse_args_archive();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user