Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions scripts/dtc/apple-adt-coverage-test.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,19 @@ def test_bootstrap_rejects_paths_absent_from_both_dtbs(self):
self.assertEqual(result.returncode, 1)
self.assertIn("new absent DT path", result.stderr)

def test_bootstrap_of_a_new_board_needs_no_base_dtb(self):
directory = self.root / "baseline"
directory.mkdir()
absent = self.root / "base-dtbs"
absent.mkdir()
args = ("--baseline-manifest-dir", str(directory), "--baseline-dtb-dir", str(absent))
result = self.run_check("/x - -> MISSING\n/y - -> /soc\n", *args)
self.assertEqual(result.returncode, 0, result.stderr)
self.assertIn("new board, no base DTB", result.stdout)
result = self.run_check("/x - -> /never-existed\n", *args)
self.assertEqual(result.returncode, 1)
self.assertIn("new absent DT path", result.stderr)

def test_ratchet_validates_baseline_and_options(self):
args = self.baseline("invalid\n")
self.assertEqual(self.run_check("/x - -> /soc\n", *args).returncode, 1)
Expand Down
7 changes: 7 additions & 0 deletions scripts/dtc/apple-adt-coverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,13 @@ def main(argv=None):
# DTBs. Later runs always use the base's committed inventory.
baseline = manifest
print(f"{board}: bootstrapping baseline from head inventory")
if not (args.baseline_dtb_dir / (board + ".dtb")).is_file():
# The board itself is new: nothing at the base can regress,
# but its own inventory must still resolve in the head DTB.
print(f"{board}: new board, no base DTB")
for target in sorted(broken):
errors.append(f"{board}: new absent DT path: {target}")
continue
old, before, old_broken = inventory(
baseline, args.baseline_dtb_dir / (board + ".dtb"), board)
removed = {e[1] for e in old} - {e[1] for e in entries}
Expand Down
Loading