File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
src/bosh-director/spec/unit/bosh/director Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -913,6 +913,24 @@ module Bosh::Director
913913 end
914914 end
915915
916+ context 'when there is no active VM for the disk' do
917+ before do
918+ instance_model . active_vm . destroy
919+ instance_model . reload
920+ end
921+
922+ it 'logs a warning and skips the update' do
923+ expect ( per_spec_logger ) . to receive ( :warn ) . with ( /No active VM for disk/ )
924+
925+ disk_manager . update_detached_disks ( instance_plan )
926+
927+ expect ( cloud ) . to_not have_received ( :update_disk )
928+ model = Models ::PersistentDisk . where ( disk_cid : 'disk123' ) . first
929+ expect ( model . size ) . to eq ( 2048 )
930+ expect ( model . cloud_properties ) . to eq ( { 'old' => 'properties' } )
931+ end
932+ end
933+
916934 context 'when disk has not changed' do
917935 # Both size and cloud_properties match the initial disk state — no change.
918936 let ( :job_persistent_disk_size ) { 2048 }
You can’t perform that action at this time.
0 commit comments