phut 0.6.1 → 0.6.2
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/bin/phut +12 -2
- data/features/phut_kill.feature +27 -0
- data/features/step_definitions/phut_steps.rb +5 -0
- data/lib/phut/version.rb +1 -1
- data/lib/phut/vhost_daemon.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cc1003ee6a5a95a02df6ec9e078d0a0af4d28695
|
4
|
+
data.tar.gz: 6edafd0300df63624d9bb2a55c2a4a8bc7f6e613
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3f1005ad8db1a26a5879d5c5e3e1e9d1cebf58bdf9ccf5a3fbd6ea4380719ebbf17878d62db89a0a7add60c4b2c019fc66d95a3a06d3cfdb6157635afde89222
|
7
|
+
data.tar.gz: 37a6403bf6e10848fe58bb779156bdcb5c8ffc27290e2ea94bf037de78b94e1d9b3acc7870eebbd3e5d10a1fc924bd0e60e02ebca26674451fc07795dfda6322
|
data/CHANGELOG.md
CHANGED
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.
|
106
|
-
|
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
data/lib/phut/vhost_daemon.rb
CHANGED
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.
|
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-
|
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
|