testlab 0.4.13 → 0.4.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/bin/tl CHANGED
@@ -248,6 +248,82 @@ command :network do |c|
248
248
  end
249
249
  end
250
250
 
251
+ # NETWORK UP
252
+ ###############
253
+ c.desc 'Up a network'
254
+ c.long_desc <<-EOF
255
+ Up a network. The network is started and brought online.
256
+ EOF
257
+ c.command :up do |up|
258
+ up.action do |global_options, options, args|
259
+ if options[:id].nil?
260
+ help_now!('id is required') if options[:id].nil?
261
+ else
262
+ network = @testlab.networks.select{ |c| c.id.to_sym == options[:id].to_sym }.first
263
+ network.nil? and raise TestLab::TestLabError, "We could not find the network you supplied!"
264
+
265
+ network.up
266
+ end
267
+ end
268
+ end
269
+
270
+ # NETWORK DOWN
271
+ #################
272
+ c.desc 'Down a network'
273
+ c.long_desc <<-EOF
274
+ Down a network. The network is stopped taking it offline.
275
+ EOF
276
+ c.command :down do |down|
277
+ down.action do |global_options, options, args|
278
+ if options[:id].nil?
279
+ help_now!('id is required') if options[:id].nil?
280
+ else
281
+ network = @testlab.networks.select{ |c| c.id.to_sym == options[:id].to_sym }.first
282
+ network.nil? and raise TestLab::TestLabError, "We could not find the network you supplied!"
283
+
284
+ network.down
285
+ end
286
+ end
287
+ end
288
+
289
+ # NETWORK SETUP
290
+ ####################
291
+ c.desc 'Setup a network'
292
+ c.long_desc <<-EOF
293
+ Setup a network. The network is created, started and provisioned.
294
+ EOF
295
+ c.command :setup do |setup|
296
+ setup.action do |global_options, options, args|
297
+ if options[:id].nil?
298
+ help_now!('id is required') if options[:id].nil?
299
+ else
300
+ network = @testlab.networks.select{ |c| c.id.to_sym == options[:id].to_sym }.first
301
+ network.nil? and raise TestLab::TestLabError, "We could not find the network you supplied!"
302
+
303
+ network.setup
304
+ end
305
+ end
306
+ end
307
+
308
+ # NETWORK TEARDOWN
309
+ ####################
310
+ c.desc 'Teardown a network'
311
+ c.long_desc <<-EOF
312
+ Teardown a network. The network is offlined and destroyed.
313
+ EOF
314
+ c.command :teardown do |teardown|
315
+ teardown.action do |global_options, options, args|
316
+ if options[:id].nil?
317
+ help_now!('id is required') if options[:id].nil?
318
+ else
319
+ network = @testlab.networks.select{ |c| c.id.to_sym == options[:id].to_sym }.first
320
+ network.nil? and raise TestLab::TestLabError, "We could not find the network you supplied!"
321
+
322
+ network.teardown
323
+ end
324
+ end
325
+ end
326
+
251
327
  end
252
328
 
253
329
  # CONTAINERS
@@ -56,7 +56,7 @@ class TestLab
56
56
  def teardown
57
57
  @ui.logger.debug { "Node Teardown: #{self.id} " }
58
58
 
59
- call_collections([self.containers, self.networks], :teardown)
59
+ call_collections([self.containers.reverse, self.networks.reverse], :teardown)
60
60
 
61
61
  please_wait(:ui => @ui, :message => format_object_action(self, 'Teardown', :red)) do
62
62
  # NOOP
@@ -2,7 +2,7 @@ set -x
2
2
 
3
3
  # Update APT and ensure our required packages are installed
4
4
  apt-get -y update
5
- apt-get -y install lxc bridge-utils debootstrap yum iptables ntpdate ntp sshpass
5
+ apt-get -y install lxc bridge-utils debootstrap yum iptables ntpdate ntp
6
6
 
7
7
  # Ensure the default lxc networking services are off
8
8
  service lxc-net stop
@@ -1,6 +1,6 @@
1
1
  class TestLab
2
2
  unless const_defined?(:VERSION)
3
3
  # TestLab Gem Version
4
- VERSION = "0.4.13"
4
+ VERSION = "0.4.14"
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: testlab
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.13
4
+ version: 0.4.14
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-05-23 00:00:00.000000000 Z
12
+ date: 2013-06-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: gli
@@ -282,7 +282,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
282
282
  version: '0'
283
283
  segments:
284
284
  - 0
285
- hash: 2578879590303059436
285
+ hash: 3957733017410581282
286
286
  required_rubygems_version: !ruby/object:Gem::Requirement
287
287
  none: false
288
288
  requirements:
@@ -291,7 +291,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
291
291
  version: '0'
292
292
  segments:
293
293
  - 0
294
- hash: 2578879590303059436
294
+ hash: 3957733017410581282
295
295
  requirements: []
296
296
  rubyforge_project:
297
297
  rubygems_version: 1.8.25