Skip to content

Commit

Permalink
Merge pull request #15 from anynines/fix-dns-resolution
Browse files Browse the repository at this point in the history
Fixes DNS resolution to accept IPs as well
  • Loading branch information
khaledavarteq authored Oct 5, 2018
2 parents b64b73a + 56c7b0e commit a25caa6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion lib/unit_tests_utils/internal_dns.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ def self.resolv(hostname)
end

def self.resolve_domain_name(hostname)
`dig +short #{hostname} @#{nameserver_ip}`.strip.split("\n")
if self.valid_ips?([hostname])
return [hostname]
end

return `dig +short #{hostname} @#{nameserver_ip}`.strip.split("\n")
end

def self.host_addresses(hostnames, port)
Expand Down
4 changes: 2 additions & 2 deletions unit_tests_utils.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

Gem::Specification.new do |s|
s.name = 'unit-tests-utils'
s.version = '1.4.0'
s.date = '2018-04-25'
s.version = '1.4.1'
s.date = '2018-10-05'
s.summary = 'Common unit tests utils'
s.description = 'This gems includes all resources needed for the a9s BOSH release unit tests.'
s.authors = ['Michael Lieser', 'Dennis Groß', 'Lucas Pinto']
Expand Down

0 comments on commit a25caa6

Please sign in to comment.