Browse code

Merge "add gating up/down script for devstack"

Jenkins authored on 2015/02/12 05:53:44
Showing 7 changed files
... ...
@@ -1,4 +1,4 @@
1
-#!/usr/bin/env bash
1
+#!/bin/bash
2 2
 
3 3
 # **clean.sh**
4 4
 
... ...
@@ -83,7 +83,10 @@ if [[ -d $TOP_DIR/extras.d ]]; then
83 83
 fi
84 84
 
85 85
 # Clean projects
86
-cleanup_cinder
86
+
87
+# BUG: cinder tgt doesn't exit cleanly if it's not running.
88
+cleanup_cinder || /bin/true
89
+
87 90
 cleanup_glance
88 91
 cleanup_keystone
89 92
 cleanup_nova
90 93
new file mode 100755
... ...
@@ -0,0 +1,24 @@
0
+#!/bin/bash -xe
1
+#
2
+# An up / down test for gate functional testing
3
+#
4
+# Note: this is expected to start running as jenkins
5
+
6
+# Step 1: give back sudoers permissions to devstack
7
+TEMPFILE=`mktemp`
8
+echo "stack ALL=(root) NOPASSWD:ALL" >$TEMPFILE
9
+chmod 0440 $TEMPFILE
10
+sudo chown root:root $TEMPFILE
11
+sudo mv $TEMPFILE /etc/sudoers.d/51_stack_sh
12
+
13
+# TODO: do something to start a guest to create crud that should
14
+# disappear
15
+
16
+# Step 2: unstack
17
+echo "Running unstack.sh"
18
+sudo -H -u stack stdbuf -oL -eL bash -ex ./unstack.sh
19
+
20
+# Step 3: clean
21
+echo "Running clean.sh"
22
+sudo -H -u stack stdbuf -oL -eL bash -ex ./clean.sh
23
+
... ...
@@ -28,17 +28,14 @@ function cleanup_database_mysql {
28 28
     stop_service $MYSQL
29 29
     if is_ubuntu; then
30 30
         # Get ruthless with mysql
31
-        stop_service $MYSQL
32 31
         apt_get purge -y mysql* mariadb*
33 32
         sudo rm -rf /var/lib/mysql
34 33
         sudo rm -rf /etc/mysql
35 34
         return
36 35
     elif is_fedora; then
37
-        stop_service mariadb
38 36
         uninstall_package mariadb-server
39 37
         sudo rm -rf /var/lib/mysql
40 38
     elif is_suse; then
41
-        stop_service mysql
42 39
         uninstall_package mysql-community-server
43 40
         sudo rm -rf /var/lib/mysql
44 41
     else
... ...
@@ -40,7 +40,10 @@ function start_dstat {
40 40
 
41 41
 # stop_dstat() stop dstat process
42 42
 function stop_dstat {
43
-    screen_stop dstat
43
+    # dstat runs as a console, not as a service, and isn't trackable
44
+    # via the normal mechanisms for devstack. So lets just do a
45
+    # killall and move on.
46
+    killall dstat || /bin/true
44 47
 }
45 48
 
46 49
 # Restore xtrace
... ...
@@ -74,7 +74,8 @@ function cleanup_rpc_backend {
74 74
     if is_service_enabled rabbit; then
75 75
         # Obliterate rabbitmq-server
76 76
         uninstall_package rabbitmq-server
77
-        sudo killall epmd || sudo killall -9 epmd
77
+        # in case it's not actually running, /bin/true at the end
78
+        sudo killall epmd || sudo killall -9 epmd || /bin/true
78 79
         if is_ubuntu; then
79 80
             # And the Erlang runtime too
80 81
             apt_get purge -y erlang*
... ...
@@ -203,7 +203,7 @@ function start_sahara {
203 203
 # stop_sahara() - Stop running processes
204 204
 function stop_sahara {
205 205
     # Kill the Sahara screen windows
206
-    screen -S $SCREEN_NAME -p sahara -X kill
206
+    stop_process sahara
207 207
 }
208 208
 
209 209
 
... ...
@@ -1,4 +1,4 @@
1
-#!/usr/bin/env bash
1
+#!/bin/bash
2 2
 
3 3
 # **unstack.sh**
4 4
 
... ...
@@ -138,10 +138,13 @@ fi
138 138
 
139 139
 SCSI_PERSIST_DIR=$CINDER_STATE_PATH/volumes/*
140 140
 
141
+# BUG: tgt likes to exit 1 on service stop if everything isn't
142
+# perfect, we should clean up cinder stop paths.
143
+
141 144
 # Get the iSCSI volumes
142 145
 if is_service_enabled cinder; then
143
-    stop_cinder
144
-    cleanup_cinder
146
+    stop_cinder || /bin/true
147
+    cleanup_cinder || /bin/true
145 148
 fi
146 149
 
147 150
 if [[ -n "$UNSTACK_ALL" ]]; then
... ...
@@ -181,4 +184,5 @@ if [[ -n "$SCREEN" ]]; then
181 181
     fi
182 182
 fi
183 183
 
184
-clean_lvm_volume_group $DEFAULT_VOLUME_GROUP_NAME
184
+# BUG: maybe it doesn't exist? We should isolate this further down.
185
+clean_lvm_volume_group $DEFAULT_VOLUME_GROUP_NAME || /bin/true