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

tests: avoid leaks into host system checking of ovs-vsctl cmd #4275

Merged
merged 1 commit into from
Jul 22, 2023

Conversation

blackboxsw
Copy link
Collaborator

Proposed Commit Message

tests: avoid leaks into host system checking of ovs-vsctl cmd

Mock out the `which` checks for presence of ovs-vsctl cmd on system. This prevents test leaks which eventually call subp ovs-vsctl commands.

Additional Context

Test Steps

# install openvswitch-switch
sudo apt install openvswitch-switch
# Run failing unit tests:
tox -e py3 tests/unittests/test_net.py



FAILED tests/unittests/test_net.py::TestGenerateFallbackConfig::test_device_driver - RuntimeError: called subp. set self.allowed_subp=True to allow
FAILED tests/unittests/test_net.py::TestGenerateFallbackConfig::test_hv_netvsc_vf_filter - RuntimeError: called subp. set self.allowed_subp=True to allow
FAILED tests/unittests/test_net.py::TestNetplanNetRendering::test_render[default_generation] - AssertionError: Unexpectedly used subp.subp
============================================= 3 failed, 4777 passed, 4 skipped, 1 deselected, 1 xfailed, 271 warnings in 68.30s (0:01:08) ====

Checklist:

  • My code follows the process laid out in the documentation
  • I have updated or added any unit tests accordingly
  • I have updated or added any documentation accordingly

Mock out the `which` checks for presence of ovs-vsctl cmd on system.
This prevents test leaks which eventually call subp ovs-vsctl commands.
Copy link
Member

@TheRealFalcon TheRealFalcon left a comment

Choose a reason for hiding this comment

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

LGTM!

@TheRealFalcon TheRealFalcon merged commit 297d171 into canonical:main Jul 22, 2023
25 checks passed
TheRealFalcon pushed a commit to TheRealFalcon/cloud-init that referenced this pull request Jul 26, 2023
…cal#4275)

Mock out the `which` checks for presence of ovs-vsctl cmd on system.
This prevents test leaks which eventually call subp ovs-vsctl commands.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants