Pre-release live HA test plan #11
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
eric/10-wancarp#11
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Live HA-pair tests to run before tagging the next release. Add to this issue as further bugs are fixed and need their own tests.
Run on both nodes unless a step says otherwise. Follow the log with
opnsense-log -f | grep wancarp.Setup (after installing the new files on both nodes)
/usr/local/etc/rc.syshook.d/carp/10-wancarp, mode0700.actions_wancarp.confinstalled in/usr/local/opnsense/service/conf/actions.d/, thenservice configd restart.configctl wancarp reconcileprintsOKand logs nothing (state already correct).*on both nodes (or let HA sync carry the cron job).wancarplines in the log.Node role (#4)
./10-wancarp --dryrun --reconcileon the MASTER: therole=MASTERline lists every VHID asMASTER, and WAN's VHID (if any) shows as skipped. Reportsalready up, skipping.role=BACKUP, reportsalready down, skipping../10-wancarp --dryrun 1@<dev> MASTERon the BACKUP: what-if line says a real event would act asBACKUP, then showsWOULD enable.role=line per VHID event. WAN ends up live on exactly one node, with IP and default route.role=BACKUPand do not bring WAN up. WAN only comes up once all counted VHIDs are MASTER.$carp_vhids = [<one vhid>]on both nodes, and confirm therole=line marks the othersskipped (not in $carp_vhids). Revert afterwards.Drift correction (#3)
configctl interface reconfigure wan. WAN comes back UP (expected, this is the bug). Within about a minute the cron logs START…END withdisabling interface 'wan'plus the error-levelreconcile: interface state had drifted ...line, and WAN is down again.configctl interface reconfigure wan. WAN stays up and reconcile logs nothing.CARP VIP on a toggled interface (#5)
./10-wancarp --dryrun --reconcileon each node with the real config: noDRYRUN: CARP VHID ... is on '<alias>'error. (If one appears, that interface carries a VIP and must come out of$iface_aliasesbefore release testing goes further.)cp /usr/local/etc/rc.syshook.d/carp/10-wancarp /root/wancarp-test), and in the copy add an alias that does carry a CARP VIP (e.g.'lan') to$iface_aliases. Run/root/wancarp-test --dryrun --reconcile: an error-levelDRYRUN: CARP VHID <n> is on 'lan' (<dev>) ...line appears for each VHID on it, and therole=line marks those VHIDsskipped (on a toggled interface). Nothing changes on the box (dry-run only). Delete the copy afterwards.Default-route repoint, both directions (#6)
These need
$remove_backup_route = trueand$lan_vipset to the LAN CARP VIP in the installed hook on both nodes. If you don't run with it in production, set it back tofalseafterwards../10-wancarp --dryrun --reconcileon each node: preflight showsAPI system_routing_configure() present.and the current default route.route -n get -inet defaultshows gateway$lan_vip. Repeated CARP events and reconciles logdefault route already points at '<vip>', skipping.or nothing.default route points at '<vip>', restoring it via system_routing_configure()and thendefault gateway is now <ISP gw>. If it saysnone (WAN gateway not ready yet), the WAN default must show up shortly after through newwanip. Either way,netstat -rnends up with the default via the WAN gateway and external pings work. The newly demoted node repoints to$lan_vip.route delete -inet default. Within about a minute the cron logsrepointing default route from none to '<vip>'plus the error-level drift line, and the default points at$lan_vipagain.route change -inet default <lan_vip>. Within about a minute the reconcile restores OPNsense's default route and logs the drift line.END banner reports failures (#7)
$remove_backup_route = trueset as above:cp /usr/local/etc/rc.syshook.d/carp/10-wancarp /root/wancarp-test, and in the copy set$lan_vip = '198.51.100.1'(an off-link address). Run/root/wancarp-test --reconcile(live, not dry-run). It deletes the current default route, thenroute addfails. The log shows'route add -inet default 198.51.100.1' failed (rc=...)and the END banner saysresult=partial, notresult=ok.configctl wancarp reconcile(the real hook) puts the default back on the real$lan_vip, and its END banner saysresult=ok. Delete the copy.ENDline saysresult=okexcept the deliberate failure above.MASTER skips only a configured interface (#8)
pgrep -F /var/run/dhclient.<wan dev>.pidprints nothing. A dhclient left running on the downed WAN would make the MASTER guard skip an unconfigured interface after promotion../10-wancarp --dryrun --reconcilestill logsinterface 'wan' (<dev>) already up, skipping.(no false reconfigure of a healthy WAN).pkill -F /var/run/dhclient.<dev>.pid; ifconfig <dev> inet <wan ip> delete. Check thatifconfig <dev>still showsUPin flags but has noinetline and no globalinet6(if the WAN also has global IPv6, this test needs that removed too). Then run./10-wancarp --dryrun --reconcile: it logsis UP but has no address or DHCP client; reconfiguring it.followed byWOULD enable. Within about a minute the cron reconcile does it for real:enabling interface 'wan', the drift line, and WAN has its IP, default route and Internet again.configctl interface reconfigure wan, then straight away run./10-wancarp --dryrun --reconcilewhileifconfigshows noinetyet. It saysalready up, skippingbecause dhclient is running, notreconfiguring it.Regression
feb906f): after any promotion,fstat /tmp/wancarp.lockshows no holders, and a later demotion of that same node (no reboot in between) takes WAN down without waiting on anything.STARTwithout a matchingENDanywhere in the log during the above.Testing complete. I think we're good to go.