Merge "Remove deprecated scenario image options"
This commit is contained in:
commit
3800158de0
@ -193,10 +193,6 @@ those tests will be skipped.
|
|||||||
There are also options in the ``scenario`` section for images:
|
There are also options in the ``scenario`` section for images:
|
||||||
|
|
||||||
#. ``img_file``
|
#. ``img_file``
|
||||||
#. ``img_dir``
|
|
||||||
#. ``aki_img_file``
|
|
||||||
#. ``ari_img_file``
|
|
||||||
#. ``ami_img_file``
|
|
||||||
#. ``img_container_format``
|
#. ``img_container_format``
|
||||||
#. ``img_disk_format``
|
#. ``img_disk_format``
|
||||||
|
|
||||||
@ -205,13 +201,9 @@ of scenario tests which are uploading an image. These options are used to tell
|
|||||||
Tempest where an image file is located and describe its metadata for when it is
|
Tempest where an image file is located and describe its metadata for when it is
|
||||||
uploaded.
|
uploaded.
|
||||||
|
|
||||||
The behavior of these options is a bit convoluted (which will likely be fixed in
|
You first need to specify full path of the image using ``img_file`` option.
|
||||||
future versions). You first need to specify ``img_dir``, which is the directory
|
If it is found then the ``img_container_format`` and ``img_disk_format``
|
||||||
in which Tempest will look for the image files. First, it will check if the
|
options are used to upload that image to glance. If it's not found, the tests
|
||||||
filename set for ``img_file`` could be found in ``img_dir``. If it is found then
|
|
||||||
the ``img_container_format`` and ``img_disk_format`` options are used to upload
|
|
||||||
that image to glance. However, if it is not found, Tempest will look for the
|
|
||||||
three uec image file name options as a fallback. If neither is found, the tests
|
|
||||||
requiring an image to upload will fail.
|
requiring an image to upload will fail.
|
||||||
|
|
||||||
It is worth pointing out that using `cirros`_ is a very good choice for running
|
It is worth pointing out that using `cirros`_ is a very good choice for running
|
||||||
|
@ -0,0 +1,15 @@
|
|||||||
|
---
|
||||||
|
upgrade:
|
||||||
|
- |
|
||||||
|
The following deprecated image scenario options are removed after a ~4
|
||||||
|
year deprecation period.
|
||||||
|
|
||||||
|
* ``ami_img_file``
|
||||||
|
* ``ari_img_file``
|
||||||
|
* ``aki_img_file``
|
||||||
|
|
||||||
|
Starting Tempest 25.0.0 release, CONF.scenario.img_file need a full path
|
||||||
|
for the image. CONF.scenario.img_dir was deprecated and will be removed
|
||||||
|
in the next release. Till Tempest 25.0.0, old behavior is maintained and
|
||||||
|
keep working but starting Tempest 26.0.0, you need to specify the full path
|
||||||
|
in CONF.scenario.img_file config option.
|
@ -1068,11 +1068,13 @@ ScenarioGroup = [
|
|||||||
cfg.StrOpt('img_dir',
|
cfg.StrOpt('img_dir',
|
||||||
default='/opt/stack/new/devstack/files/images/'
|
default='/opt/stack/new/devstack/files/images/'
|
||||||
'cirros-0.3.1-x86_64-uec',
|
'cirros-0.3.1-x86_64-uec',
|
||||||
help='Directory containing image files',
|
help='Directory containing image files, this has been '
|
||||||
|
'deprecated - img_file option contains a full path now.',
|
||||||
deprecated_for_removal=True),
|
deprecated_for_removal=True),
|
||||||
cfg.StrOpt('img_file', deprecated_name='qcow2_img_file',
|
cfg.StrOpt('img_file', deprecated_name='qcow2_img_file',
|
||||||
default='cirros-0.3.1-x86_64-disk.img',
|
default='/opt/stack/new/devstack/files/images'
|
||||||
help='Image file name'),
|
'/cirros-0.3.1-x86_64-disk.img',
|
||||||
|
help='Image full path.'),
|
||||||
cfg.StrOpt('img_disk_format',
|
cfg.StrOpt('img_disk_format',
|
||||||
default='qcow2',
|
default='qcow2',
|
||||||
help='Image disk format'),
|
help='Image disk format'),
|
||||||
@ -1081,18 +1083,6 @@ ScenarioGroup = [
|
|||||||
help='Image container format'),
|
help='Image container format'),
|
||||||
cfg.DictOpt('img_properties', help='Glance image properties. '
|
cfg.DictOpt('img_properties', help='Glance image properties. '
|
||||||
'Use for custom images which require them'),
|
'Use for custom images which require them'),
|
||||||
cfg.StrOpt('ami_img_file',
|
|
||||||
default='cirros-0.3.1-x86_64-blank.img',
|
|
||||||
help='AMI image file name',
|
|
||||||
deprecated_for_removal=True),
|
|
||||||
cfg.StrOpt('ari_img_file',
|
|
||||||
default='cirros-0.3.1-x86_64-initrd',
|
|
||||||
help='ARI image file name',
|
|
||||||
deprecated_for_removal=True),
|
|
||||||
cfg.StrOpt('aki_img_file',
|
|
||||||
default='cirros-0.3.1-x86_64-vmlinuz',
|
|
||||||
help='AKI image file name',
|
|
||||||
deprecated_for_removal=True),
|
|
||||||
# TODO(yfried): add support for dhcpcd
|
# TODO(yfried): add support for dhcpcd
|
||||||
cfg.StrOpt('dhcp_client',
|
cfg.StrOpt('dhcp_client',
|
||||||
default='udhcpc',
|
default='udhcpc',
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
import netaddr
|
import netaddr
|
||||||
@ -531,33 +532,32 @@ class ScenarioTest(tempest.test.BaseTestCase):
|
|||||||
return image['id']
|
return image['id']
|
||||||
|
|
||||||
def glance_image_create(self):
|
def glance_image_create(self):
|
||||||
img_path = CONF.scenario.img_dir + "/" + CONF.scenario.img_file
|
img_path = CONF.scenario.img_file
|
||||||
aki_img_path = CONF.scenario.img_dir + "/" + CONF.scenario.aki_img_file
|
if not os.path.exists(img_path):
|
||||||
ari_img_path = CONF.scenario.img_dir + "/" + CONF.scenario.ari_img_file
|
# TODO(kopecmartin): replace LOG.warning for rasing
|
||||||
ami_img_path = CONF.scenario.img_dir + "/" + CONF.scenario.ami_img_file
|
# InvalidConfiguration exception after tempest 25.0.0 is
|
||||||
|
# released - there will be one release which accepts both
|
||||||
|
# behaviors in order to avoid many failures across CIs and etc.
|
||||||
|
LOG.warning(
|
||||||
|
'Starting Tempest 25.0.0 release, CONF.scenario.img_file need '
|
||||||
|
'a full path for the image. CONF.scenario.img_dir was '
|
||||||
|
'deprecated and will be removed in the next release. Till '
|
||||||
|
'Tempest 25.0.0, old behavior is maintained and keep working '
|
||||||
|
'but starting Tempest 26.0.0, you need to specify the full '
|
||||||
|
'path in CONF.scenario.img_file config option.')
|
||||||
|
img_path = os.path.join(CONF.scenario.img_dir, img_path)
|
||||||
img_container_format = CONF.scenario.img_container_format
|
img_container_format = CONF.scenario.img_container_format
|
||||||
img_disk_format = CONF.scenario.img_disk_format
|
img_disk_format = CONF.scenario.img_disk_format
|
||||||
img_properties = CONF.scenario.img_properties
|
img_properties = CONF.scenario.img_properties
|
||||||
LOG.debug("paths: img: %s, container_format: %s, disk_format: %s, "
|
LOG.debug("paths: img: %s, container_format: %s, disk_format: %s, "
|
||||||
"properties: %s, ami: %s, ari: %s, aki: %s",
|
"properties: %s",
|
||||||
img_path, img_container_format, img_disk_format,
|
img_path, img_container_format, img_disk_format,
|
||||||
img_properties, ami_img_path, ari_img_path, aki_img_path)
|
img_properties)
|
||||||
try:
|
image = self._image_create('scenario-img',
|
||||||
image = self._image_create('scenario-img',
|
img_container_format,
|
||||||
img_container_format,
|
img_path,
|
||||||
img_path,
|
disk_format=img_disk_format,
|
||||||
disk_format=img_disk_format,
|
properties=img_properties)
|
||||||
properties=img_properties)
|
|
||||||
except IOError:
|
|
||||||
LOG.warning(
|
|
||||||
"A(n) %s image was not found. Retrying with uec image.",
|
|
||||||
img_disk_format)
|
|
||||||
kernel = self._image_create('scenario-aki', 'aki', aki_img_path)
|
|
||||||
ramdisk = self._image_create('scenario-ari', 'ari', ari_img_path)
|
|
||||||
properties = {'kernel_id': kernel, 'ramdisk_id': ramdisk}
|
|
||||||
image = self._image_create('scenario-ami', 'ami',
|
|
||||||
path=ami_img_path,
|
|
||||||
properties=properties)
|
|
||||||
LOG.debug("image:%s", image)
|
LOG.debug("image:%s", image)
|
||||||
|
|
||||||
return image
|
return image
|
||||||
|
Loading…
x
Reference in New Issue
Block a user