mirror of
https://github.com/pi-hole/pi-hole
synced 2024-12-22 14:58:08 +00:00
update centos version check test
Signed-off-by: bcambl <blayne@blaynecampbell.com>
This commit is contained in:
parent
24b4aabae9
commit
6f8e8e98bb
@ -257,7 +257,7 @@ elif command -v rpm &> /dev/null; then
|
|||||||
CURRENT_CENTOS_VERSION=$(grep -oP '(?<= )[0-9]+(?=\.)' /etc/redhat-release)
|
CURRENT_CENTOS_VERSION=$(grep -oP '(?<= )[0-9]+(?=\.)' /etc/redhat-release)
|
||||||
# Check if CentOS version is supported
|
# Check if CentOS version is supported
|
||||||
if [[ $CURRENT_CENTOS_VERSION -lt $SUPPORTED_CENTOS_VERSION ]]; then
|
if [[ $CURRENT_CENTOS_VERSION -lt $SUPPORTED_CENTOS_VERSION ]]; then
|
||||||
echo -e " ${CROSS} CentOS $CURRENT_CENTOS_VERSION is not suported."
|
echo -e " ${CROSS} CentOS $CURRENT_CENTOS_VERSION is not supported."
|
||||||
echo -e " Please update to CentOS release $SUPPORTED_CENTOS_VERSION or later"
|
echo -e " Please update to CentOS release $SUPPORTED_CENTOS_VERSION or later"
|
||||||
# exit the installer
|
# exit the installer
|
||||||
exit
|
exit
|
||||||
|
@ -31,20 +31,13 @@ def test_release_supported_version_check_centos(Pihole):
|
|||||||
'''
|
'''
|
||||||
confirms installer exits on unsupported releases of CentOS
|
confirms installer exits on unsupported releases of CentOS
|
||||||
'''
|
'''
|
||||||
# mock CentOS release < 7 (unsupported)
|
# modify /etc/redhat-release to mock an unsupported CentOS release
|
||||||
mock_command_2(
|
Pihole.run('echo "CentOS Linux release 6.9" > /etc/redhat-release')
|
||||||
'rpm',
|
|
||||||
{"-q --queryformat '%{VERSION}' centos-release'": (
|
|
||||||
'5',
|
|
||||||
'0'
|
|
||||||
)},
|
|
||||||
Pihole
|
|
||||||
)
|
|
||||||
distro_check = Pihole.run('''
|
distro_check = Pihole.run('''
|
||||||
source /opt/pihole/basic-install.sh
|
source /opt/pihole/basic-install.sh
|
||||||
distro_check
|
distro_check
|
||||||
''')
|
''')
|
||||||
expected_stdout = cross_box + (' CentOS is not suported.')
|
expected_stdout = cross_box + (' CentOS 6 is not supported.')
|
||||||
assert expected_stdout in distro_check.stdout
|
assert expected_stdout in distro_check.stdout
|
||||||
expected_stdout = 'Please update to CentOS release 7 or later'
|
expected_stdout = 'Please update to CentOS release 7 or later'
|
||||||
assert expected_stdout in distro_check.stdout
|
assert expected_stdout in distro_check.stdout
|
||||||
|
Loading…
Reference in New Issue
Block a user