Skip to content

Commit 602fdb5

Browse files
authored
[reconfigurator-planning] add test to ensure DNS lookups work on example system (#9233)
Ensure that DNS lookups for all internal services work on the example system, through both the standard and qorb DNS resolvers. I did notice that the example system doesn't set up every service. Something worth doing in a followup, but this does catch issues like (manually tested) the repo depot response being too large.
1 parent 36eb84b commit 602fdb5

File tree

5 files changed

+337
-1
lines changed

5 files changed

+337
-1
lines changed

Cargo.lock

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal-dns/types/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ omicron-workspace-hack.workspace = true
1414
omicron-uuid-kinds.workspace = true
1515
schemars.workspace = true
1616
serde.workspace = true
17+
strum.workspace = true
1718

1819
[dev-dependencies]
1920
expectorate.workspace = true

internal-dns/types/src/names.rs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
//! Well-known DNS names and related types for internal DNS (see RFD 248)
66
77
use omicron_uuid_kinds::{OmicronZoneUuid, SledUuid};
8+
use strum::{EnumIter, IntoEnumIterator};
89

910
/// Name for the special boundary NTP DNS name
1011
///
@@ -32,7 +33,9 @@ pub const DNS_ZONE_EXTERNAL_TESTING: &str = "oxide-dev.test";
3233
pub const ZONE_APEX_NAME: &str = "@";
3334

3435
/// Names of services within the control plane
35-
#[derive(Clone, Copy, Debug, Hash, Eq, Ord, PartialEq, PartialOrd)]
36+
#[derive(
37+
Clone, Copy, Debug, Hash, Eq, Ord, PartialEq, PartialOrd, EnumIter,
38+
)]
3639
pub enum ServiceName {
3740
/// The HTTP interface to a single-node ClickHouse server.
3841
Clickhouse,
@@ -78,6 +81,16 @@ pub enum ServiceName {
7881
}
7982

8083
impl ServiceName {
84+
/// Returns an iterator over all service name variants.
85+
///
86+
/// Service names with associated data, such as [`Self::SledAgent`] and
87+
/// [`Self::Crucible`], will have default values associated with them. When
88+
/// iterating over these service names, ensure that you provide the expected
89+
/// values associated with them.
90+
pub fn iter() -> impl Iterator<Item = Self> {
91+
<Self as IntoEnumIterator>::iter()
92+
}
93+
8194
fn service_kind(&self) -> &'static str {
8295
match self {
8396
ServiceName::Clickhouse => "clickhouse",

nexus/reconfigurator/planning/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,12 @@ uuid.workspace = true
5555
omicron-workspace-hack.workspace = true
5656

5757
[dev-dependencies]
58+
dns-server.workspace = true
5859
dropshot.workspace = true
5960
expectorate.workspace = true
6061
hex-literal.workspace = true
62+
hickory-resolver.workspace = true
63+
internal-dns-types.workspace = true
6164
maplit.workspace = true
6265
omicron-common = { workspace = true, features = ["testing"] }
6366
omicron-test-utils.workspace = true

0 commit comments

Comments
 (0)