Commit graph

50 commits

Author SHA1 Message Date
Richard Hansen
009033d476 tests: Factor out duplicate log capture code 2025-01-10 19:20:25 -05:00
Richard Hansen
6fd9a6f106 tests: Add some tests for use=cmd, usev4=cmdv4, usev6=cmdv6 2025-01-09 19:29:00 -05:00
Richard Hansen
06c47695fc tests: Fix t/ssl-validate.pl in minimal test environments 2025-01-08 03:33:30 -05:00
Richard Hansen
7248341ad6 Change default location of ddclient.conf to ${sysconfdir}/ddclient 2025-01-07 04:33:54 -05:00
Richard Hansen
a12398c315 Makefile.am: Fix Automake portability warning
This silences:

    Makefile.am:20: warning: escaping \# comment markers is not portable
2024-12-19 05:00:56 -05:00
Richard Hansen
d3e793bf21 Move m4 to build-aux/m4 to reduce clutter 2024-12-19 04:21:25 -05:00
Richard Hansen
5ed43a2e4c tests: Factor out duplicate HTTP server code 2024-09-06 18:44:19 -04:00
Richard Hansen
62f3759c54 tests: Factor out duplicate IPv6 support detection code 2024-09-06 18:41:37 -04:00
Richard Hansen
c943d7c0d9 tests: Add some unit tests for read_recap 2024-09-01 18:05:53 -04:00
Richard Hansen
555359dc98 tests: Add unit tests for legacy protocol handling in nic_updateable 2024-08-22 02:08:39 -04:00
Jeff Rego
959b5ddc37 Add support for Directnic provider 2024-08-07 00:06:25 -04:00
Jeff Rego
d497422bf9 Add T_URL type for config properties 2024-08-07 00:06:25 -04:00
Richard Hansen
eb281ea47b dnsexit2: Rename test file for consistency 2024-08-03 03:32:35 -04:00
Richard Hansen
3d345ff08b dyndns2: Add tests 2024-08-03 03:32:35 -04:00
Richard Hansen
b563e9c2fd use=web: Add tests 2024-07-27 04:40:34 -04:00
Richard Hansen
49f5551764 Add variable default value tests 2024-06-28 15:53:40 -04:00
Richard Hansen
b426b370fd Rename %cache to %recap for readability 2024-06-22 02:48:03 -04:00
Richard Hansen
b58a10b3e3 header_ok: Add unit tests 2024-06-06 19:34:06 -04:00
Richard Hansen
31dbd8e4ed geturl: Set raw (binary) mode when reading from curl 2024-06-03 03:13:05 -04:00
jortkoopmans
ec2d5f7f69 dnsexit2: Add tests
Needs LWP::UserAgent.
2024-06-02 16:58:00 -04:00
Richard Hansen
ce0a362fd0 group_hosts_by: Add tests 2024-06-01 03:05:26 -04:00
Richard Hansen
d8a9d9d089 Add support for infinite duration 2024-05-25 00:38:10 -04:00
Richard Hansen
065b227711 logmsg: New low-level logging interface 2024-05-23 01:57:12 -04:00
Richard Hansen
d02a9cf6db Add infrastructure for custom logic in a %builtinfw entry 2024-05-14 22:18:59 -04:00
Richard Hansen
0806363b57 Tell Autoconf to get the version from ddclient.in
This avoids the need to maintain the same version string in two
different places.
2024-05-12 16:43:43 -04:00
Richard Hansen
58d7be4e83 Distinguish unset --*-skip settings from set to the empty string
This prevents the `%builtinweb` or `%builtinfw` skip defaults from
overriding a user's explicitly empty `--web-skip=` or `--fw-skip=`
setting.

This is technically a backwards-incompatible change: Any config that
explicitly sets `--web-skip` or `--fw-skip` to the empty string but
depends on the built-in skip behavior will fail.  This is unlikely to
affect many (if any) users; compatibility concerns are believed to be
far less significant than the potential need to turn off the built-in
skip.
2024-05-12 15:55:28 -04:00
Richard Hansen
281b7307a8 Fix misspelled *-ssl-validate option names
There is no `ssl-validate` option, and there never has been.
2024-05-10 16:54:40 -04:00
Richard Hansen
01d1d5e142 Change t/geturl_connectivity.pl to handwritten
Commit a9c1e545fb removed the
`configure.ac` substitution, so the test no longer needs to be
generated.
2024-05-07 22:39:17 -04:00
Richard Hansen
5aa6530c84 Tell make that the tests depend on ddclient
This ensures that `ddclient` is rebuilt before running tests if
`ddclient.in` changes.
2024-03-06 23:32:11 -08:00
Reuben Thomas
a9c1e545fb Require curl
Use command-line curl, and remove alternative Perl and Curl-via-Perl
implementations of network code.
2023-07-19 17:11:45 +03:00
Thomas du Boÿs
b225d37528
Remove README.ssl from makefile as it's deleted on master 2023-02-21 21:10:28 +01:00
Sandro Jäckel
8f7ddce2ec
Remove all init systems that use some variations of /etc/init.d 2023-02-08 14:02:02 +01:00
Sandro Jäckel
69996e9396
Fix CI 2022-05-15 22:20:16 +02:00
David Kerr
213cf6ad09 Add get_ip_from_interface function 2020-09-21 15:16:11 -04:00
David Kerr
d24b75960d Add support for curl and option to not validate SSL certificates for getip from web or firewall
Check exists not just length
2020-08-07 11:17:44 -04:00
David Kerr
1ad4d6737a Add is_ipv6_global and extract_ipv6_global functions 2020-08-01 19:11:28 -04:00
Richard Hansen
7a21c1646c Sort the list of tests 2020-07-11 11:16:52 -04:00
David Kerr
29202f5bc1 New is_ipv6 and extract_ipv6 algorithms
Also add unit tests.
2020-07-11 11:04:47 -04:00
David Kerr
92c1294af9 Accept leading zeros in IPv4 addresses
Also add unit tests.
2020-07-11 11:04:33 -04:00
Richard Hansen
4e1607c8f6 Enable autoflush on STDOUT and STDERR for tests
This prevents STDOUT lines from appearing out of order relative to
STDERR lines in the test log, which makes it much easier to understand
what's happening.

Devel::Autoflush is from https://metacpan.org/pod/Devel::Autoflush and
is licensed under the terms of the Apache 2.0 license.
2020-07-10 12:06:45 -04:00
Richard Hansen
dd8e376784 Add geturl SSL tests
These don't test validation, only that IO::Socket::SSL is used.
2020-07-08 13:40:31 -04:00
Richard Hansen
94aaff67cd Add Test::Simple v1.302175 to t/lib
The version of Test::More available in CentOS/RHEL 6 doesn't include
`subtest`, which we want to use. We can revert this commit once we
drop support for CentOS/RHEL 6.

The code is licensed under the same terms as Perl 5 itself:
https://github.com/Test-More/test-more/blob/v1.302175/LICENSE
2020-07-07 13:01:13 -04:00
Richard Hansen
6ae5fe62d7 Create /var/cache/ddclient if it doesn't exist
Fixes #76
2020-07-07 00:04:33 -04:00
Richard Hansen
323208e9cc Add geturl connectivity unit tests
Addresses #232
2020-07-05 18:36:46 -04:00
Richard Hansen
6d7d248f79 Improve parsing of config file assignments
* Ignore empty `key=value` strings in variable assignments. Now the
    following lines are supported with the expected meaning:
      * `a=1 , b=2`
      * `a=1,,b=2`
  * Improve the warning message when there is an unterminated quote.
  * Add a warning if the line ends with a backslash.

Also add unit tests.
2020-07-03 16:56:01 -04:00
Thorsten Behrens
2afdf5043c Add FreeBSD; change README to use json-pp for Ubuntu 2020-07-01 12:33:21 -04:00
Richard Hansen
44eaf653f1 Rename *.template to *.in
Apparently the `.template` extension is commonly used in macOS for a
word processor template file.

See issue #206.
2020-06-30 13:27:08 -04:00
Sandro Jäckel
86a3294b0f Fix shebang
cause perl needs a regular shebang even when evoking the script
directly with perl
2020-06-30 11:55:11 -04:00
Richard Hansen
c390e75769 Add unit test infrastructure.
Now all that is needed to add a new unit test is to create a `t/*.pl`
file and list it in the `handwritten_tests` variable.

To run the test suite, run:

    ./autogen && ./configure && make check

Fixes #147
2020-06-29 11:08:32 -04:00
Richard Hansen
8cbcecba99 Add Autotools-based build infrastructure
This makes it easier to package ddclient, especially as enhancements
are made such as unit tests or a man page.

I chose GNU Autoconf and Automake mostly because I'm familiar with
them, but also because I know they are well supported. Unfortunately
they can be difficult to understand/maintain (especially Autoconf), so
we may want to convert to something else later.

Addresses #146, #147
2020-06-29 11:06:34 -04:00