oxidecomputer / omicron

Omicron: Oxide control plane
Mozilla Public License 2.0
245 stars 38 forks source link

Can't run tests on macOS due to lack of `mgd` #4333

Open david-crespo opened 11 months ago

david-crespo commented 11 months ago

Same deal as #3938 — maghemite doesn't do a Mac build for mgd, so tools/ci_download_maghemite_mgd doesn't do anything on Mac.

thread 'integration_tests::schema::nexus_cannot_apply_update_from_unknown_version' panicked at 'called `Result::unwrap()` on an `Err` value: failed to spawn `mgd` (with args: ["run", "--admin-addr", "::1", "--admin-port", "0", "--no-bgp-dispatcher", "--data-dir", "/var/folders/lk/vsx86g0545g3g2tsmvs50py40000gn/T/.tmp0VxTKj"])

Caused by:
    No such file or directory (os error 2)', /Users/david/oxide/omicron/nexus/test-utils/src/lib.rs:413:63

I tried a workaround analogous to the one for dpd I describe in #3938, namely building mgd myself, but I run into this.

https://github.com/oxidecomputer/netadm-sys/blob/59e69ef8fb17be233e336cf4943e31ae398aa4d1/libnet/src/sys.rs#L696-L706

I think libc::__error() would work on Mac too based on a very cursory search online. Will see if I can test that myself by pointing at a local copy of libnet.

rcgoodfellow commented 11 months ago

mgd does build and run on Mac. I actually run the BGP integration tests regularly on Mac. Here is the incantation.

cd mgd
cargo build --no-default-features --bin mgd

This is how we build mgd for linux. If having a Mac CI job for Maghemite/mgd would be helpful we can do that.

david-crespo commented 11 months ago

Ah, perfect. I'll make sure it all works when I manually build mgd, and then yes, it would be helpful to have a mac build so we can make the prereqs installers work on mac.

david-crespo commented 11 months ago

Ok, the mgd part worked and now I'm getting this.

thread 'integration_tests::ip_pools::test_ip_range_delete_with_allocated_external_ip_fails' panicked at 'called `Result::unwrap()` on an `Err` value: failed to discover dendrite port from files in /var/folders/lk/vsx86g0545g3g2tsmvs50py40000gn/T/.tmpvk4nPt

Caused by:
    0: time out while discovering dendrite port number
    1: deadline has elapsed', /Users/david/oxide/omicron/nexus/test-utils/src/lib.rs:385:72
 ~/oxide/omicron  [ip-pools-rework]
$ l /var/folders/lk/vsx86g0545g3g2tsmvs50py40000gn/T/.tmpvk4nPt/dendrite_stdout
.rw-r--r-- 860 david 24 Oct 21:11 /var/folders/lk/vsx86g0545g3g2tsmvs50py40000gn/T/.tmpvk4nPt/dendrite_stdout
 ~/oxide/omicron  [ip-pools-rework]
$ cat /var/folders/lk/vsx86g0545g3g2tsmvs50py40000gn/T/.tmpvk4nPt/dendrite_stdout
{"msg":"dpd config: Config {\n    log_file: None,\n    log_format: Json,\n    port_config: None,\n    mac_base: None,\n    listen_addresses: [\n        [::1]:0,\n    ],\n    dns_servers: [],\n    rack_id: None,\n    sled_id: None,\n    asic_config: AsicConfig,\n}","v":0,"name":"dpd","level":30,"time":"2023-10-25T02:11:04.350076Z","hostname":"Davids-M1-MBP.local","pid":42361}
{"msg":"created new freemap","v":0,"name":"dpd","level":20,"time":"2023-10-25T02:11:04.353029Z","hostname":"Davids-M1-MBP.local","pid":42361,"unit":"freemap_route_ipv4"}
{"msg":"created new freemap","v":0,"name":"dpd","level":20,"time":"2023-10-25T02:11:04.353151Z","hostname":"Davids-M1-MBP.local","pid":42361,"unit":"freemap_route_ipv6"}
{"msg":"initializing tables","v":0,"name":"dpd","level":20,"time":"2023-10-25T02:11:04.353185Z","hostname":"Davids-M1-MBP.local","pid":42361}

I do have dpd, but it looks like the desired local_addr line isn't showing up in the log:

https://github.com/oxidecomputer/omicron/blob/9daf99b870865044ed781107605791752f0eec94/test-utils/src/dev/dendrite.rs#L139-L161

This seems relevant!

$ cat /var/folders/lk/vsx86g0545g3g2tsmvs50py40000gn/T/.tmpvk4nPt/dendrite_stderr
Error: failed to initialize tables

Caused by:
    0: creating RouteIdxIpv4 table
    1: ASIC error: InvalidArg("no such table: pipe.Ingress.l3_router.Router4.lookup_idx.tbl")
rcgoodfellow commented 11 months ago

What branch/commit of Dendrite/dpd are you running?

david-crespo commented 11 months ago

This is the latest dendrite main.

david-crespo commented 11 months ago

AH. Just tried checking out the version in dendrite_openapi_versionc0cbc39b55fac54b95468304c497e00f3d3cf686 — and it works. Good example of why I'd rather be using the normal scripts!