phut 0.6.1 → 0.6.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d3154248cc5c06ba4b45575fa25f1199e8305430
4
- data.tar.gz: b6f4eb3d52c9ec624c539a6fcbd4026879c2e70b
3
+ metadata.gz: cc1003ee6a5a95a02df6ec9e078d0a0af4d28695
4
+ data.tar.gz: 6edafd0300df63624d9bb2a55c2a4a8bc7f6e613
5
5
  SHA512:
6
- metadata.gz: 33c9b7c2b74092e5e75b6893dd73d4f3552281b7ca6c84088c2560a492d8e5a8c96bf63ad9f3db54e31aa7c23588304c96030e82e622e77418830296fee9f6f2
7
- data.tar.gz: b65ad6847e693199626e071f70f8db09cacf2755f073af6f9f72b75080fc99c0c8e6aac97d96eea7a7ce08e8c18b6c879f8385e220e53e1d8b6e9e446635bf46
6
+ metadata.gz: 3f1005ad8db1a26a5879d5c5e3e1e9d1cebf58bdf9ccf5a3fbd6ea4380719ebbf17878d62db89a0a7add60c4b2c019fc66d95a3a06d3cfdb6157635afde89222
7
+ data.tar.gz: 37a6403bf6e10848fe58bb779156bdcb5c8ffc27290e2ea94bf037de78b94e1d9b3acc7870eebbd3e5d10a1fc924bd0e60e02ebca26674451fc07795dfda6322
data/CHANGELOG.md CHANGED
@@ -3,6 +3,11 @@
3
3
  ## develop (unreleased)
4
4
 
5
5
 
6
+ ## 0.6.2 (6/3/2015)
7
+ ### Bugs fixed
8
+ * Delete a vhost.*.ctl socket file after the vhost process is killed.
9
+
10
+
6
11
  ## 0.6.1 (6/1/2015)
7
12
  ### Bugs fixed
8
13
  * Use the default port number (6653) if `port` attribute is not set.
data/bin/phut CHANGED
@@ -101,9 +101,19 @@ module Phut
101
101
  end
102
102
  end
103
103
 
104
+ desc 'Kills a vswitch or a vhost'
105
+ arg_name 'NAME'
104
106
  command :kill do |c|
105
- c.action do |_global_options, _options, args|
106
- args.each { |each| Phut::OpenVswitch.new(each).shutdown }
107
+ c.desc 'Location to find socket files'
108
+ c.flag [:s, :socket_dir], default_value: Phut.socket_dir
109
+
110
+ c.action do |_global_options, options, args|
111
+ help_now! if args.size != 1
112
+ begin
113
+ Phut::VhostDaemon.process(args[0], options[:socket_dir]).stop
114
+ rescue
115
+ Phut::OpenVswitch.new(args[0]).shutdown
116
+ end
107
117
  end
108
118
  end
109
119
 
@@ -0,0 +1,27 @@
1
+ Feature: phut kill command
2
+ Background:
3
+ Given a file named "network.conf" with:
4
+ """
5
+ vswitch { datapath_id 0xabc }
6
+
7
+ vhost('host1') { ip '192.168.0.1' }
8
+ vhost('host2') { ip '192.168.0.2' }
9
+
10
+ link '0xabc', 'host1'
11
+ link '0xabc', 'host2'
12
+ """
13
+ And I do phut run "network.conf"
14
+
15
+ @sudo
16
+ Scenario: phut kill vswitch_name
17
+ When I do phut kill "0xabc"
18
+ And I run `sudo ovs-vsctl list-br`
19
+ Then the output from "sudo ovs-vsctl list-br" should not contain "br0xabc"
20
+
21
+ @sudo
22
+ Scenario: phut kill vhost_name
23
+ When I do phut kill "host1"
24
+ And I successfully run `sleep 5`
25
+ Then the following files should not exist:
26
+ | vhost.host1.pid |
27
+ | vhost.host1.ctl |
@@ -6,6 +6,11 @@ When(/^I do phut run "(.*?)"$/) do |file_name|
6
6
  step %(I run `phut -v run #{run_opts} #{@config_file}`)
7
7
  end
8
8
 
9
+ When(/^I do phut kill "(.*?)"$/) do |name|
10
+ run_opts = "-s #{@socket_dir}"
11
+ step %(I successfully run `phut -v kill #{run_opts} #{name}`)
12
+ end
13
+
9
14
  Then(/^a vswitch named "(.*?)" should be running$/) do |name|
10
15
  expect(system("sudo ovs-vsctl br-exists br#{name}")).to be_truthy
11
16
  end
data/lib/phut/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  # Base module.
2
2
  module Phut
3
- VERSION = '0.6.1'
3
+ VERSION = '0.6.2'
4
4
  end
@@ -113,6 +113,7 @@ module Phut
113
113
  @logger.error $ERROR_INFO if $ERROR_INFO
114
114
  @logger.info 'Shutting down...'
115
115
  FileUtils.rm pid_file if running?
116
+ DRb.stop_service
116
117
  fail $ERROR_INFO if $ERROR_INFO
117
118
  end
118
119
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phut
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yasuhito Takamiya
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-01 00:00:00.000000000 Z
11
+ date: 2015-06-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gli
@@ -348,6 +348,7 @@ files:
348
348
  - features/dsl_vhost.feature
349
349
  - features/dsl_vswitch.feature
350
350
  - features/phut.feature
351
+ - features/phut_kill.feature
351
352
  - features/shell.feature
352
353
  - features/step_definitions/phut_steps.rb
353
354
  - features/support/env.rb