def test_IPv6_only_GUA(Pihole): ''' confirms IPv6 blocking is enabled for GUA addresses ''' # mock ip -6 address to return GUA address mock_command_2( 'ip', { '-6 address': ('inet6 2003:12:1e43:301:d210:52fa:fe00:7ad7/64 scope global', '0') }, Pihole) detectPlatform = Pihole.run(''' source /opt/pihole/basic-install.sh useIPv6dialog ''') expected_stdout = 'Found IPv6 GUA address, using it for blocking IPv6 ads' assert expected_stdout in detectPlatform.stdout
def test_release_supported_version_check_centos(Pihole): ''' confirms installer exits on unsupported releases of CentOS ''' # mock CentOS release < 7 (unsupported) mock_command_2( 'rpm', {"-q --queryformat '%{VERSION}' centos-release'": ('5', '0')}, Pihole) distro_check = Pihole.run(''' source /opt/pihole/basic-install.sh distro_check ''') expected_stdout = cross_box + (' CentOS is not suported.') assert expected_stdout in distro_check.stdout expected_stdout = 'Please update to CentOS release 7 or later' assert expected_stdout in distro_check.stdout
def test_IPv6_only_link_local(Pihole): ''' confirms IPv6 blocking is disabled for Link-local address ''' # mock ip -6 address to return Link-local address mock_command_2( 'ip', {'-6 address': ('inet6 fe80::d210:52fa:fe00:7ad7/64 scope link', '0')}, Pihole) detectPlatform = Pihole.run(''' source /opt/pihole/basic-install.sh useIPv6dialog ''') expected_stdout = ('Unable to find IPv6 ULA/GUA address, ' 'IPv6 adblocking will not be enabled') assert expected_stdout in detectPlatform.stdout
def test_IPv6_only_ULA(Xfilter): ''' confirms IPv6 blocking is enabled for ULA addresses ''' # mock ip -6 address to return ULA address mock_command_2( 'ip', { '-6 address': ('inet6 fda2:2001:5555:0:d210:52fa:fe00:7ad7/64 scope global', '0') }, Xfilter) detectPlatform = Xfilter.run(''' source /opt/xfilter/basic-install.sh useIPv6dialog ''') expected_stdout = 'Found IPv6 ULA address, using it for blocking IPv6 ads' assert expected_stdout in detectPlatform.stdout