teuthology 1.1.0__py3-none-any.whl → 1.2.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- scripts/describe.py +1 -0
- scripts/dispatcher.py +55 -26
- scripts/exporter.py +18 -0
- scripts/lock.py +1 -1
- scripts/node_cleanup.py +58 -0
- scripts/openstack.py +9 -9
- scripts/results.py +12 -11
- scripts/schedule.py +4 -0
- scripts/suite.py +57 -16
- scripts/supervisor.py +44 -0
- scripts/update_inventory.py +10 -4
- teuthology/__init__.py +24 -26
- teuthology/beanstalk.py +4 -3
- teuthology/config.py +16 -6
- teuthology/contextutil.py +18 -14
- teuthology/describe_tests.py +25 -18
- teuthology/dispatcher/__init__.py +210 -35
- teuthology/dispatcher/supervisor.py +140 -58
- teuthology/exceptions.py +43 -0
- teuthology/exporter.py +347 -0
- teuthology/kill.py +76 -81
- teuthology/lock/cli.py +3 -3
- teuthology/lock/ops.py +135 -61
- teuthology/lock/query.py +61 -44
- teuthology/ls.py +1 -1
- teuthology/misc.py +61 -75
- teuthology/nuke/__init__.py +12 -353
- teuthology/openstack/__init__.py +4 -3
- teuthology/openstack/openstack-centos-7.0-user-data.txt +1 -1
- teuthology/openstack/openstack-centos-7.1-user-data.txt +1 -1
- teuthology/openstack/openstack-centos-7.2-user-data.txt +1 -1
- teuthology/openstack/openstack-debian-8.0-user-data.txt +1 -1
- teuthology/openstack/openstack-opensuse-42.1-user-data.txt +1 -1
- teuthology/openstack/openstack-teuthology.cron +0 -1
- teuthology/orchestra/cluster.py +49 -7
- teuthology/orchestra/connection.py +17 -4
- teuthology/orchestra/console.py +111 -50
- teuthology/orchestra/daemon/cephadmunit.py +15 -2
- teuthology/orchestra/daemon/state.py +8 -1
- teuthology/orchestra/daemon/systemd.py +4 -4
- teuthology/orchestra/opsys.py +30 -11
- teuthology/orchestra/remote.py +405 -338
- teuthology/orchestra/run.py +3 -3
- teuthology/packaging.py +19 -16
- teuthology/provision/__init__.py +30 -10
- teuthology/provision/cloud/openstack.py +12 -6
- teuthology/provision/cloud/util.py +1 -2
- teuthology/provision/downburst.py +4 -3
- teuthology/provision/fog.py +68 -20
- teuthology/provision/openstack.py +5 -4
- teuthology/provision/pelagos.py +1 -1
- teuthology/repo_utils.py +43 -13
- teuthology/report.py +57 -35
- teuthology/results.py +5 -3
- teuthology/run.py +13 -14
- teuthology/run_tasks.py +27 -43
- teuthology/schedule.py +4 -3
- teuthology/scrape.py +28 -22
- teuthology/suite/__init__.py +74 -45
- teuthology/suite/build_matrix.py +34 -24
- teuthology/suite/fragment-merge.lua +105 -0
- teuthology/suite/matrix.py +31 -2
- teuthology/suite/merge.py +175 -0
- teuthology/suite/placeholder.py +6 -9
- teuthology/suite/run.py +175 -100
- teuthology/suite/util.py +64 -218
- teuthology/task/__init__.py +1 -1
- teuthology/task/ansible.py +101 -32
- teuthology/task/buildpackages.py +2 -2
- teuthology/task/ceph_ansible.py +13 -6
- teuthology/task/cephmetrics.py +2 -1
- teuthology/task/clock.py +33 -14
- teuthology/task/exec.py +18 -0
- teuthology/task/hadoop.py +2 -2
- teuthology/task/install/__init__.py +29 -7
- teuthology/task/install/bin/adjust-ulimits +16 -0
- teuthology/task/install/bin/daemon-helper +114 -0
- teuthology/task/install/bin/stdin-killer +263 -0
- teuthology/task/install/deb.py +1 -1
- teuthology/task/install/rpm.py +17 -5
- teuthology/task/install/util.py +3 -3
- teuthology/task/internal/__init__.py +41 -10
- teuthology/task/internal/edit_sudoers.sh +10 -0
- teuthology/task/internal/lock_machines.py +2 -9
- teuthology/task/internal/redhat.py +31 -1
- teuthology/task/internal/syslog.py +31 -8
- teuthology/task/kernel.py +152 -145
- teuthology/task/lockfile.py +1 -1
- teuthology/task/mpi.py +10 -10
- teuthology/task/pcp.py +1 -1
- teuthology/task/selinux.py +16 -8
- teuthology/task/ssh_keys.py +4 -4
- teuthology/timer.py +3 -3
- teuthology/util/loggerfile.py +19 -0
- teuthology/util/scanner.py +159 -0
- teuthology/util/sentry.py +52 -0
- teuthology/util/time.py +52 -0
- teuthology-1.2.1.data/scripts/adjust-ulimits +16 -0
- teuthology-1.2.1.data/scripts/daemon-helper +114 -0
- teuthology-1.2.1.data/scripts/stdin-killer +263 -0
- teuthology-1.2.1.dist-info/METADATA +88 -0
- teuthology-1.2.1.dist-info/RECORD +168 -0
- {teuthology-1.1.0.dist-info → teuthology-1.2.1.dist-info}/WHEEL +1 -1
- {teuthology-1.1.0.dist-info → teuthology-1.2.1.dist-info}/entry_points.txt +3 -2
- scripts/nuke.py +0 -47
- scripts/worker.py +0 -37
- teuthology/lock/test/__init__.py +0 -0
- teuthology/lock/test/test_lock.py +0 -7
- teuthology/nuke/actions.py +0 -456
- teuthology/openstack/test/__init__.py +0 -0
- teuthology/openstack/test/openstack-integration.py +0 -286
- teuthology/openstack/test/test_config.py +0 -35
- teuthology/openstack/test/test_openstack.py +0 -1695
- teuthology/orchestra/test/__init__.py +0 -0
- teuthology/orchestra/test/integration/__init__.py +0 -0
- teuthology/orchestra/test/integration/test_integration.py +0 -94
- teuthology/orchestra/test/test_cluster.py +0 -240
- teuthology/orchestra/test/test_connection.py +0 -106
- teuthology/orchestra/test/test_console.py +0 -217
- teuthology/orchestra/test/test_opsys.py +0 -404
- teuthology/orchestra/test/test_remote.py +0 -185
- teuthology/orchestra/test/test_run.py +0 -286
- teuthology/orchestra/test/test_systemd.py +0 -54
- teuthology/orchestra/test/util.py +0 -12
- teuthology/task/tests/__init__.py +0 -110
- teuthology/task/tests/test_locking.py +0 -25
- teuthology/task/tests/test_run.py +0 -40
- teuthology/test/__init__.py +0 -0
- teuthology/test/fake_archive.py +0 -107
- teuthology/test/fake_fs.py +0 -92
- teuthology/test/integration/__init__.py +0 -0
- teuthology/test/integration/test_suite.py +0 -86
- teuthology/test/task/__init__.py +0 -205
- teuthology/test/task/test_ansible.py +0 -624
- teuthology/test/task/test_ceph_ansible.py +0 -176
- teuthology/test/task/test_console_log.py +0 -88
- teuthology/test/task/test_install.py +0 -337
- teuthology/test/task/test_internal.py +0 -57
- teuthology/test/task/test_kernel.py +0 -243
- teuthology/test/task/test_pcp.py +0 -379
- teuthology/test/task/test_selinux.py +0 -35
- teuthology/test/test_config.py +0 -189
- teuthology/test/test_contextutil.py +0 -68
- teuthology/test/test_describe_tests.py +0 -316
- teuthology/test/test_email_sleep_before_teardown.py +0 -81
- teuthology/test/test_exit.py +0 -97
- teuthology/test/test_get_distro.py +0 -47
- teuthology/test/test_get_distro_version.py +0 -47
- teuthology/test/test_get_multi_machine_types.py +0 -27
- teuthology/test/test_job_status.py +0 -60
- teuthology/test/test_ls.py +0 -48
- teuthology/test/test_misc.py +0 -391
- teuthology/test/test_nuke.py +0 -290
- teuthology/test/test_packaging.py +0 -763
- teuthology/test/test_parallel.py +0 -28
- teuthology/test/test_repo_utils.py +0 -225
- teuthology/test/test_report.py +0 -77
- teuthology/test/test_results.py +0 -155
- teuthology/test/test_run.py +0 -239
- teuthology/test/test_safepath.py +0 -55
- teuthology/test/test_schedule.py +0 -45
- teuthology/test/test_scrape.py +0 -167
- teuthology/test/test_timer.py +0 -80
- teuthology/test/test_vps_os_vers_parameter_checking.py +0 -84
- teuthology/test/test_worker.py +0 -303
- teuthology/worker.py +0 -354
- teuthology-1.1.0.dist-info/METADATA +0 -76
- teuthology-1.1.0.dist-info/RECORD +0 -213
- {teuthology-1.1.0.dist-info → teuthology-1.2.1.dist-info}/LICENSE +0 -0
- {teuthology-1.1.0.dist-info → teuthology-1.2.1.dist-info}/top_level.txt +0 -0
teuthology/task/kernel.py
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
Kernel installation task
|
3
3
|
"""
|
4
4
|
|
5
|
+
import contextlib
|
5
6
|
import logging
|
6
7
|
import os
|
7
8
|
import re
|
@@ -32,7 +33,7 @@ from teuthology.task.install.deb import install_dep_packages
|
|
32
33
|
|
33
34
|
log = logging.getLogger(__name__)
|
34
35
|
|
35
|
-
CONFIG_DEFAULT = {'branch': '
|
36
|
+
CONFIG_DEFAULT = {'branch': 'main'}
|
36
37
|
TIMEOUT_DEFAULT = 300
|
37
38
|
|
38
39
|
VERSION_KEYS = ['branch', 'tag', 'sha1', 'deb', 'rpm', 'koji', 'koji_task']
|
@@ -77,9 +78,10 @@ def normalize_config(ctx, config):
|
|
77
78
|
:param ctx: Context
|
78
79
|
:param config: Configuration
|
79
80
|
"""
|
81
|
+
log.info(f'normalize config orig: {config}')
|
80
82
|
if not config or \
|
81
83
|
len([x for x in config.keys() if x in
|
82
|
-
VERSION_KEYS + ['kdb', 'flavor']]) == len(config.keys()):
|
84
|
+
VERSION_KEYS + ['kdb', 'flavor', 'hwe']]) == len(config.keys()):
|
83
85
|
new_config = {}
|
84
86
|
if not config:
|
85
87
|
config = CONFIG_DEFAULT
|
@@ -99,6 +101,7 @@ def normalize_config(ctx, config):
|
|
99
101
|
# specific overrides generic
|
100
102
|
if name not in config:
|
101
103
|
new_config[name] = role_config.copy()
|
104
|
+
log.info(f'normalize config final: {new_config}')
|
102
105
|
return new_config
|
103
106
|
|
104
107
|
|
@@ -118,7 +121,6 @@ def normalize_and_apply_overrides(ctx, config, overrides):
|
|
118
121
|
if 'timeout' in config:
|
119
122
|
timeout = config.pop('timeout')
|
120
123
|
config = normalize_config(ctx, config)
|
121
|
-
log.debug('normalized config %s' % config)
|
122
124
|
|
123
125
|
if 'timeout' in overrides:
|
124
126
|
timeout = overrides.pop('timeout')
|
@@ -287,7 +289,7 @@ def install_firmware(ctx, config):
|
|
287
289
|
run.Raw('&&'),
|
288
290
|
'sudo', 'git', 'fetch', 'origin',
|
289
291
|
run.Raw('&&'),
|
290
|
-
'sudo', 'git', 'reset', '--hard', 'origin/
|
292
|
+
'sudo', 'git', 'reset', '--hard', 'origin/main'
|
291
293
|
],
|
292
294
|
)
|
293
295
|
|
@@ -480,7 +482,7 @@ def update_rh_kernel(remote):
|
|
480
482
|
log.info("Latest version already installed on %s", remote.shortname)
|
481
483
|
|
482
484
|
|
483
|
-
def install_and_reboot(ctx, config):
|
485
|
+
def install_and_reboot(ctx, need_install, config):
|
484
486
|
"""
|
485
487
|
Install and reboot the kernel. This mostly performs remote
|
486
488
|
installation operations. The code does check for Arm images
|
@@ -490,15 +492,16 @@ def install_and_reboot(ctx, config):
|
|
490
492
|
it expects kernel entries to be present under submenu entries.
|
491
493
|
|
492
494
|
:param ctx: Context
|
495
|
+
:param need_install: map from caller
|
493
496
|
:param config: Configuration
|
494
497
|
"""
|
495
498
|
procs = {}
|
496
499
|
kernel_title = ''
|
497
|
-
for role, src in
|
500
|
+
for role, src in need_install.items():
|
498
501
|
(role_remote,) = ctx.cluster.only(role).remotes.keys()
|
499
502
|
if isinstance(src, str) and src.find('distro') >= 0:
|
500
503
|
log.info('Installing distro kernel on {role}...'.format(role=role))
|
501
|
-
install_kernel(role_remote, version=src)
|
504
|
+
install_kernel(role_remote, config[role], version=src)
|
502
505
|
continue
|
503
506
|
|
504
507
|
log.info('Installing kernel {src} on {role}...'.format(src=src,
|
@@ -515,7 +518,7 @@ def install_and_reboot(ctx, config):
|
|
515
518
|
'--replacepkgs',
|
516
519
|
remote_pkg_path(role_remote),
|
517
520
|
])
|
518
|
-
install_kernel(role_remote, remote_pkg_path(role_remote))
|
521
|
+
install_kernel(role_remote, config[role], path=remote_pkg_path(role_remote))
|
519
522
|
continue
|
520
523
|
|
521
524
|
# TODO: Refactor this into install_kernel() so that it handles all
|
@@ -659,7 +662,7 @@ def enable_disable_kdb(ctx, config):
|
|
659
662
|
'sudo', 'tee', '/sys/module/kgdboc/parameters/kgdboc'
|
660
663
|
])
|
661
664
|
except run.CommandFailedError:
|
662
|
-
log.
|
665
|
+
log.warning('Kernel does not support kdb')
|
663
666
|
else:
|
664
667
|
log.info('Disabling kdb on {role}...'.format(role=role))
|
665
668
|
# Add true pipe so command doesn't fail on kernel without kdb support.
|
@@ -673,10 +676,10 @@ def enable_disable_kdb(ctx, config):
|
|
673
676
|
'true',
|
674
677
|
])
|
675
678
|
except run.CommandFailedError:
|
676
|
-
log.
|
679
|
+
log.warning('Kernel does not support kdb')
|
677
680
|
|
678
681
|
|
679
|
-
def wait_for_reboot(ctx, need_install, timeout, distro=False):
|
682
|
+
def wait_for_reboot(ctx, need_install, timeout, config, distro=False):
|
680
683
|
"""
|
681
684
|
Loop reconnecting and checking kernel versions until
|
682
685
|
they're all correct or the timeout is exceeded.
|
@@ -692,15 +695,15 @@ def wait_for_reboot(ctx, need_install, timeout, distro=False):
|
|
692
695
|
time.sleep(30)
|
693
696
|
starttime = time.time()
|
694
697
|
while need_install:
|
695
|
-
teuthology.reconnect(ctx, timeout)
|
696
698
|
for client in list(need_install.keys()):
|
697
699
|
if 'distro' in str(need_install[client]):
|
698
700
|
distro = True
|
699
701
|
log.info('Checking client {client} for new kernel version...'.format(client=client))
|
700
702
|
try:
|
703
|
+
(remote,) = ctx.cluster.only(client).remotes.keys()
|
704
|
+
remote.reconnect(timeout=timeout)
|
701
705
|
if distro:
|
702
|
-
(remote,
|
703
|
-
assert not need_to_install_distro(remote), \
|
706
|
+
assert not need_to_install_distro(remote, config[client]), \
|
704
707
|
'failed to install new distro kernel version within timeout'
|
705
708
|
|
706
709
|
else:
|
@@ -734,7 +737,7 @@ def get_version_of_running_kernel(remote):
|
|
734
737
|
return current
|
735
738
|
|
736
739
|
|
737
|
-
def need_to_install_distro(remote):
|
740
|
+
def need_to_install_distro(remote, role_config):
|
738
741
|
"""
|
739
742
|
Installing kernels on rpm won't setup grub/boot into them. This installs
|
740
743
|
the newest kernel package and checks its version and compares against
|
@@ -784,7 +787,7 @@ def need_to_install_distro(remote):
|
|
784
787
|
newest = get_latest_image_version_rpm(remote)
|
785
788
|
|
786
789
|
if package_type == 'deb':
|
787
|
-
newest = get_latest_image_version_deb(remote, dist_release)
|
790
|
+
newest = get_latest_image_version_deb(remote, dist_release, role_config)
|
788
791
|
|
789
792
|
if current in newest or current.replace('-', '_') in newest:
|
790
793
|
log.info('Newest distro kernel installed and running')
|
@@ -821,7 +824,7 @@ def maybe_generate_initrd_rpm(remote, path, version):
|
|
821
824
|
])
|
822
825
|
|
823
826
|
|
824
|
-
def install_kernel(remote, path=None, version=None):
|
827
|
+
def install_kernel(remote, role_config, path=None, version=None):
|
825
828
|
"""
|
826
829
|
A bit of misnomer perhaps - the actual kernel package is installed
|
827
830
|
elsewhere, this function deals with initrd and grub. Currently the
|
@@ -856,7 +859,7 @@ def install_kernel(remote, path=None, version=None):
|
|
856
859
|
return
|
857
860
|
|
858
861
|
if package_type == 'deb':
|
859
|
-
newversion = get_latest_image_version_deb(remote, dist_release)
|
862
|
+
newversion = get_latest_image_version_deb(remote, dist_release, role_config)
|
860
863
|
if 'ubuntu' in dist_release:
|
861
864
|
grub2conf = teuthology.get_file(remote,
|
862
865
|
'/boot/grub/grub.cfg', sudo=True).decode()
|
@@ -980,14 +983,14 @@ def generate_legacy_grub_entry(remote, newversion):
|
|
980
983
|
if re.match('^title', line):
|
981
984
|
titleline = line
|
982
985
|
titlelinenum = linenum
|
983
|
-
if re.match('(^\s+)root', line):
|
986
|
+
if re.match(r'(^\s+)root', line):
|
984
987
|
rootline = line
|
985
|
-
if re.match('(^\s+)kernel', line):
|
988
|
+
if re.match(r'(^\s+)kernel', line):
|
986
989
|
kernelline = line
|
987
990
|
for word in line.split(' '):
|
988
991
|
if 'vmlinuz' in word:
|
989
992
|
kernelversion = word.split('vmlinuz-')[-1]
|
990
|
-
if re.match('(^\s+)initrd', line):
|
993
|
+
if re.match(r'(^\s+)initrd', line):
|
991
994
|
initline = line
|
992
995
|
if (kernelline != '') and (initline != ''):
|
993
996
|
break
|
@@ -1030,8 +1033,9 @@ def get_image_version(remote, path):
|
|
1030
1033
|
raise UnsupportedPackageTypeError(remote)
|
1031
1034
|
|
1032
1035
|
for file in files.split('\n'):
|
1033
|
-
|
1034
|
-
|
1036
|
+
match = re.search(r'/lib/modules/(.*)/modules\.order$', file)
|
1037
|
+
if match:
|
1038
|
+
version = match.group(1)
|
1035
1039
|
break
|
1036
1040
|
|
1037
1041
|
log.debug("get_image_version: %s", version)
|
@@ -1050,9 +1054,9 @@ def get_latest_image_version_rpm(remote):
|
|
1050
1054
|
kernel_pkg_name = "kernel-default"
|
1051
1055
|
else:
|
1052
1056
|
kernel_pkg_name = "kernel"
|
1053
|
-
# get tip of package list ordered by
|
1057
|
+
# get tip of package list ordered by descending version
|
1054
1058
|
newest_package = remote.sh(
|
1055
|
-
'rpm -q %s
|
1059
|
+
'rpm -q %s | sort -rV | head -n 1' % kernel_pkg_name).strip()
|
1056
1060
|
for kernel in newest_package.split():
|
1057
1061
|
if kernel.startswith('kernel'):
|
1058
1062
|
if 'ceph' not in kernel:
|
@@ -1063,7 +1067,7 @@ def get_latest_image_version_rpm(remote):
|
|
1063
1067
|
return version
|
1064
1068
|
|
1065
1069
|
|
1066
|
-
def get_latest_image_version_deb(remote, ostype):
|
1070
|
+
def get_latest_image_version_deb(remote, ostype, role_config):
|
1067
1071
|
"""
|
1068
1072
|
Get kernel image version of the newest kernel deb package.
|
1069
1073
|
Used for distro case.
|
@@ -1089,26 +1093,16 @@ def get_latest_image_version_deb(remote, ostype):
|
|
1089
1093
|
return newest
|
1090
1094
|
# Ubuntu is a depend in a depend.
|
1091
1095
|
if 'ubuntu' in ostype:
|
1092
|
-
|
1093
|
-
|
1094
|
-
|
1095
|
-
|
1096
|
-
|
1097
|
-
|
1098
|
-
|
1099
|
-
|
1100
|
-
|
1101
|
-
|
1102
|
-
'install', depends])
|
1103
|
-
remote.run(args=['dpkg', '-s', depends], stdout=output)
|
1104
|
-
except run.CommandFailedError:
|
1105
|
-
# Non precise ubuntu machines (like trusty) don't have
|
1106
|
-
# linux-image-current-generic so use linux-image-generic instead.
|
1107
|
-
args=['sudo', 'DEBIAN_FRONTEND=noninteractive',
|
1108
|
-
'apt-get', '-y', 'install', 'linux-image-generic']
|
1109
|
-
install_dep_packages(remote, args)
|
1110
|
-
remote.run(args=['dpkg', '-s', 'linux-image-generic'],
|
1111
|
-
stdout=output)
|
1096
|
+
name = 'linux-image-generic'
|
1097
|
+
if role_config.get('hwe'):
|
1098
|
+
name = f'linux-image-generic-hwe-{remote.os.version}'
|
1099
|
+
|
1100
|
+
args=['sudo', 'DEBIAN_FRONTEND=noninteractive',
|
1101
|
+
'apt-get', '-y', 'install', name]
|
1102
|
+
install_dep_packages(remote, args)
|
1103
|
+
remote.run(args=['dpkg', '-s', name],
|
1104
|
+
stdout=output)
|
1105
|
+
|
1112
1106
|
for line in output.getvalue().split('\n'):
|
1113
1107
|
if 'Depends:' in line:
|
1114
1108
|
newest = line.split('linux-image-')[1]
|
@@ -1138,13 +1132,14 @@ def get_sha1_from_pkg_name(path):
|
|
1138
1132
|
return sha1
|
1139
1133
|
|
1140
1134
|
|
1135
|
+
@contextlib.contextmanager
|
1141
1136
|
def task(ctx, config):
|
1142
1137
|
"""
|
1143
1138
|
Make sure the specified kernel is installed.
|
1144
1139
|
This can be a branch, tag, or sha1 of ceph-client.git or a local
|
1145
1140
|
kernel package.
|
1146
1141
|
|
1147
|
-
To install ceph-client.git branch (default:
|
1142
|
+
To install ceph-client.git branch (default: main)::
|
1148
1143
|
|
1149
1144
|
kernel:
|
1150
1145
|
branch: testing
|
@@ -1213,7 +1208,7 @@ def task(ctx, config):
|
|
1213
1208
|
client.1:
|
1214
1209
|
branch: more_specific
|
1215
1210
|
osd.3:
|
1216
|
-
branch:
|
1211
|
+
branch: main
|
1217
1212
|
|
1218
1213
|
To wait 3 minutes for hosts to reboot (default: 300)::
|
1219
1214
|
|
@@ -1238,105 +1233,117 @@ def task(ctx, config):
|
|
1238
1233
|
validate_config(ctx, config)
|
1239
1234
|
log.info('config %s, timeout %d' % (config, timeout))
|
1240
1235
|
|
1241
|
-
|
1242
|
-
|
1243
|
-
|
1236
|
+
with parallel() as p:
|
1237
|
+
for role, role_config in config.items():
|
1238
|
+
p.spawn(process_role, ctx, config, timeout, role, role_config)
|
1244
1239
|
|
1245
|
-
|
1246
|
-
|
1247
|
-
|
1248
|
-
|
1249
|
-
if role_config.get('rpm') or role_config.get('deb'):
|
1250
|
-
# We only care about path - deb: vs rpm: is meaningless,
|
1251
|
-
# rpm: just happens to be parsed first. Nothing is stopping
|
1252
|
-
# 'deb: /path/to/foo.rpm' and it will work provided remote's
|
1253
|
-
# os.package_type is 'rpm' and vice versa.
|
1254
|
-
path = role_config.get('rpm')
|
1255
|
-
if not path:
|
1256
|
-
path = role_config.get('deb')
|
1257
|
-
sha1 = get_sha1_from_pkg_name(path)
|
1258
|
-
assert sha1, "failed to extract commit hash from path %s" % path
|
1259
|
-
if need_to_install(ctx, role, sha1):
|
1260
|
-
need_install[role] = path
|
1261
|
-
need_version[role] = sha1
|
1262
|
-
elif role_config.get('sha1') == 'distro':
|
1263
|
-
version = need_to_install_distro(role_remote)
|
1264
|
-
if version:
|
1265
|
-
need_install[role] = 'distro'
|
1266
|
-
need_version[role] = version
|
1267
|
-
elif role_config.get("koji") or role_config.get('koji_task'):
|
1268
|
-
# installing a kernel from koji
|
1269
|
-
build_id = role_config.get("koji")
|
1270
|
-
task_id = role_config.get("koji_task")
|
1271
|
-
if role_remote.os.package_type != "rpm":
|
1272
|
-
msg = (
|
1273
|
-
"Installing a kernel from koji is only supported "
|
1274
|
-
"on rpm based systems. System type is {system_type}."
|
1275
|
-
)
|
1276
|
-
msg = msg.format(system_type=system_type)
|
1277
|
-
log.error(msg)
|
1278
|
-
ctx.summary["failure_reason"] = msg
|
1279
|
-
ctx.summary["status"] = "dead"
|
1280
|
-
raise ConfigError(msg)
|
1281
|
-
|
1282
|
-
# FIXME: this install should probably happen somewhere else
|
1283
|
-
# but I'm not sure where, so we'll leave it here for now.
|
1284
|
-
install_package('koji', role_remote)
|
1285
|
-
|
1286
|
-
if build_id:
|
1287
|
-
# get information about this build from koji
|
1288
|
-
build_info = get_koji_build_info(build_id, role_remote, ctx)
|
1289
|
-
version = "{ver}-{rel}.x86_64".format(
|
1290
|
-
ver=build_info["version"],
|
1291
|
-
rel=build_info["release"]
|
1292
|
-
)
|
1293
|
-
elif task_id:
|
1294
|
-
# get information about results of this task from koji
|
1295
|
-
task_result = get_koji_task_result(task_id, role_remote, ctx)
|
1296
|
-
# this is not really 'build_info', it's a dict of information
|
1297
|
-
# about the kernel rpm from the task results, but for the sake
|
1298
|
-
# of reusing the code below I'll still call it that.
|
1299
|
-
build_info = get_koji_task_rpm_info(
|
1300
|
-
'kernel',
|
1301
|
-
task_result['rpms']
|
1302
|
-
)
|
1303
|
-
# add task_id so we can know later that we're installing
|
1304
|
-
# from a task and not a build.
|
1305
|
-
build_info["task_id"] = task_id
|
1306
|
-
version = build_info["version"]
|
1307
|
-
|
1308
|
-
if need_to_install(ctx, role, version):
|
1309
|
-
need_install[role] = build_info
|
1310
|
-
need_version[role] = version
|
1311
|
-
else:
|
1312
|
-
builder = get_builder_project()(
|
1313
|
-
"kernel",
|
1314
|
-
role_config,
|
1315
|
-
ctx=ctx,
|
1316
|
-
remote=role_remote,
|
1317
|
-
)
|
1318
|
-
sha1 = builder.sha1
|
1319
|
-
log.debug('sha1 for {role} is {sha1}'.format(role=role, sha1=sha1))
|
1320
|
-
ctx.summary['{role}-kernel-sha1'.format(role=role)] = sha1
|
1240
|
+
try:
|
1241
|
+
yield
|
1242
|
+
finally:
|
1243
|
+
pass
|
1321
1244
|
|
1322
|
-
if need_to_install(ctx, role, sha1):
|
1323
|
-
if teuth_config.use_shaman:
|
1324
|
-
version = builder.scm_version
|
1325
|
-
else:
|
1326
|
-
version = builder.version
|
1327
|
-
if not version:
|
1328
|
-
raise VersionNotFoundError(builder.base_url)
|
1329
|
-
need_install[role] = sha1
|
1330
|
-
need_version[role] = version
|
1331
1245
|
|
1332
|
-
|
1333
|
-
|
1334
|
-
|
1246
|
+
def process_role(ctx, config, timeout, role, role_config):
|
1247
|
+
need_install = None # sha1 to dl, or path to rpm or deb
|
1248
|
+
need_version = None # utsrelease or sha1
|
1335
1249
|
|
1336
|
-
|
1337
|
-
|
1338
|
-
|
1339
|
-
|
1340
|
-
|
1250
|
+
# gather information about this remote
|
1251
|
+
(role_remote,) = ctx.cluster.only(role).remotes.keys()
|
1252
|
+
system_type = role_remote.os.name
|
1253
|
+
if role_remote.is_container:
|
1254
|
+
log.info(f"Remote f{role_remote.shortname} is a container; skipping kernel installation")
|
1255
|
+
return
|
1256
|
+
if role_config.get('rpm') or role_config.get('deb'):
|
1257
|
+
# We only care about path - deb: vs rpm: is meaningless,
|
1258
|
+
# rpm: just happens to be parsed first. Nothing is stopping
|
1259
|
+
# 'deb: /path/to/foo.rpm' and it will work provided remote's
|
1260
|
+
# os.package_type is 'rpm' and vice versa.
|
1261
|
+
path = role_config.get('rpm')
|
1262
|
+
if not path:
|
1263
|
+
path = role_config.get('deb')
|
1264
|
+
sha1 = get_sha1_from_pkg_name(path)
|
1265
|
+
assert sha1, "failed to extract commit hash from path %s" % path
|
1266
|
+
if need_to_install(ctx, role, sha1):
|
1267
|
+
need_install = path
|
1268
|
+
need_version = sha1
|
1269
|
+
elif role_config.get('sha1') == 'distro':
|
1270
|
+
version = need_to_install_distro(role_remote, role_config)
|
1271
|
+
if version:
|
1272
|
+
need_install = 'distro'
|
1273
|
+
need_version = version
|
1274
|
+
elif role_config.get("koji") or role_config.get('koji_task'):
|
1275
|
+
# installing a kernel from koji
|
1276
|
+
build_id = role_config.get("koji")
|
1277
|
+
task_id = role_config.get("koji_task")
|
1278
|
+
if role_remote.os.package_type != "rpm":
|
1279
|
+
msg = (
|
1280
|
+
"Installing a kernel from koji is only supported "
|
1281
|
+
"on rpm based systems. System type is {system_type}."
|
1282
|
+
)
|
1283
|
+
msg = msg.format(system_type=system_type)
|
1284
|
+
log.error(msg)
|
1285
|
+
ctx.summary["failure_reason"] = msg
|
1286
|
+
ctx.summary["status"] = "dead"
|
1287
|
+
raise ConfigError(msg)
|
1288
|
+
|
1289
|
+
# FIXME: this install should probably happen somewhere else
|
1290
|
+
# but I'm not sure where, so we'll leave it here for now.
|
1291
|
+
install_package('koji', role_remote)
|
1292
|
+
|
1293
|
+
if build_id:
|
1294
|
+
# get information about this build from koji
|
1295
|
+
build_info = get_koji_build_info(build_id, role_remote, ctx)
|
1296
|
+
version = "{ver}-{rel}.x86_64".format(
|
1297
|
+
ver=build_info["version"],
|
1298
|
+
rel=build_info["release"]
|
1299
|
+
)
|
1300
|
+
elif task_id:
|
1301
|
+
# get information about results of this task from koji
|
1302
|
+
task_result = get_koji_task_result(task_id, role_remote, ctx)
|
1303
|
+
# this is not really 'build_info', it's a dict of information
|
1304
|
+
# about the kernel rpm from the task results, but for the sake
|
1305
|
+
# of reusing the code below I'll still call it that.
|
1306
|
+
build_info = get_koji_task_rpm_info(
|
1307
|
+
'kernel',
|
1308
|
+
task_result['rpms']
|
1309
|
+
)
|
1310
|
+
# add task_id so we can know later that we're installing
|
1311
|
+
# from a task and not a build.
|
1312
|
+
build_info["task_id"] = task_id
|
1313
|
+
version = build_info["version"]
|
1314
|
+
|
1315
|
+
if need_to_install(ctx, role, version):
|
1316
|
+
need_install = build_info
|
1317
|
+
need_version = version
|
1318
|
+
else:
|
1319
|
+
builder = get_builder_project()(
|
1320
|
+
"kernel",
|
1321
|
+
role_config,
|
1322
|
+
ctx=ctx,
|
1323
|
+
remote=role_remote,
|
1324
|
+
)
|
1325
|
+
sha1 = builder.sha1
|
1326
|
+
log.debug('sha1 for {role} is {sha1}'.format(role=role, sha1=sha1))
|
1327
|
+
ctx.summary['{role}-kernel-sha1'.format(role=role)] = sha1
|
1341
1328
|
|
1342
|
-
|
1329
|
+
if need_to_install(ctx, role, sha1):
|
1330
|
+
if teuth_config.use_shaman:
|
1331
|
+
version = builder.scm_version
|
1332
|
+
else:
|
1333
|
+
version = builder.version
|
1334
|
+
if not version:
|
1335
|
+
raise VersionNotFoundError(builder.base_url)
|
1336
|
+
need_install = sha1
|
1337
|
+
need_version = version
|
1338
|
+
|
1339
|
+
if need_install:
|
1340
|
+
install_firmware(ctx, {role: need_install})
|
1341
|
+
download_kernel(ctx, {role: need_install})
|
1342
|
+
install_and_reboot(ctx, {role: need_install}, config)
|
1343
|
+
wait_for_reboot(ctx, {role: need_version}, timeout, config)
|
1344
|
+
|
1345
|
+
# enable or disable kdb if specified, otherwise do not touch
|
1346
|
+
if role_config.get('kdb') is not None:
|
1347
|
+
kdb = role_config.get('kdb')
|
1348
|
+
enable_disable_kdb(ctx, {role: kdb})
|
1349
|
+
|
teuthology/task/lockfile.py
CHANGED
@@ -94,7 +94,7 @@ def task(ctx, config):
|
|
94
94
|
'wget',
|
95
95
|
'-nv',
|
96
96
|
'--no-check-certificate',
|
97
|
-
'https://raw.github.com/gregsfortytwo/FileLocker/
|
97
|
+
'https://raw.github.com/gregsfortytwo/FileLocker/main/sclockandhold.cpp',
|
98
98
|
'-O', '{tdir}/lockfile/sclockandhold.cpp'.format(tdir=testdir),
|
99
99
|
run.Raw('&&'),
|
100
100
|
'g++', '{tdir}/lockfile/sclockandhold.cpp'.format(tdir=testdir),
|
teuthology/task/mpi.py
CHANGED
@@ -18,7 +18,7 @@ def _check_mpi_version(remotes):
|
|
18
18
|
for remote in remotes:
|
19
19
|
version_str = remote.sh("mpiexec --version")
|
20
20
|
try:
|
21
|
-
version = re.search("^\s+Version:\s+(.+)$", version_str, re.MULTILINE).group(1)
|
21
|
+
version = re.search(r"^\s+Version:\s+(.+)$", version_str, re.MULTILINE).group(1)
|
22
22
|
except AttributeError:
|
23
23
|
raise RuntimeError("Malformed MPI version output: {0}".format(version_str))
|
24
24
|
else:
|
@@ -89,7 +89,7 @@ def task(ctx, config):
|
|
89
89
|
mpiexec = config['exec'].replace('$TESTDIR', testdir)
|
90
90
|
hosts = []
|
91
91
|
remotes = []
|
92
|
-
|
92
|
+
main_remote = None
|
93
93
|
if 'nodes' in config:
|
94
94
|
if isinstance(config['nodes'], str) and config['nodes'] == 'all':
|
95
95
|
for role in teuthology.all_roles(ctx.cluster):
|
@@ -97,17 +97,17 @@ def task(ctx, config):
|
|
97
97
|
ip,port = remote.ssh.get_transport().getpeername()
|
98
98
|
hosts.append(ip)
|
99
99
|
remotes.append(remote)
|
100
|
-
(
|
100
|
+
(main_remote,) = ctx.cluster.only(config['nodes'][0]).remotes.keys()
|
101
101
|
elif isinstance(config['nodes'], list):
|
102
102
|
for role in config['nodes']:
|
103
103
|
(remote,) = ctx.cluster.only(role).remotes.keys()
|
104
104
|
ip,port = remote.ssh.get_transport().getpeername()
|
105
105
|
hosts.append(ip)
|
106
106
|
remotes.append(remote)
|
107
|
-
(
|
107
|
+
(main_remote,) = ctx.cluster.only(config['nodes'][0]).remotes.keys()
|
108
108
|
else:
|
109
109
|
roles = ['client.{id}'.format(id=id_) for id_ in teuthology.all_roles_of_type(ctx.cluster, 'client')]
|
110
|
-
(
|
110
|
+
(main_remote,) = ctx.cluster.only(roles[0]).remotes.keys()
|
111
111
|
for role in roles:
|
112
112
|
(remote,) = ctx.cluster.only(role).remotes.keys()
|
113
113
|
ip,port = remote.ssh.get_transport().getpeername()
|
@@ -121,17 +121,17 @@ def task(ctx, config):
|
|
121
121
|
if 'workdir' in config:
|
122
122
|
workdir = ['-wdir', config['workdir'].replace('$TESTDIR', testdir) ]
|
123
123
|
|
124
|
-
log.info('mpi rank 0 is: {name}'.format(name=
|
124
|
+
log.info('mpi rank 0 is: {name}'.format(name=main_remote.name))
|
125
125
|
|
126
126
|
# write out the mpi hosts file
|
127
127
|
log.info('mpi nodes: [%s]' % (', '.join(hosts)))
|
128
|
-
teuthology.write_file(remote=
|
128
|
+
teuthology.write_file(remote=main_remote,
|
129
129
|
path='{tdir}/mpi-hosts'.format(tdir=testdir),
|
130
130
|
data='\n'.join(hosts))
|
131
|
-
log.info('mpiexec on {name}: {cmd}'.format(name=
|
131
|
+
log.info('mpiexec on {name}: {cmd}'.format(name=main_remote.name, cmd=mpiexec))
|
132
132
|
args=['mpiexec', '-f', '{tdir}/mpi-hosts'.format(tdir=testdir)]
|
133
133
|
args.extend(workdir)
|
134
134
|
args.extend(mpiexec.split(' '))
|
135
|
-
|
135
|
+
main_remote.run(args=args, )
|
136
136
|
log.info('mpi task completed')
|
137
|
-
|
137
|
+
main_remote.run(args=['rm', '{tdir}/mpi-hosts'.format(tdir=testdir)])
|
teuthology/task/pcp.py
CHANGED
teuthology/task/selinux.py
CHANGED
@@ -24,7 +24,7 @@ class SELinux(Task):
|
|
24
24
|
fail for other denials one can add the overrides with appropriate escapes
|
25
25
|
overrides:
|
26
26
|
selinux:
|
27
|
-
|
27
|
+
allowlist:
|
28
28
|
- 'name="cephtest"'
|
29
29
|
- 'dmidecode'
|
30
30
|
- 'comm="logrotate"'
|
@@ -53,6 +53,9 @@ class SELinux(Task):
|
|
53
53
|
if remote.is_vm:
|
54
54
|
msg = "Excluding {host}: VMs are not yet supported"
|
55
55
|
log.info(msg.format(host=remote.shortname))
|
56
|
+
elif remote.is_container:
|
57
|
+
msg = "Excluding {host}: containers are not yet supported"
|
58
|
+
log.info(msg.format(host=remote.shortname))
|
56
59
|
elif remote.os.name in ['opensuse', 'sle']:
|
57
60
|
msg = "Excluding {host}: \
|
58
61
|
SELinux is not supported for '{os}' os_type yet"
|
@@ -131,16 +134,21 @@ class SELinux(Task):
|
|
131
134
|
'comm="rpm"',
|
132
135
|
'tcontext=system_u:object_r:container_runtime_exec_t:s0',
|
133
136
|
'comm="ksmtuned"',
|
137
|
+
'comm="sssd"',
|
138
|
+
'comm="sss_cache"',
|
139
|
+
'context=system_u:system_r:NetworkManager_dispatcher_t:s0',
|
140
|
+
'context=system_u:system_r:getty_t:s0',
|
134
141
|
]
|
135
|
-
|
136
|
-
if
|
137
|
-
known_denials.extend(
|
138
|
-
|
142
|
+
se_allowlist = self.config.get('allowlist', [])
|
143
|
+
if se_allowlist:
|
144
|
+
known_denials.extend(se_allowlist)
|
145
|
+
get_denials_cmd = ['sudo', 'grep', '-a', 'avc: .*denied', '/var/log/audit/audit.log']
|
146
|
+
filter_denials_cmd = ['grep', '-av']
|
147
|
+
for known_denial in known_denials:
|
148
|
+
filter_denials_cmd.extend(['-e', known_denial])
|
139
149
|
for remote in self.cluster.remotes.keys():
|
140
150
|
proc = remote.run(
|
141
|
-
args=
|
142
|
-
'/var/log/audit/audit.log', run.Raw('|'), 'grep', '-av',
|
143
|
-
run.Raw(ignore_known_denials)],
|
151
|
+
args = get_denials_cmd + [run.Raw('|')] + filter_denials_cmd,
|
144
152
|
stdout=StringIO(),
|
145
153
|
check_status=False,
|
146
154
|
)
|
teuthology/task/ssh_keys.py
CHANGED
@@ -3,10 +3,10 @@
|
|
3
3
|
Ssh-key key handlers and associated routines
|
4
4
|
"""
|
5
5
|
import contextlib
|
6
|
+
import datetime
|
6
7
|
import logging
|
7
8
|
import paramiko
|
8
9
|
import re
|
9
|
-
from datetime import datetime
|
10
10
|
|
11
11
|
from io import StringIO
|
12
12
|
from teuthology import contextutil
|
@@ -21,7 +21,7 @@ def timestamp(format_='%Y-%m-%d_%H:%M:%S:%f'):
|
|
21
21
|
"""
|
22
22
|
Return a UTC timestamp suitable for use in filenames
|
23
23
|
"""
|
24
|
-
return datetime.
|
24
|
+
return datetime.datetime.now(datetime.timezone.utc).strftime(format_)
|
25
25
|
|
26
26
|
|
27
27
|
def backup_file(remote, path, sudo=False):
|
@@ -54,7 +54,7 @@ def particular_ssh_key_test(line_to_test, ssh_key):
|
|
54
54
|
"""
|
55
55
|
Check the validity of the ssh_key
|
56
56
|
"""
|
57
|
-
match = re.match('[\w-]+ {key} \S+@\S+'.format(key=re.escape(ssh_key)), line_to_test)
|
57
|
+
match = re.match(r'[\w-]+ {key} \S+@\S+'.format(key=re.escape(ssh_key)), line_to_test)
|
58
58
|
|
59
59
|
if match:
|
60
60
|
return False
|
@@ -65,7 +65,7 @@ def ssh_keys_user_line_test(line_to_test, username ):
|
|
65
65
|
"""
|
66
66
|
Check the validity of the username
|
67
67
|
"""
|
68
|
-
match = re.match('[\w-]+ \S+ {username}@\S+'.format(username=username), line_to_test)
|
68
|
+
match = re.match(r'[\w-]+ \S+ {username}@\S+'.format(username=username), line_to_test)
|
69
69
|
|
70
70
|
if match:
|
71
71
|
return False
|