Skip to content

Commit d26da45

Browse files
Jenkinsopenstack-gerrit
authored andcommitted
Merge "add gating up/down script for devstack"
2 parents a99e5c9 + 9a413ab commit d26da45

7 files changed

Lines changed: 44 additions & 12 deletions

File tree

clean.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env bash
1+
#!/bin/bash
22

33
# **clean.sh**
44

@@ -83,7 +83,10 @@ if [[ -d $TOP_DIR/extras.d ]]; then
8383
fi
8484

8585
# 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+
8790
cleanup_glance
8891
cleanup_keystone
8992
cleanup_nova

gate/updown.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash -xe
2+
#
3+
# An up / down test for gate functional testing
4+
#
5+
# Note: this is expected to start running as jenkins
6+
7+
# Step 1: give back sudoers permissions to devstack
8+
TEMPFILE=`mktemp`
9+
echo "stack ALL=(root) NOPASSWD:ALL" >$TEMPFILE
10+
chmod 0440 $TEMPFILE
11+
sudo chown root:root $TEMPFILE
12+
sudo mv $TEMPFILE /etc/sudoers.d/51_stack_sh
13+
14+
# TODO: do something to start a guest to create crud that should
15+
# disappear
16+
17+
# Step 2: unstack
18+
echo "Running unstack.sh"
19+
sudo -H -u stack stdbuf -oL -eL bash -ex ./unstack.sh
20+
21+
# Step 3: clean
22+
echo "Running clean.sh"
23+
sudo -H -u stack stdbuf -oL -eL bash -ex ./clean.sh
24+

lib/databases/mysql

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,14 @@ function cleanup_database_mysql {
2828
stop_service $MYSQL
2929
if is_ubuntu; then
3030
# Get ruthless with mysql
31-
stop_service $MYSQL
3231
apt_get purge -y mysql* mariadb*
3332
sudo rm -rf /var/lib/mysql
3433
sudo rm -rf /etc/mysql
3534
return
3635
elif is_fedora; then
37-
stop_service mariadb
3836
uninstall_package mariadb-server
3937
sudo rm -rf /var/lib/mysql
4038
elif is_suse; then
41-
stop_service mysql
4239
uninstall_package mysql-community-server
4340
sudo rm -rf /var/lib/mysql
4441
else

lib/dstat

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@ function start_dstat {
4040

4141
# stop_dstat() stop dstat process
4242
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
4447
}
4548

4649
# Restore xtrace

lib/rpc_backend

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ function cleanup_rpc_backend {
7474
if is_service_enabled rabbit; then
7575
# Obliterate rabbitmq-server
7676
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
7879
if is_ubuntu; then
7980
# And the Erlang runtime too
8081
apt_get purge -y erlang*

lib/sahara

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ function start_sahara {
203203
# stop_sahara() - Stop running processes
204204
function stop_sahara {
205205
# Kill the Sahara screen windows
206-
screen -S $SCREEN_NAME -p sahara -X kill
206+
stop_process sahara
207207
}
208208

209209

unstack.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env bash
1+
#!/bin/bash
22

33
# **unstack.sh**
44

@@ -138,10 +138,13 @@ fi
138138

139139
SCSI_PERSIST_DIR=$CINDER_STATE_PATH/volumes/*
140140

141+
# BUG: tgt likes to exit 1 on service stop if everything isn't
142+
# perfect, we should clean up cinder stop paths.
143+
141144
# Get the iSCSI volumes
142145
if is_service_enabled cinder; then
143-
stop_cinder
144-
cleanup_cinder
146+
stop_cinder || /bin/true
147+
cleanup_cinder || /bin/true
145148
fi
146149

147150
if [[ -n "$UNSTACK_ALL" ]]; then
@@ -181,4 +184,5 @@ if [[ -n "$SCREEN" ]]; then
181184
fi
182185
fi
183186

184-
clean_lvm_volume_group $DEFAULT_VOLUME_GROUP_NAME
187+
# BUG: maybe it doesn't exist? We should isolate this further down.
188+
clean_lvm_volume_group $DEFAULT_VOLUME_GROUP_NAME || /bin/true

0 commit comments

Comments
 (0)