Commit graph

91 commits

Author SHA1 Message Date
Mark Drobnak
1789a2db29
Merge pull request #2384 from pi-hole/feature/install-privacy-level
Set FTL Privacy Level During Install
2018-11-01 15:16:11 -04:00
bcambl
6f8e8e98bb update centos version check test
Signed-off-by: bcambl <blayne@blaynecampbell.com>
2018-08-29 22:16:11 -06:00
Mcat12
c22e94c9c7
Update test to include empty FTL config
The installer ensures that an FTL config will exist, and creates an
empty file if it doesn't.

Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-08-20 19:33:15 -04:00
DL6ER
f5c3dc5d9d
Improve download error message that is shown when downloading or verifying the binary failed
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-08-07 16:51:58 +02:00
Adam Hill
b04195041a
Update README.md 2018-07-12 10:22:50 -05:00
Adam Hill
8ca4c66e3c
make smarter assertions rathe than largestring not in string
Signed-off-by: Adam Hill <adam@diginc.us>
2018-07-12 00:03:25 -05:00
Adam Hill
449b7bf6e4
reduce the amount of strict not in checks
Signed-off-by: Adam Hill <adam@diginc.us>
2018-07-11 23:25:16 -05:00
Adam Hill
88e4b6390c
Tox!
Signed-off-by: Adam Hill <adam@diginc.us>
2018-07-11 23:24:28 -05:00
bcambl
fff31558a0 assert REMI repository is not installed for Fedora
- fix whiptail mock comments to clarify continue vs cancel

Signed-off-by: bcambl <blayne@blaynecampbell.com>
2018-07-08 14:02:31 -06:00
bcambl
4c23964964 ensure images are build prior to running tests
Signed-off-by: bcambl <blayne@blaynecampbell.com>
2018-07-07 18:43:11 -06:00
bcambl
d4addd53ad Add tests for Fedora/CentOS distro_check
- test to ensure installer behavior with unsupported CentOS releases
- test to ensure repository enablement
- test to ensure PHP upgrade opt-in/opt-out behavior

Signed-off-by: bcambl <blayne@blaynecampbell.com>
2018-07-07 17:44:05 -06:00
bcambl
09d40679c0 add test for unsupported distro checking
Signed-off-by: bcambl <blayne@blaynecampbell.com>
2018-07-06 10:07:43 -06: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
40537e1522 python linting: missing whitespace after ',' (E231)
Signed-off-by: bcambl <blayne@blaynecampbell.com>
2018-07-03 00:43:24 -06:00
bcambl
064a75b21b python linting: missing whitespace around operator (E225)
Signed-off-by: bcambl <blayne@blaynecampbell.com>
2018-07-03 00:43:18 -06:00
bcambl
1d3445bc0f python linting: whitespace after '(' and before ')' (E201 & E202)
Signed-off-by: bcambl <blayne@blaynecampbell.com>
2018-07-03 00:43:09 -06:00
bcambl
79232d02c9 python linting: 'pytest' imported but unused (F401)
Signed-off-by: bcambl <blayne@blaynecampbell.com>
2018-07-03 00:30:00 -06:00
bcambl
9bd4986781 python linting: whitespace before ':' (E203)
Signed-off-by: bcambl <blayne@blaynecampbell.com>
2018-07-03 00:21:57 -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
da3dfd0998 python linting: missing whitespace after ':' (E231)
Signed-off-by: bcambl <blayne@blaynecampbell.com>
2018-07-02 15:25:51 -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
bcambl
9d3d33b6a2 add tests for selinux checking
Signed-off-by: bcambl <blayne@blaynecampbell.com>
2018-06-26 00:09:30 -06:00
Adam Warner
8cf8da4c78
- Check file /etc/pihole/ftlbranch for current FTL branch, download from github if master, or pi-hole.net if other
- Check if downloaded binary file can resolve queries, if so stop and disable dnsmasq
- Add service_disable function
- Add dependency libcap2-bin on debian to enable setcap. Need to check other distos
-Always download FTL binary if /etc/pihole/ftlbranch does not contain "master"
- Change some strings/variables that reference dnsmasq and change them to pihole/pihole-FTL

Signed-off-by: Adam Warner <adamw@rner.email>
2018-03-06 18:44:57 +00:00
WaLLy3K
26afe04926 Remove index.js test 2017-09-19 01:04:04 +10:00
Adam Warner
42b5574f9b
remove no longer needed tests
Signed-off-by: Adam Warner <adamw@rner.email>
2017-09-09 19:41:05 +01:00
WaLLy3K
fdf2649f2f Clean up known remaining colour output issues (#1613)
* Print newline on error message

* Output last three lines of error if update fails

* Consistent error messages & housekeeping

* Add shellcheck directive to ignore COL_TABLE
* Quoted and braced variables for codebase consistency
* Escaped newlines correctly
* Made error messages consistent (indenting and wording)
* Removed consecutive echos

* Conditional formatting consistency

* Braced, quoted and used [[ on conditionals

* Fix specific ShellCheck issues

* Fixed issues that could be safely changed without extensive testing

* Update SELinux whiptail behaviour & more

* Colourised some strings
* Fixed multiple line string indenting
* Made output consistent with existing codebase
* Removed sequential echos
* Make SELinux whiptail use "--defaultno", and change text wording

* Add help text for hostrecord, and colourise output

* this should fix the tests...

Signed-off-by: Adam Warner <adamw@rner.email>

* revert changes to `update_package_cache()` to prove tests

Signed-off-by: Adam Warner <adamw@rner.email>
2017-07-26 18:00:08 +01:00
Mcat12
b09c660833 Always process DNS and DHCP settings in installer (#1630)
* Always process DNS and DHCP settings in installer

* Make sure dnsmasq config exists before modifying it

Signed-off-by: Mcat12 <newtoncat12@yahoo.com>

* Make sure the dnsmasq config directory exists

Signed-off-by: Mcat12 <newtoncat12@yahoo.com>

* Only remove the DHCP config if it exists (fixes tests, hopefully)

Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2017-07-26 17:15:23 +01:00
Adam Warner
bf70c2c660
initial changes to tests to take into account changes to strings
Signed-off-by: Adam Warner <adamw@rner.email>
2017-07-12 22:57:57 +01:00
Dan Schaper
c29c4ceb0f
Integrate DL's update.sh fixes.
`shellcheck -x` for following files.

Do not test for included files SC1091

Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
2017-06-25 14:39:09 -07:00
Dan Schaper
07fc047dd8
Remove testing for debug as this is getting a re-write by Jacob.
Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
2017-06-25 12:26:16 -07:00
Dan Schaper
0c2827e130
Test exclusion for sourced files SC1090.
Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
2017-06-24 15:49:16 -07:00
Adam Warner
536585b846 Colourise Core Output Text (#1471)
* Define colours within COL_TABLE
* Do not output colours for non-terminal instances
* Removed ":::"
* Fixed indenting & spacing
* Made output consistent throughout project
* Reworded text to fit on standard 80 char wide Terminal screen
* Made 'sudo raspi-config' warning (insufficient disk space) only show on RPi
* Make "Installation/Update Complete" the final msg
* Remove redundant messages
* Simplify update available message
* Confirm user would like to begin uninstall
* If "git pull" string says "Already up-to-date.", place [i] before it
* Colour Temp/Interface output
* Made `pihole disable 5z` invalid
* Added error fallback if invalid argument (not s/m) is detected
* Quoted "$2" for consistency
* Updated help text
* L185/286: Replaced echo with redirect
* User agents for adblock.mahakala.is/adaway.org unnecessary 
* Print newline on confirmation of repository reset
* Add output to admin-related dnsmasq restarts
* Return error message for "pihole -q"
* Imply default checkout behaviour with y/N
* Fix uninstall failing to remove pihole user
* Print checkout 'git remote show origin' STDERR on new line
* Replaced checkout "AdminLTE" wording with "Web Admin"
2017-06-21 21:49:05 +10:00
DL6ER
939055f19c Revert "Add FTL tests to the test suite (#1510)" (#1519)
This reverts commit cf6a1ac9ad.
2017-06-05 13:51:13 +02:00
DL6ER
cf6a1ac9ad Add FTL tests to the test suite (#1510)
* Add first version of FTL tests

* Wait one second to allow FTL to start up and analyze our mock log

* Add test_FTL_telnet_statistics

* Added test_FTL_telnet_top_clients

* Add test_FTL_telnet_top_domains
2017-06-04 13:23:56 +02:00
DL6ER
01e091fd17 Prefer ULA over GUA addresses [IPv6] (#1508)
* On installs with GUA and ULA's we should prefer ULA's as it's been demonstrated that GUA's can and often are rotated by ISPs. Fixes #1473

* Add test for link-local address detection

* Add ULA-only and GUA-only tests

* Add test_IPv6_GUA_ULA_test and test_IPv6_ULA_GUA_test

* Add ""

* Add mock_command_2 command that can mock a command with more than one argument (as "ip -6 address") and result multiple lines of results

* Make mock_command_2 more similar to the original mock_command

* Correct comments

* Fixed remaining comments

* Fixed one last comment...

* Fixed a comment...
2017-06-02 23:01:48 +02:00
georou
6c56665403 updated travis for new firewalld add service 2017-03-16 10:26:51 +11:00
Dan Schaper
dcb9797f35
Tests changed to reflect uname calls.
Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
2017-02-21 09:24:00 -08:00
DL6ER
e9b50442fa
Remove test_FTL_support_files_installed as we create them using the init.d script as of now 2017-02-21 11:25:18 +01:00
Dan Schaper
02ea9b9abc
Check file path and permissions in one go.
Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
2017-02-20 18:15:40 -08:00
Dan Schaper
4cd598ae10
Check support files installed and permissions.
Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
2017-02-20 18:12:51 -08:00
Dan Schaper
8eeb8ad779
Check binary installed and functional.
Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
2017-02-20 17:15:04 -08:00
Dan Schaper
70e876ee13
Download tests.
Make sure we download a binary and not just get the GitHub page.

Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
2017-02-20 11:11:16 -08:00
Dan Schaper
7a269e757e
Debian buildpack image for docker (Need curl for testing, using scm version to add curl and git.)
Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
2017-02-20 09:24:47 -08:00
Dan Schaper
87edbeaf58
Factor out downloader from detector function.
Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
2017-02-20 08:40:17 -08:00
Dan Schaper
339f95b00c
Change from uname -m to straight arch
Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
2017-02-20 08:13:46 -08:00
Dan Schaper
e480c761cd
Merge remote-tracking branch 'origin/new/FTL-binary' into new/FTL-binary
# Conflicts:
#	test/test_automated_install.py
2017-02-20 07:25:34 -08:00
Dan Schaper
26c628f8a5
Mock ldd command response.
Test aarch64 detection

Arm v6/v7 little endian.

x86_64 native

Test aarch64 detection

Unknown platform detection.

Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
2017-02-20 07:22:25 -08:00
Dan Schaper
59d6907d71
Test aarch64 detection
Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
2017-02-20 06:34:57 -08:00
Dan Schaper
b4450a3918
Mock ldd command response.
Test aarch64 detection

Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
2017-02-20 06:34:54 -08:00