Skip to content

Commit

Permalink
Port detection logic and new conf options
Browse files Browse the repository at this point in the history
* new port detection logic, allowing multiple people test *from* the same host
* clean up of ssh tunnels code
* configurable chef-zero path
* configurable user + sudo support
  • Loading branch information
Marcin Sawicki committed Sep 4, 2014
1 parent 0bf05d1 commit 352e719
Show file tree
Hide file tree
Showing 15 changed files with 369 additions and 456 deletions.
183 changes: 0 additions & 183 deletions between-meals/changes.rb

This file was deleted.

10 changes: 5 additions & 5 deletions between-meals/repo/git.rb
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,11 @@ def parse_status(changes)
fail 'No match'
end
end.flatten.map do |x|
{
:status => x[:status],
:path => x[:path].sub("#{@repo_path}/", '')
}
end
{
:status => x[:status],
:path => x[:path].sub("#{@repo_path}/", '')
}
end
# rubocop:enable MultilineBlockChain
end
end
Expand Down
19 changes: 19 additions & 0 deletions between-meals/util.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# vim: syntax=ruby:expandtab:shiftwidth=2:softtabstop=2:tabstop=2

require 'colorize'
require 'socket'
require 'timeout'

module BetweenMeals
# A set of simple utility functions used throughout BetweenMeals
Expand Down Expand Up @@ -51,5 +53,22 @@ def execute(command)
end
return c
end

def port_open?(port)
begin
Timeout.timeout(1) do
begin
s = TCPSocket.new('localhost', port)
s.close
return true
rescue Errno::ECONNREFUSED, Errno::EHOSTUNREACH
return false
end
end
rescue Timeout::Error
return false
end
return false
end
end
end
116 changes: 0 additions & 116 deletions spec/between-meals/changes_spec.rb

This file was deleted.

6 changes: 2 additions & 4 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# vim: syntax=ruby:expandtab:shiftwidth=2:softtabstop=2:tabstop=2

require 'logger'

module TasteTester
# Null logger
module Logging
Expand All @@ -11,7 +13,3 @@ def self.logger
end
end
end

require_relative '../taste-tester/util'
require_relative '../taste-tester/config'
require_relative '../taste-tester/taste-tester'
Loading

0 comments on commit 352e719

Please sign in to comment.