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

Update tests #362

Merged
merged 1 commit into from
Jul 2, 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
6 changes: 3 additions & 3 deletions tests/deploys-images/deploy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ var _ = Describe("cOS Deploy tests", func() {
When("deploying again", func() {
It("deploys only if --force flag is provided", func() {
By("deploying without --force")
out, err := s.Command("cos-deploy --docker-image quay.io/costoolkit/releases-opensuse:cos-system-0.5.5")
out, err := s.Command("cos-deploy --docker-image quay.io/costoolkit/releases-opensuse:cos-system-0.5.7")
Expect(out).Should(ContainSubstring("There is already an active deployment"))
Expect(err).To(HaveOccurred())
By("deploying with --force")
out, err = s.Command("cos-deploy --force --docker-image quay.io/costoolkit/releases-opensuse:cos-system-0.5.5")
out, err = s.Command("cos-deploy --force --docker-image quay.io/costoolkit/releases-opensuse:cos-system-0.5.7")
Expect(out).Should(ContainSubstring("Forcing overwrite"))
Expect(out).Should(ContainSubstring("now you might want to reboot"))
Expect(err).NotTo(HaveOccurred())
Expand All @@ -64,7 +64,7 @@ var _ = Describe("cOS Deploy tests", func() {
s.Reboot()
ExpectWithOffset(1, s.BootFrom()).To(Equal(sut.Recovery))
By("deploying with --force")
out, err := s.Command("cos-deploy --force --docker-image quay.io/costoolkit/releases-opensuse:cos-system-0.5.5")
out, err := s.Command("cos-deploy --force --docker-image quay.io/costoolkit/releases-opensuse:cos-system-0.5.7")
Expect(out).Should(ContainSubstring("now you might want to reboot"))
Expect(err).NotTo(HaveOccurred())
})
Expand Down
7 changes: 3 additions & 4 deletions tests/recovery/recovery_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ var _ = Describe("cOS Recovery upgrade tests", func() {
ExpectWithOffset(1, s.BootFrom()).To(Equal(sut.Recovery))

recoveryName := s.GetOSRelease("NAME")

// In these tests, if we are booting into squashfs we are booting into recovery. And the recovery image
// is shipping a different os-release name (cOS recovery) instead of the standard one (cOS)
if s.SquashFSRecovery() {
Expand Down Expand Up @@ -88,10 +88,9 @@ var _ = Describe("cOS Recovery upgrade tests", func() {
s.Reboot()
ExpectWithOffset(1, s.BootFrom()).To(Equal(sut.Recovery))

out, err := s.Command("CURRENT=active.img cos-upgrade --no-verify --docker-image quay.io/costoolkit/releases-opensuse:cos-system-0.5.1")
out, err := s.Command("CURRENT=active.img cos-upgrade --no-verify --docker-image quay.io/costoolkit/releases-opensuse:cos-system-0.5.7")
Expect(err).ToNot(HaveOccurred())
Expect(out).Should(ContainSubstring("Upgrade done, now you might want to reboot"))
Expect(out).Should(ContainSubstring("Upgrade done, now you might want to reboot"))

err = s.ChangeBoot(sut.Active)
Expect(err).ToNot(HaveOccurred())
Expand All @@ -101,7 +100,7 @@ var _ = Describe("cOS Recovery upgrade tests", func() {

upgradedVersion := s.GetOSRelease("VERSION")
Expect(upgradedVersion).ToNot(Equal(currentVersion))
Expect(upgradedVersion).To(Equal("0.5.1\n"))
Expect(upgradedVersion).To(Equal("0.5.7\n"))
})
})

Expand Down
10 changes: 2 additions & 8 deletions tests/upgrades-images-signed/upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,6 @@ 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 All @@ -69,7 +63,7 @@ var _ = Describe("cOS Upgrade tests - Images signed", func() {

version := out
By("upgrading to an old image")
out, err = s.Command("cos-upgrade --docker-image quay.io/costoolkit/releases-opensuse:cos-system-0.5.1")
out, err = s.Command("cos-upgrade --docker-image quay.io/costoolkit/releases-opensuse:cos-system-0.5.7")
Expect(err).ToNot(HaveOccurred())
Expect(out).Should(ContainSubstring("Upgrade done, now you might want to reboot"))
Expect(out).Should(ContainSubstring("to /usr/local/tmp/rootfs"))
Expand All @@ -82,7 +76,7 @@ var _ = Describe("cOS Upgrade tests - Images signed", func() {
Expect(err).ToNot(HaveOccurred())
Expect(out).ToNot(Equal(""))
Expect(out).ToNot(Equal(version))
Expect(out).To(Equal("0.5.1\n"))
Expect(out).To(Equal("0.5.7\n"))
})
})
})
Expand Down
8 changes: 4 additions & 4 deletions tests/upgrades-images-unsigned/upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ var _ = Describe("cOS Upgrade tests - Images unsigned", func() {
})
Context("After install", func() {
When("images are not signed", func() {
It("upgrades to latest available (master) with --no-verify", func() {
It("upgrades to v0.5.7 with --no-verify", func() {
out, err := s.Command("source /etc/os-release && echo $VERSION")
Expect(err).ToNot(HaveOccurred())
Expect(out).ToNot(Equal(""))

version := out
out, err = s.Command("cos-upgrade --no-verify --docker-image quay.io/costoolkit/releases-opensuse:cos-system-0.5.1")
out, err = s.Command("cos-upgrade --no-verify --docker-image quay.io/costoolkit/releases-opensuse:cos-system-0.5.7")
if err != nil {
fmt.Fprintf(GinkgoWriter, "Error from cos-upgrade: %v\n", err)
}
Expand All @@ -63,15 +63,15 @@ var _ = Describe("cOS Upgrade tests - Images unsigned", func() {
Expect(err).ToNot(HaveOccurred())
Expect(out).ToNot(Equal(""))
Expect(out).ToNot(Equal(version))
Expect(out).To(Equal("0.5.1\n"))
Expect(out).To(Equal("0.5.7\n"))

By("rollbacking state")
s.Reset()

out, err = s.Command("source /etc/os-release && echo $VERSION")
Expect(err).ToNot(HaveOccurred())
Expect(out).ToNot(Equal(""))
Expect(out).ToNot(Equal("0.5.1\n"))
Expect(out).ToNot(Equal("0.5.7\n"))
Expect(out).To(Equal(version))
})
})
Expand Down
10 changes: 5 additions & 5 deletions tests/upgrades-local/upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ var _ = Describe("cOS Upgrade tests - local upgrades", func() {

version := out

out, err = s.Command("mkdir /run/update && luet util unpack quay.io/costoolkit/releases-opensuse:cos-system-0.5.1 /run/update")
if err != nil{
out, err = s.Command("mkdir /run/update && luet util unpack quay.io/costoolkit/releases-opensuse:cos-system-0.5.7 /run/update")
if err != nil {
fmt.Fprintf(GinkgoWriter, "Error from luet util unpack: %v\n", err)
}
Expect(err).ToNot(HaveOccurred())
Expect(out).ToNot(Equal(""))

out, err = s.Command("cos-upgrade --no-verify --directory /run/update")
if err != nil{
if err != nil {
fmt.Fprintf(GinkgoWriter, "Error from cos-upgrade: %v\n", err)
}
Expect(err).ToNot(HaveOccurred())
Expand All @@ -46,15 +46,15 @@ var _ = Describe("cOS Upgrade tests - local upgrades", func() {
Expect(err).ToNot(HaveOccurred())
Expect(out).ToNot(Equal(""))
Expect(out).ToNot(Equal(version))
Expect(out).To(Equal("0.5.1\n"))
Expect(out).To(Equal("0.5.7\n"))

By("rollbacking state")
s.Reset()

out, err = s.Command("source /etc/os-release && echo $VERSION")
Expect(err).ToNot(HaveOccurred())
Expect(out).ToNot(Equal(""))
Expect(out).ToNot(Equal("0.5.1\n"))
Expect(out).ToNot(Equal("0.5.7\n"))
Expect(out).To(Equal(version))
})
})
Expand Down