Adam Warner
48f56d0385
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-13 22:48:39 +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
Adam Warner
5b03160295
Install script comment tweaks ( #4361 )
2021-10-04 11:40:53 +01:00
Christian König
466520366d
Fogot to save...
...
Signed-off-by: Christian König <ckoenig@posteo.de >
2021-10-02 23:47:13 +02:00
Christian König
9dbcbdbe66
Adjust tests
...
Signed-off-by: Christian König <ckoenig@posteo.de >
2021-10-02 23:43:08 +02:00
yubiuser
1c286c7bc4
Select proper PHP version on RPM based OS after INSTALLER_DEPS have been installed ( #4325 )
...
* Select proper PHP version on RPM based OS after INSTALLER_DEPS have been installed
* Remove check for unsupported RPM distros as it is checked in os_check already
* Add select_rpm_php function to tox tests
Signed-off-by: Christian König <ckoenig@posteo.de >
2021-09-12 13:40:37 -07:00
Adam Warner
d68a2ffaf3
Install only minimal requiered package before performing os_check
...
Co-authored-by: Christian König <ckoenig@posteo.de >
Signed-off-by: Adam Warner <me@adamwarner.co.uk >
2021-08-05 19:02:36 +01:00
Adam Warner
1358209a9a
rename distro_check to package_manager_detect, as it is more in keeping with what the function actually does
...
Signed-off-by: Adam Warner <me@adamwarner.co.uk >
2021-08-05 19:02:36 +01:00
Adam Warner
38d4b2a883
add OS_CHECK_DOMAIN_NAME override to all the dockerfiles
...
Signed-off-by: Adam Warner <me@adamwarner.co.uk >
2021-07-14 22:41:17 +01:00
Adam Warner
e2e7d0a6aa
add tests for ubuntu 21
...
Signed-off-by: Adam Warner <me@adamwarner.co.uk >
2021-07-14 22:36:02 +01:00
Daniel
fdca19e66d
Support and test Debian Bullsye (11)
...
Signed-off-by: Daniel <daniel@developerdan.com >
2021-07-07 19:09:54 +00:00
Adam Warner
4ac4bc5c18
Merge branch 'development' into fix/gravity_no_locallist
2021-07-04 00:48:09 +01:00
Adam Warner
87f2ae82cd
Stickler gonna stickle...
...
Signed-off-by: Adam Warner <me@adamwarner.co.uk >
2021-07-03 00:07:37 +01:00
Adam Warner
469b715442
Add three new tests (one for each dependecy array) to check packages are available in supported OS package repos
...
Signed-off-by: Adam Warner <me@adamwarner.co.uk >
2021-07-03 00:00:54 +01:00
DL6ER
60513f93a3
Don't set IPV{4,6}_ADDRESS in conftest.py
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2021-04-18 09:26:23 +02:00
DL6ER
aa88be335e
Acknowledge that IPV{4,6}_ADDRESS may not exist
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2021-04-16 11:44:54 +02:00
DL6ER
74948ae5c1
The correct port separator is '#' not ':' in dnsmasq style. This should not have been changed in #4083 in the first place.
...
Signed-off-by: DL6ER <dl6er@dl6er.de >
2021-04-14 22:53:12 +02:00
bcambl
d5f13018a7
Merge branch 'release/v5.3' into fedora_33_support
...
Signed-off-by: bcambl <blayne@blaynecampbell.com >
2021-04-12 20:06:11 -06:00
jbzdarkid
8090071eff
Update regex to disallow leading zeros
...
Also updated a comment to point to a non-experimental RFC.
Signed-off-by: jbzdarkid <jbzdarkid@gmail.com >
2021-03-21 16:27:08 -07:00
Joseph Blackman
89c80947df
Improve regexes for ipv4 matching
...
Signed-off-by: jbzdarkid <jbzdarkid@gmail.com >
2021-03-21 16:24:35 -07:00
bcambl
b62495d89e
update tests to fedora 33
...
Signed-off-by: bcambl <blayne@blaynecampbell.com >
2021-01-21 20:20:07 -06:00
Adam Warner
d1539335bc
appease stickler-ci
...
Signed-off-by: Adam Warner <me@adamwarner.co.uk >
2020-12-01 10:13:36 +00:00
Adam Warner
3e73782f0e
Remove Travis CI config
...
Create Github Actions config
Split tox ini into one per supported distro so they can be run seperately
Signed-off-by: Adam Warner <me@adamwarner.co.uk >
2020-12-01 10:02:31 +00:00
Adam Warner
2a82e1fec1
Nothing to see here. I just forgot a page.
...
Signed-off-by: Adam Warner <me@adamwarner.co.uk >
2020-11-18 23:29:08 +00:00
Adam Warner
f7982dfbe1
-remove duplicate OS dockerfiles
...
+rename centos->centos_8, centos7 -> centos_7
+update centos/fedora test script
Signed-off-by: Adam Warner <me@adamwarner.co.uk >
2020-11-16 22:39:50 +00:00
pvogt09
b375dd2c81
Update test/ubuntu_20.Dockerfile
...
Co-authored-by: Adam Warner <github@adamwarner.co.uk >
Signed-off-by: pvogt09 <50047961+pvogt09@users.noreply.github.com >
2020-11-15 20:13:43 +01:00
pvogt09
4386cc4f22
Revert "add test case for installation of dependencies for installer, core and web"
...
This reverts commit 60a4814ac1
.
Signed-off-by: pvogt09 <50047961+pvogt09@users.noreply.github.com >
2020-10-27 12:44:57 +01:00
pvogt09
cb49ce38f5
fix stickler errors
...
Signed-off-by: pvogt09 <50047961+pvogt09@users.noreply.github.com >
2020-10-27 12:32:23 +01:00
pvogt09
3128d14d1f
update images to versions supported by pi-hole 5
...
Signed-off-by: pvogt09 <50047961+pvogt09@users.noreply.github.com >
2020-10-27 12:02:57 +01:00
pvogt09
bef9cd3bc2
mock whiptail to add universe repo
...
Signed-off-by: pvogt09 <50047961+pvogt09@users.noreply.github.com >
2020-10-27 11:35:49 +01:00
pvogt09
60a4814ac1
add test case for installation of dependencies for installer, core and web
...
Signed-off-by: pvogt09 <50047961+pvogt09@users.noreply.github.com >
2020-10-27 11:35:48 +01:00
pvogt09
fec1595183
add docker containers for debian 9 and 10, ubuntu 16 and 18, fedora 28 and 29
...
Signed-off-by: pvogt09 <50047961+pvogt09@users.noreply.github.com >
2020-10-27 11:34:27 +01:00
Adam Warner
c80f0766c5
drop debian/fedora container versions to lowest supported
...
Signed-off-by: Adam Warner <me@adamwarner.co.uk >
2020-10-26 17:56:17 +00:00
Adam Warner
fb454ebe14
fix stickler complaints
...
Signed-off-by: Adam Warner <me@adamwarner.co.uk >
2020-10-23 23:09:07 +01:00
Adam Warner
ee556088b5
Fake OS details in /etc/os-release and confirm install fails
...
Signed-off-by: Adam Warner <me@adamwarner.co.uk >
2020-10-23 23:05:41 +01:00
bcambl
660c17814d
E128 continuation line under-indented for visual indent
...
Signed-off-by: bcambl <blayne@blaynecampbell.com >
2020-10-23 22:20:37 +01:00
bcambl
a7c58e7112
E302 expected 2 blank lines, found 1
...
Signed-off-by: bcambl <blayne@blaynecampbell.com >
2020-10-23 22:20:36 +01:00
bcambl
05b6717187
test PHP optin/optout separately for CentOS 7 & 8
...
Signed-off-by: bcambl <blayne@blaynecampbell.com >
2020-10-23 22:20:36 +01:00