curtin-dev team mailing list archive
-
curtin-dev team
-
Mailing list archive
-
Message #04196
[Merge] ~vinodcyamd/curtin/+git/curtin-1:rhcos_support into curtin:master
Vinod Chamunny has proposed merging ~vinodcyamd/curtin/+git/curtin-1:rhcos_support into curtin:master.
Requested reviews:
curtin developers (curtin-dev)
Related bugs:
Bug #1979280 in curtin: "Deploying Alma linux 9 - unsupported RHEL version"
https://bugs.launchpad.net/curtin/+bug/1979280
Bug #2090874 in curtin: "find_efi_loader is missing bindings for aarch64 artifacts"
https://bugs.launchpad.net/curtin/+bug/2090874
For more details, see:
https://code.launchpad.net/~vinodcyamd/curtin/+git/curtin-1/+merge/492845
--
Your team curtin developers is requested to review the proposed merge of ~vinodcyamd/curtin/+git/curtin-1:rhcos_support into curtin:master.
diff --git a/curtin/commands/__init__.py b/curtin/commands/__init__.py
index 51b91c6..2d784db 100644
--- a/curtin/commands/__init__.py
+++ b/curtin/commands/__init__.py
@@ -1,5 +1,6 @@
# This file is part of curtin. See LICENSE file for copyright and license info.
+
class MutuallyExclusiveGroup:
def __init__(self, entries) -> None:
self.entries = entries
diff --git a/curtin/commands/block_meta.py b/curtin/commands/block_meta.py
index 8dad729..8340946 100644
--- a/curtin/commands/block_meta.py
+++ b/curtin/commands/block_meta.py
@@ -1,7 +1,11 @@
# This file is part of curtin. See LICENSE file for copyright and license info.
from collections import OrderedDict, namedtuple
+<<<<<<< curtin/commands/block_meta.py
from curtin import (block, compat, config, paths, storage_actions, util)
+=======
+from curtin import (block, compat, config, paths, util)
+>>>>>>> curtin/commands/block_meta.py
from curtin.block import schemas
from curtin.block import (bcache, clear_holders, dasd, iscsi, lvm, mdadm, mkfs,
multipath, zfs)
@@ -679,10 +683,16 @@ class Device:
def image_handler(info, storage_config, context):
+<<<<<<< curtin/commands/block_meta.py
image: Image = storage_actions.asobject(info)
path = image.path
size = image.size
if image.preserve:
+=======
+ path = info['path']
+ size = int(util.human2bytes(info['size']))
+ if info.get('preserve', False):
+>>>>>>> curtin/commands/block_meta.py
actual_size = os.stat(path).st_size
if size != actual_size:
raise RuntimeError(
@@ -700,7 +710,11 @@ def image_handler(info, storage_config, context):
raise
cmd = ['losetup', '--show', '--find', path]
+<<<<<<< curtin/commands/block_meta.py
sector_size = image.sector_size
+=======
+ sector_size = int(util.human2bytes(info.get('sector_size', 512)))
+>>>>>>> curtin/commands/block_meta.py
if sector_size != 512:
compat.supports_large_sectors(fatal=True)
cmd.extend(('--sector-size', str(sector_size)))
diff --git a/curtin/commands/block_meta_v2.py b/curtin/commands/block_meta_v2.py
index c006f1a..5d218bf 100644
--- a/curtin/commands/block_meta_v2.py
+++ b/curtin/commands/block_meta_v2.py
@@ -1,10 +1,6 @@
# This file is part of curtin. See LICENSE file for copyright and license info.
import os
-from typing import (
- List,
- Optional,
- )
import attr
@@ -27,6 +23,7 @@ from curtin.storage_config import (
from curtin.udev import udevadm_settle
+<<<<<<< curtin/commands/block_meta_v2.py
def to_utf8_hex_notation(string: str) -> str:
''' Convert a string into a valid ASCII string where all characters outside
the alphanumerical range (according to bytes.isalnum()) are translated to
@@ -45,20 +42,23 @@ def to_utf8_hex_notation(string: str) -> str:
@attr.s(auto_attribs=True)
+=======
+@attr.s()
+>>>>>>> curtin/commands/block_meta_v2.py
class PartTableEntry:
# The order listed here matches the order sfdisk represents these fields
# when using the --dump argument.
- number: int
- start: int
- size: int
- type: str
- uuid: Optional[str]
+ number = attr.ib(default=None)
+ start = attr.ib(default=None)
+ size = attr.ib(default=None)
+ type = attr.ib(default=None)
+ uuid = attr.ib(default=None)
# name here is the sfdisk term - quoted descriptive text of the partition -
# not to be confused with what make_dname() does.
# Offered in the partition command as 'partition_name'.
- name: Optional[str]
- attrs: Optional[List[str]]
- bootable: bool = False
+ name = attr.ib(default=None)
+ attrs = attr.ib(default=None)
+ bootable = attr.ib(default=False)
def render(self):
r = '{}: '.format(self.number)
@@ -107,7 +107,11 @@ def resize_ext(path, size):
def resize_ntfs(path, size):
+<<<<<<< curtin/commands/block_meta_v2.py
util.subp(['ntfsresize', '--no-progress-bar', '-f', '-s', str(size), path],
+=======
+ util.subp(['ntfsresize', '-f', '-s', str(size), path],
+>>>>>>> curtin/commands/block_meta_v2.py
data=b'y\n',
capture=True)
@@ -149,8 +153,8 @@ class SFDiskPartTable:
self._sector_bytes = sector_bytes
if ONE_MIB_BYTES % sector_bytes != 0:
raise Exception(
- f"sector_bytes {sector_bytes} does not divide 1MiB, cannot "
- "continue!")
+ "sector_bytes {} does not divide 1MiB, cannot "
+ "continue!".format(sector_bytes))
self.one_mib_sectors = ONE_MIB_BYTES // sector_bytes
def bytes2sectors(self, amount):
diff --git a/curtin/commands/curthooks.py b/curtin/commands/curthooks.py
index 5032863..9a4d646 100644
--- a/curtin/commands/curthooks.py
+++ b/curtin/commands/curthooks.py
@@ -9,6 +9,7 @@ import platform
import re
import sys
import shutil
+import subprocess
import textwrap
from typing import List, Tuple
@@ -837,7 +838,12 @@ def setup_grub(
efi_orig_state = util.get_efibootmgr(target)
uefi_remove_old_loaders(bootcfg, target)
+<<<<<<< curtin/commands/curthooks.py
install_grub(instdevs, target, uefi=uefi_bootable, bootcfg=bootcfg)
+=======
+ LOG.warn("Grub Details : %s %s %s %s", instdevs, target, uefi_bootable, grubcfg)
+ install_grub(instdevs, target, uefi=uefi_bootable, grubcfg=grubcfg)
+>>>>>>> curtin/commands/curthooks.py
if uefi_bootable and update_nvram:
uefi_reorder_loaders(bootcfg, target, efi_orig_state, variant)
@@ -1417,7 +1423,8 @@ def install_missing_packages(cfg, target, osfamily=DISTROS.debian):
'pkg1': ['op_name_1', 'op_name_2', ...]
}
'''
- installed_packages = distro.get_installed_packages(target)
+ #installed_packages = distro.get_installed_packages(target)
+ installed_packages = []
needed_packages = set([pkg for pkg in
detect_required_packages(cfg, osfamily=osfamily)
if pkg not in installed_packages])
@@ -1495,12 +1502,12 @@ def install_missing_packages(cfg, target, osfamily=DISTROS.debian):
if needed_packages:
to_add = list(sorted(needed_packages))
state = util.load_command_environment()
- with events.ReportEventStack(
- name=state.get('report_stack_prefix'),
- reporting_enabled=True, level="INFO",
- description="Installing packages on target system: " +
- str(to_add)):
- distro.install_packages(to_add, target=target, osfamily=osfamily)
+ #with events.ReportEventStack(
+ # name=state.get('report_stack_prefix'),
+ # reporting_enabled=True, level="INFO",
+ # description="Installing packages on target system: " +
+ # str(to_add)):
+ # distro.install_packages(to_add, target=target, osfamily=osfamily)
def system_upgrade(cfg, target, osfamily=DISTROS.debian):
@@ -1641,6 +1648,7 @@ def configure_mdadm(cfg, state_etcd, target, osfamily=DISTROS.debian):
data=None, target=target)
+<<<<<<< curtin/commands/curthooks.py
def configure_nvme_over_tcp(cfg, target: pathlib.Path) -> None:
"""If any NVMe controller using the TCP transport is present in the storage
configuration, create a nvme-stas configuration and configure the initramfs
@@ -1693,6 +1701,8 @@ Pin-Priority: -1
nvme_tcp.configure_nvme_stas(cfg, target)
+=======
+>>>>>>> curtin/commands/curthooks.py
def configure_kernel_crash_dumps(cfg, target: pathlib.Path) -> None:
"""Configure kernel crash dumps on target system.
@@ -1705,7 +1715,11 @@ def configure_kernel_crash_dumps(cfg, target: pathlib.Path) -> None:
"""
kdump_cfg = cfg.get("kernel-crash-dumps", {})
+<<<<<<< curtin/commands/curthooks.py
enabled: bool = kdump_cfg.get("enabled")
+=======
+ enabled = kdump_cfg.get("enabled")
+>>>>>>> curtin/commands/curthooks.py
automatic = enabled is None
if automatic:
@@ -1716,6 +1730,7 @@ def configure_kernel_crash_dumps(cfg, target: pathlib.Path) -> None:
kernel_crash_dumps.manual_disable(target)
+<<<<<<< curtin/commands/curthooks.py
def flash_kernel_env():
env = os.environ.copy()
# recent flash_kernel has checks to prevent it running in cases
@@ -1738,6 +1753,8 @@ def reconfigure_kernel(target: pathlib.Path) -> None:
)
+=======
+>>>>>>> curtin/commands/curthooks.py
def handle_cloudconfig(cfg, base_dir=None):
"""write cloud-init configuration files into base_dir.
@@ -1947,12 +1964,12 @@ def redhat_update_initramfs(target, cfg):
kver_cmd = ['rpm', '-q', '--queryformat',
'%{VERSION}-%{RELEASE}.%{ARCH}', 'kernel']
with util.ChrootableTarget(target) as in_chroot:
- LOG.debug('Finding redhat kernel version: %s', kver_cmd)
+ LOG.info('Finding redhat kernel version: %s', kver_cmd)
kver, _err = in_chroot.subp(kver_cmd, capture=True)
- LOG.debug('Found kver=%s' % kver)
+ LOG.info('Found kver=%s' % kver)
initramfs = '/boot/initramfs-%s.img' % kver
dracut_cmd = ['dracut', '-f', initramfs, kver]
- LOG.debug('Rebuilding initramfs with: %s', dracut_cmd)
+ LOG.info('Rebuilding initramfs with: %s', dracut_cmd)
in_chroot.subp(dracut_cmd, capture=True)
@@ -1987,6 +2004,7 @@ def builtin_curthooks(cfg: dict, target: str, state: dict):
osfamily = distro_info.family
LOG.info('Configuring target system for distro: %s osfamily: %s',
distro_info.variant, osfamily)
+
if osfamily == DISTROS.debian:
with events.ReportEventStack(
name=stack_prefix + '/writing-apt-config',
@@ -2003,11 +2021,11 @@ def builtin_curthooks(cfg: dict, target: str, state: dict):
in_chroot.subp(['apt-mark', 'hold', 'zfs-dkms'])
# packages may be needed prior to installing kernel
- with events.ReportEventStack(
- name=stack_prefix + '/installing-missing-packages',
- reporting_enabled=True, level="INFO",
- description="installing missing packages"):
- install_missing_packages(cfg, target, osfamily=osfamily)
+ #with events.ReportEventStack(
+ # name=stack_prefix + '/installing-missing-packages',
+ # reporting_enabled=True, level="INFO",
+ # description="installing missing packages"):
+ # install_missing_packages(cfg, target, osfamily=osfamily)
with events.ReportEventStack(
name=stack_prefix + '/configuring-iscsi-service',
@@ -2129,6 +2147,17 @@ def builtin_curthooks(cfg: dict, target: str, state: dict):
copy_dname_rules(udev_rules_d, target)
# Setup kernel crash dumps
+<<<<<<< curtin/commands/curthooks.py
+=======
+ with events.ReportEventStack(
+ name=stack_prefix + "/configuring-kernel-crash-dumps",
+ reporting_enabled=True,
+ level="INFO",
+ description="configuring kernel crash dumps settings",
+ ):
+ configure_kernel_crash_dumps(cfg, pathlib.Path(target))
+
+>>>>>>> curtin/commands/curthooks.py
with events.ReportEventStack(
name=stack_prefix + "/configuring-kernel-crash-dumps",
reporting_enabled=True,
diff --git a/curtin/commands/install.py b/curtin/commands/install.py
index 9fb4116..f57ad23 100644
--- a/curtin/commands/install.py
+++ b/curtin/commands/install.py
@@ -112,16 +112,16 @@ def writeline(fname, output):
pass
-@attr.s(auto_attribs=True)
+@attr.s()
class WorkingDir:
- target: str
- top: str
- scratch: str
- interfaces: str
- netconf: str
- netstate: str
- fstab: str
- config_file: str
+ target = attr.ib()
+ top = attr.ib()
+ scratch = attr.ib()
+ interfaces = attr.ib()
+ netconf = attr.ib()
+ netstate = attr.ib()
+ fstab = attr.ib()
+ config_file = attr.ib()
@classmethod
def import_existing(cls, config):
diff --git a/curtin/kernel_crash_dumps.py b/curtin/kernel_crash_dumps.py
index 5012945..3d87760 100644
--- a/curtin/kernel_crash_dumps.py
+++ b/curtin/kernel_crash_dumps.py
@@ -4,7 +4,11 @@ from pathlib import Path
from curtin import distro
from curtin.log import LOG
+<<<<<<< curtin/kernel_crash_dumps.py
from curtin.util import ChrootableTarget
+=======
+from curtin.util import ChrootableTarget, ProcessExecutionError
+>>>>>>> curtin/kernel_crash_dumps.py
ENABLEMENT_SCRIPT = "/usr/share/kdump-tools/kdump_set_default"
@@ -38,6 +42,7 @@ def detection_script_available(target: Path) -> bool:
def manual_enable(target: Path) -> None:
"""Manually enable kernel crash dumps with kdump-tools on target."""
ensure_kdump_installed(target)
+<<<<<<< curtin/kernel_crash_dumps.py
if detection_script_available(target):
with ChrootableTarget(str(target)) as in_target:
in_target.subp([ENABLEMENT_SCRIPT, "true"])
@@ -52,6 +57,17 @@ def manual_enable(target: Path) -> None:
"kernel-crash-dumps enablement requested but enablement "
"script not found. Not running."
),
+=======
+ try:
+ with ChrootableTarget(str(target)) as in_target:
+ in_target.subp([ENABLEMENT_SCRIPT, "true"])
+ except ProcessExecutionError as exc:
+ # Likely the enablement script hasn't been SRU'd
+ # Let's not block the install on this.
+ LOG.warning(
+ "Unable to run kernel-crash-dumps enablement script: %s",
+ exc,
+>>>>>>> curtin/kernel_crash_dumps.py
)
diff --git a/curtin/util.py b/curtin/util.py
index 1390c51..b020b36 100644
--- a/curtin/util.py
+++ b/curtin/util.py
@@ -1421,6 +1421,7 @@ def not_exclusive_retry(fun, *args, **kwargs):
time.sleep(1)
return fun(*args, **kwargs)
+<<<<<<< curtin/util.py
class FlockEx:
"""Acquire an exclusive lock on device.
@@ -1460,4 +1461,6 @@ class FlockEx:
with suppress(Exception):
os.close(self.lock_fd)
+=======
+>>>>>>> curtin/util.py
# vi: ts=4 expandtab syntax=python
diff --git a/debian/control b/debian/control
index 590dd5a..7768df0 100644
--- a/debian/control
+++ b/debian/control
@@ -13,7 +13,10 @@ Build-Depends: debhelper (>= 7),
python3-jsonschema,
python3-nose,
python3-oauthlib,
+<<<<<<< debian/control
python3-packaging,
+=======
+>>>>>>> debian/control
python3-parameterized,
python3-setuptools,
python3-yaml
diff --git a/doc/topics/config.rst b/doc/topics/config.rst
index 7040909..32f72d0 100644
--- a/doc/topics/config.rst
+++ b/doc/topics/config.rst
@@ -545,6 +545,7 @@ directive may be ignored.
- xenial:
- 4.4.0: -my-custom-kernel
+<<<<<<< doc/topics/config.rst
# install this kernel if not yet installed,
# and remove other kernels if present
kernel:
@@ -556,6 +557,8 @@ directive may be ignored.
package: linux-image-generic-hwe-24.04
remove: ["linux-generic"]
+=======
+>>>>>>> doc/topics/config.rst
kernel-crash-dumps
~~~~~~~~~~~~~~~~~~
Configure how Curtin will configure kernel crash dumps in the target system
diff --git a/test-requirements.txt b/test-requirements.txt
index fd23867..b6cd69e 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -1,7 +1,11 @@
coverage
flake8
jsonschema
+<<<<<<< test-requirements.txt
parameterized
+=======
+mock
+>>>>>>> test-requirements.txt
pip
pyflakes
pytest
diff --git a/tests/integration/test_block_meta.py b/tests/integration/test_block_meta.py
index 0211e54..fe96575 100644
--- a/tests/integration/test_block_meta.py
+++ b/tests/integration/test_block_meta.py
@@ -1,20 +1,29 @@
# This file is part of curtin. See LICENSE file for copyright and license info.
-import dataclasses
-from dataclasses import dataclass
import contextlib
import json
import os
+<<<<<<< tests/integration/test_block_meta.py
from parameterized import parameterized
from pathlib import Path
+=======
+>>>>>>> tests/integration/test_block_meta.py
import re
import stat
import sys
+<<<<<<< tests/integration/test_block_meta.py
from typing import Optional
import tempfile
from unittest import skipIf
import yaml
+=======
+from unittest import skipIf
+import yaml
+
+import attr
+
+>>>>>>> tests/integration/test_block_meta.py
from curtin import block, compat, distro, log, udev, util
from curtin.commands.block_meta import _get_volume_fstype
from curtin.commands.block_meta_v2 import ONE_MIB_BYTES
@@ -41,22 +50,25 @@ def loop_dev(image, sector_size=512):
util.subp(['losetup', '--detach', dev])
-@dataclass(order=True)
+@attr.s(init=True, cmp=False)
class PartData:
- number: Optional[int] = None
- offset: Optional[int] = None
- size: Optional[int] = None
- boot: Optional[bool] = None
- partition_type: Optional[str] = None
+ number = attr.ib(default=None)
+ offset = attr.ib(default=None)
+ size = attr.ib(default=None)
+ boot = attr.ib(default=None)
+ partition_type = attr.ib(default=None)
# test cases may initialize the values they care about
# test utilities shall initialize all fields
def assertFieldsAreNotNone(self):
- for field in dataclasses.fields(self):
+ for field in attr.fields(self.__class__):
assert getattr(self, field.name) is not None
+ def __lt__(self, other):
+ return self.number < other.number
+
def __eq__(self, other):
- for field in dataclasses.fields(self):
+ for field in attr.fields(self.__class__):
myval = getattr(self, field.name)
otherval = getattr(other, field.name)
if myval is not None and otherval is not None \
@@ -67,7 +79,7 @@ class PartData:
def _get_ext_size(dev, part_action):
num = part_action['number']
- cmd = ['dumpe2fs', '-h', f'{dev}p{num}']
+ cmd = ['dumpe2fs', '-h', '{}p{}'.format(dev, num)]
out = util.subp(cmd, capture=True)[0]
for line in out.splitlines():
if line.startswith('Block count'):
@@ -82,7 +94,7 @@ def _get_ntfs_size(dev, part_action):
cmd = ['ntfsresize',
'--no-action',
'--force', # needed post-resize, which otherwise demands a CHKDSK
- '--info', f'{dev}p{num}']
+ '--info', '{}p{}'.format(dev, num)]
out = util.subp(cmd, capture=True)[0]
# Sample input:
# Current volume size: 41939456 bytes (42 MB)
@@ -104,7 +116,7 @@ _get_fs_sizers = {
def _get_filesystem_size(dev, part_action, fstype='ext4'):
if fstype not in _get_fs_sizers.keys():
- raise Exception(f'_get_filesystem_size: no support for {fstype}')
+ raise Exception('_get_filesystem_size: no support for %s' % fstype)
return _get_fs_sizers[fstype](dev, part_action)
@@ -127,7 +139,7 @@ def summarize_partitions(dev):
(unused, s_number, s_offset, s_size) = [
entry for entry in sysfs_data
if '/dev/' + entry[0] == node][0]
- assert node.startswith(f'{dev}p')
+ assert node.startswith(dev + 'p')
number = int(node[len(dev) + 1:])
ptype = part['type']
offset = part['start'] * sectorsize
@@ -218,13 +230,13 @@ class TestBlockMeta(IntegrationTestCase):
def mount(self, dev, partition_cfg):
mnt_point = self.tmp_dir()
num = partition_cfg['number']
- with util.mount(f'{dev}p{num}', mnt_point):
+ with util.mount('{}p{}'.format(dev, num), mnt_point):
yield mnt_point
@contextlib.contextmanager
def open_file_on_part(self, dev, part_action, mode):
with self.mount(dev, part_action) as mnt_point:
- with open(f'{mnt_point}/data.txt', mode) as fp:
+ with open(mnt_point + '/data.txt', mode) as fp:
yield fp
def create_data(self, dev, part_action):
@@ -244,7 +256,7 @@ class TestBlockMeta(IntegrationTestCase):
tolerance = 512 * 10
actual_fssize = _get_filesystem_size(dev, part_action, fstype)
diff = expected - actual_fssize
- self.assertTrue(0 <= diff <= tolerance, f'difference of {diff}')
+ self.assertTrue(0 <= diff <= tolerance, 'difference of ' + str(diff))
def run_bm(self, config, *args, **kwargs):
config_path = self.tmp_path('config.yaml')
@@ -646,7 +658,7 @@ subprocess.run(cmd, env=env)
}
with loop_dev(img) as dev:
try:
- self.run_bm(curtin_cfg, f'--devices={dev}', env=cmd_env)
+ self.run_bm(curtin_cfg, '--devices=' + dev, env=cmd_env)
finally:
util.subp(['umount', mnt_point])
udev.udevadm_settle()
@@ -666,7 +678,7 @@ subprocess.run(cmd, env=env)
fstype=fstype)
self.run_bm(config.render())
with loop_dev(img) as dev:
- self.assertEqual(fstype, _get_volume_fstype(f'{dev}p1'))
+ self.assertEqual(fstype, _get_volume_fstype(dev + 'p1'))
self.create_data(dev, p1)
self.assertEqual(
summarize_partitions(dev), [
@@ -695,7 +707,11 @@ subprocess.run(cmd, env=env)
p1['size'] = size
self.run_bm(config.render())
with loop_dev(img) as dev:
+<<<<<<< tests/integration/test_block_meta.py
self.assertEqual('ntfs', _get_volume_fstype(f'{dev}p1'))
+=======
+ self.assertEqual('ntfs', _get_volume_fstype(dev + 'p1'))
+>>>>>>> tests/integration/test_block_meta.py
self.create_data(dev, p1)
self.assertEqual(
summarize_partitions(dev), [
@@ -1003,11 +1019,11 @@ subprocess.run(cmd, env=env)
with self.mount(dev, p1) as mnt_point:
# Attempt to create files across the partition with gaps
for i in range(1, 41):
- with open(f'{mnt_point}/{str(i)}', 'wb') as fp:
+ with open('{}/{}'.format(mnt_point, i), 'wb') as fp:
fp.write(bytes([i]) * (2 << 20))
for i in range(1, 41):
if i % 5 != 0:
- os.remove(f'{mnt_point}/{str(i)}')
+ os.remove('{}/{}'.format(mnt_point, i))
config = StorageConfigBuilder(version=2)
config.add_image(path=img, size='100M', ptable='gpt')
@@ -1025,7 +1041,7 @@ subprocess.run(cmd, env=env)
])
with self.mount(dev, p1) as mnt_point:
for i in range(5, 41, 5):
- with open(f'{mnt_point}/{i}', 'rb') as fp:
+ with open('{}/{}'.format(mnt_point, i), 'rb') as fp:
self.assertEqual(bytes([i]) * (2 << 20), fp.read())
def test_parttype_dos(self):
@@ -1087,8 +1103,7 @@ subprocess.run(cmd, env=env)
PartData(number=4, offset=80 << 20, size=19 << 20,
partition_type=winre))
- @parameterized.expand([('msdos',), ('gpt',)])
- def test_disk_label_id_persistent(self, ptable):
+ def _test_disk_label_id_persistent(self, ptable):
# when the disk is preserved, the disk label id shall also be preserved
self.img = self.tmp_path('image.img')
config = StorageConfigBuilder(version=2)
@@ -1107,6 +1122,12 @@ subprocess.run(cmd, env=env)
with loop_dev(self.img) as dev:
self.assertEqual(orig_label_id, _get_disk_label_id(dev))
+ def test_disk_label_id_persistent_msdos(self):
+ self._test_disk_label_id_persistent('msdos')
+
+ def test_disk_label_id_persistent_gpt(self):
+ self._test_disk_label_id_persistent('gpt')
+
def test_gpt_uuid_persistent(self):
# A persistent partition with an unspecified uuid shall keep the uuid
self.img = self.tmp_path('image.img')
@@ -1143,12 +1164,16 @@ subprocess.run(cmd, env=env)
actual_name = sfdisk_info['partitions'][0]['name']
self.assertEqual(name, actual_name)
+<<<<<<< tests/integration/test_block_meta.py
@parameterized.expand([
('random', CiTestCase.random_string(),),
# "écrasé" means "overwritten"
('unicode', "'name' must not be écrasé/덮어쓴!"),
])
def test_gpt_name_persistent(self, title, name):
+=======
+ def _test_gpt_name_persistent(self, title, name):
+>>>>>>> tests/integration/test_block_meta.py
self.img = self.tmp_path('image.img')
config = StorageConfigBuilder(version=2)
config.add_image(path=self.img, size='20M', ptable='gpt')
@@ -1171,6 +1196,9 @@ subprocess.run(cmd, env=env)
actual_name = sfdisk_info['partitions'][0]['name']
self.assertEqual(name, actual_name)
+ def test_gpt_name_persistent_random(self):
+ self._test_gpt_name_persistent('random', CiTestCase.random_string())
+
def test_gpt_set_single_attr(self):
self.img = self.tmp_path('image.img')
config = StorageConfigBuilder(version=2)
@@ -1315,8 +1343,7 @@ table-length: 256'''.encode()
self.assertPartitions(
PartData(number=1, offset=1 << 20, size=1 << 20))
- @parameterized.expand(((1,), (2,)))
- def test_swap(self, sv):
+ def _test_swap(self, sv):
self.img = self.tmp_path('image.img')
config = StorageConfigBuilder(version=sv)
config.add_image(path=self.img, create=True, size='20M',
@@ -1328,6 +1355,7 @@ table-length: 256'''.encode()
PartData(number=1, offset=1 << 20, size=1 << 20, boot=False,
partition_type='82'))
+<<<<<<< tests/integration/test_block_meta.py
@parameterized.expand(((1,), (2,)))
def test_cryptoswap(self, sv=2):
self.img = self.tmp_path('image.img')
@@ -1430,3 +1458,10 @@ table-length: 256'''.encode()
for run in range(5):
self.run_bm(config.render())
self.assertPartitions(*parts)
+=======
+ def test_swap_sv1(self):
+ self._test_swap(1)
+
+ def test_swap_sv2(self):
+ self._test_swap(2)
+>>>>>>> tests/integration/test_block_meta.py
diff --git a/tests/integration/webserv.py b/tests/integration/webserv.py
index f4ce4e4..de30e04 100644
--- a/tests/integration/webserv.py
+++ b/tests/integration/webserv.py
@@ -1,8 +1,10 @@
# This file is part of curtin. See LICENSE file for copyright and license info.
-import threading
-import socketserver
from http.server import SimpleHTTPRequestHandler
+import socketserver
+import threading
+import os
+
from tests.vmtests.image_sync import IMAGE_DIR
@@ -12,7 +14,17 @@ class ThreadedTCPServer(socketserver.ThreadingMixIn, socketserver.TCPServer):
class ImageHTTPRequestHandler(SimpleHTTPRequestHandler):
def __init__(self, *args, **kwargs):
- super().__init__(*args, directory=IMAGE_DIR, **kwargs)
+ try:
+ super().__init__(*args, directory=IMAGE_DIR, **kwargs)
+ except TypeError:
+ # SimpleHTTPRequestHandler in python < 3.7 doesn't take a directory
+ # arg, fake it.
+ curdir = os.getcwd()
+ os.chdir(IMAGE_DIR)
+ try:
+ super().__init__(*args, **kwargs)
+ finally:
+ os.chdir(curdir)
class ImageServer:
@@ -50,4 +62,4 @@ class ImageServer:
if self.server is not None:
ip, port = self.server.server_address
- return f"http://{ip}:{port}"
+ return "http://{}:{}".format(ip, port)
diff --git a/tests/unittests/test_commands_block_meta.py b/tests/unittests/test_commands_block_meta.py
index bcf16d8..fbaaea7 100644
--- a/tests/unittests/test_commands_block_meta.py
+++ b/tests/unittests/test_commands_block_meta.py
@@ -3512,10 +3512,10 @@ label: gpt
table = block_meta_v2.GPTPartTable(512)
table.add(dict(number=1, offset=1 << 20, size=9 << 20,
flag='boot', partition_type=ptype))
- expected = f'''\
+ expected = '''\
label: gpt
-1: start=2048 size=18432 type={ptype}'''
+1: start=2048 size=18432 type={}'''.format(ptype)
self.assertEqual(expected, table.render())
def test_gpt_name(self):
@@ -3524,11 +3524,18 @@ label: gpt
table.add(dict(number=1, offset=1 << 20, size=9 << 20, flag='boot',
partition_name=name))
type_id = "C12A7328-F81F-11D2-BA4B-00A0C93EC93B"
+<<<<<<< tests/unittests/test_commands_block_meta.py
to_hex = block_meta_v2.to_utf8_hex_notation
expected = f'''\
label: gpt
1: start=2048 size=18432 type={type_id} name="{to_hex(name)}"'''
+=======
+ expected = '''\
+label: gpt
+
+1: start=2048 size=18432 type={} name="{}"'''.format(type_id, name)
+>>>>>>> tests/unittests/test_commands_block_meta.py
self.assertEqual(expected, table.render())
def test_gpt_name_free_text(self):
@@ -3542,10 +3549,14 @@ label: gpt
table.add(dict(number=1, offset=1 << 20, size=9 << 20, flag='boot',
partition_name=name))
type_id = "C12A7328-F81F-11D2-BA4B-00A0C93EC93B"
- expected = f'''\
+ expected = '''\
label: gpt
+<<<<<<< tests/unittests/test_commands_block_meta.py
1: start=2048 size=18432 type={type_id} name="{expected_name}"'''
+=======
+1: start=2048 size=18432 type={} name="{}"'''.format(type_id, name)
+>>>>>>> tests/unittests/test_commands_block_meta.py
self.assertEqual(expected, table.render())
def test_gpt_attrs_none(self):
@@ -3553,10 +3564,10 @@ label: gpt
table.add(dict(number=1, offset=1 << 20, size=9 << 20, flag='boot',
attrs=None))
type_id = "C12A7328-F81F-11D2-BA4B-00A0C93EC93B"
- expected = f'''\
+ expected = '''\
label: gpt
-1: start=2048 size=18432 type={type_id}'''
+1: start=2048 size=18432 type={}'''.format(type_id)
self.assertEqual(expected, table.render())
def test_gpt_attrs_empty(self):
@@ -3564,10 +3575,10 @@ label: gpt
table.add(dict(number=1, offset=1 << 20, size=9 << 20, flag='boot',
attrs=[]))
type_id = "C12A7328-F81F-11D2-BA4B-00A0C93EC93B"
- expected = f'''\
+ expected = '''\
label: gpt
-1: start=2048 size=18432 type={type_id}'''
+1: start=2048 size=18432 type={}'''.format(type_id)
self.assertEqual(expected, table.render())
def test_gpt_attrs_required(self):
@@ -3575,10 +3586,10 @@ label: gpt
table.add(dict(number=1, offset=1 << 20, size=9 << 20, flag='boot',
attrs=['RequiredPartition']))
type_id = "C12A7328-F81F-11D2-BA4B-00A0C93EC93B"
- expected = f'''\
+ expected = '''\
label: gpt
-1: start=2048 size=18432 type={type_id} attrs="RequiredPartition"'''
+1: start=2048 size=18432 type={} attrs="RequiredPartition"'''.format(type_id)
self.assertEqual(expected, table.render())
def test_gpt_attrs_bit(self):
@@ -3586,10 +3597,10 @@ label: gpt
table.add(dict(number=1, offset=1 << 20, size=9 << 20, flag='boot',
attrs=['GUID:51']))
type_id = "C12A7328-F81F-11D2-BA4B-00A0C93EC93B"
- expected = f'''\
+ expected = '''\
label: gpt
-1: start=2048 size=18432 type={type_id} attrs="GUID:51"'''
+1: start=2048 size=18432 type={} attrs="GUID:51"'''.format(type_id)
self.assertEqual(expected, table.render())
def test_gpt_attrs_multi(self):
@@ -3597,10 +3608,11 @@ label: gpt
table.add(dict(number=1, offset=1 << 20, size=9 << 20, flag='boot',
attrs=['RequiredPartition', 'GUID:51']))
type_id = "C12A7328-F81F-11D2-BA4B-00A0C93EC93B"
- expected = f'''\
+ attrs = 'RequiredPartition GUID:51'
+ expected = '''\
label: gpt
-1: start=2048 size=18432 type={type_id} attrs="RequiredPartition GUID:51"'''
+1: start=2048 size=18432 type={} attrs="{}"'''.format(type_id, attrs)
self.assertEqual(expected, table.render())
def test_dos_basic(self):
@@ -3624,10 +3636,10 @@ label: dos
table = block_meta_v2.DOSPartTable(512)
table.add(dict(number=1, offset=1 << 20, size=9 << 20,
flag='boot', partition_type=ptype))
- expected = f'''\
+ expected = '''\
label: dos
-1: start=2048 size=18432 type={ptype} bootable'''
+1: start=2048 size=18432 type={} bootable'''.format(ptype)
self.assertEqual(expected, table.render())
def test_preserve_labelid_gpt(self):
@@ -3723,21 +3735,26 @@ label: dos
number=1, start=2, size=3, type='04', bootable=True,
uuid=uuid, name='name',
attrs=['stuff', 'things'])
- expected = f'1: start=2 size=3 type=04 uuid={uuid} ' + \
+ expected = '1: start=2 size=3 type=04 uuid={} '.format(uuid) + \
'name="name" attrs="stuff things" bootable'
self.assertEqual(expected, pte.render())
def test_gpt_entry_preserve(self):
uuid = str(random_uuid())
name = self.random_string()
- attrs = f'{self.random_string()} {self.random_string()}'
+ attrs = '{} {}'.format(self.random_string(), self.random_string())
pte = block_meta_v2.PartTableEntry(
number=1, start=2, size=3, type='04', bootable=False,
uuid=None, name=None, attrs=None)
pte.preserve({'uuid': uuid, 'name': name, 'attrs': attrs})
+<<<<<<< tests/unittests/test_commands_block_meta.py
to_hex = block_meta_v2.to_utf8_hex_notation
expected = f'1: start=2 size=3 type=04 uuid={uuid} ' + \
f'name="{to_hex(name)}" attrs="{attrs}"'
+=======
+ expected = '1: start=2 size=3 type=04 uuid={} '.format(uuid) + \
+ 'name="{}" attrs="{}"'.format(name, attrs)
+>>>>>>> tests/unittests/test_commands_block_meta.py
self.assertEqual(expected, pte.render())
def test_v2_dos_is_logical(self):
diff --git a/tests/unittests/test_curthooks.py b/tests/unittests/test_curthooks.py
index 3153f0d..5abb48b 100644
--- a/tests/unittests/test_curthooks.py
+++ b/tests/unittests/test_curthooks.py
@@ -1176,7 +1176,10 @@ class TestSetupGrub(CiTestCase):
variant=self.variant)
logs = self.logs.getvalue()
print(logs)
+<<<<<<< tests/unittests/test_curthooks.py
print(self.mock_subp.call_args_list)
+=======
+>>>>>>> tests/unittests/test_curthooks.py
self.assertEqual([], self.mock_subp.call_args_list)
self.assertIn("Using fallback UEFI reordering:", logs)
self.assertIn("missing 'BootCurrent' value", logs)
@@ -1286,7 +1289,10 @@ class TestSetupGrub(CiTestCase):
variant=self.variant)
logs = self.logs.getvalue()
print(logs)
+<<<<<<< tests/unittests/test_curthooks.py
print(self.mock_subp.call_args_list)
+=======
+>>>>>>> tests/unittests/test_curthooks.py
self.assertEqual([
call(['efibootmgr', '-o', '0001,0000'], target=self.target)],
self.mock_subp.call_args_list)
@@ -1341,7 +1347,11 @@ class TestSetupGrub(CiTestCase):
print(logs)
print('Number of bootmgr calls: %s' % self.mock_efibootmgr.call_count)
self.assertEqual([
+<<<<<<< tests/unittests/test_curthooks.py
call(['efibootmgr', '-o', '%s' % (",".join(final_state.order))],
+=======
+ call(['efibootmgr', '-o', '%s' % (",".join(expected_order))],
+>>>>>>> tests/unittests/test_curthooks.py
target=self.target)],
self.mock_subp.call_args_list)
self.assertIn("Using fallback UEFI reordering:", logs)
@@ -1389,8 +1399,13 @@ class TestUefiRemoveDuplicateEntries(CiTestCase):
@patch.object(util.ChrootableTarget, "__enter__", new=lambda a: a)
def test_uefi_remove_duplicate_entries(self):
+<<<<<<< tests/unittests/test_curthooks.py
bootcfg = config.BootCfg(['grub'])
curthooks.uefi_remove_duplicate_entries(bootcfg, self.target)
+=======
+ grubcfg = {}
+ curthooks.uefi_remove_duplicate_entries(grubcfg, self.target)
+>>>>>>> tests/unittests/test_curthooks.py
self.assertEqual([
call(['efibootmgr', '--bootnum=0001', '--delete-bootnum'],
target=self.target),
@@ -1404,7 +1419,11 @@ class TestUefiRemoveDuplicateEntries(CiTestCase):
efiout = copy_efi_state(self.efibootmgr_output)
efiout.current = ''
self.m_efibootmgr.return_value = efiout
+<<<<<<< tests/unittests/test_curthooks.py
curthooks.uefi_remove_duplicate_entries(bootcfg, self.target)
+=======
+ curthooks.uefi_remove_duplicate_entries(grubcfg, self.target)
+>>>>>>> tests/unittests/test_curthooks.py
self.assertEqual([
call(['efibootmgr', '--bootnum=0001', '--delete-bootnum'],
target=self.target),
@@ -1414,8 +1433,15 @@ class TestUefiRemoveDuplicateEntries(CiTestCase):
@patch.object(util.ChrootableTarget, "__enter__", new=lambda a: a)
def test_uefi_remove_duplicate_entries_disabled(self):
+<<<<<<< tests/unittests/test_curthooks.py
bootcfg = config.BootCfg(['grub'], remove_duplicate_entries=False)
curthooks.uefi_remove_duplicate_entries(bootcfg, self.target)
+=======
+ grubcfg = {
+ 'remove_duplicate_entries': False,
+ }
+ curthooks.uefi_remove_duplicate_entries(grubcfg, self.target)
+>>>>>>> tests/unittests/test_curthooks.py
self.assertEqual([], self.m_subp.call_args_list)
@patch.object(util.ChrootableTarget, "__enter__", new=lambda a: a)
@@ -1424,7 +1450,11 @@ class TestUefiRemoveDuplicateEntries(CiTestCase):
efiout = copy_efi_state(self.efibootmgr_output)
efiout.current = '0003'
self.m_efibootmgr.return_value = efiout
+<<<<<<< tests/unittests/test_curthooks.py
curthooks.uefi_remove_duplicate_entries(bootcfg, self.target)
+=======
+ curthooks.uefi_remove_duplicate_entries(grubcfg, self.target)
+>>>>>>> tests/unittests/test_curthooks.py
self.assertEqual([
call(['efibootmgr', '--bootnum=0000', '--delete-bootnum'],
target=self.target),
@@ -1511,6 +1541,7 @@ class TestSetupExtlinux(CiTestCase):
]
}
}
+<<<<<<< tests/unittests/test_curthooks.py
for machine in ['i586', 'i686', 'x86_64']:
curthooks.setup_boot(
cfg, self.target, machine, '/testing',
@@ -1537,6 +1568,10 @@ class TestSetupExtlinux(CiTestCase):
self.m_install_extlinux.assert_not_called()
self.m_setup_grub.assert_not_called()
self.m_run_zipl.assert_not_called()
+=======
+ curthooks.uefi_remove_duplicate_entries(grubcfg, self.target)
+ self.assertEqual([], self.m_subp.call_args_list)
+>>>>>>> tests/unittests/test_curthooks.py
class TestUbuntuCoreHooks(CiTestCase):
@@ -2762,20 +2797,22 @@ class TestDoAptConfig(CiTestCase):
def test_apt_config_dict(self):
with patch(self.handle_apt_sym) as m_handle_apt:
curthooks.do_apt_config({"apt": {}}, target="/")
- m_handle_apt.assert_called()
+ m_handle_apt.assert_any_call({}, '/')
def test_with_apt_config(self):
with patch(self.handle_apt_sym) as m_handle_apt:
curthooks.do_apt_config(
{"apt": {"proxy": {"http_proxy": "http://proxy:3128"}}},
target="/")
- m_handle_apt.assert_called_once()
+ m_handle_apt.assert_any_call(
+ {'proxy': {'http_proxy': 'http://proxy:3128'}}, '/')
def test_with_debconf_selections(self):
# debconf_selections are translated to apt config
with patch(self.handle_apt_sym) as m_handle_apt:
curthooks.do_apt_config({"debconf_selections": "foo"}, target="/")
- m_handle_apt.assert_called_once()
+ m_handle_apt.assert_any_call({'debconf_selections': 'foo'}, '/')
+
class TestDpkgReconfigure(CiTestCase):
diff --git a/tests/unittests/test_distro.py b/tests/unittests/test_distro.py
index f38b3a7..5bb96e3 100644
--- a/tests/unittests/test_distro.py
+++ b/tests/unittests/test_distro.py
@@ -311,7 +311,7 @@ class TestAptInstall(CiTestCase):
]
distro.run_apt_command('install', ['foobar', 'wark'])
- m_apt_update.assert_called_once()
+ self.assertEqual(1, m_apt_update.call_count)
m_apt_install.assert_has_calls(expected_calls)
m_subp.assert_called_once_with(['apt-get', 'clean'], target='/')
@@ -321,7 +321,7 @@ class TestAptInstall(CiTestCase):
# no clean option
distro.run_apt_command('install', ['foobar', 'wark'], clean=False)
- m_apt_update.assert_called_once()
+ self.assertEqual(1, m_apt_update.call_count)
m_subp.assert_has_calls(expected_calls[:-1])
@mock.patch.object(util.ChrootableTarget, "__enter__", new=lambda a: a)
@@ -334,11 +334,11 @@ class TestAptInstall(CiTestCase):
]
expected_calls = [
- mock.call(cmd_prefix + ['install', '--download-only']
- + ['foobar', 'wark'],
+ mock.call(cmd_prefix +
+ ['install', '--download-only'] +
+ ['foobar', 'wark'],
env=None, target='/', retries=None),
- mock.call(cmd_prefix + ['install']
- + ['foobar', 'wark'],
+ mock.call(cmd_prefix + ['install', 'foobar', 'wark'],
env=None, target='/'),
]
diff --git a/tests/unittests/test_kernel_crash_dumps.py b/tests/unittests/test_kernel_crash_dumps.py
index 5747100..a878958 100644
--- a/tests/unittests/test_kernel_crash_dumps.py
+++ b/tests/unittests/test_kernel_crash_dumps.py
@@ -3,14 +3,20 @@
from pathlib import Path
from unittest.mock import MagicMock, patch
+<<<<<<< tests/unittests/test_kernel_crash_dumps.py
from parameterized import parameterized
+=======
+>>>>>>> tests/unittests/test_kernel_crash_dumps.py
from curtin.commands.curthooks import configure_kernel_crash_dumps
from curtin.kernel_crash_dumps import (ENABLEMENT_SCRIPT, automatic_detect,
detection_script_available,
ensure_kdump_installed, manual_disable,
manual_enable)
+<<<<<<< tests/unittests/test_kernel_crash_dumps.py
from curtin.util import ProcessExecutionError
+=======
+>>>>>>> tests/unittests/test_kernel_crash_dumps.py
from tests.unittests.helpers import CiTestCase
@@ -19,17 +25,21 @@ from tests.unittests.helpers import CiTestCase
@patch("curtin.kernel_crash_dumps.automatic_detect")
class TestKernelCrashDumpsCurthook(CiTestCase):
+<<<<<<< tests/unittests/test_kernel_crash_dumps.py
@parameterized.expand(
(
({"kernel-crash-dumps": {}},),
({"kernel-crash-dumps": {"enabled": None}},),
)
)
+=======
+>>>>>>> tests/unittests/test_kernel_crash_dumps.py
def test_config__automatic(
self,
auto_mock,
enable_mock,
disable_mock,
+<<<<<<< tests/unittests/test_kernel_crash_dumps.py
config,
):
"""Test expected automatic configs."""
@@ -38,6 +48,21 @@ class TestKernelCrashDumpsCurthook(CiTestCase):
auto_mock.assert_called_once()
enable_mock.assert_not_called()
disable_mock.assert_not_called()
+=======
+ ):
+ """Test expected automatic configs."""
+ configs = [
+ {"kernel-crash-dumps": {}},
+ {"kernel-crash-dumps": {"enabled": None}},
+ ]
+ for config in configs:
+ configure_kernel_crash_dumps(config, "/target")
+ auto_mock.assert_called_once_with("/target")
+ enable_mock.assert_not_called()
+ disable_mock.assert_not_called()
+
+ auto_mock.reset_mock()
+>>>>>>> tests/unittests/test_kernel_crash_dumps.py
def test_config__manual_enable(
self,
@@ -49,7 +74,11 @@ class TestKernelCrashDumpsCurthook(CiTestCase):
config = {"kernel-crash-dumps": {"enabled": True}}
configure_kernel_crash_dumps(config, "/target")
auto_mock.assert_not_called()
+<<<<<<< tests/unittests/test_kernel_crash_dumps.py
enable_mock.assert_called_once()
+=======
+ enable_mock.assert_called_once_with("/target")
+>>>>>>> tests/unittests/test_kernel_crash_dumps.py
disable_mock.assert_not_called()
def test_config__manual_disable(
@@ -63,11 +92,16 @@ class TestKernelCrashDumpsCurthook(CiTestCase):
configure_kernel_crash_dumps(config, "/target")
auto_mock.assert_not_called()
enable_mock.assert_not_called()
+<<<<<<< tests/unittests/test_kernel_crash_dumps.py
disable_mock.assert_called_once()
+=======
+ disable_mock.assert_called_once_with("/target")
+>>>>>>> tests/unittests/test_kernel_crash_dumps.py
class TestKernelCrashDumpsUtilities(CiTestCase):
+<<<<<<< tests/unittests/test_kernel_crash_dumps.py
@parameterized.expand(
(
(True, True),
@@ -218,3 +252,106 @@ class TestKernelCrashDumpsUtilities(CiTestCase):
subp_mock.assert_called_with([ENABLEMENT_SCRIPT])
else:
subp_mock.assert_not_called()
+=======
+ def test_detection_script_available(self):
+ """Test detection_script_available checks for script path."""
+
+ cases = [
+ (True, True),
+ (False, False),
+ ]
+
+ for preinstalled, expected in cases:
+ with patch(
+ "curtin.kernel_crash_dumps.Path.exists",
+ return_value=preinstalled,
+ ):
+ self.assertEqual(
+ detection_script_available(Path("")),
+ expected,
+ )
+
+ def test_ensure_kdump_installed(self):
+ """Test detection of preinstall and install of kdump-tools."""
+
+ cases = [True, False]
+
+ target = Path("/target")
+ for preinstalled in cases:
+ with (
+ patch(
+ "curtin.distro.get_installed_packages",
+ return_value=["kdump-tools" if preinstalled else ""],
+ )
+ ):
+ with patch("curtin.distro.install_packages") as do_install:
+ ensure_kdump_installed(target)
+
+ if preinstalled:
+ do_install.assert_not_called()
+ else:
+ do_install.assert_called_with(
+ ["kdump-tools"], target=str(target),
+ )
+
+ def test_manual_enable(self):
+ """Test manual enablement logic."""
+ target = Path("/target")
+ with patch(
+ "curtin.kernel_crash_dumps.ensure_kdump_installed",
+ ) as ensure_mock:
+ with patch(
+ "curtin.kernel_crash_dumps.ChrootableTarget",
+ new=MagicMock(),
+ ) as chroot_mock:
+ manual_enable(target)
+ ensure_mock.assert_called_once_with(Path("/target"))
+ subp_mock = chroot_mock.return_value.__enter__.return_value.subp
+ subp_mock.assert_called_with(
+ [ENABLEMENT_SCRIPT, "true"],
+ )
+
+ def test_manual_disable(self):
+ """Test manual disable logic."""
+ cases = [True, False]
+ target = Path("/target")
+
+ for preinstalled in cases:
+ with patch(
+ "curtin.distro.get_installed_packages",
+ return_value=["kdump-tools" if preinstalled else ""],
+ ):
+ with patch(
+ "curtin.kernel_crash_dumps.ChrootableTarget",
+ new=MagicMock(),
+ ) as chroot_mock:
+ manual_disable(target)
+
+ subp_mock = chroot_mock.return_value.__enter__.return_value.subp
+ if preinstalled:
+ subp_mock.assert_called_with([ENABLEMENT_SCRIPT, "false"])
+ else:
+ subp_mock.assert_not_called()
+
+ def test_automatic_detect(self):
+ """Test automatic enablement logic."""
+ cases = [True, False]
+ target = Path("/target")
+
+ for wants_enablement in cases:
+ with patch(
+ "curtin.kernel_crash_dumps.detection_script_available",
+ return_value=wants_enablement,
+ ):
+ with patch(
+ "curtin.kernel_crash_dumps.ChrootableTarget",
+ new=MagicMock(),
+ ) as chroot_mock:
+ automatic_detect(target)
+
+ subp_mock = chroot_mock.return_value.__enter__.return_value.subp
+ if wants_enablement:
+ subp_mock.assert_called_with([ENABLEMENT_SCRIPT])
+ else:
+ subp_mock.assert_not_called()
+>>>>>>> tests/unittests/test_kernel_crash_dumps.py
diff --git a/tests/unittests/test_storage_config.py b/tests/unittests/test_storage_config.py
index f2c56d8..586114d 100644
--- a/tests/unittests/test_storage_config.py
+++ b/tests/unittests/test_storage_config.py
@@ -1368,9 +1368,11 @@ class TestExtractStorageConfig(CiTestCase):
config = extracted['storage']['config']
disks = [cfg for cfg in config if cfg['type'] == 'disk']
expected_count = len([
- 1 for bd_name, bd_data in self.probe_data['blockdev'].items()
- if bd_data.get('DM_UUID', '').startswith('mpath-')
- or bd_name.startswith('/dev/dasd') and bd_data['DEVTYPE'] == 'disk'
+ 1
+ for bd_name, bd_data in self.probe_data['blockdev'].items()
+ if bd_data.get('DM_UUID', '').startswith('mpath-') or
+ bd_name.startswith('/dev/dasd') and
+ bd_data['DEVTYPE'] == 'disk'
])
self.assertEqual(expected_count, len(disks))
@@ -1429,7 +1431,10 @@ class TestSelectConfigs(CiTestCase):
id1 = {'a': 1, 'c': 3}
sc = {'id0': id0, 'id1': id1}
- self.assertEqual([id0, id1], select_configs(sc, a=1))
+ actual = select_configs(sc, a=1)
+ self.assertEqual(2, len(actual))
+ self.assertIn(id0, actual)
+ self.assertIn(id1, actual)
def test_not_found(self):
id0 = {'a': 1, 'b': 2}
diff --git a/tests/unittests/test_util.py b/tests/unittests/test_util.py
index 90303e9..40d92b8 100644
--- a/tests/unittests/test_util.py
+++ b/tests/unittests/test_util.py
@@ -1077,6 +1077,7 @@ class TestGetEFIBootMGR(CiTestCase):
Boot0005* UEFI:Network Device BBS(131,,0x0)
"""), ''))
observed = util.get_efibootmgr('target')
+<<<<<<< tests/unittests/test_util.py
expected = util.EFIBootState(
current='0000',
timeout='1 seconds',
@@ -1109,6 +1110,39 @@ class TestGetEFIBootMGR(CiTestCase):
})
self.assertEqual(expected, observed)
+=======
+ self.assertEqual({
+ 'current': '0000',
+ 'timeout': '1 seconds',
+ 'order': ['0000', '0002', '0001', '0003', '0004', '0005'],
+ 'entries': {
+ '0000': {
+ 'name': 'ubuntu',
+ 'path': 'HD(1,GPT)/File(\\EFI\\ubuntu\\shimx64.efi)',
+ },
+ '0001': {
+ 'name': 'CD/DVD Drive',
+ 'path': 'BBS(CDROM,,0x0)',
+ },
+ '0002': {
+ 'name': 'Hard Drive',
+ 'path': 'BBS(HD,,0x0)',
+ },
+ '0003': {
+ 'name': 'UEFI:CD/DVD Drive',
+ 'path': 'BBS(129,,0x0)',
+ },
+ '0004': {
+ 'name': 'UEFI:Removable Device',
+ 'path': 'BBS(130,,0x0)',
+ },
+ '0005': {
+ 'name': 'UEFI:Network Device',
+ 'path': 'BBS(131,,0x0)',
+ },
+ }
+ }, observed)
+>>>>>>> tests/unittests/test_util.py
def test_parses_output_filter_missing(self):
"""ensure parsing ignores items in order that don't have entries"""
@@ -1125,6 +1159,7 @@ class TestGetEFIBootMGR(CiTestCase):
Boot0005* UEFI:Network Device BBS(131,,0x0)
"""), ''))
observed = util.get_efibootmgr('target')
+<<<<<<< tests/unittests/test_util.py
expected = util.EFIBootState(
current='0000',
timeout='1 seconds',
@@ -1156,6 +1191,39 @@ class TestGetEFIBootMGR(CiTestCase):
),
})
self.assertEqual(expected, observed)
+=======
+ self.assertEqual({
+ 'current': '0000',
+ 'timeout': '1 seconds',
+ 'order': ['0000', '0002', '0001', '0003', '0004', '0005'],
+ 'entries': {
+ '0000': {
+ 'name': 'ubuntu',
+ 'path': 'HD(1,GPT)/File(\\EFI\\ubuntu\\shimx64.efi)',
+ },
+ '0001': {
+ 'name': 'CD/DVD Drive',
+ 'path': 'BBS(CDROM,,0x0)',
+ },
+ '0002': {
+ 'name': 'Hard Drive',
+ 'path': 'BBS(HD,,0x0)',
+ },
+ '0003': {
+ 'name': 'UEFI:CD/DVD Drive',
+ 'path': 'BBS(129,,0x0)',
+ },
+ '0004': {
+ 'name': 'UEFI:Removable Device',
+ 'path': 'BBS(130,,0x0)',
+ },
+ '0005': {
+ 'name': 'UEFI:Network Device',
+ 'path': 'BBS(131,,0x0)',
+ },
+ }
+ }, observed)
+>>>>>>> tests/unittests/test_util.py
class TestUsesSystemd(CiTestCase):
@@ -1346,7 +1414,11 @@ class TestNotExclusiveRetry(CiTestCase):
f = mock.Mock(side_effect=[util.NotExclusiveError, 'success'])
self.assertEqual(util.not_exclusive_retry(f, 1, 2, 3), 'success')
+<<<<<<< tests/unittests/test_util.py
sleep.assert_called_once()
+=======
+ self.assertEqual(1, sleep.call_count)
+>>>>>>> tests/unittests/test_util.py
@mock.patch('curtin.util.time.sleep')
def test_not_exclusive_retry_not_exclusive_twice(self, sleep):
@@ -1354,7 +1426,11 @@ class TestNotExclusiveRetry(CiTestCase):
with self.assertRaises(util.NotExclusiveError):
util.not_exclusive_retry(f, 1, 2, 3)
+<<<<<<< tests/unittests/test_util.py
sleep.assert_called_once()
+=======
+ self.assertEqual(1, sleep.call_count)
+>>>>>>> tests/unittests/test_util.py
@mock.patch('curtin.util.time.sleep')
def test_not_exclusive_retry_not_exclusive_once_then_error(self, sleep):
@@ -1362,6 +1438,7 @@ class TestNotExclusiveRetry(CiTestCase):
with self.assertRaises(OSError):
util.not_exclusive_retry(f, 1, 2, 3)
+<<<<<<< tests/unittests/test_util.py
sleep.assert_called_once()
@@ -1438,5 +1515,8 @@ class TestFlockEx(CiTestCase):
fcntl.flock(fp, fcntl.LOCK_UN)
+=======
+ self.assertEqual(1, sleep.call_count)
+>>>>>>> tests/unittests/test_util.py
# vi: ts=4 expandtab syntax=python
diff --git a/tests/vmtests/releases.py b/tests/vmtests/releases.py
index 56e5e8c..3202893 100644
--- a/tests/vmtests/releases.py
+++ b/tests/vmtests/releases.py
@@ -172,6 +172,13 @@ class _JammyBase(_UbuntuBase):
subarch = "ga-22.04"
+class _JammyBase(_UbuntuBase):
+ release = "jammy"
+ target_release = "jammy"
+ if _UbuntuBase.arch == "arm64":
+ subarch = "ga-22.04"
+
+
class _Releases(object):
trusty = _TrustyBase
precise = _PreciseBase
@@ -190,6 +197,11 @@ class _Releases(object):
disco = _DiscoBase
eoan = _EoanBase
focal = _FocalBase
+<<<<<<< tests/vmtests/releases.py
+=======
+ hirsute = _HirsuteBase
+ impish = _ImpishBase
+>>>>>>> tests/vmtests/releases.py
jammy = _JammyBase
diff --git a/tests/vmtests/test_apt_config_cmd.py b/tests/vmtests/test_apt_config_cmd.py
index 5a1c322..82bdae3 100644
--- a/tests/vmtests/test_apt_config_cmd.py
+++ b/tests/vmtests/test_apt_config_cmd.py
@@ -79,4 +79,8 @@ class JammyTestAptConfigCMDCMD(relbase.jammy, TestAptConfigCMD):
__test__ = True
+class JammyTestAptConfigCMDCMD(relbase.jammy, TestAptConfigCMD):
+ __test__ = True
+
+
# vi: ts=4 expandtab syntax=python
diff --git a/tests/vmtests/test_basic.py b/tests/vmtests/test_basic.py
index f9c3b04..33b0e95 100644
--- a/tests/vmtests/test_basic.py
+++ b/tests/vmtests/test_basic.py
@@ -251,6 +251,10 @@ class JammyTestBasic(relbase.jammy, TestBasicAbs):
__test__ = True
+class JammyTestBasic(relbase.jammy, TestBasicAbs):
+ __test__ = True
+
+
class TestBasicScsiAbs(TestBasicAbs):
arch_skip = [
'arm64', # arm64 is UEFI only
@@ -377,4 +381,8 @@ class JammyTestScsiBasic(relbase.jammy, TestBasicScsiAbs):
__test__ = True
+class JammyTestScsiBasic(relbase.jammy, TestBasicScsiAbs):
+ __test__ = True
+
+
# vi: ts=4 expandtab syntax=python
diff --git a/tests/vmtests/test_basic_dasd.py b/tests/vmtests/test_basic_dasd.py
index 154f26d..78edb3a 100644
--- a/tests/vmtests/test_basic_dasd.py
+++ b/tests/vmtests/test_basic_dasd.py
@@ -60,4 +60,8 @@ class JammyTestBasicDasd(relbase.jammy, TestBasicDasd):
__test__ = True
+class JammyTestBasicDasd(relbase.jammy, TestBasicDasd):
+ __test__ = True
+
+
# vi: ts=4 expandtab syntax=python
diff --git a/tests/vmtests/test_bcache_basic.py b/tests/vmtests/test_bcache_basic.py
index 2e62f0b..a7e4f37 100644
--- a/tests/vmtests/test_bcache_basic.py
+++ b/tests/vmtests/test_bcache_basic.py
@@ -72,4 +72,8 @@ class JammyBcacheBasic(relbase.jammy, TestBcacheBasic):
__test__ = True
+class JammyBcacheBasic(relbase.jammy, TestBcacheBasic):
+ __test__ = True
+
+
# vi: ts=4 expandtab syntax=python
diff --git a/tests/vmtests/test_bcache_bug1718699.py b/tests/vmtests/test_bcache_bug1718699.py
index 82a765a..56ee7b0 100644
--- a/tests/vmtests/test_bcache_bug1718699.py
+++ b/tests/vmtests/test_bcache_bug1718699.py
@@ -27,4 +27,8 @@ class JammyTestBcacheBug1718699(relbase.jammy, TestBcacheBug1718699):
__test__ = True
+class JammyTestBcacheBug1718699(relbase.jammy, TestBcacheBug1718699):
+ __test__ = True
+
+
# vi: ts=4 expandtab syntax=python
diff --git a/tests/vmtests/test_bcache_ceph.py b/tests/vmtests/test_bcache_ceph.py
index 15cce59..53df0ad 100644
--- a/tests/vmtests/test_bcache_ceph.py
+++ b/tests/vmtests/test_bcache_ceph.py
@@ -83,6 +83,10 @@ class JammyTestBcacheCeph(relbase.jammy, TestBcacheCeph):
__test__ = True
+class JammyTestBcacheCeph(relbase.jammy, TestBcacheCeph):
+ __test__ = True
+
+
class TestBcacheCephLvm(TestBcacheCeph):
test_type = 'storage'
nr_cpus = 2
@@ -113,4 +117,8 @@ class JammyTestBcacheCephLvm(relbase.jammy, TestBcacheCephLvm):
__test__ = True
+class JammyTestBcacheCephLvm(relbase.jammy, TestBcacheCephLvm):
+ __test__ = True
+
+
# vi: ts=4 expandtab syntax=python
diff --git a/tests/vmtests/test_bcache_partitions.py b/tests/vmtests/test_bcache_partitions.py
index c3c41bc..42f8575 100644
--- a/tests/vmtests/test_bcache_partitions.py
+++ b/tests/vmtests/test_bcache_partitions.py
@@ -33,4 +33,8 @@ class JammyTestBcachePartitions(relbase.jammy, TestBcachePartitions):
__test__ = True
+class JammyTestBcachePartitions(relbase.jammy, TestBcachePartitions):
+ __test__ = True
+
+
# vi: ts=4 expandtab syntax=python
diff --git a/tests/vmtests/test_fs_battery.py b/tests/vmtests/test_fs_battery.py
index bd1e629..be63ba2 100644
--- a/tests/vmtests/test_fs_battery.py
+++ b/tests/vmtests/test_fs_battery.py
@@ -254,4 +254,8 @@ class JammyTestFsBattery(relbase.jammy, TestFsBattery):
__test__ = True
+class JammyTestFsBattery(relbase.jammy, TestFsBattery):
+ __test__ = True
+
+
# vi: ts=4 expandtab syntax=python
diff --git a/tests/vmtests/test_iscsi.py b/tests/vmtests/test_iscsi.py
index b5d9082..6f6951b 100644
--- a/tests/vmtests/test_iscsi.py
+++ b/tests/vmtests/test_iscsi.py
@@ -82,4 +82,8 @@ class JammyTestIscsiBasic(relbase.jammy, TestBasicIscsiAbs):
__test__ = True
+class JammyTestIscsiBasic(relbase.jammy, TestBasicIscsiAbs):
+ __test__ = True
+
+
# vi: ts=4 expandtab syntax=python
diff --git a/tests/vmtests/test_journald_reporter.py b/tests/vmtests/test_journald_reporter.py
index ba39af2..0056b73 100644
--- a/tests/vmtests/test_journald_reporter.py
+++ b/tests/vmtests/test_journald_reporter.py
@@ -40,4 +40,8 @@ class JammyTestJournaldReporter(relbase.jammy, TestJournaldReporter):
__test__ = True
+class JammyTestJournaldReporter(relbase.jammy, TestJournaldReporter):
+ __test__ = True
+
+
# vi: ts=4 expandtab syntax=python
diff --git a/tests/vmtests/test_lvm.py b/tests/vmtests/test_lvm.py
index e53e9f2..2c19e94 100644
--- a/tests/vmtests/test_lvm.py
+++ b/tests/vmtests/test_lvm.py
@@ -89,4 +89,8 @@ class JammyTestLvm(relbase.jammy, TestLvmAbs):
__test__ = True
+class JammyTestLvm(relbase.jammy, TestLvmAbs):
+ __test__ = True
+
+
# vi: ts=4 expandtab syntax=python
diff --git a/tests/vmtests/test_lvm_iscsi.py b/tests/vmtests/test_lvm_iscsi.py
index 94e523b..77c16f3 100644
--- a/tests/vmtests/test_lvm_iscsi.py
+++ b/tests/vmtests/test_lvm_iscsi.py
@@ -103,4 +103,8 @@ class JammyTestIscsiLvm(relbase.jammy, TestLvmIscsiAbs):
__test__ = True
+class JammyTestIscsiLvm(relbase.jammy, TestLvmIscsiAbs):
+ __test__ = True
+
+
# vi: ts=4 expandtab syntax=python
diff --git a/tests/vmtests/test_lvm_root.py b/tests/vmtests/test_lvm_root.py
index 4c9b5f3..04c4b9b 100644
--- a/tests/vmtests/test_lvm_root.py
+++ b/tests/vmtests/test_lvm_root.py
@@ -104,6 +104,13 @@ class JammyTestLvmRootExt4(relbase.jammy, TestLvmRootAbs):
}
+class JammyTestLvmRootExt4(relbase.jammy, TestLvmRootAbs):
+ __test__ = True
+ conf_replace = {
+ '__ROOTFS_FORMAT__': 'ext4',
+ }
+
+
class XenialTestLvmRootXfs(relbase.xenial, TestLvmRootAbs):
__test__ = True
conf_replace = {
@@ -158,6 +165,14 @@ class JammyTestUefiLvmRootExt4(relbase.jammy, TestUefiLvmRootAbs):
}
+class JammyTestUefiLvmRootExt4(relbase.jammy, TestUefiLvmRootAbs):
+ __test__ = True
+ conf_replace = {
+ '__BOOTFS_FORMAT__': 'ext4',
+ '__ROOTFS_FORMAT__': 'ext4',
+ }
+
+
class XenialTestUefiLvmRootXfs(relbase.xenial, TestUefiLvmRootAbs):
__test__ = True
conf_replace = {
diff --git a/tests/vmtests/test_mdadm_bcache.py b/tests/vmtests/test_mdadm_bcache.py
index 8de7702..a2911c0 100644
--- a/tests/vmtests/test_mdadm_bcache.py
+++ b/tests/vmtests/test_mdadm_bcache.py
@@ -169,6 +169,10 @@ class JammyTestMdadmBcache(relbase.jammy, TestMdadmBcacheAbs):
__test__ = True
+class JammyTestMdadmBcache(relbase.jammy, TestMdadmBcacheAbs):
+ __test__ = True
+
+
class TestMirrorbootAbs(TestMdadmAbs):
# alternative config for more complex setup
conf_file = "examples/tests/mirrorboot.yaml"
@@ -215,6 +219,10 @@ class JammyTestMirrorboot(relbase.jammy, TestMirrorbootAbs):
__test__ = True
+class JammyTestMirrorboot(relbase.jammy, TestMirrorbootAbs):
+ __test__ = True
+
+
class TestMirrorbootPartitionsAbs(TestMdadmAbs):
# alternative config for more complex setup
conf_file = "examples/tests/mirrorboot-msdos-partition.yaml"
@@ -266,6 +274,11 @@ class JammyTestMirrorbootPartitions(relbase.jammy,
__test__ = True
+class JammyTestMirrorbootPartitions(relbase.jammy,
+ TestMirrorbootPartitionsAbs):
+ __test__ = True
+
+
class TestMirrorbootPartitionsUEFIAbs(TestMdadmAbs):
# alternative config for more complex setup
conf_file = "examples/tests/mirrorboot-uefi.yaml"
@@ -366,6 +379,11 @@ class JammyTestMirrorbootPartitionsUEFI(relbase.jammy,
__test__ = True
+class JammyTestMirrorbootPartitionsUEFI(relbase.jammy,
+ TestMirrorbootPartitionsUEFIAbs):
+ __test__ = True
+
+
class TestRaid5bootAbs(TestMdadmAbs):
# alternative config for more complex setup
conf_file = "examples/tests/raid5boot.yaml"
@@ -414,6 +432,10 @@ class JammyTestRaid5boot(relbase.jammy, TestRaid5bootAbs):
__test__ = True
+class JammyTestRaid5boot(relbase.jammy, TestRaid5bootAbs):
+ __test__ = True
+
+
class TestRaid6bootAbs(TestMdadmAbs):
# alternative config for more complex setup
conf_file = "examples/tests/raid6boot.yaml"
@@ -475,6 +497,10 @@ class JammyTestRaid6boot(relbase.jammy, TestRaid6bootAbs):
__test__ = True
+class JammyTestRaid6boot(relbase.jammy, TestRaid6bootAbs):
+ __test__ = True
+
+
class TestRaid10bootAbs(TestMdadmAbs):
# alternative config for more complex setup
conf_file = "examples/tests/raid10boot.yaml"
@@ -522,6 +548,10 @@ class JammyTestRaid10boot(relbase.jammy, TestRaid10bootAbs):
__test__ = True
+class JammyTestRaid10boot(relbase.jammy, TestRaid10bootAbs):
+ __test__ = True
+
+
class TestAllindataAbs(TestMdadmAbs):
# more complex, needs more time
# alternative config for more complex setup
@@ -632,4 +662,8 @@ class FocalTestAllindata(relbase.focal, TestAllindataAbs):
# __test__ = True
+class JammyTestAllindata(relbase.jammy, TestAllindataAbs):
+ __test__ = True
+
+
# vi: ts=4 expandtab syntax=python
diff --git a/tests/vmtests/test_mdadm_iscsi.py b/tests/vmtests/test_mdadm_iscsi.py
index 8c61efe..456e779 100644
--- a/tests/vmtests/test_mdadm_iscsi.py
+++ b/tests/vmtests/test_mdadm_iscsi.py
@@ -59,4 +59,8 @@ class JammyTestIscsiMdadm(relbase.jammy, TestMdadmIscsiAbs):
__test__ = True
+class JammyTestIscsiMdadm(relbase.jammy, TestMdadmIscsiAbs):
+ __test__ = True
+
+
# vi: ts=4 expandtab syntax=python
diff --git a/tests/vmtests/test_multipath.py b/tests/vmtests/test_multipath.py
index 50db226..96cda7b 100644
--- a/tests/vmtests/test_multipath.py
+++ b/tests/vmtests/test_multipath.py
@@ -170,6 +170,10 @@ class JammyTestMultipathBasic(relbase.jammy, TestMultipathBasicAbs):
__test__ = True
+class JammyTestMultipathBasic(relbase.jammy, TestMultipathBasicAbs):
+ __test__ = True
+
+
class TestMultipathReuseAbs(TestMultipathBasicAbs):
conf_file = "examples/tests/multipath-reuse.yaml"
@@ -182,4 +186,8 @@ class JammyTestMultipathReuse(relbase.jammy, TestMultipathReuseAbs):
__test__ = True
+class JammyTestMultipathReuse(relbase.jammy, TestMultipathReuseAbs):
+ __test__ = True
+
+
# vi: ts=4 expandtab syntax=python
diff --git a/tests/vmtests/test_multipath_lvm.py b/tests/vmtests/test_multipath_lvm.py
index 86cb393..375aa0e 100644
--- a/tests/vmtests/test_multipath_lvm.py
+++ b/tests/vmtests/test_multipath_lvm.py
@@ -68,6 +68,10 @@ class JammyTestMultipathLvm(relbase.jammy, TestMultipathLvmAbs):
__test__ = True
+class JammyTestMultipathLvm(relbase.jammy, TestMultipathLvmAbs):
+ __test__ = True
+
+
class TestMultipathLvmPartWipeAbs(TestMultipathLvmAbs):
conf_file = "examples/tests/multipath-lvm-part-wipe.yaml"
@@ -83,4 +87,9 @@ class JammyTestMultipathLvmPartWipe(relbase.jammy,
__test__ = True
+class JammyTestMultipathLvmPartWipe(relbase.jammy,
+ TestMultipathLvmPartWipeAbs):
+ __test__ = True
+
+
# vi: ts=4 expandtab syntax=python
diff --git a/tests/vmtests/test_network.py b/tests/vmtests/test_network.py
index ad5a8bd..baebfc9 100644
--- a/tests/vmtests/test_network.py
+++ b/tests/vmtests/test_network.py
@@ -489,6 +489,10 @@ class JammyTestNetworkBasic(relbase.jammy, TestNetworkBasicAbs):
__test__ = True
+class JammyTestNetworkBasic(relbase.jammy, TestNetworkBasicAbs):
+ __test__ = True
+
+
class Centos70TestNetworkBasic(centos_relbase.centos70_xenial,
CentosTestNetworkBasicAbs):
__test__ = True
diff --git a/tests/vmtests/test_network_alias.py b/tests/vmtests/test_network_alias.py
index 628a8b7..9925faf 100644
--- a/tests/vmtests/test_network_alias.py
+++ b/tests/vmtests/test_network_alias.py
@@ -55,4 +55,8 @@ class JammyTestNetworkAlias(relbase.jammy, TestNetworkAliasAbs):
__test__ = True
+class JammyTestNetworkAlias(relbase.jammy, TestNetworkAliasAbs):
+ __test__ = True
+
+
# vi: ts=4 expandtab syntax=python
diff --git a/tests/vmtests/test_network_bonding.py b/tests/vmtests/test_network_bonding.py
index ea411d8..3a3477e 100644
--- a/tests/vmtests/test_network_bonding.py
+++ b/tests/vmtests/test_network_bonding.py
@@ -65,6 +65,10 @@ class JammyTestBonding(relbase.jammy, TestNetworkBondingAbs):
__test__ = True
+class JammyTestBonding(relbase.jammy, TestNetworkBondingAbs):
+ __test__ = True
+
+
class Centos70TestNetworkBonding(centos_relbase.centos70_xenial,
CentosTestNetworkBondingAbs):
__test__ = True
diff --git a/tests/vmtests/test_network_bridging.py b/tests/vmtests/test_network_bridging.py
index 329a49f..eca0bc0 100644
--- a/tests/vmtests/test_network_bridging.py
+++ b/tests/vmtests/test_network_bridging.py
@@ -237,6 +237,10 @@ class JammyTestBridging(relbase.jammy, TestBridgeNetworkAbs):
__test__ = True
+class JammyTestBridging(relbase.jammy, TestBridgeNetworkAbs):
+ __test__ = True
+
+
class XenialTestBridgingV2(relbase.xenial, TestBridgeNetworkAbs):
""" This class only needs to verify that when provided a v2 config
that the Xenial network packages are installed. """
diff --git a/tests/vmtests/test_network_disabled.py b/tests/vmtests/test_network_disabled.py
index f9efaa6..e0c99af 100644
--- a/tests/vmtests/test_network_disabled.py
+++ b/tests/vmtests/test_network_disabled.py
@@ -66,6 +66,21 @@ class FocalCurtinDisableNetworkRendering(relbase.focal, TestKlass1):
__test__ = True
+<<<<<<< tests/vmtests/test_network_disabled.py
+=======
+class HirsuteCurtinDisableNetworkRendering(relbase.hirsute, TestKlass1):
+ __test__ = True
+
+
+class ImpishCurtinDisableNetworkRendering(relbase.impish, TestKlass1):
+ __test__ = True
+
+
+class JammyCurtinDisableNetworkRendering(relbase.jammy, TestKlass1):
+ __test__ = True
+
+
+>>>>>>> tests/vmtests/test_network_disabled.py
class FocalCurtinDisableCloudInitNetworking(relbase.focal, TestKlass2):
__test__ = True
@@ -74,7 +89,15 @@ class FocalCurtinDisableCloudInitNetworkingVersion1(relbase.focal, TestKlass3):
__test__ = True
+<<<<<<< tests/vmtests/test_network_disabled.py
class JammyCurtinDisableNetworkRendering(relbase.jammy, TestKlass1):
+=======
+class JammyCurtinDisableCloudInitNetworking(relbase.jammy, TestKlass2):
+ __test__ = True
+
+
+class FocalCurtinDisableCloudInitNetworkingVersion1(relbase.focal, TestKlass3):
+>>>>>>> tests/vmtests/test_network_disabled.py
__test__ = True
@@ -88,4 +111,9 @@ class JammyCurtinDisableCloudInitNetworkingVersion1(relbase.jammy, TestKlass3):
__test__ = True
+class JammyCurtinDisableCloudInitNetworkingVersion1(relbase.jammy,
+ TestKlass3):
+ __test__ = True
+
+
# vi: ts=4 expandtab syntax=python
diff --git a/tests/vmtests/test_network_ipv6.py b/tests/vmtests/test_network_ipv6.py
index 5c31b48..64c162f 100644
--- a/tests/vmtests/test_network_ipv6.py
+++ b/tests/vmtests/test_network_ipv6.py
@@ -61,6 +61,10 @@ class JammyTestNetworkIPV6(relbase.jammy, TestNetworkIPV6Abs):
__test__ = True
+class JammyTestNetworkIPV6(relbase.jammy, TestNetworkIPV6Abs):
+ __test__ = True
+
+
class Centos70TestNetworkIPV6(centos_relbase.centos70_xenial,
CentosTestNetworkIPV6Abs):
__test__ = True
diff --git a/tests/vmtests/test_network_ipv6_static.py b/tests/vmtests/test_network_ipv6_static.py
index 5352bfe..d317977 100644
--- a/tests/vmtests/test_network_ipv6_static.py
+++ b/tests/vmtests/test_network_ipv6_static.py
@@ -31,6 +31,10 @@ class JammyTestNetworkIPV6Static(relbase.jammy, TestNetworkIPV6StaticAbs):
__test__ = True
+class JammyTestNetworkIPV6Static(relbase.jammy, TestNetworkIPV6StaticAbs):
+ __test__ = True
+
+
class Centos70TestNetworkIPV6Static(centos_relbase.centos70_xenial,
CentosTestNetworkIPV6StaticAbs):
__test__ = True
diff --git a/tests/vmtests/test_network_ipv6_vlan.py b/tests/vmtests/test_network_ipv6_vlan.py
index 8f3fe64..3516d60 100644
--- a/tests/vmtests/test_network_ipv6_vlan.py
+++ b/tests/vmtests/test_network_ipv6_vlan.py
@@ -30,6 +30,10 @@ class JammyTestNetworkIPV6Vlan(relbase.jammy, TestNetworkIPV6VlanAbs):
__test__ = True
+class JammyTestNetworkIPV6Vlan(relbase.jammy, TestNetworkIPV6VlanAbs):
+ __test__ = True
+
+
class Centos70TestNetworkIPV6Vlan(centos_relbase.centos70_xenial,
CentosTestNetworkIPV6VlanAbs):
__test__ = True
diff --git a/tests/vmtests/test_network_mtu.py b/tests/vmtests/test_network_mtu.py
index 67d5d01..5a80d1b 100644
--- a/tests/vmtests/test_network_mtu.py
+++ b/tests/vmtests/test_network_mtu.py
@@ -197,6 +197,10 @@ class JammyTestNetworkMtu(relbase.jammy, TestNetworkMtuNetworkdAbs):
__test__ = True
+class JammyTestNetworkMtu(relbase.jammy, TestNetworkMtuNetworkdAbs):
+ __test__ = True
+
+
class Centos70TestNetworkMtu(centos_relbase.centos70_xenial,
CentosTestNetworkMtuAbs):
__test__ = True
diff --git a/tests/vmtests/test_network_ovs.py b/tests/vmtests/test_network_ovs.py
index c50d115..363f140 100644
--- a/tests/vmtests/test_network_ovs.py
+++ b/tests/vmtests/test_network_ovs.py
@@ -49,4 +49,8 @@ class JammyTestNetworkOvs(relbase.jammy, TestNetworkOvsAbs):
__test__ = True
+class JammyTestNetworkOvs(relbase.jammy, TestNetworkOvsAbs):
+ __test__ = True
+
+
# vi: ts=4 expandtab syntax=python
diff --git a/tests/vmtests/test_network_static.py b/tests/vmtests/test_network_static.py
index 620c952..e3f6711 100644
--- a/tests/vmtests/test_network_static.py
+++ b/tests/vmtests/test_network_static.py
@@ -36,6 +36,10 @@ class JammyTestNetworkStatic(relbase.jammy, TestNetworkStaticAbs):
__test__ = True
+class JammyTestNetworkStatic(relbase.jammy, TestNetworkStaticAbs):
+ __test__ = True
+
+
class Centos70TestNetworkStatic(centos_relbase.centos70_xenial,
CentosTestNetworkStaticAbs):
__test__ = True
diff --git a/tests/vmtests/test_network_static_routes.py b/tests/vmtests/test_network_static_routes.py
index 0258113..e099ddd 100644
--- a/tests/vmtests/test_network_static_routes.py
+++ b/tests/vmtests/test_network_static_routes.py
@@ -38,6 +38,11 @@ class JammyTestNetworkStaticRoutes(relbase.jammy,
__test__ = True
+class JammyTestNetworkStaticRoutes(relbase.jammy,
+ TestNetworkStaticRoutesAbs):
+ __test__ = True
+
+
class Centos70TestNetworkStaticRoutes(centos_relbase.centos70_xenial,
CentosTestNetworkStaticRoutesAbs):
__test__ = False
diff --git a/tests/vmtests/test_network_vlan.py b/tests/vmtests/test_network_vlan.py
index 0ab62bb..0f2473a 100644
--- a/tests/vmtests/test_network_vlan.py
+++ b/tests/vmtests/test_network_vlan.py
@@ -84,6 +84,10 @@ class JammyTestNetworkVlan(relbase.jammy, TestNetworkVlanAbs):
__test__ = True
+class JammyTestNetworkVlan(relbase.jammy, TestNetworkVlanAbs):
+ __test__ = True
+
+
class Centos70TestNetworkVlan(centos_relbase.centos70_xenial,
CentosTestNetworkVlanAbs):
__test__ = True
diff --git a/tests/vmtests/test_nvme.py b/tests/vmtests/test_nvme.py
index dd071e9..158c4e8 100644
--- a/tests/vmtests/test_nvme.py
+++ b/tests/vmtests/test_nvme.py
@@ -85,6 +85,10 @@ class JammyTestNvme(relbase.jammy, TestNvmeAbs):
# OSError - [Errno 16] Device or resource busy: '/dev/mapper/mpatha'
+class JammyTestNvme(relbase.jammy, TestNvmeAbs):
+ __test__ = False
+
+
class TestNvmeBcacheAbs(TestNvmeAbs):
arch_skip = [
"s390x", # nvme is a pci device, no pci on s390x
@@ -155,4 +159,8 @@ class JammyTestNvmeBcache(relbase.jammy, TestNvmeBcacheAbs):
__test__ = True
+class JammyTestNvmeBcache(relbase.jammy, TestNvmeBcacheAbs):
+ __test__ = True
+
+
# vi: ts=4 expandtab syntax=python
diff --git a/tests/vmtests/test_panic.py b/tests/vmtests/test_panic.py
index d8d3f22..39f30e1 100644
--- a/tests/vmtests/test_panic.py
+++ b/tests/vmtests/test_panic.py
@@ -33,4 +33,8 @@ class JammyTestInstallPanic(relbase.jammy, TestInstallPanic):
__test__ = True
+class JammyTestInstallPanic(relbase.jammy, TestInstallPanic):
+ __test__ = True
+
+
# vi: ts=4 expandtab syntax=python
diff --git a/tests/vmtests/test_pollinate_useragent.py b/tests/vmtests/test_pollinate_useragent.py
index 5a4b0fb..cfb75a8 100644
--- a/tests/vmtests/test_pollinate_useragent.py
+++ b/tests/vmtests/test_pollinate_useragent.py
@@ -69,4 +69,8 @@ class JammyTestPollinateUserAgent(relbase.jammy, TestPollinateUserAgent):
__test__ = True
+class JammyTestPollinateUserAgent(relbase.jammy, TestPollinateUserAgent):
+ __test__ = True
+
+
# vi: ts=4 expandtab syntax=python
diff --git a/tests/vmtests/test_preserve.py b/tests/vmtests/test_preserve.py
index d6eb922..ff0ab59 100644
--- a/tests/vmtests/test_preserve.py
+++ b/tests/vmtests/test_preserve.py
@@ -33,4 +33,8 @@ class JammyTestPreserve(relbase.jammy, TestPreserve):
__test__ = True
+class JammyTestPreserve(relbase.jammy, TestPreserve):
+ __test__ = True
+
+
# vi: ts=4 expandtab syntax=python
diff --git a/tests/vmtests/test_preserve_bcache.py b/tests/vmtests/test_preserve_bcache.py
index 2384be8..762e146 100644
--- a/tests/vmtests/test_preserve_bcache.py
+++ b/tests/vmtests/test_preserve_bcache.py
@@ -64,4 +64,8 @@ class JammyTestPreserveBcache(relbase.jammy, TestPreserveBcache):
__test__ = True
+class JammyTestPreserveBcache(relbase.jammy, TestPreserveBcache):
+ __test__ = True
+
+
# vi: ts=4 expandtab syntax=python
diff --git a/tests/vmtests/test_preserve_lvm.py b/tests/vmtests/test_preserve_lvm.py
index e0bab24..351176b 100644
--- a/tests/vmtests/test_preserve_lvm.py
+++ b/tests/vmtests/test_preserve_lvm.py
@@ -81,4 +81,8 @@ class JammyTestLvmPreserve(relbase.jammy, TestLvmPreserveAbs):
__test__ = True
+class JammyTestLvmPreserve(relbase.jammy, TestLvmPreserveAbs):
+ __test__ = True
+
+
# vi: ts=4 expandtab syntax=python
diff --git a/tests/vmtests/test_preserve_partition_wipe_vg.py b/tests/vmtests/test_preserve_partition_wipe_vg.py
index 7120e63..bc1dcf3 100644
--- a/tests/vmtests/test_preserve_partition_wipe_vg.py
+++ b/tests/vmtests/test_preserve_partition_wipe_vg.py
@@ -35,6 +35,10 @@ class JammyTestPreserveWipeLvm(relbase.jammy, TestPreserveWipeLvm):
__test__ = True
+class JammyTestPreserveWipeLvm(relbase.jammy, TestPreserveWipeLvm):
+ __test__ = True
+
+
class TestPreserveWipeLvmSimple(VMBaseClass):
conf_file = "examples/tests/preserve-partition-wipe-vg-simple.yaml"
uefi = False
@@ -59,4 +63,9 @@ class JammyTestPreserveWipeLvmSimple(relbase.jammy, TestPreserveWipeLvmSimple):
__test__ = True
+class JammyTestPreserveWipeLvmSimple(relbase.jammy,
+ TestPreserveWipeLvmSimple):
+ __test__ = True
+
+
# vi: ts=4 expandtab syntax=python
diff --git a/tests/vmtests/test_preserve_raid.py b/tests/vmtests/test_preserve_raid.py
index cf97203..8fd5c82 100644
--- a/tests/vmtests/test_preserve_raid.py
+++ b/tests/vmtests/test_preserve_raid.py
@@ -33,6 +33,10 @@ class JammyTestPreserveRAID(relbase.jammy, TestPreserveRAID):
__test__ = True
+class JammyTestPreserveRAID(relbase.jammy, TestPreserveRAID):
+ __test__ = True
+
+
class TestPartitionExistingRAID(VMBaseClass):
""" Test that curtin can repartition an existing RAID. """
conf_file = "examples/tests/partition-existing-raid.yaml"
@@ -66,4 +70,9 @@ class JammyTestPartitionExistingRAID(
__test__ = True
+class JammyTestPartitionExistingRAID(
+ relbase.jammy, TestPartitionExistingRAID):
+ __test__ = True
+
+
# vi: ts=4 expandtab syntax=python
diff --git a/tests/vmtests/test_python_apt.py b/tests/vmtests/test_python_apt.py
index 5243578..1f2d6d9 100644
--- a/tests/vmtests/test_python_apt.py
+++ b/tests/vmtests/test_python_apt.py
@@ -37,4 +37,8 @@ class JammyTestPythonApt(relbase.jammy, TestPythonApt):
__test__ = True
+class JammyTestPythonApt(relbase.jammy, TestPythonApt):
+ __test__ = True
+
+
# vi: ts=4 expandtab syntax=python
diff --git a/tests/vmtests/test_raid5_bcache.py b/tests/vmtests/test_raid5_bcache.py
index e04120d..ed1328c 100644
--- a/tests/vmtests/test_raid5_bcache.py
+++ b/tests/vmtests/test_raid5_bcache.py
@@ -96,4 +96,8 @@ class JammyTestRaid5Bcache(relbase.jammy, TestMdadmBcacheAbs):
__test__ = True
+class JammyTestRaid5Bcache(relbase.jammy, TestMdadmBcacheAbs):
+ __test__ = True
+
+
# vi: ts=4 expandtab syntax=python
diff --git a/tests/vmtests/test_raid_partition_to_disk.py b/tests/vmtests/test_raid_partition_to_disk.py
index fa1939c..1adba86 100644
--- a/tests/vmtests/test_raid_partition_to_disk.py
+++ b/tests/vmtests/test_raid_partition_to_disk.py
@@ -26,4 +26,8 @@ class JammyTestRAIDPartitionToDisk(relbase.jammy, TestRAIDPartitionToDisk):
__test__ = True
+class JammyTestRAIDPartitionToDisk(relbase.jammy, TestRAIDPartitionToDisk):
+ __test__ = True
+
+
# vi: ts=4 expandtab syntax=python
diff --git a/tests/vmtests/test_reuse_lvm_member.py b/tests/vmtests/test_reuse_lvm_member.py
index cd7efd6..448adce 100644
--- a/tests/vmtests/test_reuse_lvm_member.py
+++ b/tests/vmtests/test_reuse_lvm_member.py
@@ -31,4 +31,9 @@ class JammyTestReuseLVMMemberPartition(relbase.jammy,
__test__ = True
+class JammyTestReuseLVMMemberPartition(relbase.jammy,
+ TestReuseLVMMemberPartition):
+ __test__ = True
+
+
# vi: ts=4 expandtab syntax=python
diff --git a/tests/vmtests/test_reuse_msdos_partitions.py b/tests/vmtests/test_reuse_msdos_partitions.py
index 32b4ad3..ad7fb42 100644
--- a/tests/vmtests/test_reuse_msdos_partitions.py
+++ b/tests/vmtests/test_reuse_msdos_partitions.py
@@ -30,4 +30,9 @@ class JammyTestReuseMSDOSPartitions(relbase.jammy,
__test__ = True
+class JammyTestReuseMSDOSPartitions(relbase.jammy,
+ TestReuseMSDOSPartitions):
+ __test__ = True
+
+
# vi: ts=4 expandtab syntax=python
diff --git a/tests/vmtests/test_reuse_raid_member.py b/tests/vmtests/test_reuse_raid_member.py
index 43c7185..fa62d42 100644
--- a/tests/vmtests/test_reuse_raid_member.py
+++ b/tests/vmtests/test_reuse_raid_member.py
@@ -36,6 +36,10 @@ class JammyTestReuseRAIDMember(relbase.jammy, TestReuseRAIDMember):
__test__ = True
+class JammyTestReuseRAIDMember(relbase.jammy, TestReuseRAIDMember):
+ __test__ = True
+
+
class BionicTestReuseRAIDMemberPartition(relbase.bionic,
TestReuseRAIDMemberPartition):
__test__ = True
@@ -51,4 +55,9 @@ class JammyTestReuseRAIDMemberPartition(relbase.jammy,
__test__ = True
+class JammyTestReuseRAIDMemberPartition(relbase.jammy,
+ TestReuseRAIDMemberPartition):
+ __test__ = True
+
+
# vi: ts=4 expandtab syntax=python
diff --git a/tests/vmtests/test_reuse_uefi_esp.py b/tests/vmtests/test_reuse_uefi_esp.py
index 3116505..c81ece8 100644
--- a/tests/vmtests/test_reuse_uefi_esp.py
+++ b/tests/vmtests/test_reuse_uefi_esp.py
@@ -48,4 +48,11 @@ class JammyTestUefiReuseEsp(relbase.jammy, TestUefiReuseEspAbs):
return super().test_efiboot_menu_has_one_distro_entry()
+class JammyTestUefiReuseEsp(relbase.jammy, TestUefiReuseEspAbs):
+ __test__ = True
+
+ def test_efiboot_menu_has_one_distro_entry(self):
+ return super().test_efiboot_menu_has_one_distro_entry()
+
+
# vi: ts=4 expandtab syntax=python
diff --git a/tests/vmtests/test_simple.py b/tests/vmtests/test_simple.py
index 47f4d15..da5e9f1 100644
--- a/tests/vmtests/test_simple.py
+++ b/tests/vmtests/test_simple.py
@@ -54,6 +54,13 @@ class JammyTestSimple(relbase.jammy, TestSimple):
self.output_files_exist(["netplan.yaml"])
+class JammyTestSimple(relbase.jammy, TestSimple):
+ __test__ = True
+
+ def test_output_files_exist(self):
+ self.output_files_exist(["netplan.yaml"])
+
+
class TestSimpleStorage(VMBaseClass):
""" Test curtin runs clear-holders when mode=simple with storage cfg. """
conf_file = "examples/tests/simple-storage.yaml"
@@ -113,6 +120,13 @@ class JammyTestSimpleStorage(relbase.jammy, TestSimpleStorage):
self.output_files_exist(["netplan.yaml"])
+class JammyTestSimpleStorage(relbase.jammy, TestSimpleStorage):
+ __test__ = True
+
+ def test_output_files_exist(self):
+ self.output_files_exist(["netplan.yaml"])
+
+
class TestGrubNoDefaults(VMBaseClass):
""" Test that curtin does not emit any grub configuration files. """
conf_file = "examples/tests/no-grub-file.yaml"
@@ -146,4 +160,11 @@ class JammyTestGrubNoDefaults(relbase.jammy, TestGrubNoDefaults):
self.output_files_exist(["netplan.yaml"])
+class JammyTestGrubNoDefaults(relbase.jammy, TestGrubNoDefaults):
+ __test__ = True
+
+ def test_output_files_exist(self):
+ self.output_files_exist(["netplan.yaml"])
+
+
# vi: ts=4 expandtab syntax=python
diff --git a/tests/vmtests/test_uefi_basic.py b/tests/vmtests/test_uefi_basic.py
index e962e09..3821129 100644
--- a/tests/vmtests/test_uefi_basic.py
+++ b/tests/vmtests/test_uefi_basic.py
@@ -104,6 +104,10 @@ class JammyUefiTestBasic(relbase.jammy, TestBasicAbs):
__test__ = True
+class JammyUefiTestBasic(relbase.jammy, TestBasicAbs):
+ __test__ = True
+
+
class Centos70UefiTestBasic4k(centos_relbase.centos70_xenial, TestBasicAbs):
__test__ = True
disk_block_size = 4096
@@ -129,4 +133,9 @@ class JammyUefiTestBasic4k(relbase.jammy, TestBasicAbs):
disk_block_size = 4096
+class JammyUefiTestBasic4k(relbase.jammy, TestBasicAbs):
+ __test__ = True
+ disk_block_size = 4096
+
+
# vi: ts=4 expandtab syntax=python
diff --git a/tests/vmtests/test_zfsroot.py b/tests/vmtests/test_zfsroot.py
index 6b4209d..ad8d02f 100644
--- a/tests/vmtests/test_zfsroot.py
+++ b/tests/vmtests/test_zfsroot.py
@@ -106,6 +106,11 @@ class JammyTestZfsRoot(relbase.jammy, TestZfsRootAbs):
mem = 4096
+class JammyTestZfsRoot(relbase.jammy, TestZfsRootAbs):
+ __test__ = True
+ mem = 4096
+
+
class TestZfsRootFsTypeAbs(TestZfsRootAbs):
conf_file = "examples/tests/basic-zfsroot.yaml"
@@ -135,4 +140,9 @@ class JammyTestZfsRootFsType(relbase.jammy, TestZfsRootFsTypeAbs):
mem = 4096
+class JammyTestZfsRootFsType(relbase.jammy, TestZfsRootFsTypeAbs):
+ __test__ = True
+ mem = 4096
+
+
# vi: ts=4 expandtab syntax=python
diff --git a/tools/vmtest-system-setup b/tools/vmtest-system-setup
index b0aab8a..ab03506 100755
--- a/tools/vmtest-system-setup
+++ b/tools/vmtest-system-setup
@@ -14,7 +14,10 @@ esac
DEPS=(
build-essential
cloud-image-utils
+<<<<<<< tools/vmtest-system-setup
cryptsetup
+=======
+>>>>>>> tools/vmtest-system-setup
git
libapt-pkg-dev
make
@@ -23,7 +26,10 @@ DEPS=(
python3-apt
python3-attr
python3-coverage
+<<<<<<< tools/vmtest-system-setup
python3-debian
+=======
+>>>>>>> tools/vmtest-system-setup
python3-jsonschema
python3-nose
python3-oauthlib
@@ -46,7 +52,10 @@ DEPS=(
tgt
tox
wget
+<<<<<<< tools/vmtest-system-setup
zfsutils-linux
+=======
+>>>>>>> tools/vmtest-system-setup
)
apt_get() {
diff --git a/tox.ini b/tox.ini
index 4e3a880..34fa117 100644
--- a/tox.ini
+++ b/tox.ini
@@ -29,7 +29,11 @@ sitepackages = false
[testenv:py3-flake8]
basepython = python3
deps = {[testenv]deps}
+<<<<<<< tox.ini
commands = {envpython} -m flake8 {posargs:--isolated curtin tests/}
+=======
+commands = {envpython} -m flake8 {posargs:curtin tests/}
+>>>>>>> tox.ini
[testenv:py3-pyflakes]
basepython = python3
Follow ups