Commit graph

1459 commits

Author SHA1 Message Date
Richard Hansen
dd7ad1ccf4 tests: dnsexit2: Use reserved IP addresses and domain names 2024-09-06 15:47:05 -04:00
Richard Hansen
d38fcbddb8 tests: dnsexit2: Rename variables to follow got, want pattern 2024-09-06 15:47:05 -04:00
Richard Hansen
d0eb899fc8 tests: dnsexit2: Localize changes to %config 2024-09-06 15:47:05 -04:00
Richard Hansen
e8d79d842c tests: dnsexit2: Inline unnecessary helper function
for readability
2024-09-06 15:47:05 -04:00
Richard Hansen
7653f60058 tests: dnsexit2: Move request to a variable
for readability
2024-09-06 15:46:59 -04:00
Richard Hansen
c768f1350b tests: dnsexit2: Check number of requests 2024-09-06 15:24:16 -04:00
Richard Hansen
e9029b85d5 tests: dnsexit2: Simplify request check 2024-09-06 15:22:55 -04:00
Richard Hansen
bd1e42ac6c tests: dnsexit2: Declare @requests where used
for readability
2024-09-06 15:22:55 -04:00
Richard Hansen
d7861b6d61 tests: Do use parent -norequire instead of modifying ISA 2024-09-06 15:22:55 -04:00
Richard Hansen
6c33ccaa25 tests: Always have a truthy final expression in modules
This ensures that `eval { require Module; } or ...` doesn't execute
the `or` case when loading is successful.
2024-09-06 15:22:55 -04:00
Richard Hansen
2ccdd3b19e tests: Delete obsolete debugging comments
All log output goes to stderr, so turning on `debug` or `verbose` will
not interfere with TAP.  A better way to debug is to add the following
to whatever scope you think is appropriate:

    local $ddclient::globals{debug} = 1;
    local $ddclient::globals{verbose} = 1;
2024-09-06 15:22:55 -04:00
Richard Hansen
8b7581287c tests: update_nics: Test number of web* queries
This will be used in a future commit to test deduplication of of
`use*` strategies.
2024-09-06 15:22:46 -04:00
Richard Hansen
b6ac0e6d05 tests: update_nics: Support multiple hosts
This will be used in a future commit to test deduplication of `use*`
strategies.
2024-09-06 15:22:37 -04:00
Richard Hansen
f32f7fc29a tests: update_nics: Fix tracking of update calls
The tests weren't failing because there was only one host being
updated at a time, but this will change in a future commit.
2024-09-06 15:22:18 -04:00
Richard Hansen
a7abfcb715
Merge pull request #740 from rhansen/recap
Overhaul recap handling
2024-09-02 03:59:15 -04:00
Richard Hansen
695c3c4be8 Separate recap variables from configuration variables 2024-09-02 03:55:09 -04:00
Richard Hansen
76afbb6673 _read_config: Add infrastructure for host-dependent validation
This is a preparatory step for separating recap variables from config
variables.
2024-09-02 03:55:09 -04:00
Richard Hansen
0f1ea65fd7 _read_config: Minor refactor for readability and maintainability 2024-09-02 03:55:09 -04:00
Richard Hansen
ac67c04f13 _read_config: Check host definedness, not existence 2024-09-02 03:55:09 -04:00
Richard Hansen
a18efcbe32 Force an update if a host's protocol changes 2024-09-02 03:55:09 -04:00
Richard Hansen
1e3bebc60d Object-oriented protocol definitions
This improves readability and will make it easier to refactor to fix
issues or add features.
2024-09-02 03:55:09 -04:00
Richard Hansen
2da08cceb9 Convert static list of config change detection vars to per-protocol 2024-09-02 03:55:09 -04:00
Richard Hansen
273af1c821 nic_updateable: Ignore non-recap vars when detecting config change 2024-09-02 03:55:09 -04:00
Richard Hansen
803621a9ee Switch "magic constant" list of change detection vars to a var 2024-09-02 03:55:09 -04:00
Richard Hansen
268369a05e Write update status to %recap, not %config
Status is not configuration so it doesn't belong in `%config`.

`wantip`, `wantipv4`, and `wantipv6` are still passed along in
`%config` because `group_hosts_by` needs access to them like other
settings.
2024-09-02 03:55:09 -04:00
Richard Hansen
0348ded46b write_recap: Move update-specific %recap sync to update_nics
This is a step toward separating `%recap` from `%config`.
2024-09-01 20:10:42 -04:00
Richard Hansen
e478117d4e write_recap: Move warned-min-* recap sync to where they are set
This is a step toward separating `%recap` from `%config`.
2024-09-01 20:10:26 -04:00
Richard Hansen
1a748e7a86 write_recap: Only update variables that could have changed
This is a step toward improving readability of `%config`/`%recap`
synchronization.
2024-09-01 20:10:09 -04:00
Richard Hansen
7660ca52bf write_recap: Remove unnecessary recap existence check 2024-09-01 20:09:52 -04:00
Richard Hansen
2927f205ea update_nics: Move non-config recap var reset to update call
for readability
2024-09-01 20:09:35 -04:00
Richard Hansen
974bba4d93 update_nics: Don't set wantip* if they're all undef
This helps keep `%config` "clean", which helps with testing and
debugging.
2024-09-01 20:09:18 -04:00
Richard Hansen
75552f80f7 nic_updateable: Don't mutate status-ipv* vars if not updating
This simplifies the logic a bit and improves readability.
2024-09-01 20:09:01 -04:00
Richard Hansen
25fac765a0 nic_updateable: Move clearing of update to write_recap
for readability (the logic that uses the `update` boolean should be
responsible for clearing it).
2024-09-01 20:08:44 -04:00
Richard Hansen
5256a1d02c update_nics: Move legacy protocol support to an adapter function 2024-09-01 20:08:27 -04:00
Richard Hansen
a178d40633 update_nics: Combine post-update host loops 2024-09-01 20:08:10 -04:00
Richard Hansen
bf83ba032c update_nics: Move legacy wantip assignment to update call
This consolidates the legacy support with other legacy support logic,
which will make it easier to refactor in a future commit.
2024-09-01 20:07:53 -04:00
Richard Hansen
c5df774b7e update_nics: Change || next to or next (for readability) 2024-09-01 20:07:36 -04:00
Richard Hansen
20439bc130 update_nics: Refine comment 2024-09-01 20:07:19 -04:00
Richard Hansen
cb66870019 update_nics: Refine debug message for consistency/readability 2024-09-01 20:07:02 -04:00
Richard Hansen
78be40fe2c update_nics: Remove unnecessary assertions
These just add cold code paths and impair readability and
maintainability.
2024-09-01 20:06:45 -04:00
Richard Hansen
499318fbe0 update_nics: Always overwrite status-ipv* with value from status 2024-09-01 20:06:28 -04:00
Richard Hansen
94ce6367ec write_recap: Also clear out non-recap and stale values
Before, if a non-`undef` value was in `%recap` and the corresponding
value in `%config` became `undef`, the `%recap` value would remain
untouched.  Now it is deleted to match `%config`.

Also, any `%recap` values without a corresponding recap variable
declaration are deleted.
2024-09-01 20:06:11 -04:00
Richard Hansen
c64e432bf1 write_recap: Update all status recap vars when writing recap 2024-09-01 20:05:54 -04:00
Richard Hansen
f2c9ef6641 read_recap: Scrub recap values without var declarations 2024-09-01 20:05:40 -04:00
Richard Hansen
70e2b51377 read_recap: Don't copy non-recap values to %config 2024-09-01 20:04:45 -04:00
Richard Hansen
8359eff6ea read_recap: Check variable definedness, not existence 2024-09-01 20:03:13 -04:00
Richard Hansen
989f8be8c3 read_recap: Delete from %config any status values missing from recap 2024-09-01 20:02:58 -04:00
Richard Hansen
c9cdb96086 read_recap: Fix copying of recap values into %config 2024-09-01 20:02:34 -04:00
Richard Hansen
fbd7167b94 read_recap: Fix iteration over hosts 2024-09-01 18:08:10 -04:00
Richard Hansen
35cbc8d200 read_recap: Reference %recap directly (for readability)
There's no need to pass a reference to `%recap` as an argument when
that is the only way `read_recap` is ever used.
2024-09-01 18:08:10 -04:00