landrush 0.19.0 → 1.0.0
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/.config/cucumber.yml +7 -0
- data/.gitignore +6 -4
- data/.rubocop.yml +5 -0
- data/.rubocop_todo.yml +32 -259
- data/CHANGELOG.md +8 -1
- data/CONTRIBUTING.md +11 -10
- data/Gemfile +7 -4
- data/Gemfile.lock +178 -0
- data/README.md +148 -35
- data/Rakefile +18 -0
- data/doc/img/advanced-tcp-properties.png +0 -0
- data/doc/img/network-connections.png +0 -0
- data/features/dns_resolution.feature +26 -0
- data/features/step_definitions/dns.rb +19 -0
- data/features/support/env.rb +16 -0
- data/landrush.gemspec +1 -2
- data/lib/landrush.rb +0 -12
- data/lib/landrush/action/common.rb +5 -5
- data/lib/landrush/action/redirect_dns.rb +1 -1
- data/lib/landrush/action/setup.rb +9 -14
- data/lib/landrush/action/teardown.rb +5 -1
- data/lib/landrush/cap/debian/install_iptables.rb +2 -2
- data/lib/landrush/cap/linux/add_iptables_rule.rb +0 -1
- data/lib/landrush/cap/linux/redirect_dns.rb +0 -1
- data/lib/landrush/cap/redhat/install_iptables.rb +2 -2
- data/lib/landrush/command.rb +8 -10
- data/lib/landrush/config.rb +1 -1
- data/lib/landrush/dependent_vms.rb +2 -2
- data/lib/landrush/os.rb +19 -0
- data/lib/landrush/plugin.rb +4 -4
- data/lib/landrush/resolver_config.rb +1 -5
- data/lib/landrush/server.rb +187 -25
- data/lib/landrush/store.rb +12 -4
- data/lib/landrush/version.rb +1 -1
- data/test/landrush/action/setup_test.rb +14 -9
- data/test/landrush/action/teardown_test.rb +8 -9
- data/test/landrush/cap/linux/configured_dns_servers_test.rb +2 -2
- data/test/landrush/cap/linux/read_host_visible_ip_address_test.rb +5 -7
- data/test/landrush/cap/linux/redirect_dns_test.rb +1 -1
- data/test/landrush/resolver_config_test.rb +0 -2
- data/test/landrush/server_test.rb +18 -12
- data/test/landrush/store_test.rb +7 -6
- data/test/support/clear_dependent_vms.rb +4 -2
- data/test/support/create_fake_working_dir.rb +19 -0
- data/test/support/delete_fake_working_dir.rb +12 -0
- data/test/support/fake_resolver_config.rb +8 -3
- data/test/support/test_server_daemon.rb +20 -15
- data/test/test_helper.rb +31 -22
- metadata +26 -28
- data/lib/ext/rexec.rb +0 -10
- data/test/support/fake_working_dir.rb +0 -16
data/test/test_helper.rb
CHANGED
@@ -12,7 +12,9 @@ require 'minitest/autorun'
|
|
12
12
|
require 'mocha/mini_test'
|
13
13
|
|
14
14
|
def fake_environment(options = { enabled: true })
|
15
|
-
|
15
|
+
# For the home_path we want the base Vagrant directory
|
16
|
+
vagrant_test_home = Pathname(Landrush::Server.working_dir).parent.parent
|
17
|
+
{ machine: fake_machine(options), ui: FakeUI, home_path: vagrant_test_home }
|
16
18
|
end
|
17
19
|
|
18
20
|
class RecordingCommunicator
|
@@ -33,10 +35,10 @@ class RecordingCommunicator
|
|
33
35
|
responses[command]
|
34
36
|
end
|
35
37
|
|
36
|
-
def execute(command
|
38
|
+
def execute(command)
|
37
39
|
commands[:execute] << command
|
38
40
|
responses[command].split("\n").each do |line|
|
39
|
-
|
41
|
+
yield(:stdout, "#{line}\n")
|
40
42
|
end
|
41
43
|
end
|
42
44
|
|
@@ -50,28 +52,32 @@ class RecordingCommunicator
|
|
50
52
|
end
|
51
53
|
end
|
52
54
|
|
53
|
-
|
54
|
-
|
55
|
-
|
55
|
+
module Landrush
|
56
|
+
class FakeProvider
|
57
|
+
def initialize(*args)
|
58
|
+
end
|
56
59
|
|
57
|
-
|
58
|
-
|
60
|
+
def _initialize(*args)
|
61
|
+
end
|
59
62
|
|
60
|
-
|
61
|
-
|
63
|
+
def ssh_info
|
64
|
+
end
|
62
65
|
|
63
|
-
|
64
|
-
|
66
|
+
def state
|
67
|
+
@state ||= Vagrant::MachineState.new('fake-state', 'fake-state', 'fake-state')
|
68
|
+
end
|
65
69
|
end
|
66
70
|
end
|
67
71
|
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
+
module Landrush
|
73
|
+
class FakeConfig
|
74
|
+
def landrush
|
75
|
+
@landrush_config ||= Landrush::Config.new
|
76
|
+
end
|
72
77
|
|
73
|
-
|
74
|
-
|
78
|
+
def vm
|
79
|
+
VagrantPlugins::Kernel_V2::VMConfig.new
|
80
|
+
end
|
75
81
|
end
|
76
82
|
end
|
77
83
|
|
@@ -107,16 +113,19 @@ def fake_static_entry(env, hostname, ip)
|
|
107
113
|
Landrush::Store.hosts.set(hostname, ip)
|
108
114
|
end
|
109
115
|
|
110
|
-
|
111
|
-
|
116
|
+
module MiniTest
|
117
|
+
class Spec
|
118
|
+
alias_method :hush, :capture_io
|
119
|
+
end
|
112
120
|
end
|
113
121
|
|
114
122
|
# order is important on these
|
123
|
+
require 'support/create_fake_working_dir'
|
124
|
+
|
115
125
|
require 'support/clear_dependent_vms'
|
116
126
|
|
117
127
|
require 'support/fake_ui'
|
118
128
|
require 'support/test_server_daemon'
|
119
129
|
require 'support/fake_resolver_config'
|
120
130
|
|
121
|
-
|
122
|
-
require 'support/fake_working_dir'
|
131
|
+
require 'support/delete_fake_working_dir'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: landrush
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paul Hinze
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-05-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubydns
|
@@ -16,28 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 0.8.5
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: rexec
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
26
|
+
version: 0.8.5
|
41
27
|
description: |
|
42
28
|
Forget about IPs in Vagrant - Automated DNS for your VMs
|
43
29
|
|
@@ -54,17 +40,21 @@ executables: []
|
|
54
40
|
extensions: []
|
55
41
|
extra_rdoc_files: []
|
56
42
|
files:
|
57
|
-
-
|
58
|
-
-
|
59
|
-
-
|
60
|
-
-
|
43
|
+
- .config/cucumber.yml
|
44
|
+
- .gitignore
|
45
|
+
- .rubocop.yml
|
46
|
+
- .rubocop_todo.yml
|
47
|
+
- .travis.yml
|
61
48
|
- CHANGELOG.md
|
62
49
|
- CONTRIBUTING.md
|
63
50
|
- Gemfile
|
51
|
+
- Gemfile.lock
|
64
52
|
- LICENSE.txt
|
65
53
|
- NOTES.md
|
66
54
|
- README.md
|
67
55
|
- Rakefile
|
56
|
+
- doc/img/advanced-tcp-properties.png
|
57
|
+
- doc/img/network-connections.png
|
68
58
|
- doc/img/osx.png
|
69
59
|
- doc/img/ubuntu.png
|
70
60
|
- doc/img/vbox.png
|
@@ -73,9 +63,11 @@ files:
|
|
73
63
|
- doc/vagrant_dns_without_landrush.diag
|
74
64
|
- doc/vagrant_dns_without_landrush.svg
|
75
65
|
- examples/Vagrantfile
|
66
|
+
- features/dns_resolution.feature
|
67
|
+
- features/step_definitions/dns.rb
|
68
|
+
- features/support/env.rb
|
76
69
|
- issues/vbox/Vagrantfile
|
77
70
|
- landrush.gemspec
|
78
|
-
- lib/ext/rexec.rb
|
79
71
|
- lib/landrush.rb
|
80
72
|
- lib/landrush/action/common.rb
|
81
73
|
- lib/landrush/action/install_prerequisites.rb
|
@@ -93,6 +85,7 @@ files:
|
|
93
85
|
- lib/landrush/command.rb
|
94
86
|
- lib/landrush/config.rb
|
95
87
|
- lib/landrush/dependent_vms.rb
|
88
|
+
- lib/landrush/os.rb
|
96
89
|
- lib/landrush/plugin.rb
|
97
90
|
- lib/landrush/resolver_config.rb
|
98
91
|
- lib/landrush/server.rb
|
@@ -109,9 +102,10 @@ files:
|
|
109
102
|
- test/landrush/server_test.rb
|
110
103
|
- test/landrush/store_test.rb
|
111
104
|
- test/support/clear_dependent_vms.rb
|
105
|
+
- test/support/create_fake_working_dir.rb
|
106
|
+
- test/support/delete_fake_working_dir.rb
|
112
107
|
- test/support/fake_resolver_config.rb
|
113
108
|
- test/support/fake_ui.rb
|
114
|
-
- test/support/fake_working_dir.rb
|
115
109
|
- test/support/test_server_daemon.rb
|
116
110
|
- test/test_helper.rb
|
117
111
|
homepage: https://github.com/phinze/landrush
|
@@ -124,21 +118,24 @@ require_paths:
|
|
124
118
|
- lib
|
125
119
|
required_ruby_version: !ruby/object:Gem::Requirement
|
126
120
|
requirements:
|
127
|
-
- -
|
121
|
+
- - '>='
|
128
122
|
- !ruby/object:Gem::Version
|
129
123
|
version: '0'
|
130
124
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
131
125
|
requirements:
|
132
|
-
- -
|
126
|
+
- - '>='
|
133
127
|
- !ruby/object:Gem::Version
|
134
128
|
version: '0'
|
135
129
|
requirements: []
|
136
130
|
rubyforge_project:
|
137
|
-
rubygems_version: 2.
|
131
|
+
rubygems_version: 2.4.6
|
138
132
|
signing_key:
|
139
133
|
specification_version: 4
|
140
134
|
summary: a vagrant plugin providing consistent DNS visible on host and guests
|
141
135
|
test_files:
|
136
|
+
- features/dns_resolution.feature
|
137
|
+
- features/step_definitions/dns.rb
|
138
|
+
- features/support/env.rb
|
142
139
|
- test/landrush/action/setup_test.rb
|
143
140
|
- test/landrush/action/teardown_test.rb
|
144
141
|
- test/landrush/cap/linux/configured_dns_servers_test.rb
|
@@ -150,8 +147,9 @@ test_files:
|
|
150
147
|
- test/landrush/server_test.rb
|
151
148
|
- test/landrush/store_test.rb
|
152
149
|
- test/support/clear_dependent_vms.rb
|
150
|
+
- test/support/create_fake_working_dir.rb
|
151
|
+
- test/support/delete_fake_working_dir.rb
|
153
152
|
- test/support/fake_resolver_config.rb
|
154
153
|
- test/support/fake_ui.rb
|
155
|
-
- test/support/fake_working_dir.rb
|
156
154
|
- test/support/test_server_daemon.rb
|
157
155
|
- test/test_helper.rb
|
data/lib/ext/rexec.rb
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
module FakeWorkingDirHooks
|
2
|
-
def setup
|
3
|
-
super
|
4
|
-
Landrush.working_dir = '/tmp/vagrant_landrush_test_working_dir'
|
5
|
-
end
|
6
|
-
|
7
|
-
def teardown
|
8
|
-
super
|
9
|
-
Landrush.working_dir.rmtree if Landrush.working_dir.directory?
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
class MiniTest::Spec
|
14
|
-
include FakeWorkingDirHooks
|
15
|
-
end
|
16
|
-
|