Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add BANP conformance tests for .Spec.Ingress and .Spec.Egress fields #109

Merged

Conversation

tssurya
Copy link
Contributor

@tssurya tssurya commented May 24, 2023

This is same as done in #99 but for BANP.
Since we don't have BANP Pass action, we don't need that for the tests here.

Sample output as run on OVN-K cluster:

   --- PASS: TestConformance/BaselineAdminNetworkPolicyEgressSCTP (13.04s)
        --- PASS: TestConformance/BaselineAdminNetworkPolicyEgressSCTP/Should_support_an_'allow-egress'_policy_for_SCTP_protocol;_ensure_rule_ordering_is_respected (0.24s)
        --- PASS: TestConformance/BaselineAdminNetworkPolicyEgressSCTP/Should_support_an_'allow-egress'_policy_for_SCTP_protocol_at_the_specified_port (3.22s)
        --- PASS: TestConformance/BaselineAdminNetworkPolicyEgressSCTP/Should_support_an_'deny-egress'_policy_for_SCTP_protocol;_ensure_rule_ordering_is_respected (6.26s)
        --- PASS: TestConformance/BaselineAdminNetworkPolicyEgressSCTP/Should_support_a_'deny-egress'_policy_for_SCTP_protocol_at_the_specified_port (3.29s)
    --- PASS: TestConformance/BaselineAdminNetworkPolicyEgressTCP (13.07s)
        --- PASS: TestConformance/BaselineAdminNetworkPolicyEgressTCP/Should_support_an_'allow-egress'_policy_for_TCP_protocol;_ensure_rule_ordering_is_respected (0.23s)
        --- PASS: TestConformance/BaselineAdminNetworkPolicyEgressTCP/Should_support_an_'allow-egress'_policy_for_TCP_protocol_at_the_specified_port (3.24s)
        --- PASS: TestConformance/BaselineAdminNetworkPolicyEgressTCP/Should_support_an_'deny-egress'_policy_for_TCP_protocol;_ensure_rule_ordering_is_respected (6.32s)
        --- PASS: TestConformance/BaselineAdminNetworkPolicyEgressTCP/Should_support_a_'deny-egress'_policy_for_TCP_protocol_at_the_specified_port (3.26s)
    --- PASS: TestConformance/BaselineAdminNetworkPolicyEgressUDP (13.53s)
        --- PASS: TestConformance/BaselineAdminNetworkPolicyEgressUDP/Should_support_an_'allow-egress'_policy_for_UDP_protocol;_ensure_rule_ordering_is_respected (0.43s)
        --- PASS: TestConformance/BaselineAdminNetworkPolicyEgressUDP/Should_support_an_'allow-egress'_policy_for_UDP_protocol_at_the_specified_port (3.52s)
        --- PASS: TestConformance/BaselineAdminNetworkPolicyEgressUDP/Should_support_an_'deny-egress'_policy_for_UDP_protocol;_ensure_rule_ordering_is_respected (6.26s)
        --- PASS: TestConformance/BaselineAdminNetworkPolicyEgressUDP/Should_support_a_'deny-egress'_policy_for_UDP_protocol_at_the_specified_port (3.30s)
    --- PASS: TestConformance/BaselineAdminNetworkPolicyIngressSCTP (13.23s)
        --- PASS: TestConformance/BaselineAdminNetworkPolicyIngressSCTP/Should_support_an_'allow-ingress'_policy_for_SCTP_protocol;_ensure_rule_ordering_is_respected (0.23s)
        --- PASS: TestConformance/BaselineAdminNetworkPolicyIngressSCTP/Should_support_an_'allow-ingress'_policy_for_SCTP_protocol_at_the_specified_port (3.24s)
        --- PASS: TestConformance/BaselineAdminNetworkPolicyIngressSCTP/Should_support_an_'deny-ingress'_policy_for_SCTP_protocol;_ensure_rule_ordering_is_respected (6.29s)
        --- PASS: TestConformance/BaselineAdminNetworkPolicyIngressSCTP/Should_support_a_'deny-ingress'_policy_for_SCTP_protocol_at_the_specified_port (3.44s)
    --- PASS: TestConformance/BaselineAdminNetworkPolicyIngressTCP (13.10s)
        --- PASS: TestConformance/BaselineAdminNetworkPolicyIngressTCP/Should_support_an_'allow-ingress'_policy_for_TCP_protocol;_ensure_rule_ordering_is_respected (0.27s)
        --- PASS: TestConformance/BaselineAdminNetworkPolicyIngressTCP/Should_support_an_'allow-ingress'_policy_for_TCP_protocol_at_the_specified_port (3.22s)
        --- PASS: TestConformance/BaselineAdminNetworkPolicyIngressTCP/Should_support_an_'deny-ingress'_policy_for_TCP_protocol;_ensure_rule_ordering_is_respected (6.31s)
        --- PASS: TestConformance/BaselineAdminNetworkPolicyIngressTCP/Should_support_a_'deny-ingress'_policy_for_TCP_protocol_at_the_specified_port (3.28s)
    --- PASS: TestConformance/BaselineAdminNetworkPolicyIngressUDP (13.33s)
        --- PASS: TestConformance/BaselineAdminNetworkPolicyIngressUDP/Should_support_an_'allow-ingress'_policy_for_UDP_protocol;_ensure_rule_ordering_is_respected (0.36s)
        --- PASS: TestConformance/BaselineAdminNetworkPolicyIngressUDP/Should_support_an_'allow-ingress'_policy_for_UDP_protocol_at_the_specified_port (3.24s)
        --- PASS: TestConformance/BaselineAdminNetworkPolicyIngressUDP/Should_support_an_'deny-ingress'_policy_for_UDP_protocol;_ensure_rule_ordering_is_respected (6.32s)
        --- PASS: TestConformance/BaselineAdminNetworkPolicyIngressUDP/Should_support_a_'deny-ingress'_policy_for_UDP_protocol_at_the_specified_port (3.38s)
PASS
ok  	sigs.k8s.io/network-policy-api/conformance	193.009s
?   	sigs.k8s.io/network-policy-api/conformance/tests	[no test files]
?   	sigs.k8s.io/network-policy-api/conformance/utils/config	[no test files]
?   	sigs.k8s.io/network-policy-api/conformance/utils/flags	[no test files]
=== RUN   TestPrepareResources
=== RUN   TestPrepareResources/empty_namespace_labels
=== RUN   TestPrepareResources/simple_namespace_labels
=== RUN   TestPrepareResources/overwrite_namespace_labels
--- PASS: TestPrepareResources (0.00s)
    --- PASS: TestPrepareResources/empty_namespace_labels (0.00s)
    --- PASS: TestPrepareResources/simple_namespace_labels (0.00s)
    --- PASS: TestPrepareResources/overwrite_namespace_labels (0.00s)
PASS

tssurya added 6 commits May 24, 2023 14:09
This commit tests .Spec.Egress specifically.
We test deny, allow and pass actions.
We test TCP protocol with and without port combination.

TODO: In future add test for port range and named ports.

Signed-off-by: Surya Seetharaman <suryaseetharaman.9@gmail.com>
This commit tests .Spec.Egress specifically.
We test deny, allow and pass actions.
We test SCTP protocol with and without port combination.

TODO: In future add test for port range and named ports.

Signed-off-by: Surya Seetharaman <suryaseetharaman.9@gmail.com>
This commit tests .Spec.Egress specifically.
We test deny, allow and pass actions.
We test UDP protocol with and without port combination.

TODO: In future add test for port range and named ports.

Signed-off-by: Surya Seetharaman <suryaseetharaman.9@gmail.com>
This commit tests .Spec.Ingress specifically.
We test deny, allow and pass actions.
We test TCP protocol with and without port combination.

TODO: In future add test for port range and named ports.

Signed-off-by: Surya Seetharaman <suryaseetharaman.9@gmail.com>
This commit tests .Spec.Ingress specifically.
We test deny, allow and pass actions.
We test SCTP protocol with and without port combination.

TODO: In future add test for port range and named ports.

Signed-off-by: Surya Seetharaman <suryaseetharaman.9@gmail.com>
This commit tests .Spec.Ingress specifically.
We test deny, allow and pass actions.
We test UDP protocol with and without port combination.

TODO: In future add test for port range and named ports.

Signed-off-by: Surya Seetharaman <suryaseetharaman.9@gmail.com>
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label May 24, 2023
@netlify
Copy link

netlify bot commented May 24, 2023

Deploy Preview for kubernetes-sigs-network-policy-api ready!

Name Link
🔨 Latest commit 8c46a56
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-network-policy-api/deploys/64860fb64a61b9000824d6cd
😎 Deploy Preview https://deploy-preview-109--kubernetes-sigs-network-policy-api.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@k8s-ci-robot k8s-ci-robot requested review from astoycos and Dyanngg May 24, 2023 20:45
@k8s-ci-robot k8s-ci-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label May 24, 2023
Copy link
Member

@astoycos astoycos left a comment

Choose a reason for hiding this comment

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

One question otherwise looks good

This commit simply moves the base yamls from
the test folder into the base folder under
sub directories that can be easily maintained.

Signed-off-by: Surya Seetharaman <suryaseetharaman.9@gmail.com>
@astoycos
Copy link
Member

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 16, 2023
@astoycos
Copy link
Member

Thanks @tssurya!

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: astoycos, tssurya

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 16, 2023
@k8s-ci-robot k8s-ci-robot merged commit 579435f into kubernetes-sigs:master Jun 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants