Skip to content

Commit

Permalink
NTP self assembling zone (#5168)
Browse files Browse the repository at this point in the history
  • Loading branch information
karencfv authored Mar 6, 2024
1 parent 94bc6f5 commit c3f385e
Show file tree
Hide file tree
Showing 6 changed files with 385 additions and 299 deletions.
12 changes: 8 additions & 4 deletions illumos-utils/src/running_zone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1139,7 +1139,7 @@ impl InstalledZone {

#[derive(Clone)]
pub struct FakeZoneBuilderConfig {
temp_dir: Arc<Utf8TempDir>,
temp_dir: Arc<Utf8PathBuf>,
}

#[derive(Clone, Default)]
Expand All @@ -1157,10 +1157,14 @@ pub struct ZoneBuilderFactory {

impl ZoneBuilderFactory {
/// For use in unit tests that don't require actual zone creation to occur.
pub fn fake() -> Self {
pub fn fake(temp_dir: Option<&String>) -> Self {
let temp_dir = match temp_dir {
Some(dir) => Utf8PathBuf::from(dir),
None => Utf8TempDir::new().unwrap().into_path(),
};
Self {
fake_cfg: Some(FakeZoneBuilderConfig {
temp_dir: Arc::new(Utf8TempDir::new().unwrap()),
temp_dir: Arc::new(temp_dir),
}),
}
}
Expand Down Expand Up @@ -1280,7 +1284,7 @@ impl<'a> ZoneBuilder<'a> {
.new_control(None)
.map_err(move |err| InstallZoneError::CreateVnic { zone, err })?;
let fake_cfg = self.fake_cfg.unwrap();
let temp_dir = fake_cfg.temp_dir.path().to_path_buf();
let temp_dir = fake_cfg.temp_dir;
(|| {
let full_zone_name = InstalledZone::get_zone_name(
self.zone_type?,
Expand Down
13 changes: 13 additions & 0 deletions package-manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -273,12 +273,25 @@ output.type = "zone"
[package.ntp]
service_name = "ntp"
only_for_targets.image = "standard"
source.type = "composite"
source.packages = [
"ntp-svc.tar.gz",
"opte-interface-setup.tar.gz",
"zone-network-setup.tar.gz",
"zone-network-install.tar.gz"
]
output.type = "zone"

[package.ntp-svc]
service_name = "ntp-svc"
only_for_targets.image = "standard"
source.type = "local"
source.paths = [
{ from = "smf/ntp/manifest", to = "/var/svc/manifest/site/ntp" },
{ from = "smf/ntp/method", to = "/var/svc/method" },
{ from = "smf/ntp/etc", to = "/etc" },
]
output.intermediate_only = true
output.type = "zone"

[package.omicron-gateway]
Expand Down
Loading

0 comments on commit c3f385e

Please sign in to comment.