summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRamana Raja <rraja@redhat.com>2015-08-14 13:36:34 +0530
committerRamana Raja <rraja@redhat.com>2015-08-17 16:38:01 +0530
commit858b2443f1b94dac9fca3a8cdfdaed215a041a46 (patch)
treee336e53ff693058794258e10fa6850246daf7690
parente5404555a5519145d7c126e8e2bcb50f9efcf656 (diff)
Manila: add pre_, post_ test_hook scripts for CI
Add pre_test_hook and post_test_hook scripts that enables Manila to be setup with one of the GlusterFS based drivers as the backend share_drive, and allows Tempest test cases to run with the Manila setup. Change-Id: I60c715350b8e53a7e19667574ce0e5ef02e51f22
Notes
Notes (review): Verified+2: Jenkins Code-Review+2: Bharat Kumar Kobagana (BharatK) <bharat.kobagana@redhat.com> Workflow+1: Bharat Kumar Kobagana (BharatK) <bharat.kobagana@redhat.com> Submitted-by: Jenkins Submitted-at: Mon, 17 Aug 2015 13:27:13 +0000 Reviewed-on: https://review.openstack.org/213044 Project: stackforge/devstack-plugin-glusterfs Branch: refs/heads/master
-rwxr-xr-xmanila/post_test_hook.sh84
-rwxr-xr-xmanila/pre_test_hook.sh50
2 files changed, 134 insertions, 0 deletions
diff --git a/manila/post_test_hook.sh b/manila/post_test_hook.sh
new file mode 100755
index 0000000..6a428fc
--- /dev/null
+++ b/manila/post_test_hook.sh
@@ -0,0 +1,84 @@
1#!/bin/bash -xe
2#
3# Licensed under the Apache License, Version 2.0 (the "License"); you may
4# not use this file except in compliance with the License. You may obtain
5# a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12# License for the specific language governing permissions and limitations
13# under the License.
14
15# This script is executed inside post_test_hook function in devstack gate.
16
17sudo chown -R jenkins:stack $BASE/new/tempest
18sudo chown -R jenkins:stack $BASE/data/tempest
19sudo chmod -R o+rx $BASE/new/devstack/files
20
21# Import devstack functions 'iniset'
22source $BASE/new/devstack/functions
23
24
25
26if [[ "$JOB_NAME" =~ "glusterfs-native" ]]; then
27 local BACKEND_NAME="GLUSTERNATIVE"
28 iniset $BASE/new/tempest/etc/tempest.conf share enable_protocols glusterfs
29 iniset $BASE/new/tempest/etc/tempest.conf share storage_protocol GLUSTERFS
30else
31 local BACKEND_NAME="GLUSTERFS"
32 iniset $BASE/new/tempest/etc/tempest.conf share enable_protocols nfs
33 iniset $BASE/new/tempest/etc/tempest.conf share enable_ip_rules_for_protocols nfs
34 iniset $BASE/new/tempest/etc/tempest.conf share storage_protocol NFS
35fi
36
37
38iniset $BASE/new/tempest/etc/tempest.conf share backend_names $BACKEND_NAME
39
40# Set two retries for CI jobs
41iniset $BASE/new/tempest/etc/tempest.conf share share_creation_retry_number 2
42
43# Suppress errors in cleanup of resources
44SUPPRESS_ERRORS=${SUPPRESS_ERRORS_IN_CLEANUP:-True}
45iniset $BASE/new/tempest/etc/tempest.conf share suppress_errors_in_cleanup $SUPPRESS_ERRORS
46
47
48# Disable multi_backend tests
49RUN_MANILA_MULTI_BACKEND_TESTS=${RUN_MANILA_MULTI_BACKEND_TESTS:-False}
50iniset $BASE/new/tempest/etc/tempest.conf share multi_backend $RUN_MANILA_MULTI_BACKEND_TESTS
51
52# Disable manage/unmanage tests
53RUN_MANILA_MANAGE_TESTS=${RUN_MANILA_MANAGE_TESTS:-False}
54iniset $BASE/new/tempest/etc/tempest.conf share run_manage_unmanage_tests $RUN_MANILA_MANAGE_TESTS
55
56# Disable extend tests
57RUN_MANILA_EXTEND_TESTS=${RUN_MANILA_EXTEND_TESTS:-False}
58iniset $BASE/new/tempest/etc/tempest.conf share run_extend_tests $RUN_MANILA_EXTEND_TESTS
59
60# Disable shrink tests
61RUN_MANILA_SHRINK_TESTS=${RUN_MANILA_SHRINK_TESTS:-False}
62iniset $BASE/new/tempest/etc/tempest.conf share run_shrink_tests $RUN_MANILA_SHRINK_TESTS
63
64# Disable multi_tenancy tests
65iniset $BASE/new/tempest/etc/tempest.conf share multitenancy_enabled False
66
67# Disable snapshot tests
68RUN_MANILA_SNAPSHOT_TESTS=${RUN_MANILA_SNAPSHOT_TESTS:-False}
69iniset $BASE/new/tempest/etc/tempest.conf share run_snapshot_tests $RUN_MANILA_SNAPSHOT_TESTS
70
71# let us control if we die or not
72set +o errexit
73cd $BASE/new/tempest
74
75export MANILA_TEMPEST_CONCURRENCY=${MANILA_TEMPEST_CONCURRENCY:-12}
76export MANILA_TESTS=${MANILA_TESTS:-'tempest.api.share*'}
77
78if [[ "$JOB_NAME" =~ "scenario" ]]; then
79 echo "Set test set to scenario only"
80 MANILA_TESTS='tempest.scenario.*share*'
81fi
82
83echo "Running tempest manila test suites"
84sudo -H -u jenkins tox -eall $MANILA_TESTS -- --concurrency=$MANILA_TEMPEST_CONCURRENCY
diff --git a/manila/pre_test_hook.sh b/manila/pre_test_hook.sh
new file mode 100755
index 0000000..c3e35fb
--- /dev/null
+++ b/manila/pre_test_hook.sh
@@ -0,0 +1,50 @@
1#!/bin/bash -xe
2#
3# Licensed under the Apache License, Version 2.0 (the "License"); you may
4# not use this file except in compliance with the License. You may obtain
5# a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12# License for the specific language governing permissions and limitations
13# under the License.
14
15# This script is executed inside pre_test_hook function in devstack gate.
16
17localrc_path=$BASE/new/devstack/localrc
18echo "DEVSTACK_GATE_TEMPEST_ALLOW_TENANT_ISOLATION=1" >> $localrc_path
19echo "API_RATE_LIMIT=False" >> $localrc_path
20echo "TEMPEST_SERVICES+=,manila" >> $localrc_path
21
22echo "MANILA_USE_DOWNGRADE_MIGRATIONS=True" >> $localrc_path
23
24# JOB_NAME is defined in openstack-infra/config project
25# used by CI/CD, where this script is intended to be used.
26if [[ "$JOB_NAME" =~ "multibackend" ]]; then
27 echo "MANILA_MULTI_BACKEND=True" >> $localrc_path
28else
29 echo "MANILA_MULTI_BACKEND=False" >> $localrc_path
30fi
31
32# Enabling isolated metadata in Neutron is required because
33# Tempest creates isolated networks and created vm's in scenario tests don't
34# have access to Nova Metadata service. This leads to unavailability of
35# created vm's in scenario tests.
36echo '[[post-config|$Q_DHCP_CONF_FILE]]' >> $localrc_path
37echo '[DEFAULT]' >> $localrc_path
38echo "enable_isolated_metadata=True" >> $localrc_path
39
40# Go to Tempest dir and checkout stable commit to avoid possible
41# incompatibilities for plugin stored in Manila repo.
42TEMPEST_COMMIT="489f5e62" # 15 June, 2015
43cd $BASE/new/tempest
44git checkout $TEMPEST_COMMIT
45
46# Print current Tempest status
47git status
48
49# Install Manila Tempest integration
50cp -r $BASE/new/manila/contrib/tempest/tempest/* $BASE/new/tempest/tempest