startstop

package
v0.0.0-...-683b059 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2022 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Overview

Package startstop provides a test fixture to make sure some conditions around ARC starting and ARC stopping for performance and stability by reducing the number of Chrome launching.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Subtest

type Subtest interface {
	// Name returns the name of this subtest.
	Name() string

	// PreStart is called before starting Chrome.
	PreStart(ctx context.Context, s *testing.State)

	// PostStart is called after starting ARC, i.e. called during the
	// ARC session.
	PostStart(ctx context.Context, s *testing.State)

	// PostStop is called after logout from Chrome.
	PostStop(ctx context.Context, s *testing.State)
}

Subtest defines a test runs in arc.StartStop. Each implementation of Subtest can use the following methods to check some conditions, or to record some values to be used in a method called later. Even if an error is reported in a method, another method will be called unless the arc.StartStop is not terminated. For example, even if s.Error() is called in PostStart(), PostStop() for the same Subtest instance may be called later. The invocation of PreStart, PostStart and PostStop is wrapped by testing.State.Run, so even if s.Fatal() or s.Fatalf() is called, other methods will be called, still.

type TestMidis

type TestMidis struct{}

TestMidis verifies midis daemon starts correctly.

func (*TestMidis) Name

func (*TestMidis) Name() string

Name returns the subtest name.

func (*TestMidis) PostStart

func (*TestMidis) PostStart(ctx context.Context, s *testing.State)

PostStart makes sure that midis daemon is running.

func (*TestMidis) PostStop

func (*TestMidis) PostStop(ctx context.Context, s *testing.State)

PostStop makes sure that midis deamon is stopped.

func (*TestMidis) PreStart

func (*TestMidis) PreStart(ctx context.Context, s *testing.State)

PreStart makes sure that midis daemon is not running in login screen.

type TestMount

type TestMount struct{}

TestMount runs inside arc.StartStop.

func (*TestMount) Name

func (*TestMount) Name() string

Name returns the subtest name.

func (*TestMount) PostStart

func (*TestMount) PostStart(ctx context.Context, s *testing.State)

PostStart implements Subtest.PostStart().

func (*TestMount) PostStop

func (*TestMount) PostStop(ctx context.Context, s *testing.State)

PostStop implements Subtest.PostStop(). It makes sure that ARC related mount points are released, except ones for Mini container.

func (*TestMount) PreStart

func (*TestMount) PreStart(ctx context.Context, s *testing.State)

PreStart implements Subtest.PreStart().

type TestPID

type TestPID struct {
	// contains filtered or unexported fields
}

TestPID runs inside arc.StartStop.

func (*TestPID) Name

func (*TestPID) Name() string

Name returns the subtest name.

func (*TestPID) PostStart

func (t *TestPID) PostStart(ctx context.Context, s *testing.State)

PostStart implements Subtest.PostStart(). It remembers the current ARC's init PID, which is used in PostStop().

func (*TestPID) PostStop

func (t *TestPID) PostStop(ctx context.Context, s *testing.State)

PostStop implements Subtest.PostStop(). It checks the PID for ARC is changed on Chrome logout (i.e. on ARC shutdown).

func (*TestPID) PreStart

func (*TestPID) PreStart(ctx context.Context, s *testing.State)

PreStart implements Subtest.PreStart().

Jump to

Keyboard shortcuts

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