tests: add test that explores `apparmor_parser {,no-}expr-simplify`
When apparmor_parser is used with `-O no-expr-simplify` it can go into a expoential memory/cpu usage pattern when there are lines with `/**/`. We dealt with that in the past by adding special helpers like `AddParametricSnippet`, see 9c74887908b.
But it seems we have reached the limits for this now as we have various interfaces that e.g. contain `/sys/devices/**/.../**` like patterns which when combined seems to cause issues that make the parser easily consume more than 1G of memory.
This commit has an example snap that combines some of the problematic interfaces and demonstrates that it cannot be compiled with less than 900M (the real number is probably closer to 1G) when `no-expr-simplify` is used. It then shows that it does work with the default apparmor options.
tests: fix the core20-new-snapd-does-not-break-old-initrd test (#12911)
The test needs to use an old pc snap as the new one is making fail the boot process (error: bad shim signature) as the shim was updated to revoke old stuff because of security.
This adds options --snap and --assertion to the "snap remodel" command, which can be used to pass local files to snapd so offline remodelling is possible.
Increase a retry in a function used to determined whether a new change has been created. Since it's used after a snapd restart (when forcing an auto-refresh), the timeout wasn't enough to ensure that snapd had started, auto-refreshed and triggered the pre-download flow.
Signed-off-by: Miguel Pires <email address hidden>
Allowing loopback devices in the block-devices interface would be convenient for testing and proof-of-concept setups for users of snaps that consume block devices such as MicroCeph
Use case 1: allow a snap to utilize a preconfigured loopback bdev, for instance allow MicroCeph to use a loopback device as an OSD for testing or other non-performance critical work
Use case 2: allow a snap to create a loopback device automatically; e.g. for the above scenario MicroCeph could automatically set up a loop bdev for use as an OSD
Signed-off-by: Peter Sabaini <email address hidden>