Skip to content

Commit 127d5a8

Browse files
committed
add the "second" Nexus to the test suite blueprint; fix omdb tests
1 parent 5f43b60 commit 127d5a8

File tree

5 files changed

+238
-123
lines changed

5 files changed

+238
-123
lines changed

common/src/address.rs

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,9 @@ pub fn get_64_subnet(
373373
///
374374
/// The first address in the range is guaranteed to be no greater than the last
375375
/// address.
376-
#[derive(Clone, Copy, Debug, PartialEq, Eq, Deserialize, Serialize)]
376+
#[derive(
377+
Clone, Copy, Debug, PartialEq, Eq, Deserialize, Serialize, Ord, PartialOrd,
378+
)]
377379
#[serde(untagged)]
378380
pub enum IpRange {
379381
V4(Ipv4Range),
@@ -507,7 +509,16 @@ impl From<Ipv6Range> for IpRange {
507509
///
508510
/// The first address must be less than or equal to the last address.
509511
#[derive(
510-
Clone, Copy, Debug, PartialEq, Eq, Deserialize, Serialize, JsonSchema,
512+
Clone,
513+
Copy,
514+
Debug,
515+
PartialEq,
516+
Eq,
517+
Deserialize,
518+
Serialize,
519+
JsonSchema,
520+
PartialOrd,
521+
Ord,
511522
)]
512523
#[serde(try_from = "AnyIpv4Range")]
513524
pub struct Ipv4Range {
@@ -571,7 +582,16 @@ impl TryFrom<AnyIpv4Range> for Ipv4Range {
571582
///
572583
/// The first address must be less than or equal to the last address.
573584
#[derive(
574-
Clone, Copy, Debug, PartialEq, Eq, Deserialize, Serialize, JsonSchema,
585+
PartialOrd,
586+
Ord,
587+
Clone,
588+
Copy,
589+
Debug,
590+
PartialEq,
591+
Eq,
592+
Deserialize,
593+
Serialize,
594+
JsonSchema,
575595
)]
576596
#[serde(try_from = "AnyIpv6Range")]
577597
pub struct Ipv6Range {

dev-tools/omdb/src/bin/omdb/db.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5016,7 +5016,7 @@ async fn cmd_db_dns_diff(
50165016
// Load the added and removed items.
50175017
use nexus_db_schema::schema::dns_name::dsl;
50185018

5019-
let added = dsl::dns_name
5019+
let mut added = dsl::dns_name
50205020
.filter(dsl::dns_zone_id.eq(zone.id))
50215021
.filter(dsl::version_added.eq(version.version))
50225022
.limit(i64::from(u32::from(limit)))
@@ -5026,7 +5026,7 @@ async fn cmd_db_dns_diff(
50265026
.context("loading added names")?;
50275027
check_limit(&added, limit, || "loading added names");
50285028

5029-
let removed = dsl::dns_name
5029+
let mut removed = dsl::dns_name
50305030
.filter(dsl::dns_zone_id.eq(zone.id))
50315031
.filter(dsl::version_removed.eq(version.version))
50325032
.limit(i64::from(u32::from(limit)))
@@ -5042,6 +5042,11 @@ async fn cmd_db_dns_diff(
50425042
);
50435043
println!("");
50445044

5045+
// This is kind of stupid-expensive, but there aren't a lot of records
5046+
// here and it's helpful for this output to be stable.
5047+
added.sort_by_cached_key(|k| format!("{} {:?}", k.name, k.records()));
5048+
removed.sort_by_cached_key(|k| format!("{} {:?}", k.name, k.records()));
5049+
50455050
for a in added {
50465051
print_name("+", &a.name, a.records().context("parsing records"));
50475052
}
@@ -5097,7 +5102,8 @@ async fn cmd_db_dns_names(
50975102
}
50985103
});
50995104

5100-
for (name, records) in names {
5105+
for (name, mut records) in names {
5106+
records.sort();
51015107
print_name("", &name, Ok(records));
51025108
}
51035109
}

dev-tools/omdb/tests/successes.out

Lines changed: 115 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ changes: names added: 3, names removed: 0
3232

3333
+ @ NS ns1.oxide-dev.test
3434
+ ns1 AAAA ::1
35-
+ test-suite-silo.sys A 127.0.0.1
35+
+ test-suite-silo.sys (records: 2)
36+
+ A 127.0.0.1
37+
+ AAAA 100::1
3638
---------------------------------------------
3739
stderr:
3840
note: using database URL postgresql://root@[::1]:REDACTED_PORT/omicron?sslmode=disable
@@ -46,7 +48,9 @@ External zone: oxide-dev.test
4648
NAME RECORDS
4749
@ NS ns1.oxide-dev.test
4850
ns1 AAAA ::1
49-
test-suite-silo.sys A 127.0.0.1
51+
test-suite-silo.sys (records: 2)
52+
A 127.0.0.1
53+
AAAA 100::1
5054
---------------------------------------------
5155
stderr:
5256
note: using database URL postgresql://root@[::1]:REDACTED_PORT/omicron?sslmode=disable
@@ -489,15 +493,21 @@ task: "nat_garbage_collector"
489493

490494
task: "blueprint_loader"
491495
configured period: every <REDACTED_DURATION>m <REDACTED_DURATION>s
492-
last completed activation: <REDACTED ITERATIONS>, triggered by a periodic timer firing
496+
last completed activation: <REDACTED ITERATIONS>, triggered by an explicit signal
493497
started at <REDACTED_TIMESTAMP> (<REDACTED DURATION>s ago) and ran for <REDACTED DURATION>ms
494-
last completion reported error: failed to read target blueprint: Internal Error: no target blueprint set
498+
target blueprint: ......<REDACTED_BLUEPRINT_ID>.......
499+
execution: disabled
500+
created at: <REDACTED_TIMESTAMP>
501+
status: first target blueprint
495502

496503
task: "blueprint_executor"
497504
configured period: every <REDACTED_DURATION>m
498-
last completed activation: <REDACTED ITERATIONS>, triggered by a periodic timer firing
505+
last completed activation: <REDACTED ITERATIONS>, triggered by a dependent task completing
499506
started at <REDACTED_TIMESTAMP> (<REDACTED DURATION>s ago) and ran for <REDACTED DURATION>ms
500-
last completion reported error: no blueprint
507+
target blueprint: ......<REDACTED_BLUEPRINT_ID>.......
508+
execution: disabled
509+
status: (no event report found)
510+
error: (none)
501511

502512
task: "abandoned_vmm_reaper"
503513
configured period: every <REDACTED_DURATION>m
@@ -531,7 +541,18 @@ task: "blueprint_rendezvous"
531541
configured period: every <REDACTED_DURATION>m
532542
last completed activation: <REDACTED ITERATIONS>, triggered by a dependent task completing
533543
started at <REDACTED_TIMESTAMP> (<REDACTED DURATION>s ago) and ran for <REDACTED DURATION>ms
534-
last completion reported error: no blueprint
544+
target blueprint: ......<REDACTED_BLUEPRINT_ID>.......
545+
inventory collection: ..........<REDACTED_UUID>...........
546+
debug_dataset rendezvous counts:
547+
num_inserted: 0
548+
num_already_exist: 0
549+
num_not_in_inventory: 0
550+
num_tombstoned: 0
551+
num_already_tombstoned: 0
552+
crucible_dataset rendezvous counts:
553+
num_inserted: 0
554+
num_already_exist: 0
555+
num_not_in_inventory: 0
535556

536557
task: "chicken_switches_watcher"
537558
configured period: every <REDACTED_DURATION>s
@@ -541,9 +562,9 @@ warning: unknown background task: "chicken_switches_watcher" (don't know how to
541562

542563
task: "crdb_node_id_collector"
543564
configured period: every <REDACTED_DURATION>m
544-
last completed activation: <REDACTED ITERATIONS>, triggered by a periodic timer firing
565+
last completed activation: <REDACTED ITERATIONS>, triggered by a dependent task completing
545566
started at <REDACTED_TIMESTAMP> (<REDACTED DURATION>s ago) and ran for <REDACTED DURATION>ms
546-
last completion reported error: no blueprint
567+
warning: unknown background task: "crdb_node_id_collector" (don't know how to interpret details: Object {"errors": Array [Object {"err": String("failed to fetch node ID for zone ..........<REDACTED_UUID>........... at http://[::1]:REDACTED_PORT: Communication Error: error sending request for url (http://[::1]:REDACTED_PORT/node/id): error sending request for url (http://[::1]:REDACTED_PORT/node/id): client error (Connect): tcp connect error: Connection refused (os error 146)"), "zone_id": String("..........<REDACTED_UUID>...........")}], "nsuccess": Number(0)})
547568

548569
task: "decommissioned_disk_cleaner"
549570
configured period: every <REDACTED_DURATION>m
@@ -844,16 +865,22 @@ stdout:
844865
task: "blueprint_loader"
845866
configured period: every <REDACTED_DURATION>m <REDACTED_DURATION>s
846867
currently executing: no
847-
last completed activation: <REDACTED ITERATIONS>, triggered by a periodic timer firing
868+
last completed activation: <REDACTED ITERATIONS>, triggered by an explicit signal
848869
started at <REDACTED_TIMESTAMP> (<REDACTED DURATION>s ago) and ran for <REDACTED DURATION>ms
849-
last completion reported error: failed to read target blueprint: Internal Error: no target blueprint set
870+
target blueprint: ......<REDACTED_BLUEPRINT_ID>.......
871+
execution: disabled
872+
created at: <REDACTED_TIMESTAMP>
873+
status: first target blueprint
850874

851875
task: "blueprint_executor"
852876
configured period: every <REDACTED_DURATION>m
853877
currently executing: no
854-
last completed activation: <REDACTED ITERATIONS>, triggered by a periodic timer firing
878+
last completed activation: <REDACTED ITERATIONS>, triggered by a dependent task completing
855879
started at <REDACTED_TIMESTAMP> (<REDACTED DURATION>s ago) and ran for <REDACTED DURATION>ms
856-
last completion reported error: no blueprint
880+
target blueprint: ......<REDACTED_BLUEPRINT_ID>.......
881+
execution: disabled
882+
status: (no event report found)
883+
error: (none)
857884

858885
---------------------------------------------
859886
stderr:
@@ -1001,16 +1028,22 @@ task: "nat_garbage_collector"
10011028
task: "blueprint_loader"
10021029
configured period: every <REDACTED_DURATION>m <REDACTED_DURATION>s
10031030
currently executing: no
1004-
last completed activation: <REDACTED ITERATIONS>, triggered by a periodic timer firing
1031+
last completed activation: <REDACTED ITERATIONS>, triggered by an explicit signal
10051032
started at <REDACTED_TIMESTAMP> (<REDACTED DURATION>s ago) and ran for <REDACTED DURATION>ms
1006-
last completion reported error: failed to read target blueprint: Internal Error: no target blueprint set
1033+
target blueprint: ......<REDACTED_BLUEPRINT_ID>.......
1034+
execution: disabled
1035+
created at: <REDACTED_TIMESTAMP>
1036+
status: first target blueprint
10071037

10081038
task: "blueprint_executor"
10091039
configured period: every <REDACTED_DURATION>m
10101040
currently executing: no
1011-
last completed activation: <REDACTED ITERATIONS>, triggered by a periodic timer firing
1041+
last completed activation: <REDACTED ITERATIONS>, triggered by a dependent task completing
10121042
started at <REDACTED_TIMESTAMP> (<REDACTED DURATION>s ago) and ran for <REDACTED DURATION>ms
1013-
last completion reported error: no blueprint
1043+
target blueprint: ......<REDACTED_BLUEPRINT_ID>.......
1044+
execution: disabled
1045+
status: (no event report found)
1046+
error: (none)
10141047

10151048
task: "abandoned_vmm_reaper"
10161049
configured period: every <REDACTED_DURATION>m
@@ -1049,7 +1082,18 @@ task: "blueprint_rendezvous"
10491082
currently executing: no
10501083
last completed activation: <REDACTED ITERATIONS>, triggered by a dependent task completing
10511084
started at <REDACTED_TIMESTAMP> (<REDACTED DURATION>s ago) and ran for <REDACTED DURATION>ms
1052-
last completion reported error: no blueprint
1085+
target blueprint: ......<REDACTED_BLUEPRINT_ID>.......
1086+
inventory collection: ..........<REDACTED_UUID>...........
1087+
debug_dataset rendezvous counts:
1088+
num_inserted: 0
1089+
num_already_exist: 0
1090+
num_not_in_inventory: 0
1091+
num_tombstoned: 0
1092+
num_already_tombstoned: 0
1093+
crucible_dataset rendezvous counts:
1094+
num_inserted: 0
1095+
num_already_exist: 0
1096+
num_not_in_inventory: 0
10531097

10541098
task: "chicken_switches_watcher"
10551099
configured period: every <REDACTED_DURATION>s
@@ -1061,9 +1105,9 @@ warning: unknown background task: "chicken_switches_watcher" (don't know how to
10611105
task: "crdb_node_id_collector"
10621106
configured period: every <REDACTED_DURATION>m
10631107
currently executing: no
1064-
last completed activation: <REDACTED ITERATIONS>, triggered by a periodic timer firing
1108+
last completed activation: <REDACTED ITERATIONS>, triggered by a dependent task completing
10651109
started at <REDACTED_TIMESTAMP> (<REDACTED DURATION>s ago) and ran for <REDACTED DURATION>ms
1066-
last completion reported error: no blueprint
1110+
warning: unknown background task: "crdb_node_id_collector" (don't know how to interpret details: Object {"errors": Array [Object {"err": String("failed to fetch node ID for zone ..........<REDACTED_UUID>........... at http://[::1]:REDACTED_PORT: Communication Error: error sending request for url (http://[::1]:REDACTED_PORT/node/id): error sending request for url (http://[::1]:REDACTED_PORT/node/id): client error (Connect): tcp connect error: Connection refused (os error 146)"), "zone_id": String("..........<REDACTED_UUID>...........")}], "nsuccess": Number(0)})
10671111

10681112
task: "decommissioned_disk_cleaner"
10691113
configured period: every <REDACTED_DURATION>m
@@ -1355,53 +1399,6 @@ task: "webhook_deliverator"
13551399
stderr:
13561400
note: using Nexus URL http://127.0.0.1:REDACTED_PORT/
13571401
=============================================
1358-
EXECUTING COMMAND: omdb ["nexus", "chicken-switches", "show", "current"]
1359-
termination: Exited(0)
1360-
---------------------------------------------
1361-
stdout:
1362-
No chicken switches enabled
1363-
---------------------------------------------
1364-
stderr:
1365-
note: using Nexus URL http://127.0.0.1:REDACTED_PORT/
1366-
=============================================
1367-
EXECUTING COMMAND: omdb ["-w", "nexus", "chicken-switches", "set", "--planner-enabled", "true"]
1368-
termination: Exited(0)
1369-
---------------------------------------------
1370-
stdout:
1371-
chicken switches updated to version 1:
1372-
planner enabled: true
1373-
planner switches:
1374-
add zones with mupdate override: true
1375-
---------------------------------------------
1376-
stderr:
1377-
note: using Nexus URL http://127.0.0.1:REDACTED_PORT/
1378-
=============================================
1379-
EXECUTING COMMAND: omdb ["-w", "nexus", "chicken-switches", "set", "--add-zones-with-mupdate-override", "false"]
1380-
termination: Exited(0)
1381-
---------------------------------------------
1382-
stdout:
1383-
chicken switches updated to version 2:
1384-
planner enabled: true (unchanged)
1385-
planner switches:
1386-
* add zones with mupdate override: true -> false
1387-
---------------------------------------------
1388-
stderr:
1389-
note: using Nexus URL http://127.0.0.1:REDACTED_PORT/
1390-
=============================================
1391-
EXECUTING COMMAND: omdb ["nexus", "chicken-switches", "show", "current"]
1392-
termination: Exited(0)
1393-
---------------------------------------------
1394-
stdout:
1395-
Reconfigurator chicken switches:
1396-
version: 2
1397-
modified time: <REDACTED_TIMESTAMP>
1398-
planner enabled: true
1399-
planner switches:
1400-
add zones with mupdate override: false
1401-
---------------------------------------------
1402-
stderr:
1403-
note: using Nexus URL http://127.0.0.1:REDACTED_PORT/
1404-
=============================================
14051402
EXECUTING COMMAND: omdb ["nexus", "sagas", "list"]
14061403
termination: Exited(0)
14071404
---------------------------------------------
@@ -1538,6 +1535,7 @@ parent: <none>
15381535
oxp_..........<REDACTED_UUID>.........../crypt/zone/oxz_external_dns_..........<REDACTED_UUID>........... ..........<REDACTED_UUID>........... in service none none off
15391536
oxp_..........<REDACTED_UUID>.........../crypt/zone/oxz_internal_dns_..........<REDACTED_UUID>........... ..........<REDACTED_UUID>........... in service none none off
15401537
oxp_..........<REDACTED_UUID>.........../crypt/zone/oxz_nexus_..........<REDACTED_UUID>........... ..........<REDACTED_UUID>........... in service none none off
1538+
oxp_..........<REDACTED_UUID>.........../crypt/zone/oxz_nexus_..........<REDACTED_UUID>........... ..........<REDACTED_UUID>........... in service none none off
15411539
oxp_..........<REDACTED_UUID>.........../crypt/zone/oxz_ntp_..........<REDACTED_UUID>........... ..........<REDACTED_UUID>........... in service none none off
15421540

15431541

@@ -1552,6 +1550,7 @@ parent: <none>
15521550
external_dns ..........<REDACTED_UUID>........... install dataset in service ::1
15531551
internal_dns ..........<REDACTED_UUID>........... install dataset in service ::1
15541552
nexus ..........<REDACTED_UUID>........... install dataset in service ::ffff:127.0.0.1
1553+
nexus ..........<REDACTED_UUID>........... install dataset in service ::1
15551554

15561555

15571556
COCKROACHDB SETTINGS:
@@ -1662,6 +1661,7 @@ parent: <none>
16621661
oxp_..........<REDACTED_UUID>.........../crypt/zone/oxz_external_dns_..........<REDACTED_UUID>........... ..........<REDACTED_UUID>........... in service none none off
16631662
oxp_..........<REDACTED_UUID>.........../crypt/zone/oxz_internal_dns_..........<REDACTED_UUID>........... ..........<REDACTED_UUID>........... in service none none off
16641663
oxp_..........<REDACTED_UUID>.........../crypt/zone/oxz_nexus_..........<REDACTED_UUID>........... ..........<REDACTED_UUID>........... in service none none off
1664+
oxp_..........<REDACTED_UUID>.........../crypt/zone/oxz_nexus_..........<REDACTED_UUID>........... ..........<REDACTED_UUID>........... in service none none off
16651665
oxp_..........<REDACTED_UUID>.........../crypt/zone/oxz_ntp_..........<REDACTED_UUID>........... ..........<REDACTED_UUID>........... in service none none off
16661666

16671667

@@ -1676,6 +1676,7 @@ parent: <none>
16761676
external_dns ..........<REDACTED_UUID>........... install dataset in service ::1
16771677
internal_dns ..........<REDACTED_UUID>........... install dataset in service ::1
16781678
nexus ..........<REDACTED_UUID>........... install dataset in service ::ffff:127.0.0.1
1679+
nexus ..........<REDACTED_UUID>........... install dataset in service ::1
16791680

16801681

16811682
COCKROACHDB SETTINGS:
@@ -1739,6 +1740,53 @@ stderr:
17391740
note: using Nexus URL http://127.0.0.1:REDACTED_PORT/
17401741
Error: `blueprint2_id` was not specified and blueprint1 has no parent
17411742
=============================================
1743+
EXECUTING COMMAND: omdb ["nexus", "chicken-switches", "show", "current"]
1744+
termination: Exited(0)
1745+
---------------------------------------------
1746+
stdout:
1747+
No chicken switches enabled
1748+
---------------------------------------------
1749+
stderr:
1750+
note: using Nexus URL http://127.0.0.1:REDACTED_PORT/
1751+
=============================================
1752+
EXECUTING COMMAND: omdb ["-w", "nexus", "chicken-switches", "set", "--planner-enabled", "true"]
1753+
termination: Exited(0)
1754+
---------------------------------------------
1755+
stdout:
1756+
chicken switches updated to version 1:
1757+
planner enabled: true
1758+
planner switches:
1759+
add zones with mupdate override: true
1760+
---------------------------------------------
1761+
stderr:
1762+
note: using Nexus URL http://127.0.0.1:REDACTED_PORT/
1763+
=============================================
1764+
EXECUTING COMMAND: omdb ["-w", "nexus", "chicken-switches", "set", "--add-zones-with-mupdate-override", "false"]
1765+
termination: Exited(0)
1766+
---------------------------------------------
1767+
stdout:
1768+
chicken switches updated to version 2:
1769+
planner enabled: true (unchanged)
1770+
planner switches:
1771+
* add zones with mupdate override: true -> false
1772+
---------------------------------------------
1773+
stderr:
1774+
note: using Nexus URL http://127.0.0.1:REDACTED_PORT/
1775+
=============================================
1776+
EXECUTING COMMAND: omdb ["nexus", "chicken-switches", "show", "current"]
1777+
termination: Exited(0)
1778+
---------------------------------------------
1779+
stdout:
1780+
Reconfigurator chicken switches:
1781+
version: 2
1782+
modified time: <REDACTED_TIMESTAMP>
1783+
planner enabled: true
1784+
planner switches:
1785+
add zones with mupdate override: false
1786+
---------------------------------------------
1787+
stderr:
1788+
note: using Nexus URL http://127.0.0.1:REDACTED_PORT/
1789+
=============================================
17421790
EXECUTING COMMAND: omdb ["reconfigurator", "export", "<TMP_PATH_REDACTED>"]
17431791
termination: Exited(0)
17441792
---------------------------------------------

0 commit comments

Comments
 (0)