Functional: Add mesos functional bay creation basic testing frame work

This patch adds functional testing case for mesos bay creation testing.

1. Add gate_hook.sh to set MAGNUM_GUEST_IMAGE_URL to use ubuntu image
2. Modify post_test_hook to use ubuntu image when doing functional
testing
3. Add new tox env entry to do mesos functional testing.

Partially implements: blueprint mesos-functional-testing
Change-Id: I8ee53de4d34aa79d037901e599fc6409a7de2e72
changes/57/261457/7
Eli Qiao 7 years ago
parent ea114e14df
commit 69a4f5345e
  1. 24
      magnum/tests/contrib/gate_hook.sh
  2. 18
      magnum/tests/contrib/post_test_hook.sh
  3. 0
      magnum/tests/functional/mesos/__init__.py
  4. 30
      magnum/tests/functional/mesos/test_mesos_python_client.py
  5. 10
      tox.ini

@ -0,0 +1,24 @@
#!/bin/bash -x
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# This script is executed inside gate_hook function in devstack gate.
coe=$1
if [ "$coe" = "mesos" ]; then
echo "MAGNUM_GUEST_IMAGE_URL="https://fedorapeople.org/groups/magnum/ubuntu-14.04.3-mesos-0.25.0.qcow2"" >> $BASE/new/devstack/localrc
fi
$BASE/new/devstack-gate/devstack-vm-gate.sh

@ -27,8 +27,13 @@ function create_test_data {
# First we test Magnum's command line to see if we can stand up
# a baymodel, bay and a pod
coe=$1
local image_name="fedora-21-atomic"
if [ $coe == 'mesos' ]; then
image_name="ubuntu-14.04"
fi
export NIC_ID=$(neutron net-show public | awk '/ id /{print $4}')
export IMAGE_ID=$(glance --os-image-api-version 1 image-show fedora-21-atomic-5 | awk '/ id /{print $4}')
export IMAGE_ID=$(glance --os-image-api-version 1 image-list | grep $image_name | awk '{print $2}')
# pass the appropriate variables via a config file
CREDS_FILE=$MAGNUM_DIR/functional_creds.conf
@ -113,7 +118,10 @@ sudo chown -R jenkins:stack $MAGNUM_DIR
echo "Running magnum functional test suite for $1"
# For api, we will run tempest tests
if [[ "api" == $1 ]]; then
coe=$1
if [[ "api" == "$coe" ]]; then
# Import devstack functions 'iniset', 'iniget' and 'trueorfalse'
source $BASE/new/devstack/functions
echo "TEMPEST_SERVICES+=,magnum" >> $localrc_path
@ -126,7 +134,7 @@ if [[ "api" == $1 ]]; then
source $BASE/new/devstack/accrc/demo/demo
unset OS_AUTH_TYPE
create_test_data
create_test_data $coe
# Set up tempest config with magnum goodness
iniset $BASE/new/tempest/etc/tempest.conf magnum image_id $IMAGE_ID
@ -158,9 +166,9 @@ else
add_flavor
create_test_data
create_test_data $coe
sudo -E -H -u jenkins tox -e functional-$1 -- --concurrency=1
sudo -E -H -u jenkins tox -e functional-"$coe" -- --concurrency=1
fi
EXIT_CODE=$?

@ -0,0 +1,30 @@
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from magnum.tests.functional.python_client_base import BayTest
class TestBayModelResource(BayTest):
coe = 'mesos'
def test_baymodel_create_and_delete(self):
self._test_baymodel_create_and_delete('test_mesos_baymodel')
class TestBayResource(BayTest):
coe = 'mesos'
def test_bay_create_and_delete(self):
baymodel_uuid = self._test_baymodel_create_and_delete(
'test_mesos_baymodel', delete=False, tls_disabled=True,
network_driver='docker')
self._test_bay_create_and_delete('test_mesos_bay', baymodel_uuid)

@ -52,6 +52,16 @@ commands =
find . -type f -name "*.pyc" -delete
bash tools/pretty_tox.sh '{posargs}'
[testenv:functional-mesos]
sitepackages = True
setenv = OS_TEST_PATH=./magnum/tests/functional/mesos
OS_TEST_TIMEOUT=7200
deps =
{[testenv]deps}
commands =
find . -type f -name "*.pyc" -delete
bash tools/pretty_tox.sh '{posargs}'
[testenv:pep8]
commands =
doc8 -e .rst specs/ doc/source/ contrib/ CONTRIBUTING.rst HACKING.rst README.rst

Loading…
Cancel
Save