Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Then /^I verify that "(.+)" device is on the "(.+)" datastore on "(.+)" esx host$/ do |device_name, ds_name, esx_host|
- device_name = $common.substitute(device_name).to_sym
- ds_name = $common.substitute(ds_name).to_sym
- esx_host = $common.substitute(esx_host).to_sym
- raise "No esx_host with name #{esx_host}" unless $esx_env.key?(esx_host)
- raise "Device not found with #{device_name} name!" unless $esx_env[esx_host].vms.key?(device_name)
- device = $esx_env[esx_host].vms[device_name]
- device_id = device.vm_id
- real_ds_name = $esx_env[esx_host].get_datastore_name_of_vm(device_name, device_id)
- real_ds_name = $common.substitute(real_ds_name).to_sym
- if real_ds_name == ds_name
- puts "Real ds name for #{device_name} is the same as provided."
- else
- raise "DS name for #{device_name} is #{real_ds_name}. Provided #{ds_name}."
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement