From 0d7e18d9d7c3fc92a18f9c974142ae9f253aaa19 Mon Sep 17 00:00:00 2001 From: Colleen Murphy Date: Sat, 23 Mar 2019 23:36:42 +0100 Subject: [PATCH] Block pypi.org for pip mirror tests The beaker tests for this module use iptables to block access to pypi to ensure the mirror functionality of the custom pip provider is working. Pip now uses pypi.org instead of pypi.python.org and pypi.python.org is a CNAME to pypi.org so it makes more sense to block pypi.org directly. Also add iptables output for debugging purposes. Change-Id: I370a403aef30dc42f3d614c5882138dac4f41ec8 --- spec/acceptance/openstack_pip_provider_spec.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/spec/acceptance/openstack_pip_provider_spec.rb b/spec/acceptance/openstack_pip_provider_spec.rb index 22a55ff..68050f5 100644 --- a/spec/acceptance/openstack_pip_provider_spec.rb +++ b/spec/acceptance/openstack_pip_provider_spec.rb @@ -16,8 +16,10 @@ trusted-host = mirror.dfw.rax.openstack.org extra-index-url = http://mirror.dfw.rax.openstack.org/wheel/ubuntu-14.04-x86_64 EOF shell("if [ ! -f /etc/pip.conf ] ; then echo '#{pip_conf}' > /etc/pip.conf ; fi") - # Block pypi.python.org so we know the mirror is working - shell("iptables -A OUTPUT -d pypi.python.org -j DROP") + shell("iptables -S") + # Block pypi.org so we know the mirror is working + shell("iptables -A OUTPUT -d pypi.org -j DROP") + shell("iptables -S") # Remove the python-ipaddress distro package so that pip 10 won't fail to # install shade @@ -41,7 +43,9 @@ EOF context 'without mirrors' do before :all do - shell("iptables -D OUTPUT -d pypi.python.org -j DROP") + shell("iptables -S") + shell("iptables -D OUTPUT -d pypi.org -j DROP") + shell("iptables -S") shell("rm /etc/pip.conf") end