Removed references to bm-deploy images

Previously, kernel and ramdisk images had been
removed from glance in favor of using them directly from the
filesystem. However, some references to these images remained in a
couple of test scripts and also for node discovery where they were
being used as the default. The images being used were
bm-deploy-kernel and bm-deploy-ramdisk.

The change requiring this update was made in commit 7ad1b812fc and
can be found at review https://review.opendev.org/#/c/663897/

In tripleoclient/v1/overcloud_node.py, replaced the default kernel and
ramdisk image names with paths to the current default locations, and
adjusted tripleoclient/tests/v1/overcloud_node/test_overcloud_node.py
to use these paths in the test.

In tripleoclient/tests/v1/overcloud_image/test_overcloud_image.py,
removed mentions of these images in the image list as they no longer
appear as available images in a live setup. This rule change would
have correctly caused test failures for missing images before
overcloud_node.py was updated.

Closes-Bug: #1845698
Change-Id: Ia556e09b7e92ed16e50061ccfbd002af61252092
This commit is contained in:
Daniel King 2019-10-01 17:46:42 -04:00
parent 342c0a1b7d
commit 3f5ddb8fb4
3 changed files with 28 additions and 22 deletions

View File

@ -605,14 +605,8 @@ class TestUploadOvercloudImageFullMultiArch(TestPluginV1):
# reading logfiles a little nicer
images = [
mock.Mock(id=10, name='overcloud-full'),
mock.Mock(id=11, name='bm-deploy-kernel'),
mock.Mock(id=12, name='bm-deploy-initrd'),
mock.Mock(id=13, name='ppc64le-overcloud-full'),
mock.Mock(id=14, name='ppc64le-bm-deploy-kernel'),
mock.Mock(id=15, name='ppc64le-bm-deploy-initrd'),
mock.Mock(id=16, name='p9-ppc64le-overcloud-full'),
mock.Mock(id=17, name='p9-ppc64le-bm-deploy-kernel'),
mock.Mock(id=18, name='p9-ppc64le-bm-deploy-initrd'),
mock.Mock(id=11, name='ppc64le-overcloud-full'),
mock.Mock(id=12, name='p9-ppc64le-overcloud-full'),
]
def setUp(self):

View File

@ -789,9 +789,11 @@ class TestConfigureNode(fakes.TestOvercloudNode):
# Get the command object to test
self.cmd = overcloud_node.ConfigureNode(self.app, None)
self.http_boot = '/var/lib/ironic/httpboot'
self.workflow_input = {
'kernel_name': 'file:///var/lib/ironic/httpboot/agent.kernel',
'ramdisk_name': 'file:///var/lib/ironic/httpboot/agent.ramdisk',
'kernel_name': 'file://%s/agent.kernel' % self.http_boot,
'ramdisk_name': 'file://%s/agent.ramdisk' % self.http_boot,
'instance_boot_option': None,
'root_device': None,
'root_device_minimum_size': 4,
@ -972,6 +974,8 @@ class TestDiscoverNode(fakes.TestOvercloudNode):
"execution_id": "IDID"
}]
self.http_boot = '/var/lib/ironic/httpboot'
def test_with_ip_range(self):
argslist = ['--range', '10.0.0.0/24',
'--credentials', 'admin:password']
@ -983,11 +987,13 @@ class TestDiscoverNode(fakes.TestOvercloudNode):
self.workflow.executions.create.assert_called_once_with(
'tripleo.baremetal.v1.discover_and_enroll_nodes',
workflow_input={'ip_addresses': '10.0.0.0/24',
'credentials': [['admin', 'password']],
'kernel_name': 'bm-deploy-kernel',
'ramdisk_name': 'bm-deploy-ramdisk',
'instance_boot_option': 'local'}
workflow_input={
'ip_addresses': '10.0.0.0/24',
'credentials': [['admin', 'password']],
'kernel_name': 'file://%s/agent.kernel' % self.http_boot,
'ramdisk_name': 'file://%s/agent.ramdisk' % self.http_boot,
'instance_boot_option': 'local'
}
)
def test_with_address_list(self):
@ -1001,11 +1007,13 @@ class TestDiscoverNode(fakes.TestOvercloudNode):
self.workflow.executions.create.assert_called_once_with(
'tripleo.baremetal.v1.discover_and_enroll_nodes',
workflow_input={'ip_addresses': ['10.0.0.1', '10.0.0.2'],
'credentials': [['admin', 'password']],
'kernel_name': 'bm-deploy-kernel',
'ramdisk_name': 'bm-deploy-ramdisk',
'instance_boot_option': 'local'}
workflow_input={
'ip_addresses': ['10.0.0.1', '10.0.0.2'],
'credentials': [['admin', 'password']],
'kernel_name': 'file://%s/agent.kernel' % self.http_boot,
'ramdisk_name': 'file://%s/agent.ramdisk' % self.http_boot,
'instance_boot_option': 'local'
}
)
def test_with_all_options(self):

View File

@ -451,8 +451,12 @@ class DiscoverNode(command.Command):
deploy_kernel = None
deploy_ramdisk = None
else:
deploy_kernel = 'bm-deploy-kernel'
deploy_ramdisk = 'bm-deploy-ramdisk'
deploy_kernel = 'file://{}/agent.kernel'.format(
constants.IRONIC_HTTP_BOOT_BIND_MOUNT
)
deploy_ramdisk = 'file://{}/agent.ramdisk'.format(
constants.IRONIC_HTTP_BOOT_BIND_MOUNT
)
credentials = [list(x.split(':', 1)) for x in parsed_args.credentials]
kwargs = {}