@@ -171,11 +171,39 @@ if [[ ! -z ${TEMPESTCONF_REMOVE} ]]; then
171
171
done <<< " $TEMPESTCONF_REMOVE"
172
172
fi
173
173
174
-
175
174
if [ -n " $CONCURRENCY " ] && [ -z ${TEMPEST_CONCURRENCY} ]; then
176
175
TEMPEST_ARGS+=" --concurrency ${CONCURRENCY} "
177
176
fi
178
177
178
+ function generate_extra_tempest_configuration {
179
+ TEMPEST_NEUTRON_IMAGE=neutron_tempest_plugin_image
180
+ TEMPEST_NEUTRON_FLAVOR_ID=100
181
+
182
+ if [ ! -f " $TEMPEST_NEUTRON_IMAGE .qcow2" ]; then
183
+ sudo curl -o " $TEMPEST_NEUTRON_IMAGE .qcow2" ${TEMPEST_NEUTRON_IMAGE_URL}
184
+ fi
185
+
186
+ if ! openstack image list --os-cloud default -f value -c Name | grep ${TEMPEST_NEUTRON_IMAGE} > /dev/null; then
187
+ openstack image create \
188
+ --os-cloud default \
189
+ --disk-format qcow2 \
190
+ --container-format bare \
191
+ --file " $TEMPEST_NEUTRON_IMAGE .qcow2" ${TEMPEST_NEUTRON_IMAGE}
192
+ fi
193
+ TEMPEST_NEUTRON_IMAGE_ID=$( openstack image list --os-cloud default --name ${TEMPEST_NEUTRON_IMAGE} -f value -c ID)
194
+
195
+ if ! openstack flavor list --os-cloud default -f value -c ID | grep ${TEMPEST_NEUTRON_FLAVOR_ID} > /dev/null; then
196
+ openstack flavor create \
197
+ --os-cloud default \
198
+ --public advanced-flavor \
199
+ --id ${TEMPEST_NEUTRON_FLAVOR_ID} \
200
+ --ram 1024 --disk 10 --vcpus 1
201
+ fi
202
+
203
+ TEMPESTCONF_OVERRIDES+=" neutron_plugin_options.advanced_image_ref ${TEMPEST_NEUTRON_IMAGE_ID} "
204
+ TEMPESTCONF_OVERRIDES+=" neutron_plugin_options.advanced_image_flavor_ref ${TEMPEST_NEUTRON_FLAVOR_ID} "
205
+ }
206
+
179
207
function run_git_tempest {
180
208
mkdir -p $TEMPEST_EXTERNAL_PLUGIN_DIR
181
209
pushd $TEMPEST_EXTERNAL_PLUGIN_DIR
@@ -263,6 +291,10 @@ function generate_test_results {
263
291
264
292
export OS_CLOUD=default
265
293
294
+ if [[ ! -z ${TEMPEST_NEUTRON_IMAGE_URL} ]]; then
295
+ generate_extra_tempest_configuration
296
+ fi
297
+
266
298
if [ ! -z ${USE_EXTERNAL_FILES} ]; then
267
299
mkdir -p $HOME /.config/openstack
268
300
cp ${TEMPEST_PATH} clouds.yaml $HOME /.config/openstack/clouds.yaml
0 commit comments