#NEWLINE# @ mock . patch . object ( irmc_boot , '_setup_deploy_iso' , spec_set = True , autospec = True ) #NEWLINE# @ mock . patch . object ( deploy_utils , 'get_single_nic_with_vif_port_id' , spec_set = True , autospec = True ) #NEWLINE# def test_prepare_ramdisk( self , get_single_nic_with_vif_port_id_mock , _setup_deploy_iso_mock ) : #NEWLINE# #INDENT# instance_info = self . node . instance_info #NEWLINE# instance_info [ 'irmc_boot_iso' ] = 'glance://abcdef' #NEWLINE# instance_info [ 'image_source' ] = '6b2f0c0c-79e8-4db6-842e-43c9764204af' #NEWLINE# self . node . instance_info = instance_info #NEWLINE# self . node . provision_state = states . DEPLOYING #NEWLINE# self . node . save ( ) #NEWLINE# ramdisk_params = { #NEWLINE# #INDENT# 'a' : 'b' , #NEWLINE# #UNINDENT# } #NEWLINE# get_single_nic_with_vif_port_id_mock . return_value = '12:34:56:78:90:ab' #NEWLINE# with task_manager . acquire ( self . context , self . node . uuid , shared = False ) as task : #NEWLINE# #INDENT# task . driver . boot . prepare_ramdisk ( expected_ramdisk_opts , ramdisk_params ) #NEWLINE# expected_ramdisk_opts = { #NEWLINE# #INDENT# 'a' : 'b' , #NEWLINE# 'BOOTIF' : '12:34:56:78:90:ab' , #NEWLINE# #UNINDENT# } #NEWLINE# get_single_nic_with_vif_port_id_mock . assert_called_once_with ( task ) #NEWLINE# _setup_deploy_iso_mock . assert_called_once_with ( task , expected_ramdisk_opts ) #NEWLINE# self . assertEqual ( 'glance://abcdef' , self . node . instance_info [ 'irmc_boot_iso' ] )