From 74b93fda45800dd96bc7e8788faa48429f368f7d Mon Sep 17 00:00:00 2001 From: iwilltry42 Date: Tue, 6 Jul 2021 14:25:51 +0200 Subject: [PATCH] test/e2e: loadbalancer test case no suffix --- tests/test_loadbalancer.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/test_loadbalancer.sh b/tests/test_loadbalancer.sh index 9fbde168..664c386f 100755 --- a/tests/test_loadbalancer.sh +++ b/tests/test_loadbalancer.sh @@ -25,16 +25,26 @@ function check_container_port() { clustername="lbtest" info "Creating cluster $clustername..." -$EXE cluster create $clustername --timeout 360s --agents 1 -p 8080:80@server:0:proxy -p 1234:4321/tcp@agent:0:direct || failed "could not create cluster $clustername" +$EXE cluster create $clustername --timeout 360s --agents 1 -p 2222:3333@server:0 -p 8080:80@server:0:proxy -p 1234:4321/tcp@agent:0:direct || failed "could not create cluster $clustername" info "Checking we have access to the cluster..." check_clusters "$clustername" || failed "error checking cluster" info "Checking Container Ports..." + +info "> Checking automatic port mapping for Kube API on loadbalancer (6443)..." check_container_port k3d-$clustername-serverlb "6443/tcp" || failed "6443/tcp not on serverlb" + +info "> Checking explicit proxy port mapping of port 80 -> loadbalancer -> server-0" check_container_port k3d-$clustername-serverlb "80/tcp" || failed "80/tcp not on serverlb" + +info "> Checking explicit direct port mapping of port 4321 -> agent-0" check_container_port k3d-$clustername-agent-0 "4321/tcp" || failed "4321/tcp not on agent-0" +info "> Checking implicit proxy port mapping of port 3333 -> loadbalancer -> server-0" +check_container_port k3d-$clustername-server-0 "3333/tcp" && failed "3333/tcp on server-0 but should be on serverlb" +check_container_port k3d-$clustername-serverlb "3333/tcp" || failed "3333/tcp not on serverlb" + info "Checking Loadbalancer Config..." $EXE debug loadbalancer get-config $clustername | grep -A1 "80.tcp" | grep "k3d-$clustername-server-0" || failed "port 80.tcp not configured for server-0"