integration

package
v3.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2018 License: BSD-3-Clause Imports: 17 Imported by: 0

README

Integration Tests

This tests core use cases for u-root such as:

  • retrieving and kexec'ing a Linux kernel,
  • uinit (user init), and
  • running unit tests requiring root privileges.

Usage

Run the tests with:

go test

Requirements

  • QEMU
    • Path and arguments must be set with UROOT_QEMU.
    • Example: export UROOT_QEMU="$HOME/bin/qemu-system-x86_64 -L ."
  • Linux kernel
    • Path and arguments must be set with UROOT_KERNEL.
    • Example: export UROOT_KERNEL="$HOME/linux/arch/x86_64/boot/bzImage"

To Dos

  1. Support testing on architectures besides amd64. This is currently limited by the Linux bzImage uploaded.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func QEMU

func QEMU(o *Options) (*qemu.Options, error)

func QEMUTest

func QEMUTest(t *testing.T, o *Options) (*qemu.VM, func())

Types

type Options

type Options struct {
	// Env is the Go environment to use to build u-root.
	Env *golang.Environ

	// Name is the test's name.
	//
	// If name is left empty, the calling function's function name will be
	// used as determined by runtime.Caller
	Name string

	// Go commands to include in the initramfs for the VM.
	//
	// If left empty, all u-root commands will be included.
	Cmds []string

	// Uinit are commands to execute after init.
	//
	// If populated, a uinit.go will be generated from these.
	Uinit []string

	// Files are files to include in the VMs initramfs.
	Files []string

	// TmpDir is a temporary directory for build artifacts.
	TmpDir string

	// LogFile is a file to log serial output to.
	//
	// The default is serial/$Name.log
	LogFile string

	// Logger logs build statements.
	Logger logger.Logger

	// Timeout is the timeout for expect statements.
	Timeout time.Duration

	// Network is the VM's network.
	Network *qemu.Network

	// Extra environment variables to set when building (used by u-bmc)
	ExtraBuildEnv []string
}

Options are integration test options.

Directories

Path Synopsis
testcmd

Jump to

Keyboard shortcuts

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