Browse Source

Add Grenade support to Manila

Grenade is an OpenStack test harness to exercise the upgrade
process between releases. It uses DevStack to perform an initial
OpenStack install and as a reference for the final configuration.

Add support of it to Manila project, doing following changes:
- Add all required scripts for 'grenade' job, such as following:
-- settings
-- shutdown.sh
-- upgrade.sh
- Add optional 'resources.sh' script that performs functional
  tests using bash and manilaclient. List of scenarios:
-- 1. create and delete share setting metadata and access rule
-- 2. attach security service to share network
-- 3. update quotas
-- 4. create private share type and add access for project

Note following:
- Tempest is not used by design.
- Manilaclient is used of stable version - version of 'base' devstack,
  which is 'stable/mitaka'. It also means that used API microversion
  is latest for that branch.

Change-Id: I7d7e0c50933776ca1a710bcf069abb0282b821ac
Depends-On: I4232382d3c944666bbf0916a3f285b84f6ff9d64
Implements blueprint grenade
vponomaryov 3 years ago
parent
commit
7999280fb9

+ 1
- 1
contrib/ci/post_test_hook.sh View File

@@ -200,7 +200,7 @@ echo 'import pkg_resources; print list(pkg_resources.iter_entry_points("tempest.
200 200
 # See bugs:
201 201
 # 1) https://bugs.launchpad.net/manila/+bug/1531049
202 202
 # 2) https://bugs.launchpad.net/tempest/+bug/1524717
203
-TEMPEST_CONFIG=$BASE/new/tempest/etc/tempest.conf
203
+TEMPEST_CONFIG=${TEMPEST_CONFIG:-$TEMPEST_DIR/etc/tempest.conf}
204 204
 ADMIN_TENANT_NAME=${ADMIN_TENANT_NAME:-"admin"}
205 205
 ADMIN_DOMAIN_NAME=${ADMIN_DOMAIN_NAME:-"Default"}
206 206
 ADMIN_PASSWORD=${ADMIN_PASSWORD:-"secretadmin"}

+ 19
- 2
devstack/plugin.sh View File

@@ -663,10 +663,27 @@ function stop_manila {
663 663
 # update_tempest - Function used for updating Tempest config if Tempest service enabled
664 664
 function update_tempest {
665 665
     if is_service_enabled tempest; then
666
+        TEMPEST_CONFIG=${TEMPEST_CONFIG:-$TEMPEST_DIR/etc/tempest.conf}
667
+        ADMIN_TENANT_NAME=${ADMIN_TENANT_NAME:-"admin"}
668
+        ADMIN_DOMAIN_NAME=${ADMIN_DOMAIN_NAME:-"Default"}
669
+        ADMIN_PASSWORD=${ADMIN_PASSWORD:-"secretadmin"}
670
+
666 671
         if [ $(trueorfalse False MANILA_USE_SERVICE_INSTANCE_PASSWORD) == True ]; then
667
-            iniset $TEMPEST_DIR/etc/tempest.conf share image_password $MANILA_SERVICE_INSTANCE_PASSWORD
672
+            iniset $TEMPEST_CONFIG share image_password $MANILA_SERVICE_INSTANCE_PASSWORD
668 673
         fi
669
-        iniset $TEMPEST_DIR/etc/tempest.conf share image_with_share_tools $MANILA_SERVICE_IMAGE_NAME
674
+        iniset $TEMPEST_CONFIG share image_with_share_tools $MANILA_SERVICE_IMAGE_NAME
675
+        iniset $TEMPEST_CONFIG auth admin_username ${ADMIN_USERNAME:-"admin"}
676
+        iniset $TEMPEST_CONFIG auth admin_password ${ADMIN_PASSWORD:-"secretadmin"}
677
+        iniset $TEMPEST_CONFIG auth admin_tenant_name $ADMIN_TENANT_NAME
678
+        iniset $TEMPEST_CONFIG auth admin_domain_name $ADMIN_DOMAIN_NAME
679
+        iniset $TEMPEST_CONFIG identity username ${TEMPEST_USERNAME:-"demo"}
680
+        iniset $TEMPEST_CONFIG identity password $ADMIN_PASSWORD
681
+        iniset $TEMPEST_CONFIG identity tenant_name ${TEMPEST_TENANT_NAME:-"demo"}
682
+        iniset $TEMPEST_CONFIG identity domain_name $ADMIN_DOMAIN_NAME
683
+        iniset $TEMPEST_CONFIG identity alt_username ${ALT_USERNAME:-"alt_demo"}
684
+        iniset $TEMPEST_CONFIG identity alt_password $ADMIN_PASSWORD
685
+        iniset $TEMPEST_CONFIG identity alt_tenant_name ${ALT_TENANT_NAME:-"alt_demo"}
686
+        iniset $TEMPEST_CONFIG identity alt_domain_name $ADMIN_DOMAIN_NAME
670 687
     fi
671 688
 }
672 689
 

+ 17
- 0
devstack/upgrade/from-mitaka/upgrade-manila View File

@@ -0,0 +1,17 @@
1
+#!/usr/bin/env bash
2
+
3
+# ``upgrade-manila``
4
+
5
+function configure_manila_upgrade {
6
+    XTRACE=$(set +o | grep xtrace)
7
+    set -o xtrace
8
+
9
+    # Copy release-specific files
10
+    sudo cp -f $TARGET_RELEASE_DIR/manila/etc/manila/rootwrap.d/* $MANILA_CONF_DIR/rootwrap.d
11
+    sudo cp $TARGET_RELEASE_DIR/manila/etc/manila/api-paste.ini $MANILA_CONF_DIR/api-paste.ini
12
+    sudo cp $TARGET_RELEASE_DIR/manila/etc/manila/policy.json $MANILA_CONF_DIR/policy.json
13
+    sudo cp $TARGET_RELEASE_DIR/manila/etc/manila/rootwrap.conf $MANILA_CONF_DIR/rootwrap.conf
14
+
15
+    # reset to previous state
16
+    $XTRACE
17
+}

+ 356
- 0
devstack/upgrade/resources.sh View File

@@ -0,0 +1,356 @@
1
+#!/bin/bash
2
+
3
+set -o errexit
4
+
5
+source $GRENADE_DIR/grenaderc
6
+source $GRENADE_DIR/functions
7
+
8
+source $TOP_DIR/openrc admin demo
9
+
10
+set -o xtrace
11
+
12
+################################# Settings ####################################
13
+
14
+# Access rules data specific to first enabled backend.
15
+MANILA_GRENADE_ACCESS_TYPE=${MANILA_GRENADE_ACCESS_TYPE:-"ip"}
16
+MANILA_GRENADE_ACCESS_TO=${MANILA_GRENADE_ACCESS_TO:-"127.0.0.1"}
17
+
18
+# Network information that will be used in case DHSS=True driver is used
19
+# with non-single-network-plugin.
20
+MANILA_GRENADE_NETWORK_NAME=${MANILA_GRENADE_NETWORK_NAME:-"private"}
21
+MANILA_GRENADE_SUBNET_NAME=${MANILA_GRENADE_SUBNET_NAME:-"private-subnet"}
22
+
23
+# Timeout that will be used for share creation wait operation.
24
+MANILA_GRENADE_WAIT_STEP=${MANILA_GRENADE_WAIT_STEP:-"4"}
25
+MANILA_GRENADE_WAIT_TIMEOUT=${MANILA_GRENADE_WAIT_TIMEOUT:-"300"}
26
+
27
+MANILA_GRENADE_SHARE_NETWORK_NAME=${MANILA_GRENADE_SHARE_NETWORK_NAME:-"manila_grenade_share_network"}
28
+MANILA_GRENADE_SHARE_TYPE_NAME=${MANILA_GRENADE_SHARE_TYPE_NAME:-"manila_grenade_share_type"}
29
+MANILA_GRENADE_SHARE_NAME=${MANILA_GRENADE_SHARE_NAME:-"manila_grenade_share"}
30
+
31
+MANILA_CONF_DIR=${MANILA_CONF_DIR:-/etc/manila}
32
+MANILA_CONF=$MANILA_CONF_DIR/manila.conf
33
+
34
+################################ Scenarios ####################################
35
+
36
+function scenario_1_do_share_with_rules_and_metadata {
37
+    # NOTE(vponomaryov): nova-network with DHSS=True drivers is not supported
38
+    # by this scenario.
39
+    enabled_share_backends=$(iniget $MANILA_CONF DEFAULT enabled_share_backends)
40
+    backend=$( echo $enabled_share_backends | cut -d',' -f 1 )
41
+
42
+    enabled_share_protocols=$(iniget $MANILA_CONF DEFAULT enabled_share_protocols)
43
+    share_protocol=$( echo $enabled_share_protocols | cut -d',' -f 1 )
44
+
45
+    driver_handles_share_servers=$(iniget $MANILA_CONF $backend driver_handles_share_servers)
46
+
47
+    create_share_cmd="manila create $share_protocol 1 "
48
+    create_share_cmd+="--share-type $MANILA_GRENADE_SHARE_TYPE_NAME "
49
+    create_share_cmd+="--name $MANILA_GRENADE_SHARE_NAME"
50
+
51
+    if [[ $(trueorfalse False driver_handles_share_servers) == True ]]; then
52
+        share_driver=$(iniget $MANILA_CONF $backend share_driver)
53
+        generic_driver='manila.share.drivers.generic.GenericShareDriver'
54
+        windows_driver='manila.share.drivers.windows.windows_smb_driver.WindowsSMBDriver'
55
+        network_plugin=$(iniget $MANILA_CONF $backend network_plugin)
56
+
57
+        share_network_cmd="manila share-network-create "
58
+        share_network_cmd+="--name $MANILA_GRENADE_SHARE_NETWORK_NAME"
59
+        if [[ $share_driver == $generic_driver || \
60
+                $share_driver == $windows_driver || \
61
+                ! $network_plugin =~ 'Single' || \
62
+                ! $network_plugin =~ 'Standalone' ]]; then
63
+            net_id=$(openstack network show $MANILA_GRENADE_NETWORK_NAME -c id -f value)
64
+            subnet_id=$(openstack subnet show $MANILA_GRENADE_SUBNET_NAME -c id -f value)
65
+            share_network_cmd+=" --neutron-net $net_id --neutron-subnet $subnet_id"
66
+        fi
67
+        create_share_cmd+=" --share-network $MANILA_GRENADE_SHARE_NETWORK_NAME"
68
+        resource_save manila share_network $MANILA_GRENADE_SHARE_NETWORK_NAME
69
+    else
70
+        resource_save manila share_network 'None'
71
+    fi
72
+
73
+    # Create share-network
74
+    eval $share_network_cmd
75
+
76
+    # Create share-type
77
+    manila type-create $MANILA_GRENADE_SHARE_TYPE_NAME $driver_handles_share_servers
78
+
79
+    # Create share
80
+    eval $create_share_cmd
81
+
82
+    # Wait for share creation results
83
+    wait_timeout=$MANILA_GRENADE_WAIT_TIMEOUT
84
+    available='false'
85
+    while (( wait_timeout > 0 )) ; do
86
+        current_status=$( manila show $MANILA_GRENADE_SHARE_NAME | \
87
+                          grep " status " | get_field 2 )
88
+        if [[ $current_status == 'available' ]]; then
89
+            available='true'
90
+            break
91
+        elif [[ $current_status == 'creating' ]]; then
92
+            ((wait_timeout-=$MANILA_GRENADE_WAIT_STEP))
93
+            sleep $MANILA_GRENADE_WAIT_STEP
94
+        elif [[ $current_status == 'error' ]]; then
95
+            die $LINENO "Share failed to reach 'available' status."
96
+        else
97
+            die $LINENO "Should never reach this line."
98
+        fi
99
+    done
100
+    if [[ $available == 'true' ]]; then
101
+        echo "Share has been created successfully."
102
+    else
103
+        die $LINENO "Share timed out to reach 'available' status."
104
+    fi
105
+
106
+    # Create some metadata
107
+    manila metadata $MANILA_GRENADE_SHARE_NAME set gre=nade
108
+
109
+    # Add access rules
110
+    manila access-allow $MANILA_GRENADE_SHARE_NAME \
111
+        $MANILA_GRENADE_ACCESS_TYPE $MANILA_GRENADE_ACCESS_TO
112
+
113
+    # Wait for access rule creation results
114
+    wait_timeout=$MANILA_GRENADE_WAIT_TIMEOUT
115
+    active='false'
116
+    while (( wait_timeout > 0 )) ; do
117
+        current_state=$( manila access-list $MANILA_GRENADE_SHARE_NAME | \
118
+                         grep " $MANILA_GRENADE_ACCESS_TO " | get_field 5 )
119
+        if [[ $current_state == 'active' ]]; then
120
+            active='true'
121
+            break
122
+        elif [[ $current_state == 'creating' || $current_state == 'new' ]]; then
123
+            ((wait_timeout-=$MANILA_GRENADE_WAIT_STEP))
124
+            sleep $MANILA_GRENADE_WAIT_STEP
125
+        elif [[ $current_state == 'error' ]]; then
126
+            die $LINENO "Failed to create access rule."
127
+        else
128
+            die $LINENO "Should never reach this line."
129
+        fi
130
+    done
131
+    if [[ $active == 'true' ]]; then
132
+        echo "Access rule has been created successfully."
133
+    else
134
+        die $LINENO "Access rule timed out to reach 'active' state."
135
+    fi
136
+}
137
+
138
+function scenario_1_verify_share_with_rules_and_metadata {
139
+    share_status=$(manila show $MANILA_GRENADE_SHARE_NAME | \
140
+        grep " status " | get_field 2)
141
+    if [[ $share_status != "available" ]]; then
142
+        die $LINENO "Share status is not 'available'. It is $share_status"
143
+    fi
144
+
145
+    rule_state=$(manila access-list $MANILA_GRENADE_SHARE_NAME | \
146
+        grep " $MANILA_GRENADE_ACCESS_TO " | get_field 5)
147
+    if [[ $rule_state != "active" ]]; then
148
+        die $LINENO "Share rule state is not 'active'. It is $rule_state"
149
+    fi
150
+
151
+    metadata=$(manila metadata-show $MANILA_GRENADE_SHARE_NAME | \
152
+        grep 'gre' | get_field 2)
153
+    if [[ $metadata != "nade" ]]; then
154
+        die $LINENO "Share metadata is not 'gre=nade'. It is gre=$metadata"
155
+    fi
156
+}
157
+
158
+function scenario_1_destroy_share_with_rules_and_metadata {
159
+    manila delete $MANILA_GRENADE_SHARE_NAME
160
+
161
+    wait_timeout=$MANILA_GRENADE_WAIT_TIMEOUT
162
+    found='true'
163
+    while (( wait_timeout > 0 )) ; do
164
+        share_status=$( manila list --columns id,name,status | \
165
+            grep $MANILA_GRENADE_SHARE_NAME | get_field 3)
166
+        if [[ -z $share_status ]]; then
167
+            found='false'
168
+            break
169
+        elif [[ $share_status == 'deleting' ]]; then
170
+            ((wait_timeout-=$MANILA_GRENADE_WAIT_STEP))
171
+            sleep $MANILA_GRENADE_WAIT_STEP
172
+        elif [[ $share_status == 'error_deleting' ]]; then
173
+            die $LINENO "Share failed to be deleted."
174
+        else
175
+            die $LINENO "Should never reach this line."
176
+        fi
177
+    done
178
+    if [[ $found == 'true' ]]; then
179
+        die $LINENO "Share timed out to be deleted."
180
+    else
181
+        echo "Share has been deleted successfully."
182
+    fi
183
+
184
+    share_network=$(resource_get manila share_network)
185
+    if [[ -n $share_network && $share_network != 'None' ]]; then
186
+        manila share-network-delete $MANILA_GRENADE_SHARE_NETWORK_NAME
187
+    fi
188
+
189
+    manila type-delete $MANILA_GRENADE_SHARE_TYPE_NAME
190
+}
191
+
192
+#####
193
+
194
+function scenario_2_do_attach_ss_to_sn {
195
+    manila security-service-create \
196
+        ldap \
197
+        --name fake_ss_name \
198
+        --description fake_ss_description \
199
+        --dns-ip fake_dns_ip \
200
+        --server fake_server \
201
+        --domain fake_domain \
202
+        --user fake_user \
203
+        --password fake_password
204
+
205
+    manila share-network-create \
206
+        --name fake_sn_name \
207
+        --description fake_sn_description \
208
+        --neutron-net-id fake_net \
209
+        --neutron-subnet-id fake_subnet
210
+
211
+    manila share-network-security-service-add fake_sn_name fake_ss_name
212
+}
213
+
214
+function scenario_2_verify_attach_ss_to_sn {
215
+    attached_security_service=$(\
216
+        manila share-network-security-service-list fake_sn_name | \
217
+        grep "fake_ss_name")
218
+    if [[ -z $attached_security_service ]] ; then
219
+        die $LINENO "Security service 'fake_ss_name' is not attached "\
220
+                    "to share-network 'fake_sn_name'."
221
+    fi
222
+
223
+    function assert {
224
+        actual=$(manila $1 $2 | grep " $3 " | get_field 2)
225
+        if [[ $actual != $4 ]]; then
226
+            die $LINENO "Field $3 for command $1 with arg $2 has "\
227
+                        "value $actual, but $4 is expected."
228
+        fi
229
+    }
230
+
231
+    assert share-network-show fake_sn_name description fake_sn_description
232
+    assert share-network-show fake_sn_name neutron_net_id fake_net
233
+    assert share-network-show fake_sn_name neutron_subnet_id fake_subnet
234
+
235
+    assert security-service-show fake_ss_name description fake_ss_description
236
+    assert security-service-show fake_ss_name dns_ip fake_dns_ip
237
+    assert security-service-show fake_ss_name server fake_server
238
+    assert security-service-show fake_ss_name domain fake_domain
239
+    assert security-service-show fake_ss_name user fake_user
240
+    assert security-service-show fake_ss_name password fake_password
241
+}
242
+
243
+function scenario_2_destroy_attach_ss_to_sn {
244
+    manila share-network-delete fake_sn_name
245
+    manila security-service-delete fake_ss_name
246
+}
247
+
248
+#####
249
+
250
+function scenario_3_do_quotas {
251
+    current_shares_quota=$(manila quota-show --tenant fake | \
252
+        grep " shares " | get_field 2)
253
+    ((new_shares_quota=$current_shares_quota + 5))
254
+    manila quota-update fake --shares $new_shares_quota
255
+    resource_save manila quota $new_shares_quota
256
+}
257
+
258
+function scenario_3_verify_quotas {
259
+    shares_quota=$(manila quota-show --tenant fake | \
260
+        grep " shares " | get_field 2)
261
+    expected=$(resource_get manila quota)
262
+    if [[ $shares_quota != $expected ]] ; then
263
+        die $LINENO "Shares quota for 'fake' tenant is expected "\
264
+                    "as $expected but it is $shares_quota."
265
+    fi
266
+}
267
+
268
+function scenario_3_destroy_quotas {
269
+    manila quota-delete --tenant fake
270
+}
271
+
272
+#####
273
+
274
+function scenario_4_do_private_share_types {
275
+    manila type-create ${MANILA_GRENADE_SHARE_TYPE_NAME}_scenario4 false \
276
+        --is-public false
277
+    manila type-access-add ${MANILA_GRENADE_SHARE_TYPE_NAME}_scenario4 \
278
+        $(openstack project show demo -c id -f value)
279
+}
280
+
281
+function scenario_4_verify_private_share_types {
282
+    share_type_visibility=$(manila type-list --all \
283
+        --columns name,visibility | \
284
+        grep ${MANILA_GRENADE_SHARE_TYPE_NAME}_scenario4 | get_field 2)
285
+    if [[ $share_type_visibility != 'private' ]] ; then
286
+        die $LINENO "Visibility of share type "\
287
+                    "${MANILA_GRENADE_SHARE_TYPE_NAME}_scenario4 is not "\
288
+                    "'private'. It is $share_type_visibility"
289
+    fi
290
+
291
+    project_id=$(openstack project show demo -c id -f value)
292
+    access=$(manila type-access-list \
293
+        ${MANILA_GRENADE_SHARE_TYPE_NAME}_scenario4 | grep $project_id)
294
+    if [[ -z $access ]]; then
295
+        die $LINENO "Expected $project_id project ID is not found in list "\
296
+                    "of allowed projects of "\
297
+                    "${MANILA_GRENADE_SHARE_TYPE_NAME}_scenario4 share type."
298
+    fi
299
+}
300
+
301
+function scenario_4_destroy_private_share_types {
302
+    manila type-delete ${MANILA_GRENADE_SHARE_TYPE_NAME}_scenario4
303
+}
304
+
305
+################################# Main logic ##################################
306
+
307
+function create {
308
+    scenario_1_do_share_with_rules_and_metadata
309
+    scenario_2_do_attach_ss_to_sn
310
+    scenario_3_do_quotas
311
+    scenario_4_do_private_share_types
312
+    echo "Manila 'create': SUCCESS"
313
+}
314
+
315
+function verify {
316
+    scenario_1_verify_share_with_rules_and_metadata
317
+    scenario_2_verify_attach_ss_to_sn
318
+    scenario_3_verify_quotas
319
+    scenario_4_verify_private_share_types
320
+    echo "Manila 'verify': SUCCESS"
321
+}
322
+
323
+function destroy {
324
+    scenario_1_destroy_share_with_rules_and_metadata
325
+    scenario_2_destroy_attach_ss_to_sn
326
+    scenario_3_destroy_quotas
327
+    scenario_4_destroy_private_share_types
328
+    echo "Manila 'destroy': SUCCESS"
329
+}
330
+
331
+function verify_noapi {
332
+    :
333
+}
334
+
335
+################################# Dispatcher ##################################
336
+
337
+case $1 in
338
+    "create")
339
+        create
340
+        ;;
341
+    "verify_noapi")
342
+        verify_noapi
343
+        ;;
344
+    "verify")
345
+        verify
346
+        ;;
347
+    "destroy")
348
+        destroy
349
+        ;;
350
+    "force_destroy")
351
+        set +o errexit
352
+        destroy
353
+        ;;
354
+esac
355
+
356
+###############################################################################

+ 23
- 0
devstack/upgrade/settings View File

@@ -0,0 +1,23 @@
1
+#!/bin/bash
2
+
3
+register_project_for_upgrade manila
4
+register_db_to_save manila
5
+
6
+BASE_RUN_SMOKE=False
7
+TARGET_RUN_SMOKE=False
8
+
9
+devstack_localrc base enable_service manila m-api m-shr m-sch m-dat
10
+devstack_localrc base enable_plugin manila git://git.openstack.org/openstack/manila stable/mitaka
11
+devstack_localrc base MANILA_UI_ENABLED=False
12
+devstack_localrc base OSLO_SERVICE_WORKS=True
13
+
14
+# NOTE(vponomaryov): stable client is used for keeping scenarios stable
15
+# so they are not broken by changed CLI view.
16
+devstack_localrc base MANILACLIENT_BRANCH="stable/mitaka"
17
+
18
+devstack_localrc target enable_service manila m-api m-shr m-sch m-dat
19
+devstack_localrc target enable_plugin manila git://git.openstack.org/openstack/manila
20
+devstack_localrc target MANILA_UI_ENABLED=False
21
+devstack_localrc target OSLO_SERVICE_WORKS=True
22
+devstack_localrc target MANILA_USE_DOWNGRADE_MIGRATIONS=False
23
+devstack_localrc target MANILACLIENT_BRANCH="stable/mitaka"

+ 22
- 0
devstack/upgrade/shutdown.sh View File

@@ -0,0 +1,22 @@
1
+#!/bin/bash
2
+#
3
+#
4
+
5
+set -o errexit
6
+
7
+source $GRENADE_DIR/grenaderc
8
+source $GRENADE_DIR/functions
9
+
10
+source $BASE_DEVSTACK_DIR/functions
11
+source $BASE_DEVSTACK_DIR/stackrc # needed for status directory
12
+
13
+# Locate the manila plugin and get its functions
14
+MANILA_DEVSTACK_DIR=$(dirname $(dirname $0))
15
+source $MANILA_DEVSTACK_DIR/plugin.sh
16
+
17
+set -o xtrace
18
+
19
+stop_manila
20
+
21
+# Ensure everything is stopped
22
+ensure_services_stopped manila-api manila-share manila-scheduler manila-data

+ 73
- 0
devstack/upgrade/upgrade.sh View File

@@ -0,0 +1,73 @@
1
+#!/usr/bin/env bash
2
+
3
+# ``upgrade-manila``
4
+
5
+echo "*********************************************************************"
6
+echo "Begin $0"
7
+echo "*********************************************************************"
8
+
9
+# Clean up any resources that may be in use
10
+cleanup() {
11
+    set +o errexit
12
+
13
+    echo "*********************************************************************"
14
+    echo "ERROR: Abort $0"
15
+    echo "*********************************************************************"
16
+
17
+    # Kill ourselves to signal any calling process
18
+    trap 2; kill -2 $$
19
+}
20
+
21
+trap cleanup SIGHUP SIGINT SIGTERM
22
+
23
+# Keep track of the grenade directory
24
+RUN_DIR=$(cd $(dirname "$0") && pwd)
25
+
26
+# Source params
27
+source $GRENADE_DIR/grenaderc
28
+
29
+# Import common functions
30
+source $GRENADE_DIR/functions
31
+
32
+# This script exits on an error so that errors don't compound and you see
33
+# only the first error that occurred.
34
+set -o errexit
35
+
36
+# Upgrade Manila
37
+# ==============
38
+# Locate manila devstack plugin, the directory above the
39
+# grenade plugin.
40
+MANILA_DEVSTACK_DIR=$(dirname $(dirname $0))
41
+
42
+# Get functions from current DevStack
43
+source $TARGET_DEVSTACK_DIR/functions
44
+source $TARGET_DEVSTACK_DIR/lib/tls
45
+source $TARGET_DEVSTACK_DIR/stackrc
46
+source $(dirname $(dirname $BASH_SOURCE))/settings
47
+source $(dirname $(dirname $BASH_SOURCE))/plugin.sh
48
+
49
+# Print the commands being run so that we can see the command that triggers
50
+# an error.  It is also useful for following allowing as the install occurs.
51
+set -o xtrace
52
+
53
+# Save current config files for posterity
54
+[[ -d $SAVE_DIR/etc.manila ]] || cp -pr $MANILA_CONF_DIR $SAVE_DIR/etc.manila
55
+
56
+# Install the target manila
57
+install_manila
58
+
59
+# calls upgrade-manila for specific release
60
+upgrade_project manila $RUN_DIR $BASE_DEVSTACK_BRANCH $TARGET_DEVSTACK_BRANCH
61
+
62
+# Migrate the database
63
+$MANILA_BIN_DIR/manila-manage db sync || die $LINENO "DB migration error"
64
+
65
+start_manila
66
+
67
+# Don't succeed unless the services come up
68
+ensure_services_started manila-api manila-share manila-scheduler manila-data
69
+
70
+set +o xtrace
71
+echo "*********************************************************************"
72
+echo "SUCCESS: End $0"
73
+echo "*********************************************************************"

+ 4
- 0
tox.ini View File

@@ -39,6 +39,10 @@ commands =
39 39
          contrib/ci/pre_test_hook.sh \
40 40
          contrib/ci/post_test_hook.sh \
41 41
          devstack/plugin.sh \
42
+         devstack/upgrade/from-mitaka/upgrade-manila \
43
+         devstack/upgrade/resources.sh \
44
+         devstack/upgrade/shutdown.sh \
45
+         devstack/upgrade/upgrade.sh \
42 46
          tools/cover.sh \
43 47
          tools/check_logging.sh \
44 48
          run_tests.sh

Loading…
Cancel
Save