Skip to content

NETOBSERV-2397 QE: Automate test for auto-detect privilege run feature in network observability CLI#382

Merged
memodi merged 8 commits intonetobserv:mainfrom
oliver-smakal:automatePriviledgeTest/2397
Sep 30, 2025
Merged

NETOBSERV-2397 QE: Automate test for auto-detect privilege run feature in network observability CLI#382
memodi merged 8 commits intonetobserv:mainfrom
oliver-smakal:automatePriviledgeTest/2397

Conversation

@oliver-smakal
Copy link

@oliver-smakal oliver-smakal commented Sep 18, 2025

Description

Adds tests to verify correct privilege settings as introduced in: NETOBSERV-2262

Please also verify that polarion test case is created correctly: https://polarion.engineering.redhat.com/polarion/#/project/OSE/workitem?id=OCP-84801) is created correctly.

Dependencies

n/a

Checklist

If you are not familiar with our processes or don't know what to answer in the list below, let us know in a comment: the maintainers will take care of that.

  • Is this PR backed with a JIRA ticket? If so, make sure it is written as a title prefix (in general, PRs affecting the NetObserv/Network Observability product should be backed with a JIRA ticket - especially if they bring user facing changes).
  • Does this PR require product documentation?
    • If so, make sure the JIRA epic is labelled with "documentation" and provides a description relevant for doc writers, such as use cases or scenarios. Any required step to activate or configure the feature should be documented there, such as new CRD knobs.
  • Does this PR require a product release notes entry?
    • If so, fill in "Release Note Text" in the JIRA.
  • Is there anything else the QE team should know before testing? E.g: configuration changes, environment setup, etc.
    • If so, make sure it is described in the JIRA ticket.
      • polarion test case needs to be also verified, follow link in the description above
  • QE requirements (check 1 from the list):
    • Standard QE validation, with pre-merge tests unless stated otherwise.
    • Regression tests only (e.g. refactoring with no user-facing change).
    • No QE (e.g. trivial change with high reviewer's confidence, or per agreement with the QE team).

@openshift-ci
Copy link

openshift-ci bot commented Sep 18, 2025

Hi @oliver-smakal. Thanks for your PR.

I'm waiting for a netobserv member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@memodi
Copy link
Member

memodi commented Sep 18, 2025

/ok-to-test

@github-actions
Copy link

New image:
quay.io/netobserv/network-observability-cli:edc8705

It will expire after two weeks.

To use this build, update your commands using:

USER=netobserv VERSION=edc8705 make commands

or download the updated commands.

Copy link
Member

@memodi memodi left a comment

Choose a reason for hiding this comment

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

@oliver-smakal
Copy link
Author

@memodi all the comments were resolved -> ready for further review/approval.

@memodi
Copy link
Member

memodi commented Sep 23, 2025

/ok-to-test

@memodi
Copy link
Member

memodi commented Sep 23, 2025

@oliver-smakal - could you add local run of tests in PR description? We see some flakiness in CI

@github-actions
Copy link

New image:
quay.io/netobserv/network-observability-cli:fa3e76f

It will expire after two weeks.

To use this build, update your commands using:

USER=netobserv VERSION=fa3e76f make commands

or download the updated commands.

@oliver-smakal
Copy link
Author

@oliver-smakal - could you add local run of tests in PR description? We see some flakiness in CI

It does that locally the integration tests are failing and taking quite long. I am running it again rosa 4.19 cluster, but that should not be an issue, right?

Example logs:
Log1:

osmakal@osmakal-thinkpadp1gen7:~/Repos/cli$ go test -p 1 -timeout 45m -v -mod vendor ./e2e/integration-tests/...
=== RUN   TestIntegrationTests
Running Suite: IntegrationTests Suite - /home/osmakal/Repos/cli/e2e/integration-tests
=====================================================================================
Random Seed: 1758792960

Will run 7 of 7 specs
time="2025-09-25T11:36:00+02:00" level=info msg="Running command" arg="[flows --query=SrcK8S_Namespace=~\"openshift-monitoring\" --copy=true --max-bytes=500000 --max-time=1m]" cmd=/usr/local/bin/oc-netobserv component=integration_test
time="2025-09-25T11:37:23+02:00" level=info msg="Cleaning up..." component=integration_test
time="2025-09-25T11:37:23+02:00" level=info msg="Running command" arg="[cleanup]" cmd=/usr/local/bin/oc-netobserv component=integration_test
------------------------------
• [FAILED] [89.557 seconds]
NetObserv CLI e2e integration test suite [It] OCP-73458: Verify regexes filters are applied [Regexes]
/home/osmakal/Repos/cli/e2e/integration-tests/integration_test.go:88

  [FAILED] Flow {openshift-insights} does not meet regexes condition SrcK8S_Namespace=~openshift-monitoring
  Expected
      <bool>: true
  to be false
  In [It] at: /home/osmakal/Repos/cli/e2e/integration-tests/integration_test.go:122 @ 09/25/25 11:37:23.75
------------------------------
SSSSSS

Summarizing 1 Failure:
  [FAIL] NetObserv CLI e2e integration test suite [It] OCP-73458: Verify regexes filters are applied [Regexes]
  /home/osmakal/Repos/cli/e2e/integration-tests/integration_test.go:122

Ran 1 of 7 Specs in 89.559 seconds
FAIL! -- 0 Passed | 1 Failed | 0 Pending | 6 Skipped
--- FAIL: TestIntegrationTests (89.56s)
FAIL
FAIL    github.com/netobserv/network-observability-cli/e2e/integration-tests    89.573s
FAIL

Log2:

osmakal@osmakal-thinkpadp1gen7:~/Repos/cli$ go test -p 1 -timeout 45m -v -mod vendor ./e2e/integration-tests/...
=== RUN   TestIntegrationTests
Running Suite: IntegrationTests Suite - /home/osmakal/Repos/cli/e2e/integration-tests
=====================================================================================
Random Seed: 1758793075

Will run 6 of 6 specs
time="2025-09-25T11:37:55+02:00" level=info msg="Running command" arg="[flows --sampling=1 --copy=true --max-bytes=500000 --max-time=1m]" cmd=/usr/local/bin/oc-netobserv component=integration_test
time="2025-09-25T11:39:19+02:00" level=info msg="Cleaning up..." component=integration_test
time="2025-09-25T11:39:19+02:00" level=info msg="Running command" arg="[cleanup]" cmd=/usr/local/bin/oc-netobserv component=integration_test
•time="2025-09-25T11:39:25+02:00" level=info msg="Running command" arg="[flows --exclude_interfaces=genev_sys_6081 --copy=true --max-bytes=500000 --max-time=1m]" cmd=/usr/local/bin/oc-netobserv component=integration_test
time="2025-09-25T11:40:49+02:00" level=info msg="Cleaning up..." component=integration_test
time="2025-09-25T11:40:49+02:00" level=info msg="Running command" arg="[cleanup]" cmd=/usr/local/bin/oc-netobserv component=integration_test

------------------------------
• [FAILED] [90.059 seconds]
NetObserv CLI e2e integration test suite [It] OCP-82597: Verify excluded interface genev_sys_6081 does not appear in captured flows [ExcludeInterface]
/home/osmakal/Repos/cli/e2e/integration-tests/integration_test.go:166

  [FAILED] Flow should not contain excluded interface genev_sys_6081, but found it in interfaces: [genev_sys_6081 b9949d7f76b9f2c]
  Expected
      <string>: genev_sys_6081
  not to equal
      <string>: genev_sys_6081
  In [It] at: /home/osmakal/Repos/cli/e2e/integration-tests/integration_test.go:198 @ 09/25/25 11:40:49.189
------------------------------
SSSS

Summarizing 1 Failure:
  [FAIL] NetObserv CLI e2e integration test suite [It] OCP-82597: Verify excluded interface genev_sys_6081 does not appear in captured flows [ExcludeInterface]
  /home/osmakal/Repos/cli/e2e/integration-tests/integration_test.go:198

Ran 2 of 6 Specs in 179.926 seconds
FAIL! -- 1 Passed | 1 Failed | 0 Pending | 4 Skipped
--- FAIL: TestIntegrationTests (179.93s)
FAIL
FAIL    github.com/netobserv/network-observability-cli/e2e/integration-tests    179.941s
FAIL

trying investigate further

Copy link
Member

@memodi memodi left a comment

Choose a reason for hiding this comment

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

I ran it just by filtering new test in PR:

ginkgo --label-filter=Privileges run e2e/integration-tests

================================================================================================================================
Random Seed: 1758817130

Will run 3 of 8 specs
SSSSStime="2025-09-25T12:18:56-04:00" level=info msg="Starting command" arg="[flows]" cmd=/usr/local/bin/oc-netobserv component=integration_test
time="2025-09-25T12:19:26-04:00" level=info msg="Cleaning up..." component=integration_test
time="2025-09-25T12:19:26-04:00" level=info msg="Running command" arg="[cleanup]" cmd=/usr/local/bin/oc-netobserv component=integration_test
•time="2025-09-25T12:20:13-04:00" level=info msg="Starting command" arg="[flows --privileged=true]" cmd=/usr/local/bin/oc-netobserv component=integration_test
time="2025-09-25T12:20:43-04:00" level=info msg="Cleaning up..." component=integration_test
time="2025-09-25T12:20:43-04:00" level=info msg="Running command" arg="[cleanup]" cmd=/usr/local/bin/oc-netobserv component=integration_test
time="2025-09-25T12:21:17-04:00" level=error msg="Wait returned error: signal: hangup" component=integration_test
•time="2025-09-25T12:21:32-04:00" level=info msg="Starting command" arg="[flows --drops]" cmd=/usr/local/bin/oc-netobserv component=integration_test
time="2025-09-25T12:22:02-04:00" level=info msg="Cleaning up..." component=integration_test
time="2025-09-25T12:22:02-04:00" level=info msg="Running command" arg="[cleanup]" cmd=/usr/local/bin/oc-netobserv component=integration_test
time="2025-09-25T12:22:23-04:00" level=error msg="Wait returned error: signal: hangup" component=integration_test
•

Ran 3 of 8 Specs in 231.953 seconds
SUCCESS! -- 3 Passed | 0 Failed | 0 Pending | 5 Skipped
PASS

Ginkgo ran 1 suite in 3m58.056686761s
Test Suite Passed

@openshift-ci openshift-ci bot added the lgtm label Sep 25, 2025
@memodi
Copy link
Member

memodi commented Sep 25, 2025

thanks @oliver-smakal

@openshift-ci
Copy link

openshift-ci bot commented Sep 25, 2025

[APPROVALNOTIFIER] This PR is APPROVED

Approval requirements bypassed by manually added approval.

This pull-request has been approved by:

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

The pull request process is described here

Details 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

@memodi
Copy link
Member

memodi commented Sep 29, 2025

@oliver-smakal the build/lint/test and e2e-tests needs some attention here

@memodi memodi added the needs-changes To be added to denote PR needs changes or some questions/comments to be addressed label Sep 29, 2025
@openshift-ci openshift-ci bot removed the lgtm label Sep 30, 2025
@oliver-smakal
Copy link
Author

oliver-smakal commented Sep 30, 2025

@oliver-smakal the build/lint/test and e2e-tests needs some attention here

Yes @memodi , you are right, the go fmt generates a diff - a few empty liners extra -> updated, but now again need your approval to see if it goes through the tests without any other issuesYes, you are right, the go fmt generates a diff - a few empty liners extra -> updated,

@codecov
Copy link

codecov bot commented Sep 30, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 13.67%. Comparing base (9fb7ab2) to head (5ead863).
⚠️ Report is 11 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #382      +/-   ##
==========================================
- Coverage   17.20%   13.67%   -3.54%     
==========================================
  Files          15       18       +3     
  Lines        2133     2684     +551     
==========================================
  Hits          367      367              
- Misses       1740     2291     +551     
  Partials       26       26              
Flag Coverage Δ
unittests 13.67% <ø> (-3.54%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 12 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@memodi
Copy link
Member

memodi commented Sep 30, 2025

/ok-to-test

@memodi
Copy link
Member

memodi commented Sep 30, 2025

Yes @memodi , you are right, the go fmt generates a diff - a few empty liners extra -> updated, but now again need your approval to see if it goes through the tests without any other issuesYes, you are right, the go fmt generates a diff - a few empty liners extra -> updated,

I invited you to netobserv github org, hopefully it will not be overwritten, if it does you'd have to raise DPP request.

@github-actions
Copy link

New image:
quay.io/netobserv/network-observability-cli:a38132b

It will expire after two weeks.

To use this build, update your commands using:

USER=netobserv VERSION=a38132b make commands

or download the updated commands.

@openshift-ci
Copy link

openshift-ci bot commented Sep 30, 2025

@oliver-smakal: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/integration-tests 5ead863 link true /test integration-tests

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@memodi
Copy link
Member

memodi commented Sep 30, 2025

/lgtm

@openshift-ci openshift-ci bot added the lgtm label Sep 30, 2025
@memodi memodi merged commit 982c0e3 into netobserv:main Sep 30, 2025
10 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved lgtm needs-changes To be added to denote PR needs changes or some questions/comments to be addressed ok-to-test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants