Skip to content

Commit

Permalink
fix test workaround for localhost IPs
Browse files Browse the repository at this point in the history
  • Loading branch information
jgallagher committed Aug 6, 2024
1 parent 0f67712 commit 9c335e3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,9 @@ impl DataStore {
// the normal path because normally a given external IP must only be
// used once. Just treat localhost in the test suite as though it's
// already allocated. We do the same in is_nic_already_allocated().
if cfg!(test) && external_ip.ip().is_loopback() {
if cfg!(any(test, feature = "testing"))
&& external_ip.ip().is_loopback()
{
return Ok(true);
}

Expand Down Expand Up @@ -206,7 +208,7 @@ impl DataStore {
log: &Logger,
) -> Result<bool, Error> {
// See the comment in is_external_ip_already_allocated().
if cfg!(test) && nic.ip.is_loopback() {
if cfg!(any(test, feature = "testing")) && nic.ip.is_loopback() {
return Ok(true);
}

Expand Down
1 change: 1 addition & 0 deletions nexus/reconfigurator/execution/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ async-bb8-diesel.workspace = true
diesel.workspace = true
httptest.workspace = true
ipnet.workspace = true
nexus-db-queries = { workspace = true, features = ["testing"] }
nexus-reconfigurator-planning.workspace = true
nexus-reconfigurator-preparation.workspace = true
nexus-inventory.workspace = true
Expand Down

0 comments on commit 9c335e3

Please sign in to comment.