socallinuxexpo / scale-network

SCaLE's on-site expo network configurations, wifi, tooling, and scripts
https://www.socallinuxexpo.org/
BSD 3-Clause "New" or "Revised" License
46 stars 19 forks source link

[READY] - kea config and nixos core role #536

Closed sarcasticadmin closed 1 year ago

sarcasticadmin commented 1 year ago

Description of PR

Relates to: #392

initial work on the kea dhcpd v4 server.

I still have more work to do to close out #392 but this gets the basic vm and role configured for more testing. Main things left to do will be:

Previous Behavior

New Behavior

Tests

Leveraging the nix qemu test suite for core role: kea passes existing 2 checks:

$ nix build ".#packages.x86_64-linux.scaleTests.core"

Tests results (truncated):

...
machine1 # [   13.722202] kea-dhcp4[751]: 2023-02-10 07:56:16.717 INFO  [kea-dhcp4.dhcp4/751.139957685433728] DHCP4_STARTED Kea DHCPv4 server version 2.2.0 started
(finished: must succeed: sleep 10, in 18.84 seconds)
machine1: must succeed: kea-dhcp4 -t /etc/kea/dhcp4-server.conf
(finished: must succeed: kea-dhcp4 -t /etc/kea/dhcp4-server.conf, in 0.12 seconds)
machine1: must succeed: systemctl is-active kea-dhcp4-server
(finished: must succeed: systemctl is-active kea-dhcp4-server, in 0.05 seconds)
(finished: run the VM test script, in 19.05 seconds)
test script finished in 19.13s
cleanup
kill machine (pid 8)
machine1 # qemu-kvm: terminating on signal 15 from pid 6 (/nix/store/zdba9frlxj2ba8ca095win3nphsiiqhb-python3-3.10.8/bin/python3.10)
(finished: cleanup, in 0.04 seconds)
kill vlan (pid 7)

Local qemu tested for core checks out:

$ nix build ".#nixosConfigurations.x86_64-linux.core.config.system.build.vm"

Build image and running host on the bhyve vm works:

$ nix build ".#nixosConfigurations.x86_64-linux.core.config.system.build.bhyveImage

Leases are confirmed working reliably to the 10.0.3.0/24 subnet (more testing to come later since all subnets are present in config)