Commit 371127e8 authored by Ted Young's avatar Ted Young Committed by Corey Innis

delete deployment spec fails properly

This was a test that proves we catch raised exceptions in the CPI. However, the
exception that was raised was actually a side effect of the Config object not
being configured, not the expected CPI exception we induce in the test.

* AgentClient is mocked
* test catches the exception we intended

Signed-off-by: default avatarCorey Innis <>
parent e1aae3ad
......@@ -74,11 +74,16 @@ module Bosh::Director
it 'should ignore cpi errors if forced' do
agent = double('agent')
allow(AgentClient).to receive(:with_defaults).and_return(agent)
vm = Models::Vm.make(cid: 'vm-cid')
instance.update(vm: vm)
Models::PersistentDisk.make(disk_cid: 'disk-cid', instance_id:
expect(agent).to receive(:stop)
expect(agent).to receive(:unmount_disk).with('disk-cid')
expect(cloud).to receive(:detach_disk).with('vm-cid', 'disk-cid').and_raise('ERROR')
expect(cloud).to receive(:delete_disk).with('disk-cid').and_raise('ERROR')
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