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

o/devicestate, o/ifacestate: fix mocking in unit tests #13963

Conversation

bboozzoo
Copy link
Collaborator

Some unit tests fail unexpectedly on hosts where snapd has been installed through the package, but its services have not been enabled (or started).

The install mode unit tests block unexpectedly when snapd on the host isn't
running. This is caused by missing mocking, so the `snap changes` command called
at the end of the installation process was hitting the actual snapd process
runnig on the host machine.

Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>
Interface manager asserts whether the snapd.apparmor.service is enabled, but the
tests were missing proper mocking of this helper. In this case, on hosts where
the snapd.apparmor.service was present but not installed, the check would fail
and thus ifacemgr would push a warning indicating a possible issue, which the
braks the tests, such as interfaceManagerSuite.TestBadInterfacesWarning.

Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>
@bboozzoo bboozzoo added Simple 😃 A small PR which can be reviewed quickly Skip spread Indicate that spread job should not run labels May 13, 2024
Copy link
Collaborator

@andrewphelpsj andrewphelpsj left a comment

Choose a reason for hiding this comment

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

Thanks!

@bboozzoo bboozzoo merged commit e46286a into snapcore:master May 15, 2024
48 checks passed
@bboozzoo bboozzoo deleted the bboozzoo/fix-unitt-tests-when-snapd-not-running branch May 15, 2024 07:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Simple 😃 A small PR which can be reviewed quickly Skip spread Indicate that spread job should not run
Projects
None yet
3 participants