Documentation ¶
Index ¶
- Constants
- Variables
- func AfterReboot(c *check.C) bool
- func BeforeReboot() bool
- func CheckRebootMark(mark string) bool
- func GetCurrentUbuntuCoreVersion(c *check.C) string
- func GetCurrentVersion(c *check.C, packageName string) string
- func GetSavedVersion(c *check.C) string
- func InstallSnap(c *check.C, packageName string) string
- func IsInRebootProcess() bool
- func NeedsReboot() bool
- func Reboot(c *check.C)
- func RebootWithMark(c *check.C, mark string)
- func Release(c *check.C) string
- func RemoveRebootMark(c *check.C)
- func RemoveSnap(c *check.C, packageName string) string
- func SetSavedVersion(c *check.C, version string)
- type SnappySuite
Constants ¶
const ( // NeedsRebootFile is the file that a test writes in order to request a reboot. NeedsRebootFile = "/tmp/needs-reboot" // FormatSkipDuringReboot is the reason used to skip the pending tests when a test requested // a reboot. FormatSkipDuringReboot = "****** Skipped %s during reboot caused by %s" // FormatSkipAfterReboot is the reason used to skip already ran tests after a reboot requested // by a test. FormatSkipAfterReboot = "****** Skipped %s after reboot caused by %s" )
Variables ¶
var Cfg *config.Config
Cfg is a struct that contains the configuration values passed from the host to the testbed.
Functions ¶
func AfterReboot ¶
func AfterReboot(c *check.C) bool
AfterReboot returns True if the test is running after the test bed has been rebooted.
func BeforeReboot ¶
func BeforeReboot() bool
BeforeReboot returns True if the test is running before the test bed has been rebooted, or after the test that requested the reboot handled it.
func CheckRebootMark ¶
CheckRebootMark returns True if the reboot mark matches the string passed as argument.
func GetCurrentUbuntuCoreVersion ¶
func GetCurrentUbuntuCoreVersion(c *check.C) string
GetCurrentUbuntuCoreVersion returns the version number of the installed and active ubuntu-core.
func GetCurrentVersion ¶
GetCurrentVersion returns the version of the installed and active package.
func GetSavedVersion ¶
func GetSavedVersion(c *check.C) string
GetSavedVersion returns the saved version number.
func InstallSnap ¶
InstallSnap executes the required command to install the specified snap
func IsInRebootProcess ¶
func IsInRebootProcess() bool
IsInRebootProcess returns True if the suite needs to execute a reboot or has just rebooted.
func NeedsReboot ¶
func NeedsReboot() bool
NeedsReboot returns True if a reboot has been requested by a test.
func RebootWithMark ¶
func RebootWithMark(c *check.C, mark string)
RebootWithMark requests a reboot using a specified mark.
func Release ¶
func Release(c *check.C) string
Release returns the release of the current snappy image
func RemoveRebootMark ¶
func RemoveRebootMark(c *check.C)
RemoveRebootMark removes the reboot mark to signal that the reboot has been handled.
func RemoveSnap ¶
RemoveSnap executes the required command to remove the specified snap
func SetSavedVersion ¶
func SetSavedVersion(c *check.C, version string)
SetSavedVersion saves a version number into a file so it can be used on tests after reboots.
Types ¶
type SnappySuite ¶
SnappySuite is a structure used as a base test suite for all the snappy integration tests.
func (*SnappySuite) SetUpSuite ¶
func (s *SnappySuite) SetUpSuite(c *check.C)
SetUpSuite disables the snappy autopilot. It will run before all the integration suites.
func (*SnappySuite) SetUpTest ¶
func (s *SnappySuite) SetUpTest(c *check.C)
SetUpTest handles reboots and stores version information. It will run before all the integration tests. Before running a test, it will save the ubuntu-core version. If a reboot was requested by a previous test, it will skip all the following tests. If the suite is being called after the test bed was rebooted, it will resume the test that requested the reboot.