Skip to content

Commit

Permalink
Previously we were using ping or just an ssh connection to validate a
Browse files Browse the repository at this point in the history
deployed VM. Now we are verifying that the agent id matches the deployed
VM by comparing the agent id returned from a 'bosh vms --details'
command along with the 'hostname' of the deployed VM (which should be
the agend id). Additionally, another concern of the previous approach
was that it used ping when the port isn't guaranteed to be open, unlike
SSH.

[#107224760](https://www.pivotaltracker.com/story/show/107224760)
  • Loading branch information
aaronshurley committed Nov 11, 2015
1 parent f6fb0db commit c669c7a
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions spec/system/with_release_stemcell_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,19 @@ def matchdata_to_h(matchdata)
it 'should have network access to the vm using the manual static ip' do
skip "not applicable for dynamic networking" if dynamic_networking?

expect(static_ip).not_to be_nil
expect(ssh_sudo(director_ip, 'vcap', "ping -qc1 #{static_ip}; echo $?", ssh_options)).to end_with("0\n")
vm = wait_for_vm('colocated/0')
expect(vm).to_not be_nil
expect(static_ip).to_not be_nil
expect(ssh(public_ip, 'vcap', 'hostname', @our_ssh_options)).to match /#{vm[:agent_id]}/
end

it 'should have network access to the vm using the vip' do
skip "vip network isn't supported" unless includes_vip?

expect(vip).not_to be_nil
expect(ssh(vip, 'vcap', '/sbin/ifconfig eth0', @our_ssh_options)).to match /#{static_ip}/
vm = wait_for_vm('colocated/0')
expect(vm).to_not be_nil
expect(vip).to_not be_nil
expect(ssh(vip, 'vcap', 'hostname', @our_ssh_options)).to match /#{vm[:agent_id]}/
end

context 'changing the persistent disk size' do
Expand Down

0 comments on commit c669c7a

Please sign in to comment.