common

package
v0.0.0-...-41dd8df Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 17, 2016 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
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

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

func CheckRebootMark(mark string) bool

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

func GetCurrentVersion(c *check.C, packageName string) string

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

func InstallSnap(c *check.C, packageName string) string

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 Reboot

func Reboot(c *check.C)

Reboot requests a reboot using the test name as the mark.

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

func RemoveSnap(c *check.C, packageName string) string

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

type SnappySuite struct {
	testutil.BaseTest
}

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL