juju: github.com/juju/juju/environs/jujutest Index | Files

package jujutest

import "github.com/juju/juju/environs/jujutest"

Index

Package Files

livetests.go tests.go

Constants

const (
    AdminSecret = "admin-secret"
)

type LiveTests Uses

type LiveTests struct {
    gitjujutesting.CleanupSuite

    envtesting.ToolsFixture
    sstesting.TestDataSuite

    // TestConfig contains the configuration attributes for opening an environment.
    TestConfig coretesting.Attrs

    // Credential contains the credential for preparing an environment for
    // bootstrapping. If this is unset, empty credentials will be used.
    Credential cloud.Credential

    // CloudRegion contains the cloud region name to create resources in.
    CloudRegion string

    // CloudEndpoint contains the cloud API endpoint to communicate with.
    CloudEndpoint string

    // Attempt holds a strategy for waiting until the environment
    // becomes logically consistent.
    //
    // TODO(katco): 2016-08-09: lp:1611427
    Attempt utils.AttemptStrategy

    // CanOpenState should be true if the testing environment allows
    // the state to be opened after bootstrapping.
    CanOpenState bool

    // HasProvisioner should be true if the environment has
    // a provisioning agent.
    HasProvisioner bool

    // Env holds the currently opened environment.
    // This is set by PrepareOnce and BootstrapOnce.
    Env environs.Environ

    // ControllerStore holds the controller related information
    // such as controllers, accounts, etc., used when preparing
    // the environment. This is initialized by SetUpSuite.
    ControllerStore jujuclient.ClientStore

    // ControllerUUID is the uuid of the bootstrapped controller.
    ControllerUUID string

    // ProviderCallContext holds the context to be used to make
    // calls to a cloud provider.
    ProviderCallContext context.ProviderCallContext
    // contains filtered or unexported fields
}

LiveTests contains tests that are designed to run against a live server (e.g. Amazon EC2). The Environ is opened once only for all the tests in the suite, stored in Env, and Destroyed after the suite has completed.

func (*LiveTests) BootstrapOnce Uses

func (t *LiveTests) BootstrapOnce(c *gc.C)

func (*LiveTests) Destroy Uses

func (t *LiveTests) Destroy(c *gc.C)

func (*LiveTests) PrepareOnce Uses

func (t *LiveTests) PrepareOnce(c *gc.C)

PrepareOnce ensures that the environment is available and prepared. It sets t.Env appropriately.

func (*LiveTests) SetUpSuite Uses

func (t *LiveTests) SetUpSuite(c *gc.C)

func (*LiveTests) SetUpTest Uses

func (t *LiveTests) SetUpTest(c *gc.C)

func (*LiveTests) TearDownSuite Uses

func (t *LiveTests) TearDownSuite(c *gc.C)

func (*LiveTests) TearDownTest Uses

func (t *LiveTests) TearDownTest(c *gc.C)

func (*LiveTests) TestBootstrapAndDeploy Uses

func (t *LiveTests) TestBootstrapAndDeploy(c *gc.C)

func (*LiveTests) TestBootstrapMultiple Uses

func (t *LiveTests) TestBootstrapMultiple(c *gc.C)

func (*LiveTests) TestBootstrapWithDefaultSeries Uses

func (t *LiveTests) TestBootstrapWithDefaultSeries(c *gc.C)

func (*LiveTests) TestGlobalPorts Uses

func (t *LiveTests) TestGlobalPorts(c *gc.C)

func (*LiveTests) TestPorts Uses

func (t *LiveTests) TestPorts(c *gc.C)

func (*LiveTests) TestPrechecker Uses

func (t *LiveTests) TestPrechecker(c *gc.C)

func (*LiveTests) TestStartInstanceWithEmptyNonceFails Uses

func (t *LiveTests) TestStartInstanceWithEmptyNonceFails(c *gc.C)

Check that we get a consistent error when asking for an instance without a valid machine config.

func (*LiveTests) TestStartStop Uses

func (t *LiveTests) TestStartStop(c *gc.C)

TestStartStop is similar to Tests.TestStartStop except that it does not assume a pristine environment.

type Tests Uses

type Tests struct {
    TestConfig     coretesting.Attrs
    Credential     cloud.Credential
    CloudEndpoint  string
    CloudRegion    string
    ControllerUUID string
    envtesting.ToolsFixture
    sstesting.TestDataSuite

    // ControllerStore holds the controller related information
    // such as controllers, accounts, etc., used when preparing
    // the environment. This is initialized by SetUpSuite.
    ControllerStore jujuclient.ClientStore

    // ProviderCallContext holds the context to be used to make
    // calls to a cloud provider.
    ProviderCallContext context.ProviderCallContext
    // contains filtered or unexported fields
}

Tests is a gocheck suite containing tests verifying juju functionality against the environment with the given configuration. The tests are not designed to be run against a live server - the Environ is opened once for each test, and some potentially expensive operations may be executed.

func (*Tests) AssertPrepareFailsWithConfig Uses

func (t *Tests) AssertPrepareFailsWithConfig(c *gc.C, badConfig coretesting.Attrs, errorMatches string) error

func (*Tests) CloudSpec Uses

func (t *Tests) CloudSpec() environs.CloudSpec

func (*Tests) Open Uses

func (t *Tests) Open(c *gc.C, cfg *config.Config) environs.Environ

Open opens an instance of the testing environment.

func (*Tests) Prepare Uses

func (t *Tests) Prepare(c *gc.C) environs.Environ

Prepare prepares an instance of the testing environment.

func (*Tests) PrepareParams Uses

func (t *Tests) PrepareParams(c *gc.C) bootstrap.PrepareParams

PrepareParams returns the environs.PrepareParams that will be used to call environs.Prepare.

func (*Tests) PrepareWithParams Uses

func (t *Tests) PrepareWithParams(c *gc.C, params bootstrap.PrepareParams) environs.Environ

PrepareWithParams prepares an instance of the testing environment.

func (*Tests) SetUpTest Uses

func (t *Tests) SetUpTest(c *gc.C)

func (*Tests) TearDownTest Uses

func (t *Tests) TearDownTest(c *gc.C)

func (*Tests) TestBootstrap Uses

func (t *Tests) TestBootstrap(c *gc.C)

func (*Tests) TestStartStop Uses

func (t *Tests) TestStartStop(c *gc.C)

Bugs

Logic below is very much wrong. Must be: 1. EnsureDying on the unit and EnsureDying on the machine 2. Unit dies by itself 3. Machine removes dead unit 4. Machine dies by itself 5. Provisioner removes dead machine

Package jujutest imports 41 packages (graph) and is imported by 20 packages. Updated 2019-09-28. Refresh now. Tools for package owners.