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

Test and fix usb reset mount #22

Conversation

psafont
Copy link

@psafont psafont commented Apr 19, 2024

I can't push directly to the branch, so I'm opening this PR because I think this two commits should replace the current contents of the PR: xapi-project#5565

bernhardkaindl and others added 3 commits April 19, 2024 09:51
Use a rootless container (like unshare --map-root-user --mount)
to test the correct calling convention for mount()/umount().

Use a context manager test fixture to temporarily mock module imports:

This allows to mock global modules only temporary for importing the
testee without affecting other tests.

- Add a sufficient testcase to test usb_reset.py: mount() and umount()
  without mocking the system or library calls in any way.

- Use python3/tests a Python tests package to allow for non-deprecated
  relative imports: Absolute imports within a module are deprecated.

Signed-off-by: Bernhard Kaindl <bernhard.kaindl@cloud.com>
Signed-off-by: Pau Ruiz Safont <pau.ruizsafont@cloud.com>
…et-mount

Signed-off-by: Bernhard Kaindl <bernhardkaindl7@gmail.com>
@bernhardkaindl bernhardkaindl merged commit 50e7168 into xenserver-next:test-and-fix-usb_reset-mount Apr 23, 2024
6 of 7 checks passed
Copy link

sonarcloud bot commented Apr 23, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

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