Skip to content

test: migrate K8sDatapathConfig to component-based tests#44618

Merged
qmonnet merged 1 commit intocilium:mainfrom
saiaunghlyanhtet:pr/sai/migrate-k8sdatapathconfig-new-test-infra
Mar 27, 2026
Merged

test: migrate K8sDatapathConfig to component-based tests#44618
qmonnet merged 1 commit intocilium:mainfrom
saiaunghlyanhtet:pr/sai/migrate-k8sdatapathconfig-new-test-infra

Conversation

@saiaunghlyanhtet
Copy link
Copy Markdown
Member

@saiaunghlyanhtet saiaunghlyanhtet commented Mar 4, 2026

Remove the legacy K8sDatapathConfig Ginkgo test suite (test/k8s/datapath_configuration.go) and replace it with component-based tests.

Related: #37837
Fixes: #44166

@maintainer-s-little-helper maintainer-s-little-helper bot added the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Mar 4, 2026
@saiaunghlyanhtet saiaunghlyanhtet force-pushed the pr/sai/migrate-k8sdatapathconfig-new-test-infra branch from 5bc6e3b to a5393d0 Compare March 4, 2026 02:11
@saiaunghlyanhtet saiaunghlyanhtet marked this pull request as ready for review March 4, 2026 06:15
@saiaunghlyanhtet saiaunghlyanhtet requested review from a team as code owners March 4, 2026 06:15
@saiaunghlyanhtet
Copy link
Copy Markdown
Member Author

/test

Copy link
Copy Markdown
Contributor

@ti-mo ti-mo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack for datapath/linux/config tests. Not sure if they're really useful, but we'll remove them when the respective defines get ported to runtime configs. Thanks for picking this up!

Copy link
Copy Markdown
Member

@bimmlerd bimmlerd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a few minor things from my side, but looks promising!

Copy link
Copy Markdown
Contributor

@smagnani96 smagnani96 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contrib, don't have new feedback other than what other reviewers already pointed out. I'm migrating some Ginkgo tests too, and I think after this prepareHostPolicyEnforcement would be only used in # K8sDatapathServicesTest Checks E/W loadbalancing (ClusterIP, NodePort from inside cluster, etc) with L7 policy Tests NodePort with L7 Policy (https://github.com/cilium/cilium/blob/v1.19/.github/actions/ginkgo/main-focus.yaml#L179). However, this test IIUC simply checks NodePort with HostFirewall enabled, and we should already have coverage of that in CI. So for the sake of the PR it's good to move the function, but I'll prune it in #44168.

@saiaunghlyanhtet saiaunghlyanhtet force-pushed the pr/sai/migrate-k8sdatapathconfig-new-test-infra branch from a5393d0 to e004f85 Compare March 10, 2026 12:15
@ti-mo ti-mo added the release-note/misc This PR makes changes that have no direct user impact. label Mar 10, 2026
@maintainer-s-little-helper maintainer-s-little-helper bot removed the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Mar 10, 2026
@smagnani96 smagnani96 added release-note/ci This PR makes changes to the CI. ci/hyperjump Relates to 2022 test improvement initiative. labels Mar 10, 2026
@saiaunghlyanhtet saiaunghlyanhtet force-pushed the pr/sai/migrate-k8sdatapathconfig-new-test-infra branch from e004f85 to e08667f Compare March 10, 2026 12:50
Copy link
Copy Markdown
Member

@bimmlerd bimmlerd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@saiaunghlyanhtet saiaunghlyanhtet force-pushed the pr/sai/migrate-k8sdatapathconfig-new-test-infra branch from e08667f to ecf3d2f Compare March 14, 2026 12:11
@saiaunghlyanhtet saiaunghlyanhtet force-pushed the pr/sai/migrate-k8sdatapathconfig-new-test-infra branch from ecf3d2f to a58bd81 Compare March 14, 2026 12:15
@saiaunghlyanhtet saiaunghlyanhtet force-pushed the pr/sai/migrate-k8sdatapathconfig-new-test-infra branch from a58bd81 to 8326293 Compare March 23, 2026 10:41
@saiaunghlyanhtet saiaunghlyanhtet requested a review from a team as a code owner March 23, 2026 10:41
@saiaunghlyanhtet saiaunghlyanhtet force-pushed the pr/sai/migrate-k8sdatapathconfig-new-test-infra branch 2 times, most recently from 5f5de5d to 265ef1d Compare March 23, 2026 14:28
Copy link
Copy Markdown
Member

@qmonnet qmonnet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, the new picture is on the preview. Thanks!

Copy link
Copy Markdown
Member

@qmonnet qmonnet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I meant to approve!

@HadrienPatte HadrienPatte removed request for a team and HadrienPatte March 23, 2026 16:49
@saiaunghlyanhtet
Copy link
Copy Markdown
Member Author

/test

@smagnani96
Copy link
Copy Markdown
Contributor

ci-l7 is a flake (operation was cancelled), unrelated to this PR.
ci-runtime is actually failing in the test being added in this PR, PTAL.

Remove the legacy K8sDatapathConfig Ginkgo test suite
(test/k8s/datapath_configuration.go) and replace it with
component-based tests in the relevant packages:

- pkg/datapath/iptables/iptables_test.go:
  - TestAddNoTrackPodTrafficRules: validates NOTRACK iptables rules
    for pod traffic (replaces "Skip conntrack for pod traffic")
  - TestAllEgressMasqueradeCmdsRandomFully: validates --random-fully
    in masquerade rules (replaces "iptables masquerading with random-fully")

- pkg/datapath/linux/config/config_test.go:
  - TestPrivilegedWriteNodeConfigMonitorAggregation: validates
    CT_REPORT_INTERVAL and CT_REPORT_FLAGS BPF defines
    (replaces MonitorAggregation tests)
  - TestPrivilegedWriteNodeConfigHostFirewall: validates
    ENABLE_HOST_FIREWALL BPF define (replaces Host firewall tests)
  - TestPrivilegedWriteNodeConfigIPv4Only: validates ENABLE_IPV4/IPV6
    defines (replaces IPv4Only test)
  - TestPrivilegedWriteNodeConfigBPFMasquerade: validates BPF masquerade
    defines (replaces BPF masquerading with ip-masq-agent tests)

Move prepareHostPolicyEnforcement to test/k8s/service_helpers.go
as it is still used by test/k8s/services.go.

Clean up CI references: remove f07/f08/f09/f20 focus entries from
main-focus.yaml, junit reporter, CODEOWNERS, and documentation.

Signed-off-by: saiaunghlyanhtet <saiaunghlyanhtet2003@gmail.com>
@saiaunghlyanhtet saiaunghlyanhtet force-pushed the pr/sai/migrate-k8sdatapathconfig-new-test-infra branch from 265ef1d to ab6fa25 Compare March 26, 2026 00:39
@saiaunghlyanhtet
Copy link
Copy Markdown
Member Author

/ci-runtime

@saiaunghlyanhtet
Copy link
Copy Markdown
Member Author

ci-runtime is actually failing in the test being added in this PR, PTAL.

Thanks. Fixed.

@saiaunghlyanhtet
Copy link
Copy Markdown
Member Author

/test

@smagnani96 smagnani96 removed the request for review from rgo3 March 27, 2026 11:34
@smagnani96
Copy link
Copy Markdown
Contributor

I don't know why the bot isn't adding the ready-to-merge label 😞
Adding it manually.
Thanks again for the contrib!

@smagnani96 smagnani96 added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Mar 27, 2026
@qmonnet qmonnet added this pull request to the merge queue Mar 27, 2026
@qmonnet qmonnet removed the release-note/misc This PR makes changes that have no direct user impact. label Mar 27, 2026
Merged via the queue into cilium:main with commit bda4393 Mar 27, 2026
80 of 81 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/hyperjump Relates to 2022 test improvement initiative. ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/ci This PR makes changes to the CI.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate K8sDatapathConfig to newer testing infrastructure

7 participants