def test__link_ip_address_pxe_configs(self, provider_mock, unlink_mock, create_link_mock): ip_address = "10.10.0.1" address = "aa:aa:aa:aa:aa:aa" object_utils.create_test_port(self.context, node_id=self.node.id, address=address) provider_mock.get_ip_addresses.return_value = [ip_address] create_link_calls = [ mock.call(u"/tftpboot/1be26c0b-03f2-4d2e-ae87-c02d7f33c123/config", u"/tftpboot/0A0A0001.conf") ] with task_manager.acquire(self.context, self.node.uuid) as task: pxe_utils._link_ip_address_pxe_configs(task) unlink_mock.assert_called_once_with("/tftpboot/0A0A0001.conf") create_link_mock.assert_has_calls(create_link_calls)
def test__link_ip_address_pxe_configs(self, provider_mock, unlink_mock, create_link_mock): ip_address = '10.10.0.1' address = "aa:aa:aa:aa:aa:aa" object_utils.create_test_port(self.context, node_id=self.node.id, address=address) provider_mock.get_ip_addresses.return_value = [ip_address] create_link_calls = [ mock.call(u'1be26c0b-03f2-4d2e-ae87-c02d7f33c123/config', u'/tftpboot/10.10.0.1.conf'), ] with task_manager.acquire(self.context, self.node.uuid) as task: pxe_utils._link_ip_address_pxe_configs(task, False) unlink_mock.assert_called_once_with('/tftpboot/10.10.0.1.conf') create_link_mock.assert_has_calls(create_link_calls)