Documentation ¶
Index ¶
- type FileContent
- type LiveTests
- func (t *LiveTests) BootstrapOnce(c *C)
- func (t *LiveTests) Destroy(c *C)
- func (t *LiveTests) SetUpSuite(c *C)
- func (t *LiveTests) TearDownSuite(c *C)
- func (t *LiveTests) TestBootstrapAndDeploy(c *C)
- func (t *LiveTests) TestBootstrapMultiple(c *C)
- func (t *LiveTests) TestBootstrapVerifyStorage(c *C)
- func (t *LiveTests) TestBootstrapWithDefaultSeries(c *C)
- func (t *LiveTests) TestCheckEnvironmentOnConnect(c *C)
- func (t *LiveTests) TestCheckEnvironmentOnConnectBadVerificationFile(c *C)
- func (t *LiveTests) TestCheckEnvironmentOnConnectNoVerificationFile(c *C)
- func (t *LiveTests) TestFile(c *C)
- func (t *LiveTests) TestGlobalPorts(c *C)
- func (t *LiveTests) TestPorts(c *C)
- func (t *LiveTests) TestStartInstanceOnUnknownPlatform(c *C)
- func (t *LiveTests) TestStartInstanceWithEmptyNonceFails(c *C)
- func (t *LiveTests) TestStartStop(c *C)
- type ProxyRoundTripper
- type TestConfig
- type Tests
- type VirtualRoundTripper
- Bugs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileContent ¶
A simple content structure to pass data into VirtualRoundTripper. When using VRT, requests that match 'Name' will be served the value in 'Content'
type LiveTests ¶
type LiveTests struct { coretesting.LoggingSuite // TestConfig contains the configuration attributes for opening an environment. TestConfig TestConfig // Env holds the currently opened environment. Env environs.Environ // Attempt holds a strategy for waiting until the environment // becomes logically consistent. 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 // 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 ¶
func (t *LiveTests) BootstrapOnce(c *C)
func (*LiveTests) SetUpSuite ¶
func (t *LiveTests) SetUpSuite(c *C)
func (*LiveTests) TearDownSuite ¶
func (t *LiveTests) TearDownSuite(c *C)
func (*LiveTests) TestBootstrapAndDeploy ¶
func (t *LiveTests) TestBootstrapAndDeploy(c *C)
func (*LiveTests) TestBootstrapMultiple ¶
func (t *LiveTests) TestBootstrapMultiple(c *C)
func (*LiveTests) TestBootstrapVerifyStorage ¶
func (t *LiveTests) TestBootstrapVerifyStorage(c *C)
func (*LiveTests) TestBootstrapWithDefaultSeries ¶
func (t *LiveTests) TestBootstrapWithDefaultSeries(c *C)
func (*LiveTests) TestCheckEnvironmentOnConnect ¶
func (t *LiveTests) TestCheckEnvironmentOnConnect(c *C)
func (*LiveTests) TestCheckEnvironmentOnConnectBadVerificationFile ¶
func (t *LiveTests) TestCheckEnvironmentOnConnectBadVerificationFile(c *C)
func (*LiveTests) TestCheckEnvironmentOnConnectNoVerificationFile ¶
func (t *LiveTests) TestCheckEnvironmentOnConnectNoVerificationFile(c *C)
func (*LiveTests) TestGlobalPorts ¶
func (t *LiveTests) TestGlobalPorts(c *C)
func (*LiveTests) TestStartInstanceOnUnknownPlatform ¶
func (t *LiveTests) TestStartInstanceOnUnknownPlatform(c *C)
Check that we can't start an instance running tools that correspond with no available platform. The first thing start instance should do is find appropriate tools.
func (*LiveTests) TestStartInstanceWithEmptyNonceFails ¶
func (t *LiveTests) TestStartInstanceWithEmptyNonceFails(c *C)
Check that we can't start an instance with an empty nonce value.
func (*LiveTests) TestStartStop ¶
func (t *LiveTests) TestStartStop(c *C)
TestStartStop is similar to Tests.TestStartStop except that it does not assume a pristine environment.
type ProxyRoundTripper ¶
type ProxyRoundTripper struct {
Sub http.RoundTripper
}
When using RegisterProtocol on http.Transport, you can't actually change the registration. So we provide a RoundTripper that simply proxies to whatever we want as the current content.
type TestConfig ¶
type TestConfig struct {
Config map[string]interface{}
}
TestConfig contains the configuration for the environment This is a is an indirection to make it harder for tests to accidentally share the underlying map.
func (*TestConfig) UpdateConfig ¶
func (testConfig *TestConfig) UpdateConfig(update map[string]interface{})
UpdateConfig modifies the configuration safely by creating a new map
type Tests ¶
type Tests struct { coretesting.LoggingSuite TestConfig TestConfig Env environs.Environ }
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) TearDownTest ¶
func (t *Tests) TearDownTest(c *C)
func (*Tests) TestBootstrap ¶
func (t *Tests) TestBootstrap(c *C)
func (*Tests) TestPersistence ¶
func (t *Tests) TestPersistence(c *C)
func (*Tests) TestStartStop ¶
func (t *Tests) TestStartStop(c *C)
type VirtualRoundTripper ¶
type VirtualRoundTripper struct {
// contains filtered or unexported fields
}
VirtualRoundTripper can be used to provide "http" responses without actually starting an HTTP server. It is used by calling: vfs := NewVirtualRoundTripper([]FileContent{<file contents>, <error urls>}) http.DefaultTransport.(*http.Transport).RegisterProtocol("test", vfs) At which point requests to test:///foo will pull out the virtual content of the file named 'foo' passed into the RoundTripper constructor. If errorURLs are supplied, any URL which starts with the one of the map keys causes a response with the corresponding status code to be returned.
func NewVirtualRoundTripper ¶
func NewVirtualRoundTripper(contents []FileContent, errorURLs map[string]int) *VirtualRoundTripper
Notes ¶
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