tests: detect loop devices with deleted files as an invariant
When a loop device is created with a given backing file, the file itself may be deleted. The kernel keeps the reference to the file alive but it also adjusts the name of the file to have the suffix " (deleted)".
We should not have loop devices with this property across tests. They might indicate that a mount sticks around and leaks through a reference somehow, or that the low-level loop-back utilities are buggy.
Codecov Report
:white_check_mark: All modified and coverable lines are covered by tests.
:warning: Please upload report for BASE (master@f1825ad). Learn more about missing BASE report.
Additional details and impacted files
@@ Coverage Diff @@
## master #14568 +/- ##
=========================================
Coverage ? 77.44%
=========================================
Files ? 1318
Lines ? 178396
Branches ? 2332
=========================================
Hits ? 138162
Misses ? 31808
Partials ? 8426
| Flag | Coverage Δ | |
|---|---|---|
| unittests | 77.44% <ø> (?) |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
Fri Sep 19 11:21:21 UTC 2025 The following results are from: https://github.com/canonical/snapd/actions/runs/17854769010
Failures:
Preparing:
- openstack-ps7:ubuntu-core-24-64:tests/main/apparmor-prompting-support
- openstack-ps7:ubuntu-24.04-64:tests/main/nvidia-userspace-libs
Executing:
- google-core:ubuntu-core-18-64:tests/core/kernel-base-gadget-pair-single-reboot:kernel_base
- openstack-ps7:ubuntu-core-24-64:tests/main/dbus-activation-session-legacy
- openstack-ps7:ubuntu-core-24-64:tests/main/dbus-activation-name-conflict
- openstack-ps7:ubuntu-core-24-64:tests/main/dbus-activation-session
- openstack-ps7:ubuntu-25.04-64:tests/main/try
Restoring:
- google-core:ubuntu-core-18-64:tests/core/kernel-base-gadget-pair-single-reboot:kernel_base
- google-core:ubuntu-core-18-64:tests/core/
- google-core:ubuntu-core-18-64
- google-core:ubuntu-core-18-64:tests/core/remodel-gadget
- google-core:ubuntu-core-18-64:tests/core/auto-refresh-backoff-after-reboot:kernel
- openstack-ps7:ubuntu-core-20-64:tests/core/snapd-refresh-vs-services:start_w_2_49_2
- openstack-ps7:ubuntu-core-20-64:tests/core/gadget-update-pc
- openstack-ps7:ubuntu-core-24-64:tests/core/interfaces-gpio-chardev
- openstack-ps7:ubuntu-core-24-64:tests/core/gadget-update-pc
There is something wrong with that core24 gadget snap test. I will investigate locally.