diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 9245ff81..00635e89 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -703,6 +703,8 @@ update_package_cache() { echo -n "::: Updating local cache of available packages..." if eval ${UPDATE_PKG_CACHE}; then echo " done!" + else + echo -n "\n!!! ERROR - Unable to update package cache. Please try \"${UPDATE_PKG_CACHE}\"" fi } diff --git a/test/test_automated_install.py b/test/test_automated_install.py index 04db4f1b..29bb56d2 100644 --- a/test/test_automated_install.py +++ b/test/test_automated_install.py @@ -285,14 +285,15 @@ def test_update_package_cache_success_no_errors(Pihole): assert 'done!' in updateCache.stdout def test_update_package_cache_failure_no_errors(Pihole): - ''' confirms package cache was updated without any errors''' - mock_command('apt-get', {'*':('', '1')}, Pihole) + ''' confirms package cache was not updated''' + mock_command('apt-get', {'update':('', '1')}, Pihole) updateCache = Pihole.run(''' source /opt/pihole/basic-install.sh distro_check update_package_cache ''') assert 'Updating local cache of available packages...' in updateCache.stdout + assert 'ERROR' in updateCache.stdout assert 'done!' not in updateCache.stdout # Helper functions