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
tests: add core revert test #3348
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3348 +/- ##
==========================================
+ Coverage 77.55% 77.55% +<.01%
==========================================
Files 371 371
Lines 25519 25519
==========================================
+ Hits 19790 19792 +2
+ Misses 3978 3976 -2
Partials 1751 1751
Continue to review full report at Codecov.
|
* do not fail on broken connection (auto reboot after refresh/revert) * wait for revert change to be done
The test case finally reproduces the seccomp issue, with the current status and executed setting @niemeyer if you could take a look that would be great |
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.
Looks good, one (most unrelated for the core of this PR) comment about trap
tests/lib/nested.sh
Outdated
# create ubuntu-core image | ||
mkdir -p /tmp/work-dir | ||
snap install --devmode --beta ubuntu-image | ||
trap 'snap remove ubuntu-image' EXIT |
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.
Trap will replace other existing traps on the same signal. So if we alread use a trap ... EXIT
anwhere this is overriden now. We may consider switching to a helper (add_trap
) that stacks the cleanups if we already use traps. Probably material for a new PR though.
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.
Thanks @mvo5 ! Indeed, for the time being, and given that all the tasks in the nested suite are going to use ubuntu-image, I've moved its install/unistall at the suite level, and btw also removed a trap used for apt, please take another look.
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.
LGTM
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 review that I apparently never submitted
QEMU="$(which qemu-system-x86_64)" | ||
;; | ||
i386) | ||
QEMU="$(which qemu-system-i386)" |
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.
QEMU
can expand to "". This is not a big deal but I'd rather get a qemu-system-x86_64: command not found
than a more confusing message below when the first argument of qemu becomes the command. Could we please drop the which
?
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.
Sure, will do in a followup
esac | ||
|
||
# create ubuntu-core image | ||
mkdir -p /tmp/work-dir |
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.
I'd prefer if this was a temporary directory.
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.
Ok, noted for the followup
@@ -0,0 +1,28 @@ | |||
summary: core revert test | |||
|
|||
systems: [ubuntu-16.04-64] |
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.
Can this test happen on other distributions?
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.
I think so, in fact the interesting part happens on the nested machine, if we can install qemu all should be good. I'll try locally with debian/fedora anyway.
@@ -0,0 +1,28 @@ | |||
summary: core revert test |
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.
Could you please document the intent and mechanics of this test.
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.
Sure, I'll add a details section
This test exercises a core revert on a nested ubuntu-core system, currently only a preinstalled snap is set (network-manager) and the check after the revert only takes into account network configuration. It can be executed with:
SPREAD_CORE_CHANNEL=stable spread -v qemu:ubuntu-16.04-64:tests/nested/core-revert
.This PR also includes a refactor of reusable functions from a previous nested task, the actual test is https://github.com/snapcore/snapd/pull/3348/files#diff-4825fd024a235e7895b109ad37072e68