Skip to content

[bpf-ci-bot] Colons in traffic monitor pcap filenames break artifact upload in CI #456

@kernel-patches-review-bot

Description

@kernel-patches-review-bot

Summary

The net_timestamping BPF selftest has subtests with colons in their names (INET4: bpf timestamping, etc.). When the traffic monitor is enabled in CI, these colons end up in pcap log filenames, which GitHub Actions' upload-artifact@v4 rejects. This causes every test_progs_parallel and test_progs_no_alu32_parallel job to fail at the artifact upload step, even when all tests pass.

Failure Details

Root Cause Analysis

The encode_test_name() function at tools/testing/selftests/bpf/network_helpers.c:1137 constructs filenames for traffic monitor pcap logs. It sanitizes / and (space) characters by replacing them with underscores, but does not sanitize colons (:).

The net_timestamping test (tools/testing/selftests/bpf/prog_tests/net_timestamping.c:231-238), introduced in commit f4924aec58dd ("selftests/bpf: Add simple bpf tests in the tx path for timestamping feature"), has four subtests with colons in their names:

test__start_subtest("INET4: bpf timestamping")
test__start_subtest("INET4: bpf and socket timestamping")
test__start_subtest("INET6: bpf timestamping")
test__start_subtest("INET6: bpf and socket timestamping")

When traffic monitoring is enabled in CI (TEST_PROGS_TRAFFIC_MONITOR=true in the CI environment, which passes -m '*' to test_progs), traffic_monitor_start() calls encode_test_name() which produces filenames like:

packets-133-0-net_timestamping__INET4:_bpf_timestamping-net_timestamping_ns.log

The colon in INET4: passes through encode_test_name() unsanitized. GitHub Actions' upload-artifact@v4 rejects files with colons (and other special characters: ", <, >, |, *, ?), producing this error:

The path for one of the files in artifact is not valid:
/packets-133-0-net_timestamping__INET4:_bpf_timestamping-net_timestamping_ns.log.
Contains the following character: Colon :

The upload then times out, and the entire job is marked as failed.

Proposed Fix

Replace the two separate strchr() loops in encode_test_name() with a single strpbrk() call that sanitizes all problematic characters (/, , :, ") at once. This is both a fix and a simplification.

See patch: 0001-selftests-bpf-Sanitize-colons-in-traffic-monitor-pca.patch

-	while ((p = strchr(buf, '/')))
-		*p = '_';
-	while ((p = strchr(buf, ' ')))
+	while ((p = strpbrk(buf, " /:\"")))
 		*p = '_';

Impact

Without the fix, every CI run's parallel test jobs (test_progs_parallel and test_progs_no_alu32_parallel) fail at the artifact upload step. While these parallel jobs use continue_on_error: true so they don't block the overall CI run, they still produce a "failure" status that:

  • Degrades CI signal quality (2 false failures per run)
  • Makes it harder to notice genuine regressions in parallel test results
  • Wastes developer time investigating false failures

References

  • tools/testing/selftests/bpf/network_helpers.c:1137encode_test_name() function
  • tools/testing/selftests/bpf/prog_tests/net_timestamping.c:231 — subtests with colons
  • Commit f4924aec58dd — introduced net_timestamping test with colon-containing subtest names
  • Commit f52403b6bfea — introduced encode_test_name() and traffic monitor filename generation
  • GitHub Actions artifact upload character restrictions: ", :, <, >, |, *, ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions