-
-
Notifications
You must be signed in to change notification settings - Fork 207
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
pytest: Isolate directories, start permission store and add umockdev support #1477
Conversation
/cc @whot |
6bedc64
to
97bb235
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a few style nitpicks on style but this LGTM, thanks
97bb235
to
701f80f
Compare
Depends on #1486 now. It also adds a workaround to keep ASAN working while using LD_PRELOAD. |
316bb2b
to
4ff06c8
Compare
Needs rebase. The leak commits could also be its own PR. |
If PortalMock was subclassing DBusTestCase, then TearDown would be called, but it's not. Yield the PortalMock and call tear_down afterwards. This also reveals a bug where the loop iterated over the keys instead of the values.
This ensure that we don't use or modify any data from the actual system and instead have a clean, predictable environment for tests without the risk of accidentally modifying something on the host.
This way it becomes reusable when we want to start more components.
We now isolate the test environment so that the permission store will start with an empty state but.
This makes sure that the portal frontend exited cleanly. This includes no memory leaks detected by ASAN and for that to work we need our suppression file.
We re-exec the test case in pytest_configure if the LD_PRELOAD doesn't contain libumockdev-preload.so. Even if the system doesn't have it, it will show up in the environment and we can continue. It also sets the UMOCKDEV_DIR env for the portal frontend. In theory dbusmock should already do this for us but it doesn't seem to be working. Finally, it makes sure that ASAN keeps working even when LD_PRELOAD is being used which is always the case because we require umockdev.
4ff06c8
to
41d06b8
Compare
Rebased. Created a new PR for the memory leak fixes #1491. This PR still depends on them because it requires ASAN to pass for the tests to pass. |
Based on #1451
What the title says. This is prep work for being able to test the USB portal with the python harness.