mirror of
https://github.com/rancher/os.git
synced 2025-06-25 22:41:36 +00:00
add a test for upgrading after a rolled back upgrade
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
This commit is contained in:
parent
693ca3179b
commit
19fcea6264
@ -31,6 +31,38 @@ func (s *QemuSuite) TestUpgrade080rc7(c *C) {
|
|||||||
// alpine console is unlikely to work before 0.8.0-rc5
|
// alpine console is unlikely to work before 0.8.0-rc5
|
||||||
s.commonTestCode(c, "v0.8.0-rc7", "alpine")
|
s.commonTestCode(c, "v0.8.0-rc7", "alpine")
|
||||||
}
|
}
|
||||||
|
func (s *QemuSuite) TestUpgrade081Persistent(c *C) {
|
||||||
|
s.commonTestCode(c, "v0.8.1", "alpine")
|
||||||
|
}
|
||||||
|
func (s *QemuSuite) TestUpgrade081RollBack(c *C) {
|
||||||
|
s.commonTestCode(c, "v0.7.1", "default")
|
||||||
|
|
||||||
|
runArgs := []string{
|
||||||
|
"--boothd",
|
||||||
|
}
|
||||||
|
{
|
||||||
|
// and now rollback to 0.8.1
|
||||||
|
thisVersion := "v0.8.1"
|
||||||
|
s.RunQemuWith(c, runArgs...)
|
||||||
|
|
||||||
|
s.CheckCall(c, fmt.Sprintf("sudo ros os upgrade --no-reboot -i rancher/os:%s%s --force", thisVersion, Suffix))
|
||||||
|
|
||||||
|
s.Reboot(c)
|
||||||
|
s.CheckOutput(c, "ros version "+thisVersion+"\n", Equals, "sudo ros -v")
|
||||||
|
s.Stop(c)
|
||||||
|
}
|
||||||
|
{
|
||||||
|
// and now re-upgrade to latest
|
||||||
|
thisVersion := Version
|
||||||
|
s.RunQemuWith(c, runArgs...)
|
||||||
|
|
||||||
|
s.CheckCall(c, fmt.Sprintf("sudo ros os upgrade --no-reboot -i rancher/os:%s%s --force", thisVersion, Suffix))
|
||||||
|
|
||||||
|
s.Reboot(c)
|
||||||
|
s.CheckOutput(c, "ros version "+thisVersion+"\n", Equals, "sudo ros -v")
|
||||||
|
s.Stop(c)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// DisabledTestUpgradeInner is used to debug the above tests if they fail - the current imple of the check code limits itself to depths _one_ stacktrace
|
// DisabledTestUpgradeInner is used to debug the above tests if they fail - the current imple of the check code limits itself to depths _one_ stacktrace
|
||||||
func (s *QemuSuite) DisableTestUpgradeInner(c *C) {
|
func (s *QemuSuite) DisableTestUpgradeInner(c *C) {
|
||||||
@ -96,6 +128,7 @@ sync
|
|||||||
|
|
||||||
s.Stop(c)
|
s.Stop(c)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *QemuSuite) commonTestCode(c *C, startWithVersion, console string) {
|
func (s *QemuSuite) commonTestCode(c *C, startWithVersion, console string) {
|
||||||
runArgs := []string{
|
runArgs := []string{
|
||||||
"--iso",
|
"--iso",
|
||||||
|
Loading…
Reference in New Issue
Block a user