Generalize safe host-to-isolated rename migration
This commit is contained in:
parent
aaee63a6e3
commit
35ab7f17c0
1 changed files with 589 additions and 81 deletions
|
|
@ -5,6 +5,7 @@ import importlib.machinery
|
|||
import importlib.util
|
||||
import json
|
||||
from pathlib import Path
|
||||
import re
|
||||
import tempfile
|
||||
import unittest
|
||||
from unittest import mock
|
||||
|
|
@ -406,7 +407,7 @@ class VerificationTests(unittest.TestCase):
|
|||
)
|
||||
|
||||
def test_runsc_materializer_and_install_identity_are_exact(self) -> None:
|
||||
build_id = "b9ad6f93a8e890b5935061582b1a128682f3fd41c8053c54d0e44ff45d809971"
|
||||
build_id = "5b441d02d40792cfe228b294fb688a80cf6161fb6876d49ef03138618ae2562e"
|
||||
materializer = (ROOT / "tools/materialize-runsc").read_text()
|
||||
installer = (ROOT / "tools/install-to-host").read_text()
|
||||
runtime = (ROOT / "crates/lazaret-runtime-supervisor/src/sandbox.rs").read_text()
|
||||
|
|
@ -416,6 +417,14 @@ class VerificationTests(unittest.TestCase):
|
|||
self.assertIn(f"build_id={build_id}", materializer)
|
||||
self.assertIn(f"runsc_build_id={build_id}", installer)
|
||||
self.assertIn(f'"lazaret-runsc-{build_id}"', runtime)
|
||||
encoded = re.search(
|
||||
r"RUNSC_BUILD_ID_BYTES: \[u8; 32\] = \[(.*?)\];", runtime, re.DOTALL
|
||||
)
|
||||
self.assertIsNotNone(encoded)
|
||||
self.assertEqual(
|
||||
bytes(int(value.strip()) for value in encoded.group(1).split(",") if value.strip()),
|
||||
bytes.fromhex(build_id),
|
||||
)
|
||||
self.assertIn("cmp --silent", installer)
|
||||
self.assertTrue(
|
||||
(ROOT / "patches/gvisor-9f8f6c917-directory-handles.patch").is_file()
|
||||
|
|
@ -423,6 +432,12 @@ class VerificationTests(unittest.TestCase):
|
|||
self.assertTrue(
|
||||
(ROOT / "patches/gvisor-9f8f6c917-private-ownership.patch").is_file()
|
||||
)
|
||||
self.assertTrue(
|
||||
(
|
||||
ROOT
|
||||
/ "patches/gvisor-9f8f6c917-per-description-file-handles.patch"
|
||||
).is_file()
|
||||
)
|
||||
self.assertTrue(
|
||||
(ROOT / "patches/gvisor-9f8f6c917-MODULE.bazel.lock").is_file()
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in a new issue