snapd tests fail on snapd 2.11 on Arch Linux

Bug #1606932 reported by Timothy Redaelli
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snappy
Fix Released
Medium
John Lenton

Bug Description

by updating snapd packages (without confinement nor apparmor) on Arch Linux from 2.0.10 to 2.11 I notice that some (unit) tests doesn't work correctly:

----------------------------------------------------------------------
FAIL: api_test.go:1980: apiSuite.TestInstallJailMode

api_test.go:2000:
    c.Check(err, check.IsNil)
... value *errors.errorString = &errors.errorString{s:"this system cannot honour the jailmode flag"} ("this system cannot honour the jailmode flag")

api_test.go:2002:
    c.Check(calledFlags&snapstate.JailMode, check.Equals, snapstate.Flags(snapstate.JailMode))
... obtained snapstate.Flags = 0
... expected snapstate.Flags = 4

----------------------------------------------------------------------
FAIL: api_test.go:2022: apiSuite.TestInstallJailModeDevMode

api_test.go:2034:
    c.Check(err, check.ErrorMatches, "cannot use devmode and jailmode flags together")
... error string = "this system cannot honour the jailmode flag"
... regex string = "cannot use devmode and jailmode flags together"

----------------------------------------------------------------------
FAIL: api_test.go:1728: apiSuite.TestRefresh

api_test.go:1759:
    c.Check(calledFlags, check.Equals, snapstate.Flags(0))
... obtained snapstate.Flags = 1
... expected snapstate.Flags = 0

----------------------------------------------------------------------
FAIL: api_test.go:1340: apiSuite.TestSideloadSnapJailModeAndDevmode

api_test.go:1365:
    c.Check(rsp.Result.(*errorResult).Message, check.Equals, "cannot use devmode and jailmode flags together")
... obtained string = "this system cannot honour the jailmode flag"
... expected string = "cannot use devmode and jailmode flags together"

OOPS: 117 passed, 1 skipped, 4 FAILED
--- FAIL: Test (4.00s)
FAIL

description: updated
Revision history for this message
John Lenton (chipaca) wrote :

Aha! Those tests need a `if release.ReleaseInfo.ForceDevMode() { c.Skip("forced devmode distro") }`

Revision history for this message
John Lenton (chipaca) wrote :

or we should use a fake release.OS instead of the actual one in tests :-/

Revision history for this message
John Lenton (chipaca) wrote :
Changed in snappy:
assignee: nobody → John Lenton (chipaca)
importance: Undecided → Medium
status: New → In Progress
John Lenton (chipaca)
Changed in snappy:
status: In Progress → Fix Committed
Michael Vogt (mvo)
Changed in snappy:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.