@@ -8,6 +8,7 @@ use crate::blippy::SledKind;
8
8
use nexus_sled_agent_shared:: inventory:: ZoneKind ;
9
9
use nexus_types:: deployment:: BlueprintDatasetConfig ;
10
10
use nexus_types:: deployment:: BlueprintDatasetDisposition ;
11
+ use nexus_types:: deployment:: BlueprintHostPhase2DesiredContents ;
11
12
use nexus_types:: deployment:: BlueprintPhysicalDiskDisposition ;
12
13
use nexus_types:: deployment:: BlueprintSledConfig ;
13
14
use nexus_types:: deployment:: BlueprintZoneConfig ;
@@ -21,6 +22,8 @@ use omicron_common::address::DnsSubnet;
21
22
use omicron_common:: address:: Ipv6Subnet ;
22
23
use omicron_common:: address:: SLED_PREFIX ;
23
24
use omicron_common:: disk:: DatasetKind ;
25
+ use omicron_common:: disk:: M2Slot ;
26
+ use omicron_uuid_kinds:: MupdateOverrideUuid ;
24
27
use omicron_uuid_kinds:: SledUuid ;
25
28
use omicron_uuid_kinds:: ZpoolUuid ;
26
29
use std:: collections:: BTreeMap ;
@@ -577,9 +580,21 @@ fn check_mupdate_override(blippy: &mut Blippy<'_>) {
577
580
}
578
581
}
579
582
580
- // TODO: The host phase 2 contents should be set to CurrentContents
581
- // (waiting for
582
- // https://github.com/oxidecomputer/omicron/issues/8542).
583
+ // The host phase 2 contents should be set to CurrentContents.
584
+ check_mupdate_override_host_phase_2_contents (
585
+ blippy,
586
+ sled_id,
587
+ mupdate_override_id,
588
+ M2Slot :: A ,
589
+ & sled. host_phase_2 . slot_a ,
590
+ ) ;
591
+ check_mupdate_override_host_phase_2_contents (
592
+ blippy,
593
+ sled_id,
594
+ mupdate_override_id,
595
+ M2Slot :: B ,
596
+ & sled. host_phase_2 . slot_b ,
597
+ ) ;
583
598
584
599
// TODO: PendingMgsUpdates for this sled should be empty. Mapping
585
600
// sled IDs to their MGS identifiers (baseboard ID) requires a map
@@ -589,6 +604,30 @@ fn check_mupdate_override(blippy: &mut Blippy<'_>) {
589
604
}
590
605
}
591
606
607
+ fn check_mupdate_override_host_phase_2_contents (
608
+ blippy : & mut Blippy < ' _ > ,
609
+ sled_id : SledUuid ,
610
+ mupdate_override_id : MupdateOverrideUuid ,
611
+ slot : M2Slot ,
612
+ contents : & BlueprintHostPhase2DesiredContents ,
613
+ ) {
614
+ match contents {
615
+ BlueprintHostPhase2DesiredContents :: Artifact { version, hash } => {
616
+ blippy. push_sled_note (
617
+ sled_id,
618
+ Severity :: Fatal ,
619
+ SledKind :: MupdateOverrideWithHostPhase2Artifact {
620
+ mupdate_override_id,
621
+ slot,
622
+ version : version. clone ( ) ,
623
+ hash : * hash,
624
+ } ,
625
+ ) ;
626
+ }
627
+ BlueprintHostPhase2DesiredContents :: CurrentContents => { }
628
+ }
629
+ }
630
+
592
631
#[ cfg( test) ]
593
632
mod tests {
594
633
use super :: * ;
@@ -1637,7 +1676,7 @@ mod tests {
1637
1676
sled. remove_mupdate_override = Some ( mupdate_override_id) ;
1638
1677
1639
1678
// Find a zone and set it to use an artifact image source.
1640
- let kind = {
1679
+ let artifact_zone_kind = {
1641
1680
let mut zone = sled
1642
1681
. zones
1643
1682
. iter_mut ( )
@@ -1661,16 +1700,60 @@ mod tests {
1661
1700
}
1662
1701
} ;
1663
1702
1664
- let expected_note = Note {
1665
- severity : Severity :: Fatal ,
1666
- kind : Kind :: Sled { sled_id, kind } ,
1703
+ // Also set the host phase 2 contents.
1704
+ let host_phase_2_a_kind = {
1705
+ let version = BlueprintArtifactVersion :: Available {
1706
+ version : ArtifactVersion :: new_const ( "123" ) ,
1707
+ } ;
1708
+ let hash = ArtifactHash ( [ 2u8 ; 32 ] ) ;
1709
+ sled. host_phase_2 . slot_a =
1710
+ BlueprintHostPhase2DesiredContents :: Artifact {
1711
+ version : version. clone ( ) ,
1712
+ hash,
1713
+ } ;
1714
+ SledKind :: MupdateOverrideWithHostPhase2Artifact {
1715
+ mupdate_override_id,
1716
+ slot : M2Slot :: A ,
1717
+ version,
1718
+ hash,
1719
+ }
1667
1720
} ;
1668
1721
1722
+ let host_phase_2_b_kind = {
1723
+ let version = BlueprintArtifactVersion :: Unknown ;
1724
+ let hash = ArtifactHash ( [ 3u8 ; 32 ] ) ;
1725
+ sled. host_phase_2 . slot_b =
1726
+ BlueprintHostPhase2DesiredContents :: Artifact {
1727
+ version : version. clone ( ) ,
1728
+ hash,
1729
+ } ;
1730
+ SledKind :: MupdateOverrideWithHostPhase2Artifact {
1731
+ mupdate_override_id,
1732
+ slot : M2Slot :: B ,
1733
+ version,
1734
+ hash,
1735
+ }
1736
+ } ;
1737
+
1738
+ let expected_notes = vec ! [
1739
+ Note {
1740
+ severity: Severity :: Fatal ,
1741
+ kind: Kind :: Sled { sled_id, kind: artifact_zone_kind } ,
1742
+ } ,
1743
+ Note {
1744
+ severity: Severity :: Fatal ,
1745
+ kind: Kind :: Sled { sled_id, kind: host_phase_2_a_kind } ,
1746
+ } ,
1747
+ Note {
1748
+ severity: Severity :: Fatal ,
1749
+ kind: Kind :: Sled { sled_id, kind: host_phase_2_b_kind } ,
1750
+ } ,
1751
+ ] ;
1752
+
1669
1753
let report =
1670
1754
Blippy :: new ( & blueprint) . into_report ( BlippyReportSortKey :: Kind ) ;
1671
1755
eprintln ! ( "{}" , report. display( ) ) ;
1672
- assert_eq ! ( report. notes( ) . len( ) , 1 , "exactly one note expected" ) ;
1673
- assert_eq ! ( report. notes( ) [ 0 ] , expected_note) ;
1756
+ assert_eq ! ( report. notes( ) , & expected_notes) ;
1674
1757
1675
1758
logctx. cleanup_successful ( ) ;
1676
1759
}
0 commit comments