mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-12-25 14:20:18 +00:00
Fake OS details in /etc/os-release and confirm install fails
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
This commit is contained in:
parent
660c17814d
commit
ee556088b5
1 changed files with 19 additions and 1 deletions
|
@ -563,6 +563,24 @@ def test_validate_ip_invalid_letters(Pihole):
|
||||||
assert output.rc == 1
|
assert output.rc == 1
|
||||||
|
|
||||||
|
|
||||||
|
def test_os_check_fails(Pihole):
|
||||||
|
''' Confirms install fails on unsupported OS '''
|
||||||
|
Pihole.run('''
|
||||||
|
source /opt/pihole/basic-install.sh
|
||||||
|
distro_check
|
||||||
|
install_dependent_packages ${INSTALLER_DEPS[@]}
|
||||||
|
cat <<EOT > /etc/os-release
|
||||||
|
ID=UnsupportedOS
|
||||||
|
VERSION_ID="2"
|
||||||
|
EOT
|
||||||
|
''')
|
||||||
|
detectOS = Pihole.run('''t
|
||||||
|
source /opt/pihole/basic-install.sh
|
||||||
|
os_check
|
||||||
|
''')
|
||||||
|
expected_stdout = 'Unsupported OS detected: UnsupportedOS'
|
||||||
|
assert expected_stdout in detectOS.stdout
|
||||||
|
|
||||||
def test_os_check_passes(Pihole):
|
def test_os_check_passes(Pihole):
|
||||||
''' Confirms OS meets the requirements '''
|
''' Confirms OS meets the requirements '''
|
||||||
Pihole.run('''
|
Pihole.run('''
|
||||||
|
|
Loading…
Reference in a new issue