Skip to content

Commit

Permalink
fix network e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alacuku committed Jul 17, 2021
1 parent eff4c61 commit eca6f11
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 11 deletions.
5 changes: 3 additions & 2 deletions test/e2e/peering_e2e/basic_test.go
Expand Up @@ -75,8 +75,9 @@ var _ = Describe("Liqo E2E", func() {
})

By("Check Service NodePort Connectivity", func() {
err := net.ConnectivityCheckNodeToPod(ctx, homeCluster.Client, homeCluster.ClusterID)
Expect(err).ToNot(HaveOccurred())
Eventually(func() error {
return net.ConnectivityCheckNodeToPod(ctx, homeCluster.Client, homeCluster.ClusterID)
}, timeout, interval).ShouldNot(HaveOccurred())
})
},
Entry("Check Pod to Pod connectivity from cluster 1", testContext.Clusters[0], testContext.Clusters[1], namespace),
Expand Down
1 change: 1 addition & 0 deletions test/e2e/testutils/net/net.go
Expand Up @@ -64,6 +64,7 @@ func CheckPodConnectivity(ctx context.Context, homeConfig *restclient.Config, ho
return err
}
cmd := command + podRemoteUpdateCluster1.Status.PodIP
klog.Infof("running command %s", cmd)
stdout, stderr, err := util.ExecCmd(homeConfig, homeClient, podLocalUpdate.Name, podLocalUpdate.Namespace, cmd)
if stdout == "200" && err == nil {
return nil
Expand Down
8 changes: 0 additions & 8 deletions test/e2e/testutils/net/svc.go
Expand Up @@ -40,14 +40,6 @@ func EnsureNodePort(ctx context.Context, client kubernetes.Interface, clusterID,
klog.Error(err)
return nil, err
}
clusterIP := nodePort.Spec.ClusterIP
nodePort.Spec = serviceSpec
nodePort.Spec.ClusterIP = clusterIP
_, err = client.CoreV1().Services(namespace).Update(ctx, nodePort, metav1.UpdateOptions{})
if err != nil {
klog.Errorf("%s -> an error occurred while updating nodePort service %s : %s", clusterID, name, err)
return nil, err
}
}
if err != nil {
klog.Errorf("%s -> an error occurred while creating nodePort service %s in namespace %s: %s", clusterID, name, namespace, err)
Expand Down
3 changes: 2 additions & 1 deletion test/e2e/testutils/util/exec.go
Expand Up @@ -61,9 +61,10 @@ func TriggerCheckNodeConnectivity(localNodes *v1.NodeList, command string, nodeP
klog.Infof("running command %s", cmd)
err := c.Run()
if err != nil {
klog.Error(err)
klog.Info(output.String())
klog.Info(errput.String())
return nil
return err
}
}
return nil
Expand Down

0 comments on commit eca6f11

Please sign in to comment.