Commit Graph

205 Commits

Author SHA1 Message Date
DL6ER c02dfddebc Add quiet regex test mode for inclusion in pihole -q
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-08-10 23:27:04 +02:00
DL6ER d51224cb57 Mark get_regex_from_rowid as pure.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-08-10 23:25:49 +02:00
DL6ER 0aecef5b5c Tests: Add tests for useful error hints for incorrect regex.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-08-10 23:25:49 +02:00
DL6ER 4cb64d17f0 Tests: Bats ignored empty lines
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-08-10 23:25:49 +02:00
DL6ER 89960e3698 Make regex-text output more user-friendly
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-08-10 23:25:49 +02:00
DL6ER 66fa3190d3 Add 26 regex tests (following https://discourse.pi-hole.net/t/regex-engine-improvements/34751)
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-08-10 23:25:49 +02:00
DL6ER 5f4582e436 Merge pull request #832 from pi-hole/new/cname_inspection_logging
Add logging for CNAME inspection
2020-07-23 06:19:17 +02:00
DL6ER 4b9eeb83ec Merge pull request #839 from pi-hole/development
Import test fix from development
2020-07-17 11:43:38 +02:00
DL6ER 41b49782c2 Test: Check port file exists and contains the expected number (4711)
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-07-17 10:16:45 +02:00
DL6ER be3c75d1fb Include new column in database schema test
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-07-13 22:08:54 +02:00
DL6ER cde66d6ff9 Do not assume a query to google.com returns only one fixed AAAA record.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-07-07 22:23:09 +02:00
DL6ER 7859345e24 Tests: Test for new query types
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-06-28 20:11:12 +02:00
DL6ER 5970c0577f Ignore missing CAP_SYS_NICE in the CI tests as we are not allowed to change the nicencess.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-05-28 20:55:10 +02:00
DL6ER 0c1ab0f7aa Add CAP_SYS_NICE for the tests
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-05-28 20:50:18 +02:00
DL6ER 8fd09cd584 Merge pull request #739 from MichaIng/patch-1
Use /run instead of /var/run for FTL runtime files
2020-05-25 21:27:33 +02:00
DL6ER df6c13103e Add "not stripped" to arm-qemu test
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-05-25 19:56:20 +02:00
DL6ER c2d309401d Also check result of "file pihole-FTL" to do some further checks on the generated binary. This now includes a check for the minimum supported Linux version.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-05-25 19:37:47 +02:00
DL6ER da006e52ae Add checks for the compiled binary for all supported CI platforms.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-05-25 18:55:21 +02:00
MichaIng 0fd1e341da Use /run instead of /var/run for FTL runtime files
Compare with: https://github.com/pi-hole/pi-hole/pull/3248#issuecomment-620752054

Signed-off-by: MichaIng <micha@dietpi.com>
2020-05-01 12:41:33 +02:00
DL6ER 742e742449 CircleCI has an unforseeable number of devices in its ARP cache. Do not check for a strict number of clients during the tests. No changes to the source code.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-03-31 16:51:30 +00:00
DL6ER 3e2ef282f8 Merge pull request #713 from pi-hole/new/NAPTR
Add support for Name Authority Pointer (NAPTR) resource record
2020-03-17 23:07:37 +00:00
DL6ER 1af474819c Update tests to use gravity domain count stored in test database.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-02-03 08:43:06 +01:00
DL6ER abf0e4cdec Adjust tests after the last bugfix, bring gravity.db.sql schema to version 9.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-12-30 20:54:11 +00:00
DL6ER b6d74c701c Fix two testing errors.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-12-18 22:13:07 +00:00
DL6ER bb9f25cb85 Merge pull request #664 from pi-hole/new/group_zero
Add group zero support
2019-12-18 22:36:46 +01:00
DL6ER d752539a6f Do not try to resolve client host names during the tests. This occasionally leads to false-negatives during the CI testing (the CI cannot always resolve the hostnames).
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-12-18 10:01:12 +00:00
DL6ER 80584788ad Add new zero-group-specific tests (domain associated ONLY to a particular query is only seen by this client).
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-12-12 17:51:44 +00:00
DL6ER 5637d132bf Update FTL gravity.db.sql template to gravity database version 7.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-12-12 17:42:26 +00:00
DL6ER b37de5ce1a Add test for reporting blocking status correctly to pihole.log file.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-09-24 12:18:58 +02:00
DL6ER 685d4a7c5b Add tests for a third client that is member of an empty group. This client bypasses Pi-hole entirely as no adlists, exact or regex blacklists are enabled for it.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-09-19 18:55:41 +02:00
DL6ER 268312249a Run FTL in DEBUG_ALL mode to increase log verbosity during tests.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-09-19 18:18:34 +02:00
DL6ER 382e8dd43b Tests: add third client that does not block anything (tagged with an empty group)
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-09-19 16:00:02 +02:00
DL6ER fe0ec848d4 Add per-client tests
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-09-18 20:53:51 +02:00
DL6ER 609e09ad5f Merge branch 'development' into new/internal-blocking
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-09-10 21:15:20 +02:00
DL6ER 06c885a150 Improve tests by testing only against our own testing domains instead of relying on the outcome of some formally randomly selected domains.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-09-09 22:07:15 +02:00
DL6ER c19067b6a3 Update gravity.db.sql to version 4
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-09-09 21:46:23 +02:00
DL6ER 429a71dd56 Improve tests by testing only against our own testing domains instead of relying on the outcome of some formally randomly selected domains.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-09-09 21:45:29 +02:00
DL6ER 62af161473 Tests: Do not rely on the non-existance of regexa.com
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-09-05 21:18:08 +02:00
DL6ER ad94faf196 Adjust tests now that we have one IP reply more.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-09-05 21:16:55 +02:00
DL6ER 0d450d9f31 We store the domains converted to lowercase so we should compare case-insensitive if we look for exact matches later.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-09-05 21:16:55 +02:00
DL6ER ca37be09a0 Adjust tests now that we have one IP reply more.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-09-04 20:40:02 +02:00
DL6ER b93d6ee13b We store the domains converted to lowercase so we should compare case-insensitive if we look for exact matches later.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-09-04 20:35:11 +02:00
DL6ER 97aad2fd17 Undo testing for blacklisted.com in the Top Domains.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-09-04 19:33:28 +02:00
DL6ER 2b5e778dd4 Display number of domain in gravity table as number of blocked domains in the API.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-09-04 18:57:52 +02:00
DL6ER b17d0579ad Ensure whitelist (exact + regex) has higher importance than gravity and blacklist.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-09-04 18:45:55 +02:00
DL6ER f3e8d23baf Merge branch 'development' into new/whitelist-regex-support
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-08-17 15:01:32 +02:00
DL6ER 5b4d88867f Merge branch 'development' into tweak/bbusy_timeouts
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-07-21 21:52:58 +02:00
DL6ER b21b551a52 Add busy timeout for database connections.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-07-21 21:43:03 +02:00
DL6ER be1b573a2a Rename regex blacklist trigger to tr_regex_blacklist_update.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-07-16 11:36:00 +02:00
DL6ER 8431914084 Add tests for: Reported architecture, reported build machine, and reported compiler (+version). The tests are adaptive and can test both the situation found on the CI as well as locally.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-07-15 17:17:56 +02:00