Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkw committed Feb 8, 2024
1 parent 8eb0b98 commit 7c6d77f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 37 deletions.
3 changes: 0 additions & 3 deletions nexus/src/app/background/dns_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ impl BackgroundTask for DnsConfigWatcher {
mod test {
use crate::app::background::common::BackgroundTask;
use crate::app::background::dns_config::DnsConfigWatcher;
use crate::app::background::init::test::read_internal_dns_zone_id;
use crate::app::background::init::test::write_test_dns_generation;
use assert_matches::assert_matches;
use async_bb8_diesel::AsyncRunQueryDsl;
Expand Down Expand Up @@ -197,8 +196,6 @@ mod test {

// Now write generation 2, activate again, and verify that the update
// was sent to the watcher.
let internal_dns_zone_id =
read_internal_dns_zone_id(&opctx, &datastore).await;
write_test_dns_generation(&opctx, &datastore).await;
assert_eq!(watcher.borrow().as_ref().unwrap().generation, 1);
let value = task.activate(&opctx).await;
Expand Down
34 changes: 0 additions & 34 deletions nexus/src/app/background/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -364,23 +364,17 @@ fn init_dns(

#[cfg(test)]
pub mod test {
use async_bb8_diesel::AsyncRunQueryDsl;
use dropshot::HandlerTaskMode;
use nexus_db_model::DnsGroup;
use nexus_db_model::Generation;
use nexus_db_queries::context::OpContext;
use nexus_db_queries::db::datastore::DnsVersionUpdateBuilder;
use nexus_db_queries::db::DataStore;
use nexus_test_utils_macros::nexus_test;
use nexus_types::internal_api::params as nexus_params;
use nexus_types::internal_api::params::ServiceKind;
use omicron_common::api::external::DataPageParams;
use omicron_test_utils::dev::poll;
use std::net::SocketAddr;
use std::num::NonZeroU32;
use std::time::Duration;
use tempfile::TempDir;
use uuid::Uuid;

type ControlPlaneTestContext =
nexus_test_utils::ControlPlaneTestContext<crate::Server>;
Expand Down Expand Up @@ -440,10 +434,6 @@ pub mod test {
}
};

// We'll need the id of the internal DNS zone.
let internal_dns_zone_id =
read_internal_dns_zone_id(&opctx, datastore).await;

// Now spin up another DNS server, add it to the list of servers, and
// make sure that DNS gets propagated to it. Note that we shouldn't
// have to explicitly activate the background task because inserting a
Expand Down Expand Up @@ -660,28 +650,4 @@ pub mod test {
"test suite".to_string(),
)
}

pub(crate) async fn read_internal_dns_zone_id(
opctx: &OpContext,
datastore: &DataStore,
) -> Uuid {
let dns_zones = datastore
.dns_zones_list(
&opctx,
DnsGroup::Internal,
&DataPageParams {
marker: None,
direction: dropshot::PaginationOrder::Ascending,
limit: NonZeroU32::new(2).unwrap(),
},
)
.await
.unwrap();
assert_eq!(
dns_zones.len(),
1,
"expected exactly one internal DNS zone"
);
dns_zones[0].id
}
}

0 comments on commit 7c6d77f

Please sign in to comment.