Commit graph

18 commits

Author SHA1 Message Date
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
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
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
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
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
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
bcambl
2c461460db
test with both centos7 and centos8 images
Signed-off-by: bcambl <blayne@blaynecampbell.com>
2020-10-23 22:20:36 +01:00
jnozsc
4a711340ef
use py3 instead py2 (#3153)
* use py3 instead py2

Signed-off-by: jnozsc <jnozsc@gmail.com>

* use python 3.6

Signed-off-by: jnozsc <jnozsc@gmail.com>
2020-03-02 23:30:44 -08:00
bcambl
553aad6ed2 add Fedora container to test matrix
Signed-off-by: bcambl <blayne@blaynecampbell.com>
2018-07-05 18:12:39 -06:00
bcambl
5ca2ad6148 move test globals & mock commands to conftest
Signed-off-by: bcambl <blayne@blaynecampbell.com>
2018-07-05 18:10:43 -06:00
bcambl
c3d443aaff python linting: lines > 79 characters (E501)
Signed-off-by: bcambl <blayne@blaynecampbell.com>
2018-07-03 00:09:56 -06:00
bcambl
4468d81472 python linting: 2 lines prior to defs (E302)
Signed-off-by: bcambl <blayne@blaynecampbell.com>
2018-07-02 14:54:19 -06:00
diginc
5b54b9cb11 update Pihole fixture comment 2016-11-03 00:05:19 -05:00
diginc
a5a067d50f switching testinfra's Docker run from dash to bash 2016-11-02 23:58:54 -05:00
diginc
a03caea549 setupVar tests passing for debian & centos 2016-10-10 23:14:39 -05:00