#NEWLINE# @ mock . patch . object ( configdrive , 'required_by' ) #NEWLINE# @ mock . patch . object ( loopingcall , 'FixedIntervalLoopingCall' ) #NEWLINE# @ mock . patch . object ( objects . Instance , 'save' ) #NEWLINE# @ mock . patch . object ( FAKE_CLIENT , 'node' ) #NEWLINE# @ mock . patch . object ( ironic_driver . IronicDriver , '_wait_for_active' ) #NEWLINE# @ mock . patch . object ( ironic_driver . IronicDriver , '_plug_vifs' ) #NEWLINE# @ mock . patch . object ( ironic_driver . IronicDriver , '_start_firewall' ) #NEWLINE# def test_spawn_sets_default_ephemeral_device( self , mock_sf , mock_pvifs , mock_wait , mock_node , mock_save , mock_looping , mock_required_by ) : #NEWLINE# #INDENT# mock_required_by . return_value = False #NEWLINE# node_uuid = 'aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee' #NEWLINE# node = ironic_utils . get_test_node ( driver = 'fake' , uuid = node_uuid ) #NEWLINE# flavor = ironic_utils . get_test_flavor ( ephemeral_gb = 1 ) #NEWLINE# instance = fake_instance . fake_instance_obj ( mock_node . ctx , node = node_uuid ) #NEWLINE# instance . flavor = flavor #NEWLINE# mock_node . get_by_instance_uuid . return_value = node #NEWLINE# mock_node . set_provision_state . return_value = mock . MagicMock ( ) #NEWLINE# image_meta = ironic_utils . get_test_image_meta ( ) #NEWLINE# self . driver . spawn ( self . ctx , instance , image_meta , [ ] , None ) #NEWLINE# self . assertTrue ( mock_save . called ) #NEWLINE# self . assertEqual ( '/dev/sda1' , instance . default_ephemeral_device )