Documentation
¶
Overview ¶
Package bundletest provides fake test bundles environment.
Index ¶
- type DUTConfig
- type Env
- func (e *Env) CompanionDUTs() map[string]string
- func (e *Env) DialRemoteBundle(ctx context.Context, t *gotesting.T, name string) *grpc.ClientConn
- func (e *Env) KeyFile() string
- func (e *Env) LocalBundleDir() string
- func (e *Env) LocalDataDir() string
- func (e *Env) LocalOutDir() string
- func (e *Env) PrimaryServer() string
- func (e *Env) RemoteBundleDir() string
- func (e *Env) RemoteDataDir() string
- func (e *Env) RemoteOutDir() string
- func (e *Env) RunConfig() *protocol.RunConfig
- type Option
- func WithCompanionDUTs(ds map[string]*DUTConfig) Option
- func WithLocalBundles(reg ...*testing.Registry) Option
- func WithLocalData(m map[string]string) Option
- func WithPrimaryDUT(d *DUTConfig) Option
- func WithRemoteBundles(reg ...*testing.Registry) Option
- func WithRemoteData(m map[string]string) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DUTConfig ¶
type DUTConfig struct {
ExtraSSHHandlers []fakesshserver.Handler
}
DUTConfig contains configurations of a fake DUT.
type Env ¶
type Env struct {
// contains filtered or unexported fields
}
Env contains information needed to interact with the testing environment set up.
func SetUp ¶
SetUp sets up fake bundles with given parameters. Returned Env contains handles to interact with the environment that has been set up. connect instructs to make connections to remote bundles.
func (*Env) CompanionDUTs ¶
CompanionDUTs returns companion DUTs' role to address mapping.
func (*Env) DialRemoteBundle ¶
DialRemoteBundle makes a connection to the remote bundle with the given name.
func (*Env) LocalBundleDir ¶
LocalBundleDir returns absolute path of the local bundle directory.
func (*Env) LocalDataDir ¶
LocalDataDir returns absolute path of the local bundle directory.
func (*Env) LocalOutDir ¶
LocalOutDir returns the absolute path to the local bundle's temporary output directory.
func (*Env) PrimaryServer ¶
PrimaryServer returns primary server address.
func (*Env) RemoteBundleDir ¶
RemoteBundleDir returns absolute path of the remote bundle directory.
func (*Env) RemoteDataDir ¶
RemoteDataDir returns absolute path of the remote bundle directory.
func (*Env) RemoteOutDir ¶
RemoteOutDir returns the absolute path to the remote bundle's temporary output directory.
type Option ¶
type Option func(*config)
Option can be passed to SetUp to customize the testing environment.
func WithCompanionDUTs ¶
WithCompanionDUTs specifies fake companion DUTs.
func WithLocalBundles ¶
WithLocalBundles specifies fake local test bundles to be installed.
func WithLocalData ¶
WithLocalData specifies local data. m should be a mapping from filepath to file content, where filepath is relative to the local data directory.
func WithPrimaryDUT ¶
WithPrimaryDUT specifies fake primary DUT configuration.
func WithRemoteBundles ¶
WithRemoteBundles specifies fake remote test bundles to be installed.
func WithRemoteData ¶
WithRemoteData specifies remote data. m should be a mapping from filepath to file content, where filepath is relative to the remote data directory.