From 1d95e1c1ed0f8c45b833358b6eb1d149075914c1 Mon Sep 17 00:00:00 2001 From: kevpl Date: Tue, 24 Oct 2017 09:33:01 -0700 Subject: [PATCH] (BKR-1217) suppress enable_root on cygwin SUTs --- lib/beaker/hypervisor/vcloud.rb | 2 +- spec/beaker/hypervisor/vcloud_spec.rb | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/lib/beaker/hypervisor/vcloud.rb b/lib/beaker/hypervisor/vcloud.rb index 6d80f2d..45b13d2 100644 --- a/lib/beaker/hypervisor/vcloud.rb +++ b/lib/beaker/hypervisor/vcloud.rb @@ -180,7 +180,7 @@ def provision @vsphere_helper.find_vms(host['vmhostname'])[host['vmhostname']].summary.guest.ipAddress != nil end host[:ip] = @vsphere_helper.find_vms(host['vmhostname'])[host['vmhostname']].summary.guest.ipAddress - enable_root(host) + enable_root(host) unless host.is_cygwin? end end diff --git a/spec/beaker/hypervisor/vcloud_spec.rb b/spec/beaker/hypervisor/vcloud_spec.rb index 34bf1cc..111779f 100644 --- a/spec/beaker/hypervisor/vcloud_spec.rb +++ b/spec/beaker/hypervisor/vcloud_spec.rb @@ -46,6 +46,25 @@ module Beaker end + it 'does not run enable_root on cygwin hosts' do + MockVsphereHelper.powerOff + + opts = make_opts + opts[:pooling_api] = nil + opts[:datacenter] = 'testdc' + + hosts = make_hosts + hosts.each do |host| + allow( host ).to receive( :is_cygwin? ).and_return( true ) + end + vcloud = Beaker::Vcloud.new( hosts, opts ) + allow( vcloud ).to receive( :require ).and_return( true ) + allow( vcloud ).to receive( :sleep ).and_return( true ) + expect( vcloud ).to receive( :enable_root ).never + vcloud.provision + + end + end describe "#cleanup" do