Skip to content

The ultimate harness for coding agents and beyond. All your agents. All your machines. One command center. Start with code, then follow your curiosity and build across disciplines: CAD, circuits, robots, games and music.

fix(os): refuse unsupported T2 installations before disk changes (#787)

Dee334c72330ddc
diff --git a/.github/workflows/os-input.yml b/.github/workflows/os-input.yml
index 5c4441e41..3add318db 100644
--- a/.github/workflows/os-input.yml
+++ b/.github/workflows/os-input.yml
@@ -9,9 +9,9 @@ on:
default: '37222390225'
required: true
probe:
- description: 'Laptop media controls or Apple encrypted-boot module closure'
+ description: 'Laptop controls, Apple boot modules or unsupported-platform install refusal'
type: choice
- options: [laptop-input, apple-boot]
+ options: [laptop-input, apple-boot, install-preflight]
default: laptop-input
required: true
push:
@@ -39,18 +39,29 @@ jobs:
run-id: ${{ inputs.image_run_id || '37222390225' }}
github-token: ${{ github.token }}
- name: Check source and install native VM tools
+ env:
+ PROBE: ${{ inputs.probe }}
run: |
- make -C os check
+ if [[ "$PROBE" == install-preflight ]]; then
+ PYTHONPATH=os/tests python3 -m unittest test_hardware test_installer
+ python3 -m py_compile os/tests/platform_preflight_vm.py os/tests/platform_preflight_guest.py
+ python3 os/tools/check.py
+ else
+ make -C os check
+ fi
go run github.com/rhysd/actionlint/cmd/[email protected] .github/workflows/os-input.yml
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends qemu-system-x86 qemu-utils ovmf python3-pil tesseract-ocr
sudo chmod a+rw /dev/kvm
- name: Check actual media-key input on USB and installed sessions
- if: ${{ inputs.probe != 'apple-boot' }}
+ if: ${{ inputs.probe != 'apple-boot' && inputs.probe != 'install-preflight' }}
run: python3 os/tests/input_vm.py --iso os/dist/*.iso
- name: Check Apple initramfs selection and encrypted boot
if: ${{ inputs.probe == 'apple-boot' }}
run: python3 os/tests/apple_boot_vm.py --iso os/dist/*.iso
+ - name: Check unsupported-platform refusal without disk writes
+ if: ${{ inputs.probe == 'install-preflight' }}
+ run: python3 os/tests/platform_preflight_vm.py --iso os/dist/*.iso
- name: Retain actual input, module and display evidence
if: always()
uses: actions/upload-artifact@v6
@@ -59,9 +70,12 @@ jobs:
path: |
os/test-results/input/
os/test-results/apple-boot/
+ os/test-results/install-preflight/
!os/test-results/input/*.qcow2
!os/test-results/input/OVMF_VARS.fd
!os/test-results/apple-boot/*.qcow2
!os/test-results/apple-boot/OVMF_VARS.fd
+ !os/test-results/install-preflight/*.qcow2
+ !os/test-results/install-preflight/OVMF_VARS.fd
retention-days: 14
compression-level: 0
diff --git a/os/INSTALL.md b/os/INSTALL.md
index b127ee2a8..8ca033248 100644
--- a/os/INSTALL.md
+++ b/os/INSTALL.md
@@ -72,7 +72,9 @@ and Password focused. Installation needs no network connection or Harness accoun
Intel Macs with a 64-bit EFI and no T2 chip are an experimental target. The USB
includes optional support for selected Broadcom radios, but no physical Mac
model has passed our complete hardware checks yet. This image is not the
-Apple Silicon or T2 installation path. Core 2 CPUs cannot run bundled OpenCode; this is not a supported bundled-agent target.
+Apple Silicon or T2 installation path. The installer refuses detected Apple T2 Macs
+before collecting passwords or changing the disk; their required driver stack is
+not bundled. Core 2 CPUs cannot run bundled OpenCode; this is not a supported bundled-agent target.
Shut down, insert the USB, then hold **Option (⌥)** while turning on the Mac.
Choose the external **EFI Boot** entry. Apple's
diff --git a/os/hardware.py b/os/hardware.py
index 52c26cb54..a55e3c631 100644
--- a/os/hardware.py
+++ b/os/hardware.py
@@ -61,6 +61,15 @@ def pci_devices(sysfs=Path('/sys')):
return devices
+def installation_blocker(sysfs=Path('/sys')):
+ # The T2 BCE controller identifies this platform independently of DMI names
+ # and the currently bound driver. The stock image does not ship its stack.
+ # https://github.com/t2linux/linux-t2-patches/blob/main/1001-Add-t2bce-driver-stack.patch
+ if any(device['id'] == '106b:1801' for device in pci_devices(sysfs)):
+ return 'This Harness image does not support Apple T2 Macs yet.'
+ return None
+
+
def needs_broadcom(device):
if device['id'] not in BROADCOM_IDS or device['class'] != '028000':
return False
@@ -88,6 +97,7 @@ def report(sysfs=Path('/sys'), proc=Path('/proc')):
'opencode_cpu': {'required_x86_feature': 'sse4_2',
'available': 'sse4_2' in flags.split() if flags is not None else None},
'pci': pci_devices(sysfs),
+ 'installation_blocker': installation_blocker(sysfs),
'backlights': [p.name for p in sorted((sysfs / 'class/backlight').glob('*'))],
'broadcom_bundle_available': (BUNDLE / 'manifest.json').is_file(),
'nvidia_bundle_available': (NVIDIA_BUNDLE / 'manifest.json').is_file()}
diff --git a/os/installer.py b/os/installer.py
index aa6e7245c..620b10a0f 100644
--- a/os/installer.py
+++ b/os/installer.py
@@ -6,6 +6,7 @@ from contextlib import contextmanager
import curses
from datetime import datetime, timezone
import hashlib
+import importlib.util
import json
import os
import pwd
@@ -28,6 +29,17 @@ INSTALL_LOG = Path('/var/log/harness-install.log')
LAST_LOG = None
+def require_install_platform(sysfs=Path('/sys')):
+ # Load the root-owned packaged sibling, never a module from the working
+ # directory. Only tests supply a different sysfs root.
+ spec = importlib.util.spec_from_file_location('harness_os_hardware', Path(__file__).with_name('hardware.py'))
+ hardware = importlib.util.module_from_spec(spec)
+ spec.loader.exec_module(hardware)
+ blocker = hardware.installation_blocker(sysfs)
+ if blocker:
+ raise ValueError(blocker)
+
+
def encryption_memory(meminfo=Path('/proc/meminfo')):
"""Budget Argon2 against RAM, not zram advertised as additional swap."""
try:
@@ -317,6 +329,7 @@ def copy_image(source, target, broadcom=Path('/usr/share/harness-os/hardware/bro
def install(config, source, target, progress=None):
report = progress or (lambda message: print(message, flush=True))
validate_config(config)
+ require_install_platform()
# Inspect again immediately before partitioning, rather than trusting the picker.
selected_disk(config)
if not source.is_file():
@@ -833,6 +846,7 @@ def main(args=None):
args = arguments() if args is None else args
if os.geteuid() != 0:
raise SystemExit('Run sudo harness install from the live USB.')
+ require_install_platform()
if args.config:
if args.username is not None or args.hostname is not None or args.no_encryption:
raise ValueError('With --config, set account names and encryption in that file instead of command-line overrides.')
diff --git a/os/tests/platform_preflight_guest.py b/os/tests/platform_preflight_guest.py
new file mode 100644
index 000000000..0370f4a68
--- /dev/null
+++ b/os/tests/platform_preflight_guest.py
@@ -0,0 +1,75 @@
+#!/usr/bin/env python3
+"""Namespaced PCI fixture for a disposable VM; never install or emulate a Mac."""
+import argparse
+import hashlib
+import importlib.util
+import json
+import os
+from pathlib import Path
+import subprocess
+import tempfile
+import time
+
+
+def load(name, path):
+ spec = importlib.util.spec_from_file_location(name, path)
+ module = importlib.util.module_from_spec(spec)
+ spec.loader.exec_module(module)
+ return module
+
+
+def main():
+ parser = argparse.ArgumentParser(description=__doc__)
+ parser.add_argument('mode', choices=['check', 'ui'])
+ args = parser.parse_args()
+ assert os.geteuid() == 0 and Path('/etc/harness-live').is_file(), 'Disposable live guest only'
+ assert subprocess.check_output(['lsblk', '-ndo', 'SERIAL', '/dev/vda'], text=True).strip() == 'HN_OS_TEST'
+ assert os.readlink('/proc/self/ns/mnt') != os.readlink('/proc/1/ns/mnt'), 'A private mount namespace is required'
+ assert subprocess.check_output(['nmcli', 'networking'], text=True).strip() == 'disabled'
+ expected = 'This Harness image does not support Apple T2 Macs yet.'
+ with tempfile.TemporaryDirectory(prefix='harness-platform-', dir='/run') as directory:
+ folder = Path(directory)
+ devices = folder / 'devices'
+ device = devices / '0000:03:00.0'
+ device.mkdir(parents=True)
+ for name, value in [('vendor', '0x106b'), ('device', '0x1801'), ('class', '0x088000')]:
+ (device / name).write_text(value + '\n')
+ # Production still reads /sys. This mount affects only this test process
+ # and children, not the VM's normal installer or real PCI bindings.
+ subprocess.run(['mount', '--bind', str(devices), '/sys/bus/pci/devices'], check=True, timeout=10)
+ subprocess.run(['mount', '-o', 'remount,bind,ro', '/sys/bus/pci/devices'], check=True, timeout=10)
+ installer_path = Path('/usr/lib/harness-os/install.py')
+ hardware_path = installer_path.with_name('hardware.py')
+ if args.mode == 'ui':
+ os.execv('/usr/bin/python3', ['python3', str(installer_path), '--boot'])
+ hardware = load('hardware', hardware_path)
+ installer = load('installer', installer_path)
+ report = hardware.report()
+ assert report['installation_blocker'] == expected, report
+ config = dict(disk='/dev/vda', expected_serial='HN_OS_TEST', confirm_erase='/dev/vda',
+ username='me', hostname='harness', password='test-password-123', encrypt=True)
+ config_path = folder / 'install.json'
+ config_path.write_text(json.dumps(config))
+ started = time.monotonic()
+ result = subprocess.run(['python3', str(installer_path), '--config', str(config_path), '--yes-erase-disk'],
+ text=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, timeout=15)
+ assert result.returncode == 1 and result.stdout.strip() == 'Installation stopped: ' + expected, result
+ try:
+ installer.install(config, installer.live_payload(), Path('/mnt/harness-os'))
+ except ValueError as error:
+ assert str(error) == expected, str(error)
+ else:
+ raise AssertionError('The direct installation backend accepted a T2 platform')
+ assert not Path('/mnt/harness-os').exists(), 'Preflight created an installation target'
+ print('HN_PLATFORM_RESULT=' + json.dumps({
+ 'status': 'passed', 'cli_status': result.returncode, 'cli_output': result.stdout.strip(),
+ 'backend_refusal': expected, 'hardware_blocker': report['installation_blocker'],
+ 'real_dmi': report['computer'], 'fixture_pci_ids': [device['id'] for device in report['pci']],
+ 'hardware_sha256': hashlib.sha256(hardware_path.read_bytes()).hexdigest(),
+ 'installer_sha256': hashlib.sha256(installer_path.read_bytes()).hexdigest(),
+ 'elapsed_seconds': round(time.monotonic() - started, 3),
+ }), flush=True)
+
+
+if __name__ == '__main__':
+ main()
diff --git a/os/tests/platform_preflight_vm.py b/os/tests/platform_preflight_vm.py
new file mode 100644
index 000000000..4d746ba97
--- /dev/null
+++ b/os/tests/platform_preflight_vm.py
@@ -0,0 +1,151 @@
+#!/usr/bin/env python3
+"""Observe unsupported-platform refusal without changing a private VM's disk."""
+import argparse
+import hashlib
+import json
+import os
+from pathlib import Path
+import re
+import shlex
+import shutil
+import subprocess
+import time
+from footprint_vm import copy_file
+from hardware_install_vm import candidate_record, digest
+from session_vm import screen_text
+from vm import VM
+
+
+def user(command):
+ return ('runuser -u me -- env XDG_RUNTIME_DIR=/run/user/1000 '
+ 'DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus ' + command)
+
+
+def wait_screen(vm, name, words, timeout=30):
+ deadline = time.monotonic() + timeout
+ while time.monotonic() < deadline:
+ text = screen_text(vm, name)
+ if all(word in text for word in words):
+ return text
+ time.sleep(.5)
+ raise TimeoutError('Missing visible screen: ' + name)
+
+
+def compare_disk(vm, baseline):
+ command = ['qemu-img', 'compare', '-f', 'qcow2', '-F', 'qcow2', str(baseline), str(vm.disk)]
+ result = subprocess.run(command, text=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, timeout=60)
+ return {'command': command, 'status': result.returncode, 'output': result.stdout.strip(),
+ 'logical_disk_bytes_unchanged': result.returncode == 0}
+
+
+def main():
+ parser = argparse.ArgumentParser(description=__doc__)
+ parser.add_argument('--iso', type=Path, required=True)
+ parser.add_argument('--output', type=Path, default=Path('os/test-results/install-preflight'))
+ args = parser.parse_args()
+ assert os.access('/dev/kvm', os.R_OK | os.W_OK), 'Native x86 KVM is required'
+ iso = args.iso.resolve()
+ manifest = json.loads(iso.with_name('manifest.json').read_text())
+ assert digest(iso) == manifest['iso']['sha256'] and iso.stat().st_size == manifest['iso']['bytes']
+ folder = args.output.resolve()
+ folder.mkdir(parents=True, exist_ok=False)
+ (folder / 'image-manifest.json').write_text(json.dumps(manifest, indent=2) + '\n')
+ root = Path(__file__).resolve().parents[1]
+ candidates = {'hardware': root / 'hardware.py', 'installer': root / 'installer.py'}
+ scripts = ['platform_preflight_vm.py', 'platform_preflight_guest.py', 'vm.py',
+ 'footprint_vm.py', 'hardware_install_vm.py', 'session_vm.py']
+ receipt = dict(status='running', started_at=time.time(), image_source_commit=manifest['source_commit'],
+ iso_sha256=manifest['iso']['sha256'], memory_mib=1024, firmware='uefi', live_transport='cdrom',
+ candidates={name: candidate_record(path) for name, path in candidates.items()},
+ test_inputs={name: candidate_record(Path(__file__).with_name(name)) for name in scripts},
+ limitations=['Synthetic BCE PCI detection, not a physical T2 Mac boot or driver test.',
+ 'No T2 input, Wi-Fi, audio, storage or suspend support is established.',
+ 'Non-T2 form is observed; unchanged full installation and driver checks are not repeated.'])
+ vm = VM(folder, iso, 'uefi', 1024)
+ baseline = folder / 'baseline.qcow2'
+ try:
+ size = json.loads(subprocess.check_output(['qemu-img', 'info', '--output=json', str(vm.disk)]))['virtual-size']
+ # Preserve distinctive data where partitioning would normally overwrite
+ # the disk, then compare the entire logical disk after all three paths.
+ sentinels = [(0, 1048576, '0x5a'), (size - 1048576, 1048576, '0xa5')]
+ for offset, length, pattern in sentinels:
+ subprocess.run(['qemu-io', '-f', 'qcow2', '-c', f'write -P {pattern} {offset} {length}', str(vm.disk)],
+ check=True, timeout=30)
+ shutil.copyfile(vm.disk, baseline)
+ receipt['disk'] = dict(virtual_bytes=size, sentinels=sentinels, baseline_file_sha256=digest(baseline))
+ vm.start(live=True)
+ vm.wait(r'root@[^\r\n]*[#] ', timeout=180)
+ vm.shell_ready = True
+ vm.command('stty -echo; nmcli networking off; umask 077')
+ vm.command('timeout 30 sh -c \'until test -S /run/user/1000/bus && pgrep -x labwc >/dev/null; do sleep .25; done\'')
+ vm.command(user('systemctl --user stop harness-install.service'))
+ vm.command('test ! -e /mnt/harness-os && test "$(id -u me)" = 1000')
+ receipt['original_image_files'] = {}
+ for name, source in candidates.items():
+ destination = '/usr/lib/harness-os/' + ('install.py' if name == 'installer' else 'hardware.py')
+ receipt['original_image_files'][name] = hashlib.sha256(vm.read_file(destination)).hexdigest()
+ copy_file(vm, source.read_bytes(), destination)
+ actual = hashlib.sha256(vm.read_file(destination)).hexdigest()
+ assert actual == receipt['candidates'][name]['sha256']
+ script = Path(__file__).with_name('platform_preflight_guest.py')
+ copy_file(vm, script.read_bytes(), '/run/platform-preflight-guest.py')
+ command = 'timeout 30 unshare --mount --propagation private python3 /run/platform-preflight-guest.py check'
+ output, _ = vm.command(command, timeout=40)
+ (folder / 'refusal.log').write_text(output)
+ match = re.search(r'HN_PLATFORM_RESULT=(\{[^\r\n]+\})', output)
+ assert match, 'Missing guest platform refusal receipt'
+ receipt['refusal'] = json.loads(match.group(1))
+ for name in candidates:
+ assert receipt['refusal'][name + '_sha256'] == receipt['candidates'][name]['sha256']
+
+ # Show the actual boot installer error through its normal foot service.
+ override = '/home/me/.config/systemd/user/harness-install.service.d/preflight-test.conf'
+ vm.command(user('mkdir -p ' + shlex.quote(str(Path(override).parent))))
+ unit = ('[Service]\nExecStart=\nExecStart=/usr/bin/foot --config=/usr/share/harness-os/foot.ini '
+ '/usr/bin/sudo /usr/bin/unshare --mount --propagation private '
+ '/usr/bin/python3 /run/platform-preflight-guest.py ui\n')
+ copy_file(vm, unit.encode(), override)
+ vm.command('chown me:me ' + shlex.quote(override))
+ vm.command(user('systemctl --user daemon-reload'))
+ vm.command(user('systemctl --user start harness-install.service'))
+ receipt['visible_refusal'] = wait_screen(vm, '01-t2-refusal', ['installation stopped', 'apple t2 macs yet'])
+ vm.command(user('systemctl --user stop harness-install.service'))
+ vm.command('rm ' + shlex.quote(override))
+ vm.command(user('systemctl --user daemon-reload'))
+ # Namespace teardown restores genuine generic hardware automatically.
+ output, _ = vm.command('python3 /usr/lib/harness-os/hardware.py')
+ (folder / 'generic-hardware.log').write_text(output)
+ assert '"installation_blocker": null' in output
+ vm.command(user('systemctl --user start harness-install.service'))
+ receipt['visible_generic_form'] = wait_screen(vm, '02-generic-form', ['disk', 'encryption', 'repeat password'])
+ vm.command('sync')
+ vm.stop()
+ receipt['disk_comparison'] = compare_disk(vm, baseline)
+ assert receipt['disk_comparison']['logical_disk_bytes_unchanged'], receipt['disk_comparison']
+ receipt['status'] = 'passed'
+ except BaseException as error:
+ receipt.update(status='failed', error=repr(error))
+ if vm.process and vm.process.poll() is None:
+ try:
+ vm.screenshot('failure')
+ output, _ = vm.command(user('journalctl --user -u harness-install.service -n 50 --no-pager'), timeout=15, check=False)
+ (folder / 'failure-journal.log').write_text(output)
+ except Exception:
+ pass
+ raise
+ finally:
+ vm.stop()
+ if baseline.exists() and 'disk_comparison' not in receipt:
+ try:
+ receipt['disk_comparison'] = compare_disk(vm, baseline)
+ except Exception as error:
+ receipt['disk_comparison_error'] = repr(error)
+ receipt['finished_at'] = time.time()
+ (folder / 'receipt.json').write_text(json.dumps(receipt, indent=2) + '\n')
+ vm.log.close()
+ vm.stderr.close()
+ vm.control.cleanup()
+
+
+if __name__ == '__main__':
+ main()
diff --git a/os/tests/test_hardware.py b/os/tests/test_hardware.py
index 8fdec9b21..22084ca96 100644
--- a/os/tests/test_hardware.py
+++ b/os/tests/test_hardware.py
@@ -19,10 +19,10 @@ class HardwarePolicy(unittest.TestCase):
self.root = Path(self.temp.name).resolve()
self.sysfs = self.root / 'sys'
- def device(self, address='0000:03:00.0', device='43a0', driver=None, wireless=False, kind='028000', override='(null)'):
+ def device(self, address='0000:03:00.0', device='43a0', driver=None, wireless=False, kind='028000', override='(null)', vendor='14e4'):
path = self.sysfs / 'bus/pci/devices' / address
path.mkdir(parents=True)
- for name, value in [('vendor', '14e4'), ('device', device), ('class', kind)]:
+ for name, value in [('vendor', vendor), ('device', device), ('class', kind)]:
(path / name).write_text('0x' + value)
(path / 'driver_override').write_text(override + '\n')
if driver:
@@ -39,6 +39,25 @@ class HardwarePolicy(unittest.TestCase):
(interface / 'wireless').mkdir()
return path
+ def test_t2_installation_blocker_uses_bce_device_even_without_known_dmi(self):
+ self.device(vendor='106b', device='1801', kind='088000', driver='vfio-pci')
+ expected = 'This Harness image does not support Apple T2 Macs yet.'
+ self.assertEqual(hardware.installation_blocker(self.sysfs), expected)
+ dmi = self.sysfs / 'class/dmi/id'
+ dmi.mkdir(parents=True)
+ (dmi / 'product_name').write_text('Unrecognized Apple model')
+ self.assertEqual(hardware.report(self.sysfs, self.root / 'proc')['installation_blocker'], expected)
+
+ def test_t2_installation_blocker_does_not_guess_from_missing_dmi_or_other_ids(self):
+ self.assertIsNone(hardware.installation_blocker(self.sysfs))
+ self.device(vendor='106b', device='1803', kind='040100') # T2 audio is not the BCE selector.
+ self.device(address='0000:04:00.0', vendor='14e4', device='1801')
+ dmi = self.sysfs / 'class/dmi/id'
+ dmi.mkdir(parents=True)
+ (dmi / 'product_name').write_text('MacBookPro14,3')
+ self.assertIsNone(hardware.installation_blocker(self.sysfs))
+ self.assertIsNone(hardware.report(self.sysfs, self.root / 'proc')['installation_blocker'])
+
def bundle(self, folder=None):
folder = folder or self.root / 'bundle'
folder.mkdir(parents=True)
diff --git a/os/tests/test_installer.py b/os/tests/test_installer.py
index e2a1fc94c..a317f7457 100644
--- a/os/tests/test_installer.py
+++ b/os/tests/test_installer.py
@@ -90,6 +90,50 @@ class DiskSafety(unittest.TestCase):
installer.validate_config(dict(good, **change))
+class PlatformSafety(unittest.TestCase):
+ def setUp(self):
+ self.temporary = tempfile.TemporaryDirectory()
+ self.addCleanup(self.temporary.cleanup)
+ self.root = Path(self.temporary.name)
+ self.sysfs = self.root / 'sys'
+ device = self.sysfs / 'bus/pci/devices/0000:03:00.0'
+ device.mkdir(parents=True)
+ (device / 'vendor').write_text('0x106b\n')
+ (device / 'device').write_text('0x1801\n')
+ (device / 'class').write_text('0x088000\n')
+
+ def test_t2_is_rejected_before_the_form_or_payload_read(self):
+ check = installer.require_install_platform
+ with patch.object(installer.os, 'geteuid', return_value=0), \
+ patch.object(installer, 'require_install_platform', side_effect=lambda: check(self.sysfs)), \
+ patch.object(installer, 'live_payload') as payload, \
+ patch.object(installer, 'interactive') as form, \
+ patch.object(installer, 'install') as install:
+ with self.assertRaisesRegex(ValueError, 'does not support Apple T2 Macs yet'):
+ installer.main(installer.argparse.Namespace(config=None))
+ payload.assert_not_called()
+ form.assert_not_called()
+ install.assert_not_called()
+
+ def test_backend_rejects_t2_before_target_inspection_or_disk_commands(self):
+ config = dict(username='me', hostname='harness', password='test-password', encrypt=True,
+ disk='/dev/vda', confirm_erase='/dev/vda')
+ check = installer.require_install_platform
+ with patch.object(installer, 'require_install_platform', side_effect=lambda: check(self.sysfs)), \
+ patch.object(installer, 'selected_disk') as selected, \
+ patch.object(installer, 'preflight') as preflight, \
+ patch.object(installer, 'run') as commands:
+ with self.assertRaisesRegex(ValueError, 'does not support Apple T2 Macs yet'):
+ installer.install(config, self.root / 'payload.sfs', self.root / 'target')
+ selected.assert_not_called()
+ preflight.assert_not_called()
+ commands.assert_not_called()
+ self.assertFalse((self.root / 'target').exists())
+
+ def test_missing_sysfs_does_not_classify_an_ordinary_computer_as_t2(self):
+ installer.require_install_platform(self.root / 'missing-sysfs')
+
+
class LivePayload(unittest.TestCase):
def test_usb_ram_copy_and_mounted_media_are_both_supported(self):
with tempfile.TemporaryDirectory() as temp: