openSUSE enablement for devstack-gate

Add SUSE specific tweaks to the various scripts by invoking
zypper instead of yum when needed and adjust various paths
that are SUSE specific accordingly.

Change-Id: I572afb37e9e315e4d829ae0d946715a0fa4e3cf0
This commit is contained in:
Dirk Mueller 2017-05-27 23:55:29 +02:00
parent b5991463f1
commit 801d817b08
3 changed files with 45 additions and 22 deletions

View File

@ -283,6 +283,12 @@ function setup_localrc {
if ! dpkg -s "${PYTHON_NAME}-yaml" > /dev/null; then
apt_get_install "${PYTHON_NAME}-yaml"
fi
elif is_suse; then
if [ "$PYTHON_NAME" = "python" ] ; then
sudo zypper -n install python-PyYAML
elif [ "$PYTHON_NAME" = "python3" ] ; then
sudo zypper -n install python3-PyYAML
fi
elif is_fedora; then
if [ "$PYTHON_NAME" = "python" ] ; then
if ! rpm --quiet -q "PyYAML"; then

View File

@ -19,6 +19,13 @@
SUDO="sudo"
# Distro check functions
function is_suse {
. /etc/os-release
[[ "$NAME" =~ (openSUSE) || "$NAME" == "SUSE LINUX" ]]
}
function is_fedora {
# note this is a little mis-named, we consider basically anything
# using RPM as "is_fedora". This includes centos7, fedora &
@ -101,7 +108,7 @@ function start_timer {
# first make sure the time is right, so we don't go into crazy land
# later if the system decides to apply an ntp date and we jump forward
# 4 hrs (which has happened)
if is_fedora; then
if is_fedora || is_suse; then
local ntp_service='ntpd'
elif uses_debs; then
local ntp_service='ntp'
@ -645,7 +652,7 @@ function cleanup_host {
sleep 2
# apache logs; including wsgi stuff like horizon, keystone, etc.
if uses_debs; then
if uses_debs || is_suse; then
local apache_logs=/var/log/apache2
elif is_fedora; then
local apache_logs=/var/log/httpd
@ -686,6 +693,10 @@ function cleanup_host {
if [[ -d /etc/apache2/sites-enabled ]]; then
sudo cp /etc/apache2/sites-enabled/* $BASE/logs/apache_config
fi
elif is_suse; then
if [[ -d /etc/apache2/conf.d ]]; then
sudo cp /etc/apache2/conf.d/* $BASE/logs/apache_config
fi
elif is_fedora; then
if [[ -d /etc/apache2/httpd/conf.d ]]; then
sudo cp /etc/httpd/conf.d/* $BASE/logs/apache_config
@ -762,31 +773,12 @@ function cleanup_host {
# Copy over any devstack systemd unit journals. Note, we will no
# longer get separate new/old grenade logs when this happens.
if which journalctl; then
local jremote=""
if uses_debs; then
if ! dpkg -s "systemd-journal-remote" > /dev/null; then
apt_get_install systemd-journal-remote
fi
jremote="/lib/systemd/systemd-journal-remote"
elif is_fedora; then
if ! rpm --quiet -q "systemd-journal-gateway"; then
sudo yum install -y systemd-journal-gateway
fi
jremote="/usr/lib/systemd/systemd-journal-remote"
fi
local u=""
local name=""
for u in `sudo systemctl list-unit-files | grep devstack | awk '{print $1}'`; do
name=$(echo $u | sed 's/devstack@/screen-/' | sed 's/\.service//')
sudo journalctl -o short-precise --unit $u | sudo tee $BASE/logs/$name.txt > /dev/null
done
# export the journal in native format to make it downloadable
# for later searching, makes a class of debugging much
# easier.
sudo journalctl -u 'devstack@*' -o export | \
$jremote -o $BASE/logs/devstack.journal -
# The journal contains everything running under systemd, we'll
# build an old school version of the syslog with just the
# kernel and sudo messages.
@ -796,6 +788,30 @@ function cleanup_host {
--no-pager \
--since="$(cat $BASE/log-start-timestamp.txt)" \
| sudo tee $BASE/logs/syslog.txt > /dev/null
# export the journal in native format to make it downloadable
# for later searching, makes a class of debugging much
# easier.
local jremote=""
if uses_debs; then
if ! dpkg -s "systemd-journal-remote" > /dev/null; then
apt_get_install systemd-journal-remote
fi
jremote="/lib/systemd/systemd-journal-remote"
elif is_suse; then
# openSUSE Leap currently doesn't provide systemd-journal-remote
# see https://bugzilla.suse.com/show_bug.cgi?id=1041122
true
elif is_fedora; then
if ! rpm --quiet -q "systemd-journal-gateway"; then
sudo yum install -y systemd-journal-gateway
fi
jremote="/usr/lib/systemd/systemd-journal-remote"
fi
if [ -n "$jremote" ]; then
sudo journalctl -u 'devstack@*' -o export | \
$jremote -o $BASE/logs/devstack.journal -
fi
else
# assume rsyslog
save_file /var/log/syslog
@ -1025,7 +1041,7 @@ function enable_netconsole {
# http://www.yet.org/2014/09/openvswitch-troubleshooting/
#
function ovs_vxlan_bridge {
if is_fedora; then
if is_suse || is_fedora; then
local ovs_package='openvswitch'
local ovs_service='openvswitch'
elif uses_debs; then

View File

@ -97,6 +97,7 @@
<li><a href="pip-freeze.txt.gz">pip-freeze.txt.gz</a>: List of pip installed python packages. Output of 'pip freeze'
<li><a href="dpkg-l.txt.gz">dpkg-l.txt.gz</a>: List of apt-get installed packages. Output of 'dpkg -l'
<li><a href="df.txt.gz">df.txt.gz</a>:
<li><a href="rpm-qa.txt.gz">rpm-qa.txt.gz</a>: List of rpm installed packages. Output of 'rpm -qa'
<li><a href="syslog.txt.gz">syslog.txt.gz</a>: syslog for the test slave
<li><a href="screen-dstat.txt.gz">screen-dstat.txt.gz</a>: dstat output during the test job
<li><a href="sudoers.txt.gz">sudoers.txt.gz</a>: sudoers file