torpedo 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +4 -0
- data/README.md +36 -6
- data/VERSION +1 -1
- data/bin/torpedo +1 -1
- data/lib/torpedo/compute/servers.rb +53 -49
- data/torpedo.gemspec +1 -1
- metadata +3 -3
data/CHANGELOG
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
* Sat Oct 29 2011 Dan Prince <dan.prince@rackspace.com> - 1.0.4
|
2
|
+
-Run image metadata tests last because they make the snapshot un-bootable.
|
3
|
+
-Fixes to the resize tests.
|
4
|
+
|
1
5
|
* Sat Oct 29 2011 Dan Prince <dan.prince@rackspace.com> - 1.0.3
|
2
6
|
- Fix issues boolean config file issue with test_create_image,
|
3
7
|
test_rebuild_server, and test_resize_server config options.
|
data/README.md
CHANGED
@@ -9,16 +9,20 @@ Fire when ready. Fast Ruby integration tests for OpenStack.
|
|
9
9
|
Installation
|
10
10
|
------------
|
11
11
|
|
12
|
+
1. Install the Gem.
|
13
|
+
2. Create the torpedo.conf file in your HOME directory.
|
14
|
+
3. Source novarc for your OpenStack Compute account.
|
15
|
+
|
16
|
+
```bash
|
12
17
|
gem install torpedo
|
13
18
|
|
14
|
-
#create the torpedo YAML config in your $HOME dir:
|
15
19
|
cat > ~/.torpedo.conf <<"EOF_CAT"
|
16
20
|
# YAML config file for torpedo
|
17
21
|
|
18
22
|
# timeouts
|
19
|
-
server_build_timeout:
|
23
|
+
server_build_timeout: 420
|
20
24
|
ping_timeout: 60
|
21
|
-
ssh_timeout:
|
25
|
+
ssh_timeout: 60
|
22
26
|
|
23
27
|
# SERVER test settings
|
24
28
|
test_create_image: false
|
@@ -26,7 +30,7 @@ Installation
|
|
26
30
|
test_resize_server: false
|
27
31
|
|
28
32
|
# IMAGES (Set one of the following)
|
29
|
-
|
33
|
+
image_name: Ubuntu Natty (11.04)
|
30
34
|
#image_ref:
|
31
35
|
|
32
36
|
# FLAVORS (Set one of the following)
|
@@ -38,10 +42,12 @@ Installation
|
|
38
42
|
#ssh_public_key:
|
39
43
|
|
40
44
|
# KEYPAIRS (used to verify AMI style images)
|
41
|
-
keypair: test.pem
|
42
|
-
keyname: test
|
45
|
+
#keypair: test.pem
|
46
|
+
#keyname: test
|
43
47
|
EOF_CAT
|
44
48
|
|
49
|
+
source novarc
|
50
|
+
```
|
45
51
|
|
46
52
|
Examples
|
47
53
|
--------
|
@@ -69,6 +75,30 @@ Run all tests and output an Xunit style XML report:
|
|
69
75
|
|
70
76
|
torpedo fire --xml-report=FILE
|
71
77
|
|
78
|
+
Payload
|
79
|
+
--------
|
80
|
+
|
81
|
+
* list flavors
|
82
|
+
* get flavor
|
83
|
+
* list images
|
84
|
+
* get image
|
85
|
+
* list limits
|
86
|
+
* create server (ping and ssh test)
|
87
|
+
* delete server metadata items
|
88
|
+
* update one server metadata item
|
89
|
+
* update multiple server metadata items
|
90
|
+
* set server metadata items
|
91
|
+
* clear server metadata
|
92
|
+
* create image
|
93
|
+
* rebuild server (ping and ssh test)
|
94
|
+
* resize server (ping and ssh test)
|
95
|
+
* resize confirm (ping and ssh test)
|
96
|
+
* delete image metadata
|
97
|
+
* update one image metadata item
|
98
|
+
* update multiple image metadata items
|
99
|
+
* set image metadata items
|
100
|
+
* clear image metadata
|
101
|
+
|
72
102
|
License
|
73
103
|
-------
|
74
104
|
Copyright (c) 2011 Dan Prince. See LICENSE.txt for further details.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.4
|
data/bin/torpedo
CHANGED
@@ -9,6 +9,7 @@ class Servers < Test::Unit::TestCase
|
|
9
9
|
@@images = []
|
10
10
|
@@image_ref = Helper::get_image_ref(Helper::get_connection)
|
11
11
|
@@flavor_ref = Helper::get_flavor_ref(Helper::get_connection)
|
12
|
+
@@flavor_ref_resize = Helper::get_flavor_ref_resize(@conn)
|
12
13
|
@@server = nil #ref to last created server
|
13
14
|
|
14
15
|
def setup
|
@@ -82,7 +83,7 @@ class Servers < Test::Unit::TestCase
|
|
82
83
|
timeout(SERVER_BUILD_TIMEOUT) do
|
83
84
|
until server.status == check_status do
|
84
85
|
if server.status == "ERROR" then
|
85
|
-
fail('Server ERROR state detected when booting
|
86
|
+
fail('Server ERROR state detected when booting server!')
|
86
87
|
end
|
87
88
|
server = @conn.server(server.id)
|
88
89
|
sleep 1
|
@@ -116,7 +117,7 @@ class Servers < Test::Unit::TestCase
|
|
116
117
|
server = create_server(options)
|
117
118
|
assert_not_nil(@@server.adminPass)
|
118
119
|
|
119
|
-
#boot
|
120
|
+
#boot a server and check it
|
120
121
|
check_server(server, @@image_ref, @@flavor_ref)
|
121
122
|
|
122
123
|
assert_equal "value1", @@server.metadata['key1']
|
@@ -226,7 +227,52 @@ class Servers < Test::Unit::TestCase
|
|
226
227
|
|
227
228
|
end if TEST_CREATE_IMAGE
|
228
229
|
|
229
|
-
|
230
|
+
|
231
|
+
def test_030_rebuild
|
232
|
+
# make sure our snapshot boots
|
233
|
+
personalities={SSH_PUBLIC_KEY => "/root/.ssh/authorized_keys"}
|
234
|
+
@@server.rebuild!(:imageRef => @@image_ref, :personality => personalities)
|
235
|
+
server = @conn.server(@@server.id)
|
236
|
+
sleep 15 # sleep a couple seconds until rebuild starts
|
237
|
+
check_server(server, @@image_ref, @@flavor_ref)
|
238
|
+
|
239
|
+
end if TEST_REBUILD_SERVER
|
240
|
+
|
241
|
+
def test_040_resize
|
242
|
+
|
243
|
+
@@server.resize!(@@flavor_ref_resize)
|
244
|
+
server = @conn.server(@@server.id)
|
245
|
+
assert_equal('RESIZE', server.status)
|
246
|
+
|
247
|
+
begin
|
248
|
+
timeout(SERVER_BUILD_TIMEOUT) do
|
249
|
+
until server.status == 'VERIFY_RESIZE' do
|
250
|
+
if server.status == "ERROR" then
|
251
|
+
fail('Server ERROR state detected when resizing server!')
|
252
|
+
end
|
253
|
+
server = @conn.server(server.id)
|
254
|
+
sleep 1
|
255
|
+
end
|
256
|
+
end
|
257
|
+
rescue Timeout::Error => te
|
258
|
+
fail('Timeout resizing server.')
|
259
|
+
end
|
260
|
+
|
261
|
+
check_server(server, @@image_ref, @@flavor_ref_resize, 'VERIFY_RESIZE')
|
262
|
+
|
263
|
+
end if TEST_RESIZE_SERVER
|
264
|
+
|
265
|
+
def test_041_resize_confirm
|
266
|
+
|
267
|
+
@@server.confirm_resize!
|
268
|
+
server = @conn.server(@@server.id)
|
269
|
+
assert_equal('ACTIVE', server.status)
|
270
|
+
|
271
|
+
check_server(server, @@image_ref, @@flavor_ref_resize)
|
272
|
+
|
273
|
+
end if TEST_RESIZE_SERVER
|
274
|
+
|
275
|
+
def test_051_delete_image_metadata_items
|
230
276
|
|
231
277
|
metadata = @conn.image(@@image_ref).metadata
|
232
278
|
metadata.each_pair do |key, value|
|
@@ -239,7 +285,7 @@ class Servers < Test::Unit::TestCase
|
|
239
285
|
|
240
286
|
end if TEST_CREATE_IMAGE
|
241
287
|
|
242
|
-
def
|
288
|
+
def test_052_update_one_image_metadata_item
|
243
289
|
|
244
290
|
metadata = @conn.image(@@image_ref).metadata
|
245
291
|
metadata['foo1'] = 'bar1'
|
@@ -253,7 +299,7 @@ class Servers < Test::Unit::TestCase
|
|
253
299
|
|
254
300
|
end if TEST_CREATE_IMAGE
|
255
301
|
|
256
|
-
def
|
302
|
+
def test_053_update_some_image_metadata_items
|
257
303
|
|
258
304
|
metadata = @conn.image(@@image_ref).metadata
|
259
305
|
metadata['foo1'] = 'bar1'
|
@@ -269,7 +315,7 @@ class Servers < Test::Unit::TestCase
|
|
269
315
|
|
270
316
|
end if TEST_CREATE_IMAGE
|
271
317
|
|
272
|
-
def
|
318
|
+
def test_054_set_image_metadata_items
|
273
319
|
|
274
320
|
metadata = @conn.image(@@image_ref).metadata
|
275
321
|
metadata['foo1'] = 'that'
|
@@ -287,7 +333,7 @@ class Servers < Test::Unit::TestCase
|
|
287
333
|
|
288
334
|
end if TEST_CREATE_IMAGE
|
289
335
|
|
290
|
-
def
|
336
|
+
def test_055_clear_image_metadata
|
291
337
|
|
292
338
|
metadata = @conn.image(@@image_ref).metadata
|
293
339
|
assert metadata.clear!
|
@@ -297,48 +343,6 @@ class Servers < Test::Unit::TestCase
|
|
297
343
|
assert_equal 0, metadata.size
|
298
344
|
|
299
345
|
end if TEST_CREATE_IMAGE
|
300
|
-
|
301
|
-
def test_030_rebuild_instance
|
302
|
-
# make sure our snapshot boots
|
303
|
-
personalities={SSH_PUBLIC_KEY => "/root/.ssh/authorized_keys"}
|
304
|
-
@@server.rebuild!(:imageRef => @@image_ref, :personality => personalities)
|
305
|
-
server = @conn.server(@@server.id)
|
306
|
-
sleep 15 # sleep a couple seconds until rebuild starts
|
307
|
-
check_server(server, @@image_ref, @@flavor_ref)
|
308
|
-
|
309
|
-
end if TEST_REBUILD_SERVER
|
310
|
-
|
311
|
-
def test_040_resize_instance
|
312
|
-
|
313
|
-
flavor_ref_resize = Helper::get_flavor_ref_resize(@conn)
|
314
|
-
|
315
|
-
@@server.resize!(flavor_ref_resize)
|
316
|
-
server = @conn.server(@@server.id)
|
317
|
-
assert_equal('RESIZE', @@server.status)
|
318
|
-
|
319
|
-
begin
|
320
|
-
timeout(SERVER_BUILD_TIMEOUT) do
|
321
|
-
until server.status == 'VERIFY_RESIZE' do
|
322
|
-
if server.status == "ERROR" then
|
323
|
-
fail('Server ERROR state detected when resizing instance!')
|
324
|
-
end
|
325
|
-
server = @conn.server(@@server.id)
|
326
|
-
sleep 1
|
327
|
-
end
|
328
|
-
end
|
329
|
-
rescue Timeout::Error => te
|
330
|
-
fail('Timeout resizing server.')
|
331
|
-
end
|
332
|
-
|
333
|
-
check_server(server, @@image_ref, flavor_ref_resize, 'VERIFY_RESIZE')
|
334
|
-
|
335
|
-
server.confirm_resize!
|
336
|
-
server = @conn.server(@@server.id)
|
337
|
-
assert_equal('ACTIVE', @@server.status)
|
338
|
-
|
339
|
-
check_server(server, @@image_ref, flavor_ref_resize)
|
340
|
-
|
341
|
-
end if TEST_RESIZE_SERVER
|
342
346
|
|
343
347
|
def test_999_teardown
|
344
348
|
@@servers.each do |server|
|
data/torpedo.gemspec
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: torpedo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 31
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 4
|
10
|
+
version: 1.0.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Dan Prince
|