summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Styk <mastyk@redhat.com>2019-10-24 14:16:37 +0200
committerMartin Styk <mastyk@redhat.com>2019-10-24 14:16:37 +0200
commitf6da61ad955d6f4f77ccef723f7eb68068b957c2 (patch)
treee98b244009a63b30976ed4208e6e0704f752a135
parentfa8b5e11f99a9d0d6ce268dfec0282ed17a14e81 (diff)
parent52ab6b997adc38555dca2a32b56e18598b79ec52 (diff)
Merge branch 'release-26' into develop
Change-Id: Ic6ceb5fff8a6b8fad10e245bd994ff54ece67195 Signed-off-by: Martin Styk <mastyk@redhat.com>
-rw-r--r--Client/setup.py2
-rw-r--r--Client/src/bkr/client/tests/test_wizard.py22
-rwxr-xr-xClient/src/bkr/client/wizard.py16
-rw-r--r--Common/bkr/common/__init__.py2
-rw-r--r--Common/setup.py2
-rw-r--r--IntegrationTests/setup.py2
-rw-r--r--IntegrationTests/src/bkr/inttest/labcontroller/test_watchdog.py8
-rw-r--r--IntegrationTests/src/bkr/inttest/server/kickstarts/Fedorarawhide-scheduler-defaults.expected3
-rw-r--r--IntegrationTests/src/bkr/inttest/server/test_kickstart.py120
-rw-r--r--LabController/setup.py2
-rw-r--r--LabController/src/bkr/labcontroller/default.conf2
-rw-r--r--LabController/src/bkr/labcontroller/expire_distros.py95
-rwxr-xr-xLabController/src/bkr/labcontroller/power-scripts/apc_snmp6
-rwxr-xr-xLabController/src/bkr/labcontroller/power-scripts/wti6
-rw-r--r--Server/bkr/server/distro_family.py30
-rw-r--r--Server/bkr/server/model/distrolibrary.py26
-rw-r--r--Server/bkr/server/snippets/ssh_keys5
-rw-r--r--Server/setup.py2
-rw-r--r--beaker.spec5
-rw-r--r--documentation/user-guide/task-metadata.rst5
-rw-r--r--documentation/whats-new/release-26.rst23
21 files changed, 293 insertions, 91 deletions
diff --git a/Client/setup.py b/Client/setup.py
index e14146f..76bf278 100644
--- a/Client/setup.py
+++ b/Client/setup.py
@@ -22,7 +22,7 @@ def bash_completion_dir():
setup(
name='beaker-client',
- version='26.5',
+ version='26.6',
description='Command-line client for interacting with Beaker',
author='Red Hat, Inc.',
author_email='beaker-devel@lists.fedorahosted.org',
diff --git a/Client/src/bkr/client/tests/test_wizard.py b/Client/src/bkr/client/tests/test_wizard.py
index 3dbb593..d99e468 100644
--- a/Client/src/bkr/client/tests/test_wizard.py
+++ b/Client/src/bkr/client/tests/test_wizard.py
@@ -128,15 +128,29 @@ class DescTest(unittest.TestCase):
class ReleasesTest(unittest.TestCase):
- def setUp(self):
- self.options = options = wizard.Options([], load_user_prefs=False)
- self.releases = wizard.Releases(options)
-
# https://bugzilla.redhat.com/show_bug.cgi?id=1131429
def test_default_excludes_rhel4_rhel5(self):
+ self.options = options = wizard.Options([], load_user_prefs=False)
+ self.releases = wizard.Releases(options)
self.assertEqual(self.releases.data,
['-RHEL4', '-RHELClient5', '-RHELServer5'])
+ # https://bugzilla.redhat.com/show_bug.cgi?id=1704804
+ def test_long_spelled_out_RHEL_Name(self):
+ self.options = options = wizard.Options(['beaker-wizard', '-r', 'RedHatEnterpriseLinux8'],
+ load_user_prefs=False)
+ self.releases = wizard.Releases(options)
+ self.assertEqual(self.releases.data,
+ ['RedHatEnterpriseLinux8'])
+
+ # https://bugzilla.redhat.com/show_bug.cgi?id=1704804
+ def test_dashes_and_underscore(self):
+ self.options = options = wizard.Options(['beaker-wizard', '-r', 'Fedora-Cloud21-Alpha'],
+ load_user_prefs=False)
+ self.releases = wizard.Releases(options)
+ self.assertEqual(self.releases.data,
+ ['Fedora-Cloud21-Alpha'])
+
class TypeTest(unittest.TestCase):
diff --git a/Client/src/bkr/client/wizard.py b/Client/src/bkr/client/wizard.py
index 6c98ef2..01ad8c9 100755
--- a/Client/src/bkr/client/wizard.py
+++ b/Client/src/bkr/client/wizard.py
@@ -368,6 +368,7 @@ RegExpPackage = re.compile("^(?![._+-])[.a-zA-Z0-9_+-]+(?<![._-])$")
RegExpRhtsRequires = re.compile("^(?![._+-])[.a-zA-Z0-9_+-/()]+(?<![._-])$")
RegExpPath = re.compile("^(?![/-])[a-zA-Z0-9/_-]+(?<![/-])$")
RegExpTestName = re.compile("^(?!-)[a-zA-Z0-9-_]+(?<!-)$")
+RegExpReleases = re.compile("^(?!-)[a-zA-Z0-9-_]+(?<!-)$")
RegExpBug = re.compile("^\d+$")
RegExpBugLong = re.compile("^bz\d+$")
RegExpBugPrefix = re.compile("^bz")
@@ -1614,7 +1615,7 @@ class License(Inquisitor):
def init(self):
self.name = "License"
- self.question = "What licence should be used?"
+ self.question = "What license should be used?"
self.description = "Just supply a license GPLv2+, GPLv3+, ..."
self.common = False
self.default(self.options.license())
@@ -1731,11 +1732,12 @@ class Releases(MultipleChoice):
self.question = "Releases (choose one or more or \"all\")"
self.description = """One or more values separated with space or comma
or "all" for no limitaion. You can also use minus sign for excluding
- a specific release (-RHEL4)"""
+ a specific release (-RHEL4). Refer to Web UI Distro Family
+ selection for OSMajor alias name or if none provided use the
+ OSMajor Name"""
self.list = "RHEL2.1 RHEL3 RHEL4 RHELServer5 RHELClient5".split()
self.list += ["RHEL{0}".format(id) for id in range(6, 9)]
- self.list += "FC4 FC5 FC6".split()
- self.list += ["F{0}".format(release) for release in range(7, 28)]
+ self.list += ["F{0}".format(release) for release in range(7, 32)]
self.sort = True
self.common = False
self.emptyListMeaning = "All"
@@ -1743,7 +1745,11 @@ class Releases(MultipleChoice):
def validItem(self, item):
item = re.sub("^-","", item)
- return item in self.list
+ valid = item in self.list
+ if not valid:
+ return RegExpReleases.match(item)
+ else:
+ return valid
class Architectures(MultipleChoice):
diff --git a/Common/bkr/common/__init__.py b/Common/bkr/common/__init__.py
index 5835a79..887b797 100644
--- a/Common/bkr/common/__init__.py
+++ b/Common/bkr/common/__init__.py
@@ -2,4 +2,4 @@
# code in bkr.__init__), the version details are retrieved from here in
# order to correctly handle module shadowing on sys.path
-__version__ = '26.5'
+__version__ = '26.6'
diff --git a/Common/setup.py b/Common/setup.py
index c8143ea..c8278c4 100644
--- a/Common/setup.py
+++ b/Common/setup.py
@@ -12,7 +12,7 @@ from setuptools import setup, find_packages
setup(
name='beaker-common',
- version='26.5',
+ version='26.6',
description='Common components for Beaker packages',
author='Red Hat, Inc.',
author_email='beaker-devel@lists.fedorahosted.org',
diff --git a/IntegrationTests/setup.py b/IntegrationTests/setup.py
index 8ae0f44..27bcc1c 100644
--- a/IntegrationTests/setup.py
+++ b/IntegrationTests/setup.py
@@ -12,7 +12,7 @@ def get_compose_layout():
setup(
name='beaker-integration-tests',
- version='26.5',
+ version='26.6',
description='Integration tests for Beaker',
author='Red Hat, Inc.',
author_email='beaker-devel@lists.fedorahosted.org',
diff --git a/IntegrationTests/src/bkr/inttest/labcontroller/test_watchdog.py b/IntegrationTests/src/bkr/inttest/labcontroller/test_watchdog.py
index bc4c582..b04e2f0 100644
--- a/IntegrationTests/src/bkr/inttest/labcontroller/test_watchdog.py
+++ b/IntegrationTests/src/bkr/inttest/labcontroller/test_watchdog.py
@@ -370,3 +370,11 @@ def test_unrelated_Oops_string_is_not_detected_as_panic():
failure_found = detector.feed(line)
if failure_found:
raise AssertionError('False panic detection: %s' % failure_found)
+
+# https://bugzilla.redhat.com/show_bug.cgi?id=1719829
+def test_general_protection__user_space_is_not_detected_as_panic():
+ line = "kvm-01-guest19 login: [ 30.165967] traps: bz1172806[2463] general protection fault ip:804b000 sp:5aadc0de error:0 in bz1172806[8048000+5000] \n"
+ detector = PanicDetector(get_conf().get('PANIC_REGEX'))
+ failure_found = detector.feed(line)
+ if failure_found:
+ raise AssertionError('False panic detection: %s' % failure_found)
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 67dce5e..91ee900 100644
--- a/IntegrationTests/src/bkr/inttest/server/kickstarts/Fedorarawhide-scheduler-defaults.expected
+++ b/IntegrationTests/src/bkr/inttest/server/kickstarts/Fedorarawhide-scheduler-defaults.expected
@@ -345,6 +345,9 @@ setenv NFSSERVERS "RHEL3,rhel3-nfs.test-kickstart.invalid:/export/home RHEL4,rhe
setenv LOOKASIDE http://download.test-kickstart.invalid/lookaside/
setenv BUILDURL http://download.test-kickstart.invalid
EOF
+sed -i '/^#PermitRootLogin /s/^#//' /etc/ssh/sshd_config
+sed -i 's|PermitRootLogin .*|PermitRootLogin yes|' /etc/ssh/sshd_config
+systemctl restart sshd
# Disable rhts-compat for Fedora15/RHEL7 and newer.
cat >> /etc/profile.d/task-overrides-rhts.sh <<END
export RHTS_OPTION_COMPATIBLE=
diff --git a/IntegrationTests/src/bkr/inttest/server/test_kickstart.py b/IntegrationTests/src/bkr/inttest/server/test_kickstart.py
index a1925e1..51bb2a0 100644
--- a/IntegrationTests/src/bkr/inttest/server/test_kickstart.py
+++ b/IntegrationTests/src/bkr/inttest/server/test_kickstart.py
@@ -466,6 +466,28 @@ class KickstartTest(unittest.TestCase):
DistroTreeRepo(repo_id=u'debug', repo_type=u'debug', path=u'../debug'),
]
+ cls.f30 = data_setup.create_distro(
+ name=u'Fedora-30', osmajor=u'Fedora30', osminor=u'0')
+ cls.f30_x86_64 = data_setup.create_distro_tree(
+ distro=cls.f30, variant=u'Everything', arch=u'x86_64',
+ lab_controllers=[cls.lab_controller],
+ urls=[u'http://lab.test-kickstart.invalid/distros/F-30/GOLD/Everything/x86_64/os/',
+ u'nfs://lab.test-kickstart.invalid:/distros/F-30/GOLD/Everything/x86_64/os/'])
+ cls.f30_x86_64.repos[:] = [
+ DistroTreeRepo(repo_id=u'debug', repo_type=u'debug', path=u'../debug'),
+ ]
+
+ cls.f31 = data_setup.create_distro(
+ name=u'Fedora-31', osmajor=u'Fedora31', osminor=u'0')
+ cls.f31_x86_64 = data_setup.create_distro_tree(
+ distro=cls.f31, variant=u'Everything', arch=u'x86_64',
+ lab_controllers=[cls.lab_controller],
+ urls=[u'http://lab.test-kickstart.invalid/distros/F-31/GOLD/Everything/x86_64/os/',
+ u'nfs://lab.test-kickstart.invalid:/distros/F-31/GOLD/Everything/x86_64/os/'])
+ cls.f31_x86_64.repos[:] = [
+ DistroTreeRepo(repo_id=u'debug', repo_type=u'debug', path=u'../debug'),
+ ]
+
cls.frawhide = data_setup.create_distro(name=u'Fedora-rawhide',
osmajor=u'Fedorarawhide', osminor=u'0')
cls.frawhide_x86_64 = data_setup.create_distro_tree(
@@ -709,7 +731,7 @@ class KickstartTest(unittest.TestCase):
for line in recipe.installation.rendered_kickstart.kickstart.splitlines():
if line.startswith('repo'):
self.assert_(r'''--cost'''
- not in line,
+ not in line,
line)
def test_rhel6_defaults(self):
@@ -1322,6 +1344,76 @@ class KickstartTest(unittest.TestCase):
in recipe.installation.rendered_kickstart.kickstart.splitlines(),
recipe.installation.rendered_kickstart.kickstart)
+ def test_rhel8_root_ssh_snippet(self):
+ recipe = self.provision_recipe('''
+ <job>
+ <whiteboard/>
+ <recipeSet>
+ <recipe>
+ <distroRequires>
+ <distro_name op="=" value="RHEL-8.0-20181114.n.0" />
+ <distro_variant op="=" value="BaseOS" />
+ <distro_arch op="=" value="x86_64" />
+ </distroRequires>
+ <hostRequires/>
+ <task name="/distribution/install" />
+ <task name="/distribution/reservesys" />
+ </recipe>
+ </recipeSet>
+ </job>
+ ''', self.system)
+ self.assert_(r'''sed -i '/^#PermitRootLogin /s/^#//' /etc/ssh/sshd_config'''
+ not in recipe.installation.rendered_kickstart.kickstart.splitlines(),
+ recipe.installation.rendered_kickstart.kickstart)
+
+ def test_fedora30_root_ssh_snippet(self):
+ recipe = self.provision_recipe('''
+ <job>
+ <whiteboard/>
+ <recipeSet>
+ <recipe>
+ <distroRequires>
+ <distro_name op="=" value="Fedora-30" />
+ <distro_arch op="=" value="x86_64" />
+ </distroRequires>
+ <hostRequires/>
+ <task name="/distribution/install" />
+ <task name="/distribution/reservesys" />
+ </recipe>
+ </recipeSet>
+ </job>
+ ''', self.system)
+ self.assert_(r'''sed -i '/^#PermitRootLogin /s/^#//' /etc/ssh/sshd_config'''
+ not in recipe.installation.rendered_kickstart.kickstart.splitlines(),
+ recipe.installation.rendered_kickstart.kickstart)
+
+ def test_fedora31_root_ssh_snippet(self):
+ recipe = self.provision_recipe('''
+ <job>
+ <whiteboard/>
+ <recipeSet>
+ <recipe>
+ <distroRequires>
+ <distro_name op="=" value="Fedora-31" />
+ <distro_arch op="=" value="x86_64" />
+ </distroRequires>
+ <hostRequires/>
+ <task name="/distribution/install" />
+ <task name="/distribution/reservesys" />
+ </recipe>
+ </recipeSet>
+ </job>
+ ''', self.system)
+ self.assert_(r'''sed -i '/^#PermitRootLogin /s/^#//' /etc/ssh/sshd_config'''
+ in recipe.installation.rendered_kickstart.kickstart.splitlines(),
+ recipe.installation.rendered_kickstart.kickstart)
+ self.assert_(r'''sed -i 's|PermitRootLogin .*|PermitRootLogin yes|' /etc/ssh/sshd_config'''
+ in recipe.installation.rendered_kickstart.kickstart.splitlines(),
+ recipe.installation.rendered_kickstart.kickstart)
+ self.assert_(r'''systemctl restart sshd'''
+ in recipe.installation.rendered_kickstart.kickstart.splitlines(),
+ recipe.installation.rendered_kickstart.kickstart)
+
def test_fedora_rawhide_defaults(self):
recipe = self.provision_recipe('''
<job>
@@ -3009,12 +3101,12 @@ network --bootproto=dhcp --device=66:77:88:99:aa:bb
self.assert_(kickstart_lines.count('requires1') == 1)
def test_packages_ksmeta_replaces_recipe_packages(self):
- # Users can pass a colon-separated list of packages in ksmeta and it
- # will replace all the recipe packages (from <packages/> and task
+ # Users can pass a colon-separated list of packages in ksmeta and it
+ # will replace all the recipe packages (from <packages/> and task
# requirements).
- # This was never really intended behaviour (since it's not very
- # useful), it was just a side-effect of how Beaker passed recipe
- # packages to Cobbler through ksmeta. However to avoid breaking
+ # This was never really intended behaviour (since it's not very
+ # useful), it was just a side-effect of how Beaker passed recipe
+ # packages to Cobbler through ksmeta. However to avoid breaking
# compatibility we need to continue supporting it.
recipe = self.provision_recipe('''
<job>
@@ -3043,11 +3135,11 @@ httpd
# https://bugzilla.redhat.com/show_bug.cgi?id=952635
def test_task_requirements_with_colons_are_preserved(self):
- # Note that no package ever contains colons in its name, and a task
- # cannot use arbitrary RPM virtual requirements (like
- # perl(Archive::Tar) or similar), it has to depend on actual package
- # names because Anaconda only accepts real package names in %packages.
- # But, for completelness, we ensure colons are preserved as is in the
+ # Note that no package ever contains colons in its name, and a task
+ # cannot use arbitrary RPM virtual requirements (like
+ # perl(Archive::Tar) or similar), it has to depend on actual package
+ # names because Anaconda only accepts real package names in %packages.
+ # But, for completelness, we ensure colons are preserved as is in the
# kickstart.
task = data_setup.create_task(requires=[u'some::weird::package'])
recipe = self.provision_recipe('''
@@ -3148,8 +3240,8 @@ done
# https://bugzilla.redhat.com/show_bug.cgi?id=978640
def test_oats_api(self):
- # This is not a documented API at all, but OATS relies on
- # LAB_CONTROLLER being defined in /etc/profile.d/rh-env.sh and we don't
+ # This is not a documented API at all, but OATS relies on
+ # LAB_CONTROLLER being defined in /etc/profile.d/rh-env.sh and we don't
# want to break that.
recipe = self.provision_recipe('''
<job>
@@ -3512,7 +3604,7 @@ part /boot --recommended --asprimary --fstype ext4 --ondisk=vdb
# https://bugzilla.redhat.com/show_bug.cgi?id=1262098
def test_boot_partition_size(self):
- # On RHEL7 and later we just use --recommended, for earlier RHELs that
+ # On RHEL7 and later we just use --recommended, for earlier RHELs that
# doesn't work so we have to supply a size.
# We use fstype= here to trigger custom partitioning.
recipe = self.provision_recipe('''
diff --git a/LabController/setup.py b/LabController/setup.py
index fb1a505..5f3771a 100644
--- a/LabController/setup.py
+++ b/LabController/setup.py
@@ -49,7 +49,7 @@ else:
setup(
name='beaker-lab-controller',
- version='26.5',
+ version='26.6',
description='Daemons for controlling a Beaker lab',
author='Red Hat, Inc.',
author_email='beaker-devel@lists.fedorahosted.org',
diff --git a/LabController/src/bkr/labcontroller/default.conf b/LabController/src/bkr/labcontroller/default.conf
index cdc34d2..c2f9534 100644
--- a/LabController/src/bkr/labcontroller/default.conf
+++ b/LabController/src/bkr/labcontroller/default.conf
@@ -20,7 +20,7 @@ CACHEPATH = "/var/www/beaker/logs"
CONSOLE_LOGS = "/var/consoles"
# Regex pattern to use to find panics
-PANIC_REGEX = "Kernel panic|Oops[\s:[]|general protection fault|general protection handler: wrong gs|\(XEN\) Panic"
+PANIC_REGEX = "Kernel panic|Oops[\s:[]|general protection fault(?! ip:)|general protection handler: wrong gs|\(XEN\) Panic"
# Regex pattern which matches OS major names which do not support x86 EFI
EFI_EXCLUDED_OSMAJORS_REGEX = "RedHatEnterpriseLinux(3|4|Server5|Client5|ServerGrid5)|Fedora1[234567]"
diff --git a/LabController/src/bkr/labcontroller/expire_distros.py b/LabController/src/bkr/labcontroller/expire_distros.py
index 98d5210..69edd96 100644
--- a/LabController/src/bkr/labcontroller/expire_distros.py
+++ b/LabController/src/bkr/labcontroller/expire_distros.py
@@ -9,31 +9,38 @@ import xmlrpclib
import urllib2
import urlparse
+
def check_http(url):
try:
urllib2.urlopen(url, timeout=120)
return True
- except urllib2.HTTPError, e:
+ except urllib2.HTTPError as e:
if e.code in (404, 410):
return False
else:
raise
+
def check_ftp(url):
try:
urllib2.urlopen(url, timeout=120)
return True
- except urllib2.URLError, e:
+ except urllib2.URLError as e:
if '550' in e.reason:
return False
else:
raise
-class NFSServerInaccessible(ValueError): pass
+
+class NFSServerInaccessible(ValueError):
+ pass
+
def check_nfs(tree):
- """ Make sure the tree is accessible, check that the server is up first.
"""
+ Make sure the tree is accessible, check that the server is up first.
+ """
+
_, nfs_server, nfs_path, _, _, _ = urlparse.urlparse(tree)
# Beaker uses a non-standard syntax for NFS URLs, inherited from Cobbler:
# nfs://server:/path
@@ -45,16 +52,18 @@ def check_nfs(tree):
tree_path = os.path.join(server_path, nfs_path)
if not os.path.exists(server_path):
raise NFSServerInaccessible('Cannot access NFS server %s '
- 'or autofs not running (%s does not exist)'
- % (nfs_server, server_path))
+ 'or autofs not running (%s does not exist)'
+ % (nfs_server, server_path))
if not os.path.exists(tree_path):
return False
return True
+
def check_url(url):
"""
Returns True if the given URL exists.
"""
+
scheme = urlparse.urlparse(url).scheme
if scheme == 'nfs' or scheme.startswith('nfs+'):
return check_nfs(url)
@@ -65,43 +74,52 @@ def check_url(url):
else:
raise ValueError('Unrecognised URL scheme %s for tree %s' % (scheme, url))
-def check_all_trees(ignore_errors=False, dry_run=False):
- proxy = xmlrpclib.ServerProxy('http://localhost:8000', allow_none=True)
+
+def check_all_trees(ignore_errors=False,
+ dry_run=False,
+ lab_controller='http://localhost:8000',
+ remove_all=False):
+ proxy = xmlrpclib.ServerProxy(lab_controller, allow_none=True)
rdistro_trees = []
distro_trees = proxy.get_distro_trees()
- for distro_tree in distro_trees:
- accessable = False
- for lc, url in distro_tree['available']:
- try:
- if check_url(url):
- accessable = True
- else:
- print '%s is missing' % url
- except (urllib2.URLError, urllib2.HTTPError, NFSServerInaccessible), e:
- if ignore_errors:
- # suppress exception, assume the tree still exists
- accessable = True
- else:
- sys.stderr.write('Error checking for existence of URL %s '
- 'for distro tree %s:\n%s\n'
- % (url, distro_tree['distro_tree_id'], e))
- sys.exit(1)
- if not accessable:
- # All methods were unaccessable!
- rdistro_trees.append(distro_tree)
+ if not remove_all:
+ for distro_tree in distro_trees:
+ accessible = False
+ for lc, url in distro_tree['available']:
+ try:
+ if check_url(url):
+ accessible = True
+ else:
+ print('{0} is missing [Distro Tree ID {1}]'.format(
+ url,
+ distro_tree['distro_tree_id']))
+ except (urllib2.URLError, urllib2.HTTPError, NFSServerInaccessible) as e:
+ if ignore_errors:
+ # suppress exception, assume the tree still exists
+ accessible = True
+ else:
+ sys.stderr.write('Error checking for existence of URL %s '
+ 'for distro tree %s:\n%s\n'
+ % (url, distro_tree['distro_tree_id'], e))
+ sys.exit(1)
+ if not accessible:
+ # All methods were inaccessible!
+ rdistro_trees.append(distro_tree)
+ else:
+ rdistro_trees = distro_trees
# if all distro_trees are expired then something is probably wrong.
if len(distro_trees) != len(rdistro_trees):
for distro_tree in rdistro_trees:
if dry_run:
- print('No longer accessible distro %s:%d' % (distro_tree['distro_name'],
+ print('Distro marked for remove %s:%d' % (distro_tree['distro_name'],
distro_tree['distro_tree_id']))
else:
- print "Removing distro %s:%d" % (distro_tree['distro_name'],
- distro_tree['distro_tree_id'])
+ print('Removing distro %s:%d' % (distro_tree['distro_name'],
+ distro_tree['distro_tree_id']))
proxy.remove_distro_trees([distro_tree['distro_tree_id']])
else:
- sys.stderr.write("All distros are missing! Please check your server!!\n")
+ sys.stderr.write('All distros are missing! Please check your server!\n')
sys.exit(1)
@@ -109,12 +127,21 @@ def main():
from optparse import OptionParser
parser = OptionParser()
parser.add_option('--ignore-errors', default=False, action='store_true',
- help='Ignore all network errors when communicating with mirrors')
+ help='Ignore all network errors when communicating with mirrors.')
parser.add_option('--dry-run', default=False, action='store_true',
help='Prints no longer accessible distro without updating the database.')
+ parser.add_option('--lab-controller',
+ default='http://localhost:8000',
+ help='Specify which lab controller to import to. '
+ 'Defaults to http://localhost:8000.')
+ parser.add_option('--remove-all', default=False, action='store_true',
+ help='Remove all distros from lab controller.')
options, args = parser.parse_args()
try:
- check_all_trees(options.ignore_errors, options.dry_run)
+ check_all_trees(options.ignore_errors,
+ options.dry_run,
+ options.lab_controller,
+ options.remove_all)
except KeyboardInterrupt:
pass
diff --git a/LabController/src/bkr/labcontroller/power-scripts/apc_snmp b/LabController/src/bkr/labcontroller/power-scripts/apc_snmp
index 48418c9..d5f227c 100755
--- a/LabController/src/bkr/labcontroller/power-scripts/apc_snmp
+++ b/LabController/src/bkr/labcontroller/power-scripts/apc_snmp
@@ -4,4 +4,8 @@ if [ "$power_mode" == interrupt ] ; then
echo "interrupt not supported by apc_snmp" >&2
exit 1
fi
-fence_apc_snmp -v -a "$power_address" -n "$power_id" -o "$power_mode"
+# Handle one or more plug numbers
+# power_id must be a whitespace delimited list
+for plug in $power_id; do
+ fence_apc_snmp -a "$power_address" -n $plug -o "$power_mode"
+done \ No newline at end of file
diff --git a/LabController/src/bkr/labcontroller/power-scripts/wti b/LabController/src/bkr/labcontroller/power-scripts/wti
index 8dee0bc..270052e 100755
--- a/LabController/src/bkr/labcontroller/power-scripts/wti
+++ b/LabController/src/bkr/labcontroller/power-scripts/wti
@@ -4,4 +4,8 @@ if [ "$power_mode" == interrupt ] ; then
echo "interrupt not supported by wti" >&2
exit 1
fi
-fence_wti -v -a "$power_address" -n "$power_id" -p "$power_pass" -o "$power_mode"
+# Handle one or more plug numbers
+# power_id must be a whitespace delimited list
+for plug in $power_id ; do
+ fence_wti -a "$power_address" -n "$plug" -l "$power_user" -p "$power_pass" -o "$power_mode"
+done
diff --git a/Server/bkr/server/distro_family.py b/Server/bkr/server/distro_family.py
index c337f3b..0146719 100644
--- a/Server/bkr/server/distro_family.py
+++ b/Server/bkr/server/distro_family.py
@@ -8,17 +8,27 @@ from turbogears import expose, paginate
from bkr.server.osversion import OSVersions
from bkr.server.widgets import myPaginateDataGrid
-
class DistroFamily(OSVersions):
-
- @expose(template="bkr.server.templates.grid")
- @paginate('list',limit=50, default_order='osmajor.osmajor')
- def index(self,*args,**kw):
+
+ @expose(template="bkr.server.templates.grid")
+ @paginate('list', limit=50, default_order='osmajor.osmajor')
+ def index(self, *args, **kw):
template_data = self.osversions(*args, **kw)
template_data['search_bar'] = None
- template_data['grid'] = myPaginateDataGrid(fields=[
- myPaginateDataGrid.Column(name='osmajor.osmajor', getter=lambda x: x.osmajor, title='OS Major', options=dict(sortable=True)),
- myPaginateDataGrid.Column(name='osminor', getter=lambda x: x.osminor, title='OS Minor', options=dict(sortable=True)),
- myPaginateDataGrid.Column(name='arches', getter=lambda x: " ".join([arch.arch for arch in x.arches]), title='Arches', options=dict(sortable=True)),
- ])
+ template_data['grid'] = myPaginateDataGrid(
+ fields=[myPaginateDataGrid.Column(
+ name='osmajor.osmajor', getter=lambda x: x.osmajor,
+ title='OS Major', options=dict(sortable=True)),
+ myPaginateDataGrid.Column(
+ name='osmajor.alias', getter=lambda x: x.osmajor.alias,
+ title='Alias', options=dict(sortable=True)),
+ myPaginateDataGrid.Column(
+ name='osminor', getter=lambda x: x.osminor,
+ title='OS Minor', options=dict(sortable=True)),
+ myPaginateDataGrid.Column(
+ name='arches',
+ getter=lambda x: " ".join(
+ [arch.arch for arch in x.arches]),
+ title='Arches', options=dict(sortable=True)),
+ ])
return template_data
diff --git a/Server/bkr/server/model/distrolibrary.py b/Server/bkr/server/model/distrolibrary.py
index 9b30da1..e9b115e 100644
--- a/Server/bkr/server/model/distrolibrary.py
+++ b/Server/bkr/server/model/distrolibrary.py
@@ -35,7 +35,7 @@ def split_osmajor_name_version(osmajor):
def default_install_options_for_distro(osmajor_name, osminor, variant, arch):
"""
- Returns the default install options supplied by Beaker (rather than the
+ Returns the default install options supplied by Beaker (rather than the
admin) based on some hardcoded OS major names.
This is where installer feature test variables are populated.
"""
@@ -54,9 +54,9 @@ def default_install_options_for_distro(osmajor_name, osminor, variant, arch):
if name == 'Fedora':
fedora = version
- # We default to assuming all features are present, with features
- # conditionally turned off if needed. That way, unrecognised custom
- # distros will be assumed to support all features. The admin can
+ # We default to assuming all features are present, with features
+ # conditionally turned off if needed. That way, unrecognised custom
+ # distros will be assumed to support all features. The admin can
# override these in OS major or distro install options if necessary.
ks_meta = {}
@@ -154,7 +154,8 @@ def default_install_options_for_distro(osmajor_name, osminor, variant, arch):
]
else:
ks_meta['conflicts_groups'] = []
- #clearpart --cdl
+
+ # clearpart --cdl
if arch.arch == 's390x' and (rhel == '7' and int(osminor) >= 6
or rhel == '8' and int(osminor) >= 0):
ks_meta['has_clearpart_cdl'] = True
@@ -163,6 +164,11 @@ def default_install_options_for_distro(osmajor_name, osminor, variant, arch):
if (rhel and int(rhel) < 8) or (fedora and fedora != 'rawhide' and int(fedora) < 29):
ks_meta['has_ignoredisk_interactive'] = True
+ # Remove Fedora disabled root/password ssh combination
+ # introduced in Fedora 31
+ if fedora and (fedora == 'rawhide' or int(fedora) > 30):
+ ks_meta['disabled_root_access'] = True
+
kernel_options = {}
# set arch specific default netboot loader paths
# relative to the TFTP root directory
@@ -767,13 +773,13 @@ class DistroTree(DeclarativeMappedObject, ActivityMixin):
"""
Returns an absolute URL for this distro tree in the given lab.
- If *scheme* is a string, the URL returned will use that scheme. Callers
- can also pass a list of allowed schemes in order of preference; the URL
- returned will use one of them. If *scheme* is None or absent, any
+ If *scheme* is a string, the URL returned will use that scheme. Callers
+ can also pass a list of allowed schemes in order of preference; the URL
+ returned will use one of them. If *scheme* is None or absent, any
scheme will be used.
- If the *required* argument is false or absent, then None will be
- returned if this distro tree is not in the given lab. If *required* is
+ If the *required* argument is false or absent, then None will be
+ returned if this distro tree is not in the given lab. If *required* is
true, then an exception will be raised.
"""
if isinstance(scheme, basestring):
diff --git a/Server/bkr/server/snippets/ssh_keys b/Server/bkr/server/snippets/ssh_keys
index 7f4a98e..f4ee515 100644
--- a/Server/bkr/server/snippets/ssh_keys
+++ b/Server/bkr/server/snippets/ssh_keys
@@ -16,3 +16,8 @@ __EOF__
restorecon -R /root/.ssh
chmod go-w /root /root/.ssh /root/.ssh/authorized_keys
{% endif %}
+{% if disabled_root_access is defined %}
+sed -i '/^#PermitRootLogin /s/^#//' /etc/ssh/sshd_config
+sed -i 's|PermitRootLogin .*|PermitRootLogin yes|' /etc/ssh/sshd_config
+systemctl restart sshd
+{% endif %} \ No newline at end of file
diff --git a/Server/setup.py b/Server/setup.py
index 4c89135..be32f94 100644
--- a/Server/setup.py
+++ b/Server/setup.py
@@ -186,7 +186,7 @@ else:
setup(
name='beaker-server',
namespace_packages = ['bkr'],
- version='26.5',
+ version='26.6',
description='Beaker scheduler and web interface',
long_description=
'Beaker is a system for full stack software integration testing '
diff --git a/beaker.spec b/beaker.spec
index 0383af3..5f0ca01 100644
--- a/beaker.spec
+++ b/beaker.spec
@@ -20,10 +20,10 @@
# not representable in RPM. For example, a release candidate might be 0.15.0rc1
# but that is not usable for the RPM Version because it sorts higher than
# 0.15.0, so the RPM will have Version 0.15.0 and Release 0.rc1 in that case.
-%global upstream_version 26.5
+%global upstream_version 26.6
Name: beaker
-Version: 26.5
+Version: 26.6
Release: 1%{?dist}
Summary: Full-stack software and hardware integration testing system
Group: Applications/Internet
@@ -336,6 +336,7 @@ Requires: yum-utils
Requires: fence-agents
Requires: ipmitool
Requires: wsmancli
+Requires: /usr/bin/virsh
Requires: telnet
Requires: sudo
%if 0%{?fedora} == 29
diff --git a/documentation/user-guide/task-metadata.rst b/documentation/user-guide/task-metadata.rst
index a12d160..a2c33a1 100644
--- a/documentation/user-guide/task-metadata.rst
+++ b/documentation/user-guide/task-metadata.rst
@@ -326,8 +326,9 @@ menu. For example:
- Fedora17
Your Beaker administrator may have configured compatibility aliases for some OS
-versions, which you can also use in the ``Releases`` field. See
-:ref:`admin-os-versions` in the Administration Guide.
+versions, which you can also use in the ``Releases`` field. Refer to Distro->Family
+selection in the Web User Interface to review `alias to OSMajor name` mapping
+or :ref:`admin-os-versions` in the Administration Guide to modify alias names.
Requires
diff --git a/documentation/whats-new/release-26.rst b/documentation/whats-new/release-26.rst
index 92a93d2..ee611f3 100644
--- a/documentation/whats-new/release-26.rst
+++ b/documentation/whats-new/release-26.rst
@@ -297,4 +297,25 @@ Beaker 26.5
| (Contributed by Chris Beer)
.. internal workflow so it is not published in the release notes:
- :issue:`1707057`, `1693758` \ No newline at end of file
+ :issue:`1707057`, `1693758`
+
+Beaker 26.6
+~~~~~~~~~~~
+* | :issue:`1704804`: Extended beaker-wizard to accept full OSMajor distro names.
+ | (Contributed by Carol Bouchard)
+* | :issue:`1719829`: Watchdog no longer report user domain general protection fault
+ | as panic.
+ | (Contributed by Tomas Klohna)
+* | :issue:`1751105`: Added support to remove all distributions from Lab Controller.
+ | (Contributed by Martin Styk)
+* | :issue:`1758124`: Fedora 31+ disabled root password login in SSH. This patch
+ | enables it again to provide consistent experience on all systems under test.
+ | (Contributed by Martin Styk)
+* | :issue:`1724650`: Fixed race conditions between Python 2.6 and Python 2.7.
+ | (Contributed by Martin Styk)
+* | :issue:`1723303`: Power scripts :program:`apc_snmp` and :program:`wti` now
+ | supports multiple plugs.
+ | (Contributed by Martin Styk)
+* | :issue:`1720067`: Added support to run :program:`beaker-expire-distros` on
+ | non-local labcontroller.
+ | (Contributed by Martin Styk)