interfaces/mount: discard mount ns on backend Remove
When a snap is removed each security backend is asked to remove the
security profiles associated with the snap in question. For the mount
backend that would just remove the desired mount namespace profile.
While this part worked correctly there was more to be done. The system
may still have the preserved mount namespace as well as the actual
applied (current) mount profiles that exist therein.
In a case where a snap was installed but the installation failed because
of a hook issue, the system would be left in a state where an existing
mount namespace would be left behind.
We saw some test failures because of conflicting profiles. Upon
further inspection we noticed that the apparomor profile transition
of the "snap-confine" profile to the "snap-confine.real" profile
is not working correctly.
This PR fixes the transition and also extends the upgrade-from-2.15
test to cover this better.
After merging PR#6950 master failed because it got a new
gpio-control interface which uses the old style of testing
for os-slots. This is no longer used, see: https://github.com/snapcore/snapd/pull/6950/files
This will unbreak the current unit test failures in master.