Add hook scripts for the Jenkins job for Tricircle tempest
1.What is the purpose of this patch set? The Tricircle project doesn't provide integration test yet. To achieve integration test, the Tricircle needs to provide hook scripts for the Jenkins job to execute the test. The Tricircle integration test Jenkins job will be configured in https://github.com/openstack-infra/project-config/tree/master/jenkins/jobs A Jenkins job patch will be submited to project-config once this patch is merged. Without the hook scripts provided in this patch, the Jenkins job configured in project-config is not able to be executed successfully. After the autotimc Jenkins job is established, all new patches sumitted to the Tricircle should pass the integration test, i.e. the test is also the gate test for a new patch. For example, for cinder volume type patch, currently no integration test is provided, we don't know the patch work or not. As new features added to the Tricircle, integration test cases from the Tempest for OpenStack Nova/Cinder/Neutron could be added to the post_test_hook.sh, to test the features added to the Tricircle is correct or not. 2.What is the benefit of this patch set for the Tricircle project? Reuse OpenStack Nova/Cinder/Neutron tempest test cases, and provide integration gate test for new patches. 3.What is the platform you tested it out? After the Jenkins job patch is merged, the test will be executed in the OpenStack CI pipeline, and as one of the gate test for a new patch. CI pipeline will be triggered by gerrit review process, and the test will be executed in the devstack VM(booted by CI pipeline). http://docs.openstack.org/infra/system-config/jenkins.html Change-Id: I5333681fdcaefb01498d9d8c6751d5d174bf57c2 Signed-off-by: Chaoyi Huang <joehuang@huawei.com>
This commit is contained in:
parent
f783a98269
commit
da6c08f93e
@ -19,7 +19,7 @@ import os
|
||||
from tempest import config # noqa
|
||||
from tempest.test_discover import plugins
|
||||
|
||||
from tricircle.tests.tempestplugin import config as project_config # noqa
|
||||
from tricircle.tempestplugin import config as project_config # noqa
|
||||
|
||||
|
||||
class TricircleTempestPlugin(plugins.TempestPlugin):
|
||||
|
45
tricircle/tempestplugin/post_test_hook.sh
Executable file
45
tricircle/tempestplugin/post_test_hook.sh
Executable file
@ -0,0 +1,45 @@
|
||||
#!/bin/bash -xe
|
||||
|
||||
# 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 post_test_hook function in devstack gate.
|
||||
|
||||
export DEST=${DEST:-/opt/stack/new}
|
||||
export DEVSTACK_DIR=$DEST/tricircle/devstack
|
||||
export TRICIRCLE_DIR=$DEST/tricircle
|
||||
export TEMPEST_DIR=$DEST/tempest
|
||||
export TEMPEST_CONF=$TEMPEST_DIR/etc/tempest.conf
|
||||
|
||||
# use admin role to create Tricircle top Pod and Pod1
|
||||
source $DEVSTACK_DIR/admin-openrc.sh
|
||||
token=$(openstack token issue | awk 'NR==5 {print $4}')
|
||||
echo $token
|
||||
curl -X POST http://127.0.0.1:19999/v1.0/pods -H "Content-Type: application/json" \
|
||||
-H "X-Auth-Token: $token" -d '{"pod": {"pod_name": "RegionOne"}}'
|
||||
curl -X POST http://127.0.0.1:19999/v1.0/pods -H "Content-Type: application/json" \
|
||||
-H "X-Auth-Token: $token" -d '{"pod": {"pod_name": "Pod1", "az_name": "az1"}}'
|
||||
|
||||
# preparation for the tests
|
||||
cd $TEMPEST_DIR
|
||||
testr init
|
||||
|
||||
# change the configruation to test Tricircle Cinder-APIGW
|
||||
iniset $TEMPEST_CONF volume region RegionOne
|
||||
iniset $TEMPEST_CONF volume catalog_type volumev2
|
||||
iniset $TEMPEST_CONF volume endpoint_type publicURL
|
||||
iniset $TEMPEST_CONF volume-feature-enabled api_v1 false
|
||||
|
||||
# Run functional test
|
||||
echo "Running Tricircle functional test suite..."
|
||||
ostestr --regex tempest.api.volume.test_volumes_list
|
||||
ostestr --regex tempest.api.volume.test_volumes_get
|
22
tricircle/tempestplugin/pre_test_hook.sh
Executable file
22
tricircle/tempestplugin/pre_test_hook.sh
Executable file
@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# 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 pre_test_hook function in devstack gate.
|
||||
|
||||
export localconf=$BASE/new/devstack/local.conf
|
||||
export TRICIRCLE_API_CONF=/etc/tricircle/api.conf
|
||||
export TRICIRCLE_CINDER_APIGW_CONF=/etc/tricircle/cinder_apigw.conf
|
||||
export TRICIRCLE_NOVA_APIGW_CONF=/etc/tricircle/nova_apigw.conf
|
||||
export TRICIRCLE_XJOB_CONF=/etc/tricircle/xjob.conf
|
||||
|
Loading…
x
Reference in New Issue
Block a user