Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(3581)

Side by Side Diff: environs/jujutest/test.go

Issue 5754103: environs/ec2: test that we can connect to zookeeper after bootstrap.
Patch Set: environs/ec2: test that we can connect to zookeeper after bootstrap. Created 13 years ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « environs/jujutest/livetests.go ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 package jujutest 1 package jujutest
2 2
3 import ( 3 import (
4 . "launchpad.net/gocheck" 4 . "launchpad.net/gocheck"
5 "launchpad.net/juju/go/environs" 5 "launchpad.net/juju/go/environs"
6 "launchpad.net/juju/go/state" 6 "launchpad.net/juju/go/state"
7 "time" 7 "time"
8 ) 8 )
9 9
10 // InvalidStateInfo holds information about no state - it will always give 10 // InvalidStateInfo holds information about no state - it will always give
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 t.Env = nil 47 t.Env = nil
48 } 48 }
49 49
50 // LiveTests contains tests that are designed to run against a live server 50 // LiveTests contains tests that are designed to run against a live server
51 // (e.g. Amazon EC2). The Environ is opened once only for all the tests 51 // (e.g. Amazon EC2). The Environ is opened once only for all the tests
52 // in the suite, stored in Env, and Destroyed after the suite has completed. 52 // in the suite, stored in Env, and Destroyed after the suite has completed.
53 type LiveTests struct { 53 type LiveTests struct {
54 Environs *environs.Environs 54 Environs *environs.Environs
55 Name string 55 Name string
56 Env environs.Environ 56 Env environs.Environ
57 » // length of time to wait before environ becomes logically consistent. 57 » // ConsistencyDelay gives the length of time to wait before
58 » // environ becomes logically consistent.
58 ConsistencyDelay time.Duration 59 ConsistencyDelay time.Duration
60
61 // CanOpenState should be true if the testing environment allows
62 // the state to be opened after bootstrapping.
63 CanOpenState bool
64 bootstrapped bool
59 } 65 }
60 66
61 func (t *LiveTests) SetUpSuite(c *C) { 67 func (t *LiveTests) SetUpSuite(c *C) {
62 e, err := t.Environs.Open(t.Name) 68 e, err := t.Environs.Open(t.Name)
63 c.Assert(err, IsNil, Commentf("opening environ %q", t.Name)) 69 c.Assert(err, IsNil, Commentf("opening environ %q", t.Name))
64 c.Assert(e, NotNil) 70 c.Assert(e, NotNil)
65 t.Env = e 71 t.Env = e
66 } 72 }
67 73
74 func (t *LiveTests) BootstrapOnce(c *C) {
75 if t.bootstrapped {
76 return
77 }
78 err := t.Env.Bootstrap()
79 c.Assert(err, IsNil)
80 t.bootstrapped = true
81 }
82
83 func (t *LiveTests) Destroy(c *C) {
84 err := t.Env.Destroy(nil)
85 c.Assert(err, IsNil)
86 t.bootstrapped = false
87 }
88
68 func (t *LiveTests) TearDownSuite(c *C) { 89 func (t *LiveTests) TearDownSuite(c *C) {
69 err := t.Env.Destroy(nil) 90 err := t.Env.Destroy(nil)
70 c.Check(err, IsNil) 91 c.Check(err, IsNil)
71 t.Env = nil 92 t.Env = nil
72 } 93 }
73 94
74 func (t *LiveTests) SetUpTest(*C) { 95 func (t *LiveTests) SetUpTest(*C) {
75 } 96 }
76 97
77 func (t *LiveTests) TearDownTest(*C) { 98 func (t *LiveTests) TearDownTest(*C) {
78 } 99 }
OLDNEW
« no previous file with comments | « environs/jujutest/livetests.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b