From 801d817b08944d4d3d939ad6b6376a1bc2e86787 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Sat, 27 May 2017 23:55:29 +0200 Subject: [PATCH] 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 --- devstack-vm-gate.sh | 6 +++++ functions.sh | 60 ++++++++++++++++++++++++++---------------- help/tempest-logs.html | 1 + 3 files changed, 45 insertions(+), 22 deletions(-) diff --git a/devstack-vm-gate.sh b/devstack-vm-gate.sh index 4f64a0f4..cd97a733 100755 --- a/devstack-vm-gate.sh +++ b/devstack-vm-gate.sh @@ -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 diff --git a/functions.sh b/functions.sh index 9d8e9c68..305f76fe 100644 --- a/functions.sh +++ b/functions.sh @@ -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 diff --git a/help/tempest-logs.html b/help/tempest-logs.html index b3e72bd5..92e703e0 100644 --- a/help/tempest-logs.html +++ b/help/tempest-logs.html @@ -97,6 +97,7 @@
  • pip-freeze.txt.gz: List of pip installed python packages. Output of 'pip freeze'
  • dpkg-l.txt.gz: List of apt-get installed packages. Output of 'dpkg -l'
  • df.txt.gz: +
  • rpm-qa.txt.gz: List of rpm installed packages. Output of 'rpm -qa'
  • syslog.txt.gz: syslog for the test slave
  • screen-dstat.txt.gz: dstat output during the test job
  • sudoers.txt.gz: sudoers file