diff options
3 files changed, 136 insertions, 3 deletions
diff --git a/meta-openstack/recipes-extended/tempest/tempest/0001-Stop-auto-detecting-glance-API-versions.patch b/meta-openstack/recipes-extended/tempest/tempest/0001-Stop-auto-detecting-glance-API-versions.patch new file mode 100644 index 0000000..f382abf --- /dev/null +++ b/meta-openstack/recipes-extended/tempest/tempest/0001-Stop-auto-detecting-glance-API-versions.patch | |||
@@ -0,0 +1,129 @@ | |||
1 | Stop auto-detecting glance API versions | ||
2 | |||
3 | This commit switches the image api tests from auto detecting which | ||
4 | api versions are available to having them explicitly set in the config | ||
5 | file. This is to make it explicit which tests are expected to be run | ||
6 | instead of assuming that everything is expected to work. | ||
7 | |||
8 | Partially Implements: blueprint config-cleanup | ||
9 | |||
10 | Change-Id: Ie958a7fb03ff502c5ea1783eaae9debb442c34ea | ||
11 | --- | ||
12 | etc/tempest.conf.sample | 9 ++++++--- | ||
13 | tempest/api/image/base.py | 15 ++------------- | ||
14 | tempest/config.py | 16 +++++++++++++--- | ||
15 | 3 files changed, 21 insertions(+), 19 deletions(-) | ||
16 | |||
17 | diff --git a/etc/tempest.conf.sample b/etc/tempest.conf.sample | ||
18 | index 400cfca..e537c75 100644 | ||
19 | --- a/etc/tempest.conf.sample | ||
20 | +++ b/etc/tempest.conf.sample | ||
21 | @@ -198,12 +198,15 @@ catalog_type = image | ||
22 | # catalog, the first found one is used. | ||
23 | #region = RegionOne | ||
24 | |||
25 | -# The version of the OpenStack Images API to use | ||
26 | -api_version = 1 | ||
27 | - | ||
28 | # HTTP image to use for glance http image testing | ||
29 | http_image = http://download.cirros-cloud.net/0.3.1/cirros-0.3.1-x86_64-uec.tar.gz | ||
30 | |||
31 | +[image-feature-enabled] | ||
32 | +# Is the image api_v1 enabled | ||
33 | +api_v1 = True | ||
34 | +# Is the image api_v2 enabled | ||
35 | +api_v2 = True | ||
36 | + | ||
37 | [network] | ||
38 | # This section contains configuration options used when executing tests | ||
39 | # against the OpenStack Network API. | ||
40 | diff --git a/tempest/api/image/base.py b/tempest/api/image/base.py | ||
41 | index 4f54a15..ab0cb00 100644 | ||
42 | --- a/tempest/api/image/base.py | ||
43 | +++ b/tempest/api/image/base.py | ||
44 | @@ -74,17 +74,6 @@ class BaseImageTest(tempest.test.BaseTestCase): | ||
45 | cls.created_images.append(image['id']) | ||
46 | return resp, image | ||
47 | |||
48 | - @classmethod | ||
49 | - def _check_version(cls, version): | ||
50 | - __, versions = cls.client.get_versions() | ||
51 | - if version == 'v2.0': | ||
52 | - if 'v2.0' in versions: | ||
53 | - return True | ||
54 | - elif version == 'v1.0': | ||
55 | - if 'v1.1' in versions or 'v1.0' in versions: | ||
56 | - return True | ||
57 | - return False | ||
58 | - | ||
59 | |||
60 | class BaseV1ImageTest(BaseImageTest): | ||
61 | |||
62 | @@ -92,7 +81,7 @@ class BaseV1ImageTest(BaseImageTest): | ||
63 | def setUpClass(cls): | ||
64 | super(BaseV1ImageTest, cls).setUpClass() | ||
65 | cls.client = cls.os.image_client | ||
66 | - if not cls._check_version('v1.0'): | ||
67 | + if not cls.config.image_feature_enabled.api_v1: | ||
68 | msg = "Glance API v1 not supported" | ||
69 | raise cls.skipException(msg) | ||
70 | |||
71 | @@ -103,6 +92,6 @@ class BaseV2ImageTest(BaseImageTest): | ||
72 | def setUpClass(cls): | ||
73 | super(BaseV2ImageTest, cls).setUpClass() | ||
74 | cls.client = cls.os.image_client_v2 | ||
75 | - if not cls._check_version('v2.0'): | ||
76 | + if not cls.config.image_feature_enabled.api_v2: | ||
77 | msg = "Glance API v2 not supported" | ||
78 | raise cls.skipException(msg) | ||
79 | diff --git a/tempest/config.py b/tempest/config.py | ||
80 | index b454120..9123395 100644 | ||
81 | --- a/tempest/config.py | ||
82 | +++ b/tempest/config.py | ||
83 | @@ -252,9 +252,6 @@ image_group = cfg.OptGroup(name='image', | ||
84 | title="Image Service Options") | ||
85 | |||
86 | ImageGroup = [ | ||
87 | - cfg.StrOpt('api_version', | ||
88 | - default='1', | ||
89 | - help="Version of the API"), | ||
90 | cfg.StrOpt('catalog_type', | ||
91 | default='image', | ||
92 | help='Catalog type of the Image service.'), | ||
93 | @@ -270,6 +267,17 @@ ImageGroup = [ | ||
94 | help='http accessible image') | ||
95 | ] | ||
96 | |||
97 | +image_feature_group = cfg.OptGroup(name='image-feature-enabled', | ||
98 | + title='Enabled image service features') | ||
99 | + | ||
100 | +ImageFeaturesGroup = [ | ||
101 | + cfg.BoolOpt('api_v2', | ||
102 | + default=True, | ||
103 | + help="Is the v2 image API enabled"), | ||
104 | + cfg.BoolOpt('api_v1', | ||
105 | + default=True, | ||
106 | + help="Is the v1 image API enabled"), | ||
107 | +] | ||
108 | |||
109 | network_group = cfg.OptGroup(name='network', | ||
110 | title='Network Service Options') | ||
111 | @@ -635,6 +643,7 @@ class TempestConfig: | ||
112 | ComputeFeaturesGroup) | ||
113 | register_opt_group(cfg.CONF, identity_group, IdentityGroup) | ||
114 | register_opt_group(cfg.CONF, image_group, ImageGroup) | ||
115 | + register_opt_group(cfg.CONF, image_feature_group, ImageFeaturesGroup) | ||
116 | register_opt_group(cfg.CONF, network_group, NetworkGroup) | ||
117 | register_opt_group(cfg.CONF, volume_group, VolumeGroup) | ||
118 | register_opt_group(cfg.CONF, volume_feature_group, | ||
119 | @@ -655,6 +664,7 @@ class TempestConfig: | ||
120 | self.compute_feature_enabled = cfg.CONF['compute-feature-enabled'] | ||
121 | self.identity = cfg.CONF.identity | ||
122 | self.images = cfg.CONF.image | ||
123 | + self.image_feature_enabled = cfg.CONF['image-feature-enabled'] | ||
124 | self.network = cfg.CONF.network | ||
125 | self.volume = cfg.CONF.volume | ||
126 | self.volume_feature_enabled = cfg.CONF['volume-feature-enabled'] | ||
127 | -- | ||
128 | 1.7.9.5 | ||
129 | |||
diff --git a/meta-openstack/recipes-extended/tempest/tempest/tempest.conf b/meta-openstack/recipes-extended/tempest/tempest/tempest.conf index aea1cd6..e730983 100644 --- a/meta-openstack/recipes-extended/tempest/tempest/tempest.conf +++ b/meta-openstack/recipes-extended/tempest/tempest/tempest.conf | |||
@@ -197,12 +197,15 @@ catalog_type = image | |||
197 | # catalog, the first found one is used. | 197 | # catalog, the first found one is used. |
198 | #region = RegionOne | 198 | #region = RegionOne |
199 | 199 | ||
200 | # The version of the OpenStack Images API to use | ||
201 | api_version = 1 | ||
202 | |||
203 | # HTTP image to use for glance http image testing | 200 | # HTTP image to use for glance http image testing |
204 | http_image = http://download.cirros-cloud.net/0.3.1/cirros-0.3.1-x86_64-uec.tar.gz | 201 | http_image = http://download.cirros-cloud.net/0.3.1/cirros-0.3.1-x86_64-uec.tar.gz |
205 | 202 | ||
203 | [image-feature-enabled] | ||
204 | # Is the image api_v1 enabled | ||
205 | api_v1 = True | ||
206 | # Is the image api_v2 enabled | ||
207 | api_v2 = True | ||
208 | |||
206 | [network] | 209 | [network] |
207 | # This section contains configuration options used when executing tests | 210 | # This section contains configuration options used when executing tests |
208 | # against the OpenStack Network API. | 211 | # against the OpenStack Network API. |
diff --git a/meta-openstack/recipes-extended/tempest/tempest_git.bb b/meta-openstack/recipes-extended/tempest/tempest_git.bb index a1522c6..10b772b 100644 --- a/meta-openstack/recipes-extended/tempest/tempest_git.bb +++ b/meta-openstack/recipes-extended/tempest/tempest_git.bb | |||
@@ -12,6 +12,7 @@ inherit setuptools identity hosts | |||
12 | SRC_URI = "git://github.com/openstack/${SRCNAME}.git;branch=master \ | 12 | SRC_URI = "git://github.com/openstack/${SRCNAME}.git;branch=master \ |
13 | file://tempest.conf \ | 13 | file://tempest.conf \ |
14 | file://logging.conf \ | 14 | file://logging.conf \ |
15 | file://0001-Stop-auto-detecting-glance-API-versions.patch \ | ||
15 | " | 16 | " |
16 | 17 | ||
17 | SRCREV="50af5d5ecc7d21d5e0d1a36fa564ef4850cf94ff" | 18 | SRCREV="50af5d5ecc7d21d5e0d1a36fa564ef4850cf94ff" |