Skip to content

Commit

Permalink
Issue vagrant-landrush#171 Adding test harness. Experimenting with VB…
Browse files Browse the repository at this point in the history
…oxManage
  • Loading branch information
Hardy Ferentschik authored and hferentschik committed Jun 27, 2016
1 parent 5007fef commit 5e18ae7
Show file tree
Hide file tree
Showing 10 changed files with 241 additions and 276 deletions.
16 changes: 8 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
# Bundler
Gemfile.lock
.bundle

# Ruby / RVM
.ruby-gemset
.ruby-version
*.rbc
.bundle

# Rake / Build
.yardoc
InstalledFiles
_yardoc
coverage
lib/bundler/man
pkg
rdoc
spec/reports
test/tmp
test/version_tmp
build
tmp
tags

.vagrant

# IDE
*.iml
.idea
175 changes: 0 additions & 175 deletions Gemfile.lock

This file was deleted.

1 change: 1 addition & 0 deletions lib/landrush.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
require 'landrush/dependent_vms'
require 'landrush/plugin'
require 'landrush/resolver_config'
require 'landrush/win_network_config'
require 'landrush/server'
require 'landrush/store'
require 'landrush/version'
19 changes: 15 additions & 4 deletions lib/landrush/action/setup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,35 @@ def call(env)
# This is after the middleware stack returns, which, since we're right
# before the Network action, should mean that all interfaces are good
# to go.
record_machine_dns_entry if enabled?
setup_static_dns if enabled?
post_boot_setup if enabled?
end

def pre_boot_setup
record_dependent_vm
add_prerequisite_network_interface
setup_host_resolver
configure_server
start_server
end

def post_boot_setup
record_machine_dns_entry
setup_static_dns
setup_host_resolver
end

def record_dependent_vm
DependentVMs.add(machine_hostname)
end

def setup_host_resolver
ResolverConfig.new(env).ensure_config_exists!
if Vagrant::Util::Platform.windows?
#WinNetworkConfig.check_prerequistes(env)
WinNetworkConfig.update_network_adapter host_ip_address(), '127.0.0.1', 'foo'
elsif Vagrant::Util::Platform.darwin?
ResolverConfig.new(env).ensure_config_exists!
else
#TODO
end
end

def add_prerequisite_network_interface
Expand Down
80 changes: 0 additions & 80 deletions lib/landrush/registry_config.rb

This file was deleted.

10 changes: 3 additions & 7 deletions lib/landrush/resolver_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ def desired_contents; <<-EOS.gsub(/^ /, '')
EOS
end

def osx?
`uname`.chomp == 'Darwin'
end

def config_dir
self.class.config_dir
end
Expand All @@ -46,7 +42,7 @@ def contents_match?
end

def write_config!
info "Momentarily using sudo to put the host config in place..."
info 'Momentarily using sudo to put the host config in place...'
system "#{self.class.sudo} mkdir #{config_dir}" unless config_dir.directory?
Tempfile.open('vagrant_landrush_host_config') do |f|
f.write(desired_contents)
Expand All @@ -58,9 +54,9 @@ def write_config!

def ensure_config_exists!
if contents_match?
info "Host DNS resolver config looks good."
info 'Host DNS resolver config looks good.'
else
info "Need to configure the host."
info 'Need to configure the host.'
write_config!
end
end
Expand Down
Loading

0 comments on commit 5e18ae7

Please sign in to comment.