summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Callaghan <dcallagh@redhat.com>2018-09-28 16:12:53 +1000
committerDan Callaghan <dcallagh@redhat.com>2018-09-28 16:12:53 +1000
commit59ffa76015f90879ee82ec5dd621197dc3f0172e (patch)
tree9146d6f4793559883ca13a5560d48d37920d456c
parent7239ee87fc9b1fbe07c994ef942d98801ddab333 (diff)
parent8773dedf0a5c588fd82f350d4e21b6a57b70c87c (diff)
Merge branch 'release-25' into develop
-rwxr-xr-xClient/src/bkr/client/wizard.py2
-rw-r--r--IntegrationTests/src/bkr/inttest/client/test_wizard.py9
-rw-r--r--IntegrationTests/src/bkr/inttest/server/kickstarts/AtomicHost-defaults.expected6
-rw-r--r--IntegrationTests/src/bkr/inttest/server/kickstarts/Fedora18-harness-contained-custom.expected6
-rw-r--r--IntegrationTests/src/bkr/inttest/server/kickstarts/Fedora18-harness-contained.expected6
-rw-r--r--IntegrationTests/src/bkr/inttest/server/kickstarts/Fedora18-scheduler-defaults.expected6
-rw-r--r--IntegrationTests/src/bkr/inttest/server/kickstarts/Fedorarawhide-scheduler-defaults.expected6
-rw-r--r--IntegrationTests/src/bkr/inttest/server/kickstarts/RHVH-defaults.expected6
-rw-r--r--IntegrationTests/src/bkr/inttest/server/kickstarts/RedHatEnterpriseLinux3-scheduler-defaults.expected12
-rw-r--r--IntegrationTests/src/bkr/inttest/server/kickstarts/RedHatEnterpriseLinux4-scheduler-defaults.expected12
-rw-r--r--IntegrationTests/src/bkr/inttest/server/kickstarts/RedHatEnterpriseLinux6-scheduler-defaults-beaker-create-kickstart.expected6
-rw-r--r--IntegrationTests/src/bkr/inttest/server/kickstarts/RedHatEnterpriseLinux6-scheduler-defaults.expected6
-rw-r--r--IntegrationTests/src/bkr/inttest/server/kickstarts/RedHatEnterpriseLinux6-scheduler-guest.expected6
-rw-r--r--IntegrationTests/src/bkr/inttest/server/kickstarts/RedHatEnterpriseLinux6-scheduler-manual.expected6
-rw-r--r--IntegrationTests/src/bkr/inttest/server/kickstarts/RedHatEnterpriseLinux7-scheduler-defaults.expected6
-rw-r--r--IntegrationTests/src/bkr/inttest/server/kickstarts/RedHatEnterpriseLinux7-scheduler-manual.expected6
-rw-r--r--IntegrationTests/src/bkr/inttest/server/kickstarts/RedHatEnterpriseLinuxServer5-scheduler-defaults.expected6
-rw-r--r--IntegrationTests/src/bkr/inttest/server/test_database_migration.py40
-rw-r--r--LabController/aux/anamon9
-rw-r--r--Server/bkr/server/model/distrolibrary.py3
-rw-r--r--Server/bkr/server/snippets/beah6
-rw-r--r--Server/bkr/server/snippets/harness4
-rw-r--r--Server/bkr/server/snippets/post_anamon3
-rw-r--r--Server/bkr/server/snippets/pre_anamon3
-rw-r--r--documentation/user-guide/customizing-installation.rst9
25 files changed, 139 insertions, 51 deletions
diff --git a/Client/src/bkr/client/wizard.py b/Client/src/bkr/client/wizard.py
index e45b029..471b2dd 100755
--- a/Client/src/bkr/client/wizard.py
+++ b/Client/src/bkr/client/wizard.py
@@ -349,7 +349,7 @@ RegExpTestName = re.compile("^(?!-)[a-zA-Z0-9-_]+(?<!-)$")
RegExpBug = re.compile("^\d+$")
RegExpBugLong = re.compile("^bz\d+$")
RegExpBugPrefix = re.compile("^bz")
-RegExpCVE = re.compile("^\d{4}-\d{4}$")
+RegExpCVE = re.compile("^\d{4}-\d{4,}$")
RegExpCVELong = re.compile("^CVE-\d{4}-\d{4}$")
RegExpCVEPrefix = re.compile("^CVE-")
RegExpEmail = re.compile("^[a-z._-]+@[a-z.-]+$")
diff --git a/IntegrationTests/src/bkr/inttest/client/test_wizard.py b/IntegrationTests/src/bkr/inttest/client/test_wizard.py
index 7ca50e5..54d067c 100644
--- a/IntegrationTests/src/bkr/inttest/client/test_wizard.py
+++ b/IntegrationTests/src/bkr/inttest/client/test_wizard.py
@@ -201,3 +201,12 @@ class TestWizard(BaseWizardTestCase):
'NSS_WRAPPER_PASSWD': passwd_file.name,
'NSS_WRAPPER_GROUP': group_file.name})
self.assertIn(u'Author : Josef Ċ vejk', out.decode('utf8'))
+
+ # https://bugzilla.redhat.com/show_bug.cgi?id=1624909
+ def test_cve_number_syntax_change(self):
+ out = run_wizard(['beaker-wizard',
+ '--current-directory',
+ 'wget/Sanity/http/test-it-works',
+ 'CVE-2018-123456789'])
+ self.assertIn('Bug or CVE numbers : CVE-2018-123456789', out)
+ self.assertNotIn('2018-123456789 is not a valid bug or cve number', out)
diff --git a/IntegrationTests/src/bkr/inttest/server/kickstarts/AtomicHost-defaults.expected b/IntegrationTests/src/bkr/inttest/server/kickstarts/AtomicHost-defaults.expected
index 7c1d6ed..94a4c12 100644
--- a/IntegrationTests/src/bkr/inttest/server/kickstarts/AtomicHost-defaults.expected
+++ b/IntegrationTests/src/bkr/inttest/server/kickstarts/AtomicHost-defaults.expected
@@ -78,7 +78,8 @@ fetch - http://lab.test-kickstart.invalid:8000/install_start/@RECIPEID@
if command -v python3 >/dev/null ; then
fetch /tmp/anamon http://lab.test-kickstart.invalid/beaker/anamon3
python_command="python3"
-elif [ -f /usr/libexec/platform-python ] ; then
+elif [ -f /usr/libexec/platform-python ] && \
+ /usr/libexec/platform-python --version 2>&1 | grep -q "Python 3" ; then
fetch /tmp/anamon http://lab.test-kickstart.invalid/beaker/anamon3
python_command="/usr/libexec/platform-python"
else
@@ -165,7 +166,8 @@ fi
if command -v python3 >/dev/null ; then
fetch /usr/local/sbin/anamon http://lab.test-kickstart.invalid/beaker/anamon3
-elif [ -f /usr/libexec/platform-python ] ; then
+elif [ -f /usr/libexec/platform-python ] && \
+ /usr/libexec/platform-python --version 2>&1 | grep -q "Python 3" ; then
fetch /usr/local/sbin/anamon http://lab.test-kickstart.invalid/beaker/anamon3
sed -i 's/#!\/usr\/bin\/python3/#!\/usr\/libexec\/platform-python/' /usr/local/sbin/anamon
else
diff --git a/IntegrationTests/src/bkr/inttest/server/kickstarts/Fedora18-harness-contained-custom.expected b/IntegrationTests/src/bkr/inttest/server/kickstarts/Fedora18-harness-contained-custom.expected
index 61acbf0..245a107 100644
--- a/IntegrationTests/src/bkr/inttest/server/kickstarts/Fedora18-harness-contained-custom.expected
+++ b/IntegrationTests/src/bkr/inttest/server/kickstarts/Fedora18-harness-contained-custom.expected
@@ -85,7 +85,8 @@ fetch - http://lab.test-kickstart.invalid:8000/install_start/@RECIPEID@
if command -v python3 >/dev/null ; then
fetch /tmp/anamon http://lab.test-kickstart.invalid/beaker/anamon3
python_command="python3"
-elif [ -f /usr/libexec/platform-python ] ; then
+elif [ -f /usr/libexec/platform-python ] && \
+ /usr/libexec/platform-python --version 2>&1 | grep -q "Python 3" ; then
fetch /tmp/anamon http://lab.test-kickstart.invalid/beaker/anamon3
python_command="/usr/libexec/platform-python"
else
@@ -175,7 +176,8 @@ fi
if command -v python3 >/dev/null ; then
fetch /usr/local/sbin/anamon http://lab.test-kickstart.invalid/beaker/anamon3
-elif [ -f /usr/libexec/platform-python ] ; then
+elif [ -f /usr/libexec/platform-python ] && \
+ /usr/libexec/platform-python --version 2>&1 | grep -q "Python 3" ; then
fetch /usr/local/sbin/anamon http://lab.test-kickstart.invalid/beaker/anamon3
sed -i 's/#!\/usr\/bin\/python3/#!\/usr\/libexec\/platform-python/' /usr/local/sbin/anamon
else
diff --git a/IntegrationTests/src/bkr/inttest/server/kickstarts/Fedora18-harness-contained.expected b/IntegrationTests/src/bkr/inttest/server/kickstarts/Fedora18-harness-contained.expected
index a2041cf..e8810f4 100644
--- a/IntegrationTests/src/bkr/inttest/server/kickstarts/Fedora18-harness-contained.expected
+++ b/IntegrationTests/src/bkr/inttest/server/kickstarts/Fedora18-harness-contained.expected
@@ -86,7 +86,8 @@ fetch - http://lab.test-kickstart.invalid:8000/install_start/@RECIPEID@
if command -v python3 >/dev/null ; then
fetch /tmp/anamon http://lab.test-kickstart.invalid/beaker/anamon3
python_command="python3"
-elif [ -f /usr/libexec/platform-python ] ; then
+elif [ -f /usr/libexec/platform-python ] && \
+ /usr/libexec/platform-python --version 2>&1 | grep -q "Python 3" ; then
fetch /tmp/anamon http://lab.test-kickstart.invalid/beaker/anamon3
python_command="/usr/libexec/platform-python"
else
@@ -176,7 +177,8 @@ fi
if command -v python3 >/dev/null ; then
fetch /usr/local/sbin/anamon http://lab.test-kickstart.invalid/beaker/anamon3
-elif [ -f /usr/libexec/platform-python ] ; then
+elif [ -f /usr/libexec/platform-python ] && \
+ /usr/libexec/platform-python --version 2>&1 | grep -q "Python 3" ; then
fetch /usr/local/sbin/anamon http://lab.test-kickstart.invalid/beaker/anamon3
sed -i 's/#!\/usr\/bin\/python3/#!\/usr\/libexec\/platform-python/' /usr/local/sbin/anamon
else
diff --git a/IntegrationTests/src/bkr/inttest/server/kickstarts/Fedora18-scheduler-defaults.expected b/IntegrationTests/src/bkr/inttest/server/kickstarts/Fedora18-scheduler-defaults.expected
index 3b914d5..1c42a3f 100644
--- a/IntegrationTests/src/bkr/inttest/server/kickstarts/Fedora18-scheduler-defaults.expected
+++ b/IntegrationTests/src/bkr/inttest/server/kickstarts/Fedora18-scheduler-defaults.expected
@@ -103,7 +103,8 @@ fetch - http://lab.test-kickstart.invalid:8000/install_start/@RECIPEID@
if command -v python3 >/dev/null ; then
fetch /tmp/anamon http://lab.test-kickstart.invalid/beaker/anamon3
python_command="python3"
-elif [ -f /usr/libexec/platform-python ] ; then
+elif [ -f /usr/libexec/platform-python ] && \
+ /usr/libexec/platform-python --version 2>&1 | grep -q "Python 3" ; then
fetch /tmp/anamon http://lab.test-kickstart.invalid/beaker/anamon3
python_command="/usr/libexec/platform-python"
else
@@ -193,7 +194,8 @@ fi
if command -v python3 >/dev/null ; then
fetch /usr/local/sbin/anamon http://lab.test-kickstart.invalid/beaker/anamon3
-elif [ -f /usr/libexec/platform-python ] ; then
+elif [ -f /usr/libexec/platform-python ] && \
+ /usr/libexec/platform-python --version 2>&1 | grep -q "Python 3" ; then
fetch /usr/local/sbin/anamon http://lab.test-kickstart.invalid/beaker/anamon3
sed -i 's/#!\/usr\/bin\/python3/#!\/usr\/libexec\/platform-python/' /usr/local/sbin/anamon
else
diff --git a/IntegrationTests/src/bkr/inttest/server/kickstarts/Fedorarawhide-scheduler-defaults.expected b/IntegrationTests/src/bkr/inttest/server/kickstarts/Fedorarawhide-scheduler-defaults.expected
index 0513329..5e65d51 100644
--- a/IntegrationTests/src/bkr/inttest/server/kickstarts/Fedorarawhide-scheduler-defaults.expected
+++ b/IntegrationTests/src/bkr/inttest/server/kickstarts/Fedorarawhide-scheduler-defaults.expected
@@ -84,7 +84,8 @@ fetch - http://lab.test-kickstart.invalid:8000/install_start/@RECIPEID@
if command -v python3 >/dev/null ; then
fetch /tmp/anamon http://lab.test-kickstart.invalid/beaker/anamon3
python_command="python3"
-elif [ -f /usr/libexec/platform-python ] ; then
+elif [ -f /usr/libexec/platform-python ] && \
+ /usr/libexec/platform-python --version 2>&1 | grep -q "Python 3" ; then
fetch /tmp/anamon http://lab.test-kickstart.invalid/beaker/anamon3
python_command="/usr/libexec/platform-python"
else
@@ -174,7 +175,8 @@ fi
if command -v python3 >/dev/null ; then
fetch /usr/local/sbin/anamon http://lab.test-kickstart.invalid/beaker/anamon3
-elif [ -f /usr/libexec/platform-python ] ; then
+elif [ -f /usr/libexec/platform-python ] && \
+ /usr/libexec/platform-python --version 2>&1 | grep -q "Python 3" ; then
fetch /usr/local/sbin/anamon http://lab.test-kickstart.invalid/beaker/anamon3
sed -i 's/#!\/usr\/bin\/python3/#!\/usr\/libexec\/platform-python/' /usr/local/sbin/anamon
else
diff --git a/IntegrationTests/src/bkr/inttest/server/kickstarts/RHVH-defaults.expected b/IntegrationTests/src/bkr/inttest/server/kickstarts/RHVH-defaults.expected
index 1b5f8fb..32d4802 100644
--- a/IntegrationTests/src/bkr/inttest/server/kickstarts/RHVH-defaults.expected
+++ b/IntegrationTests/src/bkr/inttest/server/kickstarts/RHVH-defaults.expected
@@ -77,7 +77,8 @@ fetch - http://lab.test-kickstart.invalid:8000/install_start/@RECIPEID@
if command -v python3 >/dev/null ; then
fetch /tmp/anamon http://lab.test-kickstart.invalid/beaker/anamon3
python_command="python3"
-elif [ -f /usr/libexec/platform-python ] ; then
+elif [ -f /usr/libexec/platform-python ] && \
+ /usr/libexec/platform-python --version 2>&1 | grep -q "Python 3" ; then
fetch /tmp/anamon http://lab.test-kickstart.invalid/beaker/anamon3
python_command="/usr/libexec/platform-python"
else
@@ -168,7 +169,8 @@ fi
if command -v python3 >/dev/null ; then
fetch /usr/local/sbin/anamon http://lab.test-kickstart.invalid/beaker/anamon3
-elif [ -f /usr/libexec/platform-python ] ; then
+elif [ -f /usr/libexec/platform-python ] && \
+ /usr/libexec/platform-python --version 2>&1 | grep -q "Python 3" ; then
fetch /usr/local/sbin/anamon http://lab.test-kickstart.invalid/beaker/anamon3
sed -i 's/#!\/usr\/bin\/python3/#!\/usr\/libexec\/platform-python/' /usr/local/sbin/anamon
else
diff --git a/IntegrationTests/src/bkr/inttest/server/kickstarts/RedHatEnterpriseLinux3-scheduler-defaults.expected b/IntegrationTests/src/bkr/inttest/server/kickstarts/RedHatEnterpriseLinux3-scheduler-defaults.expected
index bd06ef0..ec1151f 100644
--- a/IntegrationTests/src/bkr/inttest/server/kickstarts/RedHatEnterpriseLinux3-scheduler-defaults.expected
+++ b/IntegrationTests/src/bkr/inttest/server/kickstarts/RedHatEnterpriseLinux3-scheduler-defaults.expected
@@ -96,7 +96,8 @@ fetch - http://lab.test-kickstart.invalid:8000/install_start/@RECIPEID@
if command -v python3 >/dev/null ; then
fetch /tmp/anamon http://lab.test-kickstart.invalid/beaker/anamon3
python_command="python3"
-elif [ -f /usr/libexec/platform-python ] ; then
+elif [ -f /usr/libexec/platform-python ] && \
+ /usr/libexec/platform-python --version 2>&1 | grep -q "Python 3" ; then
fetch /tmp/anamon http://lab.test-kickstart.invalid/beaker/anamon3
python_command="/usr/libexec/platform-python"
else
@@ -184,7 +185,8 @@ fi
if command -v python3 >/dev/null ; then
fetch /usr/local/sbin/anamon http://lab.test-kickstart.invalid/beaker/anamon3
-elif [ -f /usr/libexec/platform-python ] ; then
+elif [ -f /usr/libexec/platform-python ] && \
+ /usr/libexec/platform-python --version 2>&1 | grep -q "Python 3" ; then
fetch /usr/local/sbin/anamon http://lab.test-kickstart.invalid/beaker/anamon3
sed -i 's/#!\/usr\/bin\/python3/#!\/usr\/libexec\/platform-python/' /usr/local/sbin/anamon
else
@@ -312,10 +314,10 @@ EOF
# This speeds up yum because of a bug where it will update stdout too often.
# http://lists.baseurl.org/pipermail/yum-devel/2011-December/008857.html
yum check-update > /dev/null 2>&1 || true
-yum -y install beah rhts-test-env
-yum -y install beakerlib
+yum -d 1 -y install beah rhts-test-env
+yum -d 1 -y install beakerlib
# This may fail if you are outside of Red Hat..
-yum -y install beakerlib-redhat
+yum -d 1 -y install beakerlib-redhat
cp /etc/beah_beaker.conf{,.default}
cat << EOF > /etc/beah_beaker.conf
diff --git a/IntegrationTests/src/bkr/inttest/server/kickstarts/RedHatEnterpriseLinux4-scheduler-defaults.expected b/IntegrationTests/src/bkr/inttest/server/kickstarts/RedHatEnterpriseLinux4-scheduler-defaults.expected
index 2e6ad53..3ad0fbc 100644
--- a/IntegrationTests/src/bkr/inttest/server/kickstarts/RedHatEnterpriseLinux4-scheduler-defaults.expected
+++ b/IntegrationTests/src/bkr/inttest/server/kickstarts/RedHatEnterpriseLinux4-scheduler-defaults.expected
@@ -95,7 +95,8 @@ fetch - http://lab.test-kickstart.invalid:8000/install_start/@RECIPEID@
if command -v python3 >/dev/null ; then
fetch /tmp/anamon http://lab.test-kickstart.invalid/beaker/anamon3
python_command="python3"
-elif [ -f /usr/libexec/platform-python ] ; then
+elif [ -f /usr/libexec/platform-python ] && \
+ /usr/libexec/platform-python --version 2>&1 | grep -q "Python 3" ; then
fetch /tmp/anamon http://lab.test-kickstart.invalid/beaker/anamon3
python_command="/usr/libexec/platform-python"
else
@@ -180,7 +181,8 @@ fi
if command -v python3 >/dev/null ; then
fetch /usr/local/sbin/anamon http://lab.test-kickstart.invalid/beaker/anamon3
-elif [ -f /usr/libexec/platform-python ] ; then
+elif [ -f /usr/libexec/platform-python ] && \
+ /usr/libexec/platform-python --version 2>&1 | grep -q "Python 3" ; then
fetch /usr/local/sbin/anamon http://lab.test-kickstart.invalid/beaker/anamon3
sed -i 's/#!\/usr\/bin\/python3/#!\/usr\/libexec\/platform-python/' /usr/local/sbin/anamon
else
@@ -292,10 +294,10 @@ EOF
# This speeds up yum because of a bug where it will update stdout too often.
# http://lists.baseurl.org/pipermail/yum-devel/2011-December/008857.html
yum check-update > /dev/null 2>&1 || true
-yum -y install beah rhts-test-env
-yum -y install beakerlib
+yum -d 1 -y install beah rhts-test-env
+yum -d 1 -y install beakerlib
# This may fail if you are outside of Red Hat..
-yum -y install beakerlib-redhat
+yum -d 1 -y install beakerlib-redhat
cp /etc/beah_beaker.conf{,.default}
cat << EOF > /etc/beah_beaker.conf
diff --git a/IntegrationTests/src/bkr/inttest/server/kickstarts/RedHatEnterpriseLinux6-scheduler-defaults-beaker-create-kickstart.expected b/IntegrationTests/src/bkr/inttest/server/kickstarts/RedHatEnterpriseLinux6-scheduler-defaults-beaker-create-kickstart.expected
index c7b4558..19b4355 100644
--- a/IntegrationTests/src/bkr/inttest/server/kickstarts/RedHatEnterpriseLinux6-scheduler-defaults-beaker-create-kickstart.expected
+++ b/IntegrationTests/src/bkr/inttest/server/kickstarts/RedHatEnterpriseLinux6-scheduler-defaults-beaker-create-kickstart.expected
@@ -108,7 +108,8 @@ fetch - http://lab.test-kickstart.invalid:8000/install_start/@RECIPEID@
if command -v python3 >/dev/null ; then
fetch /tmp/anamon http://lab.test-kickstart.invalid/beaker/anamon3
python_command="python3"
-elif [ -f /usr/libexec/platform-python ] ; then
+elif [ -f /usr/libexec/platform-python ] && \
+ /usr/libexec/platform-python --version 2>&1 | grep -q "Python 3" ; then
fetch /tmp/anamon http://lab.test-kickstart.invalid/beaker/anamon3
python_command="/usr/libexec/platform-python"
else
@@ -195,7 +196,8 @@ fi
if command -v python3 >/dev/null ; then
fetch /usr/local/sbin/anamon http://lab.test-kickstart.invalid/beaker/anamon3
-elif [ -f /usr/libexec/platform-python ] ; then
+elif [ -f /usr/libexec/platform-python ] && \
+ /usr/libexec/platform-python --version 2>&1 | grep -q "Python 3" ; then
fetch /usr/local/sbin/anamon http://lab.test-kickstart.invalid/beaker/anamon3
sed -i 's/#!\/usr\/bin\/python3/#!\/usr\/libexec\/platform-python/' /usr/local/sbin/anamon
else
diff --git a/IntegrationTests/src/bkr/inttest/server/kickstarts/RedHatEnterpriseLinux6-scheduler-defaults.expected b/IntegrationTests/src/bkr/inttest/server/kickstarts/RedHatEnterpriseLinux6-scheduler-defaults.expected
index ac17bce..26f40b9 100644
--- a/IntegrationTests/src/bkr/inttest/server/kickstarts/RedHatEnterpriseLinux6-scheduler-defaults.expected
+++ b/IntegrationTests/src/bkr/inttest/server/kickstarts/RedHatEnterpriseLinux6-scheduler-defaults.expected
@@ -108,7 +108,8 @@ fetch - http://lab.test-kickstart.invalid:8000/install_start/@RECIPEID@
if command -v python3 >/dev/null ; then
fetch /tmp/anamon http://lab.test-kickstart.invalid/beaker/anamon3
python_command="python3"
-elif [ -f /usr/libexec/platform-python ] ; then
+elif [ -f /usr/libexec/platform-python ] && \
+ /usr/libexec/platform-python --version 2>&1 | grep -q "Python 3" ; then
fetch /tmp/anamon http://lab.test-kickstart.invalid/beaker/anamon3
python_command="/usr/libexec/platform-python"
else
@@ -195,7 +196,8 @@ fi
if command -v python3 >/dev/null ; then
fetch /usr/local/sbin/anamon http://lab.test-kickstart.invalid/beaker/anamon3
-elif [ -f /usr/libexec/platform-python ] ; then
+elif [ -f /usr/libexec/platform-python ] && \
+ /usr/libexec/platform-python --version 2>&1 | grep -q "Python 3" ; then
fetch /usr/local/sbin/anamon http://lab.test-kickstart.invalid/beaker/anamon3
sed -i 's/#!\/usr\/bin\/python3/#!\/usr\/libexec\/platform-python/' /usr/local/sbin/anamon
else
diff --git a/IntegrationTests/src/bkr/inttest/server/kickstarts/RedHatEnterpriseLinux6-scheduler-guest.expected b/IntegrationTests/src/bkr/inttest/server/kickstarts/RedHatEnterpriseLinux6-scheduler-guest.expected
index 0fc5a08..13f514d 100644
--- a/IntegrationTests/src/bkr/inttest/server/kickstarts/RedHatEnterpriseLinux6-scheduler-guest.expected
+++ b/IntegrationTests/src/bkr/inttest/server/kickstarts/RedHatEnterpriseLinux6-scheduler-guest.expected
@@ -108,7 +108,8 @@ fetch - http://lab.test-kickstart.invalid:8000/install_start/@RECIPEID@
if command -v python3 >/dev/null ; then
fetch /tmp/anamon http://lab.test-kickstart.invalid/beaker/anamon3
python_command="python3"
-elif [ -f /usr/libexec/platform-python ] ; then
+elif [ -f /usr/libexec/platform-python ] && \
+ /usr/libexec/platform-python --version 2>&1 | grep -q "Python 3" ; then
fetch /tmp/anamon http://lab.test-kickstart.invalid/beaker/anamon3
python_command="/usr/libexec/platform-python"
else
@@ -194,7 +195,8 @@ fi
if command -v python3 >/dev/null ; then
fetch /usr/local/sbin/anamon http://lab.test-kickstart.invalid/beaker/anamon3
-elif [ -f /usr/libexec/platform-python ] ; then
+elif [ -f /usr/libexec/platform-python ] && \
+ /usr/libexec/platform-python --version 2>&1 | grep -q "Python 3" ; then
fetch /usr/local/sbin/anamon http://lab.test-kickstart.invalid/beaker/anamon3
sed -i 's/#!\/usr\/bin\/python3/#!\/usr\/libexec\/platform-python/' /usr/local/sbin/anamon
else
diff --git a/IntegrationTests/src/bkr/inttest/server/kickstarts/RedHatEnterpriseLinux6-scheduler-manual.expected b/IntegrationTests/src/bkr/inttest/server/kickstarts/RedHatEnterpriseLinux6-scheduler-manual.expected
index b04c99f..75fc81b 100644
--- a/IntegrationTests/src/bkr/inttest/server/kickstarts/RedHatEnterpriseLinux6-scheduler-manual.expected
+++ b/IntegrationTests/src/bkr/inttest/server/kickstarts/RedHatEnterpriseLinux6-scheduler-manual.expected
@@ -45,7 +45,8 @@ fetch - http://lab.test-kickstart.invalid:8000/install_start/@RECIPEID@
if command -v python3 >/dev/null ; then
fetch /tmp/anamon http://lab.test-kickstart.invalid/beaker/anamon3
python_command="python3"
-elif [ -f /usr/libexec/platform-python ] ; then
+elif [ -f /usr/libexec/platform-python ] && \
+ /usr/libexec/platform-python --version 2>&1 | grep -q "Python 3" ; then
fetch /tmp/anamon http://lab.test-kickstart.invalid/beaker/anamon3
python_command="/usr/libexec/platform-python"
else
@@ -132,7 +133,8 @@ fi
if command -v python3 >/dev/null ; then
fetch /usr/local/sbin/anamon http://lab.test-kickstart.invalid/beaker/anamon3
-elif [ -f /usr/libexec/platform-python ] ; then
+elif [ -f /usr/libexec/platform-python ] && \
+ /usr/libexec/platform-python --version 2>&1 | grep -q "Python 3" ; then
fetch /usr/local/sbin/anamon http://lab.test-kickstart.invalid/beaker/anamon3
sed -i 's/#!\/usr\/bin\/python3/#!\/usr\/libexec\/platform-python/' /usr/local/sbin/anamon
else
diff --git a/IntegrationTests/src/bkr/inttest/server/kickstarts/RedHatEnterpriseLinux7-scheduler-defaults.expected b/IntegrationTests/src/bkr/inttest/server/kickstarts/RedHatEnterpriseLinux7-scheduler-defaults.expected
index ecbc752..496cbb9 100644
--- a/IntegrationTests/src/bkr/inttest/server/kickstarts/RedHatEnterpriseLinux7-scheduler-defaults.expected
+++ b/IntegrationTests/src/bkr/inttest/server/kickstarts/RedHatEnterpriseLinux7-scheduler-defaults.expected
@@ -105,7 +105,8 @@ fetch - http://lab.test-kickstart.invalid:8000/install_start/@RECIPEID@
if command -v python3 >/dev/null ; then
fetch /tmp/anamon http://lab.test-kickstart.invalid/beaker/anamon3
python_command="python3"
-elif [ -f /usr/libexec/platform-python ] ; then
+elif [ -f /usr/libexec/platform-python ] && \
+ /usr/libexec/platform-python --version 2>&1 | grep -q "Python 3" ; then
fetch /tmp/anamon http://lab.test-kickstart.invalid/beaker/anamon3
python_command="/usr/libexec/platform-python"
else
@@ -192,7 +193,8 @@ fi
if command -v python3 >/dev/null ; then
fetch /usr/local/sbin/anamon http://lab.test-kickstart.invalid/beaker/anamon3
-elif [ -f /usr/libexec/platform-python ] ; then
+elif [ -f /usr/libexec/platform-python ] && \
+ /usr/libexec/platform-python --version 2>&1 | grep -q "Python 3" ; then
fetch /usr/local/sbin/anamon http://lab.test-kickstart.invalid/beaker/anamon3
sed -i 's/#!\/usr\/bin\/python3/#!\/usr\/libexec\/platform-python/' /usr/local/sbin/anamon
else
diff --git a/IntegrationTests/src/bkr/inttest/server/kickstarts/RedHatEnterpriseLinux7-scheduler-manual.expected b/IntegrationTests/src/bkr/inttest/server/kickstarts/RedHatEnterpriseLinux7-scheduler-manual.expected
index 6d5d2ed..74fe736 100644
--- a/IntegrationTests/src/bkr/inttest/server/kickstarts/RedHatEnterpriseLinux7-scheduler-manual.expected
+++ b/IntegrationTests/src/bkr/inttest/server/kickstarts/RedHatEnterpriseLinux7-scheduler-manual.expected
@@ -44,7 +44,8 @@ fetch - http://lab.test-kickstart.invalid:8000/install_start/@RECIPEID@
if command -v python3 >/dev/null ; then
fetch /tmp/anamon http://lab.test-kickstart.invalid/beaker/anamon3
python_command="python3"
-elif [ -f /usr/libexec/platform-python ] ; then
+elif [ -f /usr/libexec/platform-python ] && \
+ /usr/libexec/platform-python --version 2>&1 | grep -q "Python 3" ; then
fetch /tmp/anamon http://lab.test-kickstart.invalid/beaker/anamon3
python_command="/usr/libexec/platform-python"
else
@@ -131,7 +132,8 @@ fi
if command -v python3 >/dev/null ; then
fetch /usr/local/sbin/anamon http://lab.test-kickstart.invalid/beaker/anamon3
-elif [ -f /usr/libexec/platform-python ] ; then
+elif [ -f /usr/libexec/platform-python ] && \
+ /usr/libexec/platform-python --version 2>&1 | grep -q "Python 3" ; then
fetch /usr/local/sbin/anamon http://lab.test-kickstart.invalid/beaker/anamon3
sed -i 's/#!\/usr\/bin\/python3/#!\/usr\/libexec\/platform-python/' /usr/local/sbin/anamon
else
diff --git a/IntegrationTests/src/bkr/inttest/server/kickstarts/RedHatEnterpriseLinuxServer5-scheduler-defaults.expected b/IntegrationTests/src/bkr/inttest/server/kickstarts/RedHatEnterpriseLinuxServer5-scheduler-defaults.expected
index 7b05550..acf5237 100644
--- a/IntegrationTests/src/bkr/inttest/server/kickstarts/RedHatEnterpriseLinuxServer5-scheduler-defaults.expected
+++ b/IntegrationTests/src/bkr/inttest/server/kickstarts/RedHatEnterpriseLinuxServer5-scheduler-defaults.expected
@@ -98,7 +98,8 @@ fetch - http://lab.test-kickstart.invalid:8000/install_start/@RECIPEID@
if command -v python3 >/dev/null ; then
fetch /tmp/anamon http://lab.test-kickstart.invalid/beaker/anamon3
python_command="python3"
-elif [ -f /usr/libexec/platform-python ] ; then
+elif [ -f /usr/libexec/platform-python ] && \
+ /usr/libexec/platform-python --version 2>&1 | grep -q "Python 3" ; then
fetch /tmp/anamon http://lab.test-kickstart.invalid/beaker/anamon3
python_command="/usr/libexec/platform-python"
else
@@ -183,7 +184,8 @@ fi
if command -v python3 >/dev/null ; then
fetch /usr/local/sbin/anamon http://lab.test-kickstart.invalid/beaker/anamon3
-elif [ -f /usr/libexec/platform-python ] ; then
+elif [ -f /usr/libexec/platform-python ] && \
+ /usr/libexec/platform-python --version 2>&1 | grep -q "Python 3" ; then
fetch /usr/local/sbin/anamon http://lab.test-kickstart.invalid/beaker/anamon3
sed -i 's/#!\/usr\/bin\/python3/#!\/usr\/libexec\/platform-python/' /usr/local/sbin/anamon
else
diff --git a/IntegrationTests/src/bkr/inttest/server/test_database_migration.py b/IntegrationTests/src/bkr/inttest/server/test_database_migration.py
index 65c431f..88b581c 100644
--- a/IntegrationTests/src/bkr/inttest/server/test_database_migration.py
+++ b/IntegrationTests/src/bkr/inttest/server/test_database_migration.py
@@ -10,6 +10,7 @@ import pkg_resources
import sqlalchemy
from turbogears import config
from turbogears.database import metadata
+from bkr.common import __version__
from bkr.server.tools.init import upgrade_db, downgrade_db, check_db, doit, \
init_db
from sqlalchemy.orm import create_session
@@ -103,6 +104,45 @@ class MigrationTest(unittest.TestCase):
downgrade_db(self.migration_metadata, '21.1-1.el6eng')
self.assertTrue(check_db(self.migration_metadata, '171c07fb4970'))
+ def test_can_downgrade_to_current_version(self):
+ # Downgrading to the current version should just be a no-op.
+ # The purpose of this to test is actually to make sure that beaker-init
+ # knows about the version number. If this test fails, it means we have
+ # tagged a new release but we forgot to record the schema version in
+ # the table that lives in beaker-init (and in the docs).
+ # It will also ensure that we have remembered to add a corresponding
+ # schema dump to the tests here.
+ #
+ # There is an added wrinkle. During the normal development cycle, on
+ # the develop branch our version will look like this:
+ # 26.0.git.82.3ffb9167e
+ # In this case, the database schema is not yet frozen and we do not
+ # expect to be able to downgrade to version 26 yet. Once a release
+ # candidate is tagged and the version becomes:
+ # 26.0rc1
+ # or on a maintenance branch like release-26, where the version is:
+ # 26.1.git.9.3ffb9167e
+ # the schema should be frozen and we should be able to downgrade to it.
+ # Therefore this test will check either the current major version or
+ # the previous major version based on the above conditions.
+ major, minor = __version__.split('.')[:2]
+ if minor == '0' and 'git' in __version__:
+ # schema is not frozen yet, test the previous major version
+ major_version_to_test = str(int(major) - 1)
+ else:
+ # schema should be frozen now
+ major_version_to_test = major
+ dump_filename = 'database-dumps/%s.sql' % major_version_to_test
+ if not pkg_resources.resource_exists('bkr.inttest.server', dump_filename):
+ raise AssertionError('Schema dump for version %s not found '
+ 'in IntegrationTests/src/bkr/inttest/server/database-dumps'
+ % major_version_to_test)
+ with self.migration_engine.connect() as connection:
+ connection.execute(pkg_resources.resource_string(
+ 'bkr.inttest.server', dump_filename))
+ downgrade_db(self.migration_metadata, major_version_to_test)
+ self.check_migrated_schema()
+
def test_full_upgrade(self):
with self.migration_engine.connect() as connection:
connection.execute(pkg_resources.resource_string('bkr.inttest.server',
diff --git a/LabController/aux/anamon b/LabController/aux/anamon
index 248f772..56901dd 100644
--- a/LabController/aux/anamon
+++ b/LabController/aux/anamon
@@ -18,10 +18,6 @@ import time
import re
import base64
import shlex
-try:
- from hashlib import md5
-except ImportError:
- from md5 import md5
# on older installers (EL 2) we might not have xmlrpclib
# and can't do logging, however this is more widely
@@ -86,15 +82,14 @@ class WatchedFile:
size = len(contents)
if size == 0:
break
- md5sum = md5(contents).hexdigest()
data = base64.encodestring(contents)
del contents
tries = 0
while tries <= retries:
debug("recipe_upload_file(%r, '/', %r, %r, %r, %r, ...)\n"
- % (recipe_id, self.alias, size, md5sum, ofs))
+ % (recipe_id, self.alias, size, '', ofs))
if session.recipe_upload_file(recipe_id, '/', self.alias,
- size, md5sum, ofs, data):
+ size, '', ofs, data):
break
else:
tries = tries + 1
diff --git a/Server/bkr/server/model/distrolibrary.py b/Server/bkr/server/model/distrolibrary.py
index 8dd4d00..8502e6f 100644
--- a/Server/bkr/server/model/distrolibrary.py
+++ b/Server/bkr/server/model/distrolibrary.py
@@ -122,6 +122,9 @@ def default_install_options_for_distro(osmajor_name, osminor, variant, arch):
ks_meta['yum'] = 'yum-2.2.2-1.rhts.EL3.noarch.rpm'
elif rhel == '4':
ks_meta['yum'] = 'yum-2.2.2-1.rhts.EL4.noarch.rpm'
+ # extra options for 'yum install' invocations
+ if rhel in ('3', '4'):
+ ks_meta['yum_install_extra_opts'] = '-d 1'
# mode
if rhel == '6':
ks_meta['mode'] = 'cmdline'
diff --git a/Server/bkr/server/snippets/beah b/Server/bkr/server/snippets/beah
index d4ddf48..04ba07f 100644
--- a/Server/bkr/server/snippets/beah
+++ b/Server/bkr/server/snippets/beah
@@ -1,7 +1,7 @@
-yum -y install {{ beah_rpm|default('beah') }} rhts-test-env
-yum -y install beakerlib
+yum{{ ' ' + yum_install_extra_opts if yum_install_extra_opts is defined else '' }} -y install {{ beah_rpm|default('beah') }} rhts-test-env
+yum{{ ' ' + yum_install_extra_opts if yum_install_extra_opts is defined else '' }} -y install beakerlib
# This may fail if you are outside of Red Hat..
-yum -y install beakerlib-redhat
+yum{{ ' ' + yum_install_extra_opts if yum_install_extra_opts is defined else '' }} -y install beakerlib-redhat
cp /etc/beah_beaker.conf{,.default}
cat << EOF > /etc/beah_beaker.conf
diff --git a/Server/bkr/server/snippets/harness b/Server/bkr/server/snippets/harness
index f9b360f..f5ca366 100644
--- a/Server/bkr/server/snippets/harness
+++ b/Server/bkr/server/snippets/harness
@@ -19,8 +19,8 @@ EOF
# the environment clean. (multilib_policy=best is the default in RHEL6+.)
cp -p /etc/yum.conf{,.orig}
echo multilib_policy=best >>/etc/yum.conf
-yum -y install {{ harness }}
+yum{{ ' ' + yum_install_extra_opts if yum_install_extra_opts is defined else '' }} -y install {{ harness }}
mv /etc/yum.conf{.orig,}
{% else %}
-yum -y install {{ harness }}
+yum{{ ' ' + yum_install_extra_opts if yum_install_extra_opts is defined else '' }} -y install {{ harness }}
{% endif %}
diff --git a/Server/bkr/server/snippets/post_anamon b/Server/bkr/server/snippets/post_anamon
index 6f68706..63bfebd 100644
--- a/Server/bkr/server/snippets/post_anamon
+++ b/Server/bkr/server/snippets/post_anamon
@@ -3,7 +3,8 @@
if command -v python3 >/dev/null ; then
fetch /usr/local/sbin/anamon {{ (anamon_url + '3')|shell_quoted }}
-elif [ -f /usr/libexec/platform-python ] ; then
+elif [ -f /usr/libexec/platform-python ] && \
+ /usr/libexec/platform-python --version 2>&1 | grep -q "Python 3" ; then
fetch /usr/local/sbin/anamon {{ (anamon_url + '3')|shell_quoted }}
sed -i 's/#!\/usr\/bin\/python3/#!\/usr\/libexec\/platform-python/' /usr/local/sbin/anamon
else
diff --git a/Server/bkr/server/snippets/pre_anamon b/Server/bkr/server/snippets/pre_anamon
index 1ec7365..5b5282f 100644
--- a/Server/bkr/server/snippets/pre_anamon
+++ b/Server/bkr/server/snippets/pre_anamon
@@ -3,7 +3,8 @@
if command -v python3 >/dev/null ; then
fetch /tmp/anamon {{ (anamon_url + '3')|shell_quoted }}
python_command="python3"
-elif [ -f /usr/libexec/platform-python ] ; then
+elif [ -f /usr/libexec/platform-python ] && \
+ /usr/libexec/platform-python --version 2>&1 | grep -q "Python 3" ; then
fetch /tmp/anamon {{ (anamon_url + '3')|shell_quoted }}
python_command="/usr/libexec/platform-python"
else
diff --git a/documentation/user-guide/customizing-installation.rst b/documentation/user-guide/customizing-installation.rst
index da500bc..3f6ed22 100644
--- a/documentation/user-guide/customizing-installation.rst
+++ b/documentation/user-guide/customizing-installation.rst
@@ -379,6 +379,15 @@ correspond to the similarly-named kickstart option.
Time zone to use. Default is ``America/New_York`` unless overridden by the
administrator.
+``yum_install_extra_opts``
+ Extra command-line options which will be passed to all invocations of ``yum
+ install`` which Beaker produces in the generated kickstart.
+
+ On RHEL3 and RHEL4 this variable defaults to "-d 1" which inhibits Yum's
+ progress bar made up of hashes which can take a long time to print. On
+ newer releases, where Yum's progress bar produces less output, this
+ variable is undefined.
+
.. _kickstart-metadata-distro-features:
Distro features