Skip to content

Commit

Permalink
MGMT-3504 Move proxy_server fixture to base_test (#389)
Browse files Browse the repository at this point in the history
- Add port 3129 to firewall
  • Loading branch information
ori-amizur authored Jan 6, 2021
1 parent 773c6d4 commit c5c9178
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
17 changes: 17 additions & 0 deletions discovery-infra/tests/base_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from test_infra import consts
import test_infra.utils as infra_utils
from test_infra.tools.assets import NetworkAssets
from test_infra.controllers.proxy_controller.proxy_controller import ProxyController
from assisted_service_client.rest import ApiException
from test_infra.helper_classes.cluster import Cluster
from test_infra.helper_classes.nodes import Nodes
Expand Down Expand Up @@ -116,6 +117,22 @@ def attach(node, disk_size):
if modified_node is not None:
modified_node.detach_all_test_disks()

@pytest.fixture()
def proxy_server(self):
logging.info('--- SETUP --- proxy controller')
proxy_servers = []

def start_proxy_server(**kwargs):
proxy_server = ProxyController(**kwargs)
proxy_servers.append(proxy_server)

return proxy_server

yield start_proxy_server
logging.info('--- TEARDOWN --- proxy controller')
for server in proxy_servers:
server.remove()

@staticmethod
def get_cluster_by_name(api_client, cluster_name):
clusters = api_client.clusters_list()
Expand Down
1 change: 1 addition & 0 deletions scripts/install_environment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ function config_squid() {
sudo sed -i -e '/^.*allowed_ips.*$/d' -e '/^acl CONNECT.*/a acl allowed_ips src 1001:db8::/120' -e '/^http_access deny all/i http_access allow allowed_ips' /etc/squid/squid.conf
sudo systemctl restart squid
sudo firewall-cmd --zone=libvirt --add-port=3128/tcp
sudo firewall-cmd --zone=libvirt --add-port=3129/tcp
}

function fix_ipv6_routing() {
Expand Down

0 comments on commit c5c9178

Please sign in to comment.