HomeFreeBSD

tests/carp: Rework unicast_v4

Description

tests/carp: Rework unicast_v4

For unicast tests, it is sufficient to use wait_for_carp() to verify
the setup is sane. Additional sanity checks are not necessarily
required but can serve purpose for redundancy.

For some unclear reason routed(8) is advertising route to carp BACKUP.
That makes the test flaky. Also routed(8) is marked deprecated and may
be removed from base in the future. Let's just add static route entry
manually for additional sanity checks.

Other noticeable changes:

  1. Add atf_check to configuration steps to prevent potential failure

on setup. That helps diagnosing on failure.

  1. Shorten the names of jails to improve readability.
  2. Prefer [ifconfig|route|sysctl] -j over jexec [ifconfig|route|sysctl]

to make the lines shorter.

MFC note: At the time writing, routed(8) does not know carp addresses
and does not distinguish carp addresses in MASTER|BACKUP|INIT state,
hence insists advertising the wrong addresses.

PR: 294817
Reviewed by: glebius (previous version), pouria, markj
Fixes: 93fbdef51a13 tests: carp: Update test case unicast_v4 to catch PR 284872
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D56761

(cherry picked from commit 9137c66c2ea6cc09e3a6f8a042ecdc5a62e0f39e)