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

Re-enable recovery upgrade test #321

Merged
merged 1 commit into from
Jun 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/cos/collection.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
packages:
- name: "cos"
category: "system"
version: "0.5.4"
version: "0.5.5"
brand_name: "cOS"
labels:
autobump.revdeps: "true"
autobump.revbump_related: "recovery/cos-img recovery/cos-squash"
- name: "cos"
category: "recovery"
version: "0.5.4"
version: "0.5.5"
brand_name: "cOS recovery"
labels:
autobump.revdeps: "true"
Expand Down
2 changes: 1 addition & 1 deletion packages/installer/definition.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
name: "installer"
category: "utils"
version: "0.7.5"
version: "0.7.6"
9 changes: 7 additions & 2 deletions packages/installer/upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -160,19 +160,24 @@ upgrade() {
export LUET_PRIVILEGED_EXTRACT=true

args=""
if [ -z "$VERIFY" ]; then
args="--enable-logfile --logfile /tmp/luet.log --plugin image-mtree-check"
if [ -z "$VERIFY" ] || [ "$VERIFY" == true ]; then
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there something that sets this var to true?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it could be set to true if someone sets it in the /etc/cos-upgrade-image file, that file gets sourced to be able to set custom behavior of cos-upgrade by default

args="--enable-logfile --logfile /tmp/luet.log --plugin luet-mtree"
fi

if [ -n "$CHANNEL_UPGRADES" ] && [ "$CHANNEL_UPGRADES" == true ]; then
echo "Upgrading from release channel"
set -x
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this a leftover from debugging?

Copy link
Contributor Author

@mudler mudler Jun 24, 2021

Choose a reason for hiding this comment

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

yes/no.. I've added it for debugging, but I'm unsure to keep it or not. It seems useful for debug, but also as a informative output of what's going on.. UX definetly deserve its own story :)

luet install $args --system-target $TARGET --system-engine memory -y $UPGRADE_IMAGE
luet cleanup
set +x
elif [ "$DIRECTORY" == true ]; then
echo "Upgrading from local folder: $UPGRADE_IMAGE"
rsync -axq --exclude='host' --exclude='mnt' --exclude='proc' --exclude='sys' --exclude='dev' --exclude='tmp' ${UPGRADE_IMAGE}/ $TARGET
else
echo "Upgrading from container image: $UPGRADE_IMAGE"
set -x
luet util unpack $args $UPGRADE_IMAGE /usr/local/tmp/rootfs
set +x
rsync -aqzAX --exclude='mnt' --exclude='proc' --exclude='sys' --exclude='dev' --exclude='tmp' /usr/local/tmp/rootfs/ $TARGET
rm -rf /usr/local/tmp/rootfs
fi
Expand Down
2 changes: 1 addition & 1 deletion packages/recovery-img/definition.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "cos-img"
category: "recovery"
version: "0.5.4"
version: "0.5.5"
brand_name: "cOS"
2 changes: 1 addition & 1 deletion packages/recovery-img/squash/definition.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
name: "cos-squash"
category: "recovery"
version: "0.5.4"
version: "0.5.5"
2 changes: 1 addition & 1 deletion tests/recovery/recovery_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ var _ = Describe("cOS Recovery upgrade tests", func() {

When("using upgrade channel", func() {
// TODO: This test cannot be enabled until we have in master a published version of cOS >=0.5.3
PIt("upgrades to latest image", func() {
It("upgrades to latest image", func() {
By("upgrading recovery and reboot")
out, err := s.Command("cos-upgrade --no-verify --recovery")
Expect(err).ToNot(HaveOccurred())
Expand Down
12 changes: 6 additions & 6 deletions tests/upgrades-images-signed/upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ var _ = Describe("cOS Upgrade tests - Images signed", func() {
})
Context("After install", func() {
When("upgrading", func() {
It("fails if verify is enabled on an unsigned/malformed version", func() {
out, err := s.Command("cos-upgrade --docker-image raccos/releases-opensuse:cos-system-0.5.0")
Expect(out).Should(ContainSubstring("luet-mtree"))
Expect(out).Should(ContainSubstring("error while executing plugin"))
Expect(err).To(HaveOccurred())
})
It("upgrades to latest available (master) and reset", func() {
out, err := s.Command("cos-upgrade")
Expect(err).ToNot(HaveOccurred())
Expand Down Expand Up @@ -78,12 +84,6 @@ var _ = Describe("cOS Upgrade tests - Images signed", func() {
Expect(out).ToNot(Equal(version))
Expect(out).To(Equal("0.5.1\n"))
})
It("fails if verify is enabled on an unsigned/malformed version", func() {
out, err := s.Command("cos-upgrade --docker-image raccos/releases-opensuse:cos-system-0.5.0")
Expect(err).To(HaveOccurred())
Expect(out).Should(ContainSubstring("luet-mtree"))
Expect(out).Should(ContainSubstring("error while executing plugin"))
})
})
})
})