Commit 3260c61a authored by anonym's avatar anonym
Browse files

Remove VMNet.bridge_ip in favour of VMNet.bridge_ip_addr.

They try to do the same thing, but the former uses uglier parsing
(imho) and fails if the test suite is run as a non-root user since
ifconfig is in /sbin, which generally isn't in such users' PATH:s.
parent b7da4b40
......@@ -66,7 +66,7 @@ When /^I connect to an SSH server on the (Internet|LAN)$/ do |location|
when 'LAN'
@ssh_port = Random.rand(1024...65535)
@ssh_username = 'user'
@ssh_host = $vmnet.bridge_ip
@ssh_host = $vmnet.bridge_ip_addr
@sshd = SSHServer.new(sshd_host = @ssh_host, sshd_port = @ssh_port)
@sshd.start
add_after_scenario_hook { @sshd.stop }
......
......@@ -57,10 +57,6 @@ class VMNet
def bridge_mac
File.open("/sys/class/net/#{bridge_name}/address", "rb").read.chomp
end
def bridge_ip
cmd_helper("ifconfig #{bridge_name}").match(/inet addr:([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)\s+Bcast/)[1]
end
end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment