1
0
mirror of https://github.com/pi-hole/pi-hole synced 2024-11-15 20:49:01 +00:00
Commit Graph

201 Commits

Author SHA1 Message Date
yubiuser
2ff1fa1b85
Merge branch 'development' into use_utils 2022-09-17 16:14:31 +02:00
Christian König
8bc5b16527
Set tox envlist to py3
Signed-off-by: Christian König <ckoenig@posteo.de>
2022-09-15 13:55:45 +02:00
Christian König
c1a927fff1
Run test workflows on python 3.10
Signed-off-by: Christian König <ckoenig@posteo.de>
2022-09-15 13:55:45 +02:00
Adam Warner
0f74165c9d
Drop Ubuntu 18 tests
Tweek version_check to only output 1st char of the reported version

Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2022-09-03 12:55:17 +01:00
Adam Warner
46e1a87e9e
Tweak FTL test to ensure we don't get false positives on incompatible OS (Will remote Ub18 in a separate commit)
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2022-09-03 12:09:37 +01:00
Christian König
9b5ea13a33 Use utils.sh in install script
Signed-off-by: Christian König <ckoenig@posteo.de>
2022-08-24 08:49:20 +02:00
Adam Warner
5421aad03e
Store versions as key/value pairs rather than space delimeted values
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2022-08-22 19:11:27 +01:00
Adam Warner
5816f495f4
Fix test_installPiholeWeb_fresh_install_no_errors and test_installPihole_fresh_install_readableBlockpage
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2022-08-08 17:12:16 +01:00
Adam Warner
71bc237639
Merge pull request #4828 from pi-hole/centos7-can-do-one
Drop explicit support for CentOS 7 from the install script
2022-07-31 19:15:41 +01:00
Adam Warner
9028898ba7
Move code from check_epel_repo_required into the rpm branch of the if check on package_manager_detect(), adjust tests to accommodate
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2022-07-30 19:27:00 +01:00
Adam Warner
fc2a564cc0
remove tests no longer needed
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2022-07-30 16:27:31 +01:00
Adam Warner
b613758419
rename select_rpm_php and simplify it to remove code no longer needed (discussed internally removing the unsupported dialog here to match behaviour on non rpm distros)
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2022-07-30 16:27:31 +01:00
Adam Warner
9c03915cb0
Remove special Centos7 hand holds. Move the unsupported dialog out to a further if block so that a user may still continue to install on centos7 (provided they have the pre-requisites installed)
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2022-07-30 16:27:31 +01:00
Adam Warner
e29aa4e205
First things first... 2022-07-30 16:27:29 +01:00
Christian König
ab6b37bdcf
Fix stickler and codefactor complaints
Signed-off-by: Christian König <ckoenig@posteo.de>
2022-07-26 19:33:38 +02:00
Christian König
c8c4eb59b7
Add getFTLPID() tests
Signed-off-by: Christian König <ckoenig@posteo.de>
2022-07-26 17:34:42 +02:00
Christian König
2651abbe6c
Add tests
Signed-off-by: Christian König <ckoenig@posteo.de>
2022-07-26 16:57:06 +02:00
Christian König
7b77d991df
Move FTL port and PID functions to utils.sh
Signed-off-by: Christian König <ckoenig@posteo.de>
2022-07-26 14:38:03 +02:00
Adam Warner
21af75a2d2
Ubuntu 21 tests are failing entirely. apt-update does not work on an impish vm, either
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2022-07-25 22:27:56 +01:00
Christian König
9f918972d2 Adjust tests
Signed-off-by: Christian König <ckoenig@posteo.de>
2022-07-10 14:33:43 +02:00
Christian König
518cbd10e0
Rename also in docker files
Signed-off-by: Christian König <ckoenig@posteo.de>
2022-07-06 22:58:14 +02:00
Dan Schaper
0b10c50a0b
Merge branch 'development' into tweak/dialog 2022-07-03 11:58:45 -07:00
Dan Schaper
6efb3a3372
Fix for epel mirror timeouts
Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
2022-07-03 11:48:12 -07:00
Dan Schaper
2845c72bde Add testing dependencies for CentOS7 and dialog
Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
2022-07-03 11:08:56 -07:00
Dan Schaper
a650641da4 Change tests to mock dialog
Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
2022-07-03 11:08:56 -07:00
Dan Schaper
80bef5f6b6
Direct pull for epel-release
Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
2022-07-03 10:47:05 -07:00
Adam Warner
0be987239e
Adds spellcheck action to the smoke-tests (also moves editorconfig-checker to smoketests away from it's own action)
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2022-07-02 14:04:08 +01:00
Christian König
f740e0fefb
Ubt22 is jammy not impish
Signed-off-by: Christian König <ckoenig@posteo.de>
2022-06-25 23:11:16 +02:00
Christian König
8c498acd4c
Re-add Ubuntu21 tests
Signed-off-by: Christian König <ckoenig@posteo.de>
2022-06-25 23:04:16 +02:00
Christian König
f9d1893f96
Update test to reflect currently supported OS
Signed-off-by: Christian König <ckoenig@posteo.de>
2022-06-20 10:34:32 +02:00
Christian König
2c07d27ad7 Forgot two places
Signed-off-by: Christian König <ckoenig@posteo.de>
2022-06-04 22:42:41 +02:00
Christian König
0fa94e0946
Remove unused test which was commented since 5 years by PR 1244
Signed-off-by: Christian König <ckoenig@posteo.de>
2022-05-15 20:26:25 +02:00
Adam Warner
73aa43611f
Merge pull request #4700 from spmfox/4697-centos8-container-ftl-arch
Changed ldd binary check for better compatibility
2022-04-20 19:27:45 +01:00
Dan Schaper
c19788dd18
Mock which sh to reutrn /bin/sh.
Check for `/bin/sh` library

Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
2022-04-20 11:22:58 -07:00
Adam Warner
8de814ab34
Split the tests, too. Enhance the descriptions
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2022-04-19 18:35:56 +01:00
spmfox
2601162243 Changed ldd binary check from /bin/ls to /usr/bin/bash
Signed-off-by: spmfox <spmfox@foxwd.com>
2022-04-16 16:46:07 -04:00
Adam Warner
db116971ce
I tried to do too many things in one function, vastly overcomplicating what should have been _this_ all along
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2022-04-14 22:53:38 +01:00
yubiuser
d3e94cbceb
Merge pull request #4653 from pi-hole/refactor-utils-redux
Tweaks to functions in utils.sh and refactored usages in webpage.sh
2022-04-04 23:25:54 +02:00
Adam Warner
4d31d5ee11
Address review comments
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2022-04-04 22:02:26 +01:00
Adam Warner
7fa8cdd03e
Address:
- Review Comments
 - Stickler Complaints
2022-04-02 12:46:07 +01:00
Dan Schaper
4230be0c80
Hirsute buildpack EOL upstream. Adding impish.
Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
2022-04-01 12:00:14 -07:00
Adam Warner
48138d32b6
Adjust addOrEditKeyValPair to optionally take two or three arguments (adjust test to suit)
Add a removeKey function with test

update webpage.sh to reference functions in utils.sh (this can likely be abstracted/refactored further)

Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2022-03-16 17:42:01 +00:00
Christian König
42424b515b Add getFTLAPIPort function
Add ftl_api_port function

Signed-off-by: Christian König <ckoenig@posteo.de>

Use getFTLAPIPort in pihole

Signed-off-by: Christian König <ckoenig@posteo.de>

Use default portfile as fallback

Signed-off-by: Christian König <ckoenig@posteo.de>

Fix stickler

Signed-off-by: Christian König <ckoenig@posteo.de>

Correct variables

Signed-off-by: Christian König <ckoenig@posteo.de>

Apply suggestions from code review

Co-authored-by: DL6ER <DL6ER@users.noreply.github.com>

Add test getFTLAPIPort returing default port

Signed-off-by: Christian König <ckoenig@posteo.de>

Remove unused code from test_key_val_replacement_works

Signed-off-by: Christian König <ckoenig@posteo.de>

Add getFTLAPIPort_custom test

Signed-off-by: Christian König <ckoenig@posteo.de>

Fix output format

Signed-off-by: Christian König <ckoenig@posteo.de>

Add debugging

Signed-off-by: Christian König <ckoenig@posteo.de>

Remove debugging and fix function

Signed-off-by: Christian König <ckoenig@posteo.de>
2022-02-27 18:16:53 +01:00
Christian König
d7d8e9730b Remove pihole-FTL.conf.5 from automated tests
Signed-off-by: Christian König <ckoenig@posteo.de>
2022-02-04 20:43:47 +01:00
Adam Warner
444526ad58
Switch from centos8 to centos8:stream base image for centos 8 tests 2022-02-03 18:43:19 +00:00
Adam Warner
77e5121d43
Split new function out into a separte utility script and add a test for it. Can be used in future to organise re/commonly-used code
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2022-01-30 23:05:28 +00:00
MichaIng
14a379d448
Fix generated /etc/os-release file in OS check test
Signed-off-by: MichaIng <micha@dietpi.com>
2021-11-30 02:57:44 +01:00
Adam Warner
cdd4d9ea9e
Update the tests (#4427)
* unpin the requirements and update all to latest available - needs more work still. see notes in `def host()`

Signed-off-by: Adam Warner <me@adamwarner.co.uk>

* fix py3 monkey patch of testinfra docker using bash

Signed-off-by: Adam Hill <adam@diginc.us>

* update the other test files to use `host` instead of `Pihole`
Address some sticklr and codefactor
update python version from 3.7 to 3.8
preload `git` onto the centos/fedora test images, and switch which with command -v in the passthrough mock
testinfra is deprecated, use pytest-testinfra

Signed-off-by: Adam Warner <me@adamwarner.co.uk>

Co-authored-by: Adam Hill <adam@diginc.us>
2021-11-18 01:03:37 +00:00
pvogt09
cedd1a2591
unit test for umask problems in #3177 and #2730 (#3191)
* add test for file permissions of $webroot

Signed-off-by: pvogt09 <50047961+pvogt09@users.noreply.github.com>

* changes sudo to su for running command as user www-data

Signed-off-by: pvogt09 <50047961+pvogt09@users.noreply.github.com>

* installs PIHOLE_WEB_DEPS to create LIGHTTPD_USER

Signed-off-by: pvogt09 <50047961+pvogt09@users.noreply.github.com>

* changes stdout to rc

Signed-off-by: pvogt09 <50047961+pvogt09@users.noreply.github.com>

* use installPihole instead of installPiholeWeb in test

Signed-off-by: pvogt09 <50047961+pvogt09@users.noreply.github.com>

* try installation process with main

Signed-off-by: pvogt09 <50047961+pvogt09@users.noreply.github.com>

* mock systemctl

Signed-off-by: pvogt09 <50047961+pvogt09@users.noreply.github.com>

* removes stickler errors

Signed-off-by: pvogt09 <50047961+pvogt09@users.noreply.github.com>

* start lighttpd and make webpage test optional

Signed-off-by: pvogt09 <50047961+pvogt09@users.noreply.github.com>

* test all files and directories in $webroot

Signed-off-by: pvogt09 <50047961+pvogt09@users.noreply.github.com>

* fix stickler and codefactor warnings

Signed-off-by: pvogt09 <50047961+pvogt09@users.noreply.github.com>

* set permission for /var/cache if it did not exist before

Signed-off-by: pvogt09 <50047961+pvogt09@users.noreply.github.com>

* add test case for pihole files

Signed-off-by: pvogt09 <50047961+pvogt09@users.noreply.github.com>

* fix stickler errors

Signed-off-by: pvogt09 <50047961+pvogt09@users.noreply.github.com>

* revert "set permission for /var/cache if it did not exist before" and make lighttpd start work

Signed-off-by: pvogt09 <50047961+pvogt09@users.noreply.github.com>

* add --add-cap=NET_ADMIN to enable FTL start

Signed-off-by: pvogt09 <50047961+pvogt09@users.noreply.github.com>

* specify DNS server for cURL

Signed-off-by: pvogt09 <50047961+pvogt09@users.noreply.github.com>

* check files created by FTL

Signed-off-by: pvogt09 <50047961+pvogt09@users.noreply.github.com>

* reorder code and change nameserver in /etc/resolv.conf

Signed-off-by: pvogt09 <50047961+pvogt09@users.noreply.github.com>

* resolve with dig instead of relying on /etc/resolv.conf

Signed-off-by: pvogt09 <50047961+pvogt09@users.noreply.github.com>

* set IP to 127.0.0.1 in setupVars.conf for blockpage tests

Signed-off-by: pvogt09 <50047961+pvogt09@users.noreply.github.com>

* resolve domain with dig and remove debug output

Signed-off-by: pvogt09 <50047961+pvogt09@users.noreply.github.com>

* fix stickler errors

Signed-off-by: pvogt09 <50047961+pvogt09@users.noreply.github.com>

* no git pull in Github Action runs for pull requests

Signed-off-by: pvogt09 <50047961+pvogt09@users.noreply.github.com>

* --cap-add=ALL test

Signed-off-by: pvogt09 <50047961+pvogt09@users.noreply.github.com>

* fix stickler errors

Signed-off-by: pvogt09 <50047961+pvogt09@users.noreply.github.com>

* remove debug code

Signed-off-by: pvogt09 <50047961+pvogt09@users.noreply.github.com>

* update_repo patch for CentOS 7 in Github Actions

Signed-off-by: pvogt09 <50047961+pvogt09@users.noreply.github.com>

* removes TODOs and stickler warnings

Signed-off-by: pvogt09 <50047961+pvogt09@users.noreply.github.com>

* adds trailing slash to domain

Signed-off-by: pvogt09 <50047961+pvogt09@users.noreply.github.com>

* use only first result from dig

Signed-off-by: pvogt09 <50047961+pvogt09@users.noreply.github.com>

* domain name resolution does not work reliably in docker container

Signed-off-by: pvogt09 <50047961+pvogt09@users.noreply.github.com>

* repair executable permission

Signed-off-by: pvogt09 <50047961+pvogt09@users.noreply.github.com>

* Create mock_command_passthrough that allows intercepting of specific arguments - everything else is passed through to the proper command. Use this new command instead of making changes in basic-install.sh to make the tests pass.

Signed-off-by: Adam Warner <me@adamwarner.co.uk>

Co-authored-by: Adam Warner <me@adamwarner.co.uk>
2021-11-11 16:44:57 +00:00
Blayne Campbell
8713135b01
update tests: remove fedora 32, add fedora 34 (#4403)
Signed-off-by: bcambl <blayne@blaynecampbell.com>
2021-10-23 19:43:20 +01:00