torpedo 1.0.10 → 1.0.11

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,9 @@
1
+ * Wed Dec 14 2011 Dan Prince <dan.prince@rackspace.com> - 1.0.11
2
+ -Set paranoid to false for ssh connection tests. (net-ssh)
3
+ -Add options to disable server and image cleanup.
4
+ -Remove sort on image id (we now use UUID's)
5
+ -Add setup test to initialize image and flavor refs.
6
+
1
7
  * Wed Dec 7 2011 Dan Prince <dan.prince@rackspace.com> - 1.0.10
2
8
  -Add admin password and change password tests.
3
9
  -Add revert resize test.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.10
1
+ 1.0.11
@@ -39,7 +39,8 @@ module Helper
39
39
  end
40
40
  elsif image_ref.nil? or image_ref.empty? then
41
41
  #take the last image if IMAGE_REF and or IMAGE_NAME aren't set
42
- images = conn.images.sort{|x,y| x[:id] <=> y[:id]}
42
+ images = conn.images
43
+ raise "Image list is empty." if images.empty?
43
44
  image_ref = images.last[:id].to_s
44
45
  end
45
46
 
@@ -8,9 +8,9 @@ class Servers < Test::Unit::TestCase
8
8
 
9
9
  @@servers = []
10
10
  @@images = []
11
- @@image_ref = Helper::get_image_ref(Helper::get_connection)
12
- @@flavor_ref = Helper::get_flavor_ref(Helper::get_connection)
13
- @@flavor_ref_resize = Helper::get_flavor_ref_resize(@conn)
11
+ @@image_ref = nil
12
+ @@flavor_ref = nil
13
+ @@flavor_ref_resize = nil
14
14
  @@server = nil #ref to last created server
15
15
  @@hostname = "torpedo"
16
16
 
@@ -48,7 +48,7 @@ class Servers < Test::Unit::TestCase
48
48
 
49
49
  def ssh_test(ip_addr, test_cmd="hostname", test_output=@@hostname, admin_pass=@@admin_pass)
50
50
 
51
- ssh_opts = {}
51
+ ssh_opts = {:paranoid => false}
52
52
  if TEST_ADMIN_PASSWORD then
53
53
  ssh_opts.store(:password, admin_pass)
54
54
  else
@@ -135,6 +135,24 @@ class Servers < Test::Unit::TestCase
135
135
 
136
136
  end
137
137
 
138
+ def test_000_setup
139
+ begin
140
+ @@image_ref = Helper::get_image_ref(Helper::get_connection)
141
+ rescue Exception => e
142
+ fail("Failed get image ref: #{e.message}")
143
+ end
144
+ begin
145
+ @@flavor_ref = Helper::get_flavor_ref(Helper::get_connection)
146
+ rescue Exception => e
147
+ fail("Failed get flavor ref: #{e.message}")
148
+ end
149
+ begin
150
+ @@flavor_ref_resize = Helper::get_flavor_ref_resize(@conn)
151
+ rescue Exception => e
152
+ fail("Failed get flavor ref resize: #{e.message}")
153
+ end
154
+ end
155
+
138
156
  def test_001_create_server
139
157
 
140
158
  metadata={ "key1" => "value1", "key2" => "value2" }
@@ -448,11 +466,15 @@ class Servers < Test::Unit::TestCase
448
466
  end if TEST_CREATE_IMAGE
449
467
 
450
468
  def test_999_teardown
451
- @@servers.each do |server|
452
- assert_equal(true, server.delete!)
469
+ if CLEAN_UP_SERVERS
470
+ @@servers.each do |server|
471
+ assert_equal(true, server.delete!)
472
+ end
453
473
  end
454
- @@images.each do |image|
455
- assert_equal(true, image.delete!)
474
+ if CLEAN_UP_IMAGES
475
+ @@images.each do |image|
476
+ assert_equal(true, image.delete!)
477
+ end
456
478
  end
457
479
  end
458
480
 
data/lib/torpedo.rb CHANGED
@@ -4,9 +4,9 @@ require 'torpedo/config'
4
4
  configs = Torpedo::Config.load_configs
5
5
 
6
6
  SSH_TIMEOUT=(configs['ssh_timeout'] || 30).to_i
7
- TEST_SSH=configs['test_ssh'] || true
7
+ TEST_SSH=configs.fetch('test_ssh', true)
8
8
  PING_TIMEOUT=(configs['ping_timeout'] || 60).to_i
9
- TEST_PING=configs['test_ping'] || true
9
+ TEST_PING=configs.fetch('test_ping', true)
10
10
  SERVER_BUILD_TIMEOUT=(configs['server_build_timeout'] || 60).to_i
11
11
  SSH_PRIVATE_KEY=configs['ssh_private_key'] || ENV['HOME'] + "/.ssh/id_rsa"
12
12
  SSH_PUBLIC_KEY=configs['ssh_public_key'] || ENV['HOME'] + "/.ssh/id_rsa.pub"
@@ -18,6 +18,8 @@ TEST_RESIZE_SERVER=configs['test_resize_server'] || false
18
18
  TEST_REVERT_RESIZE_SERVER=configs['test_revert_resize_server'] || false
19
19
  TEST_ADMIN_PASSWORD=configs['test_admin_password'] || false
20
20
  TEST_HOSTID_ON_RESIZE=configs['test_hostid_on_resize'] || false
21
+ CLEAN_UP_SERVERS=configs.fetch('clean_up_servers', true)
22
+ CLEAN_UP_IMAGES=configs.fetch('clean_up_images', true)
21
23
  KEYPAIR=configs['keypair']
22
24
  KEYNAME=configs['keyname']
23
25
 
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: 3
4
+ hash: 1
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 10
10
- version: 1.0.10
9
+ - 11
10
+ version: 1.0.11
11
11
  platform: ruby
12
12
  authors:
13
13
  - Dan Prince
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-12-07 00:00:00 -05:00
18
+ date: 2011-12-14 00:00:00 -05:00
19
19
  default_executable: torpedo
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency