Fix e2e ingress IP helper

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
This commit is contained in:
Brad Davidson 2025-02-07 23:02:40 +00:00 committed by Brad Davidson
parent 20a9a6bfc3
commit 45dbc43bd4
2 changed files with 15 additions and 6 deletions

View file

@ -348,9 +348,11 @@ func FetchIngressIP(kubeconfig string) ([]string, error) {
if err != nil {
return nil, err
}
ingressIP := strings.Trim(res, " ")
ingressIPs := strings.Split(ingressIP, " ")
return ingressIPs, nil
res = strings.TrimSpace(res)
if res == "" {
return nil, errors.New("no ingress IPs found")
}
return strings.Split(res, " "), nil
}
func (v VagrantNode) FetchNodeExternalIP() (string, error) {

View file

@ -59,6 +59,9 @@ var _ = Describe("Verify K3s can run Wasm workloads", Ordered, func() {
Eventually(func() error {
return tests.AllPodsUp(tc.KubeConfigFile)
}, "620s", "10s").Should(Succeed())
Eventually(func() error {
return tests.CheckDefaultDeployments(tc.KubeConfigFile)
}, "300s", "10s").Should(Succeed())
})
It("Verify wasm-related containerd shims are installed", func() {
@ -94,9 +97,13 @@ var _ = Describe("Verify K3s can run Wasm workloads", Ordered, func() {
})
It("Interact with Wasm applications", func() {
ingressIPs, err := e2e.FetchIngressIP(tc.KubeConfigFile)
Expect(err).NotTo(HaveOccurred())
Expect(ingressIPs).To(HaveLen(1))
var ingressIPs []string
var err error
Eventually(func(g Gomega) {
ingressIPs, err = e2e.FetchIngressIP(tc.KubeConfigFile)
g.Expect(err).NotTo(HaveOccurred())
g.Expect(ingressIPs).To(HaveLen(1))
}, "120s", "5s").Should(Succeed())
endpoints := []string{"slight/hello", "spin/go-hello", "spin/hello"}
for _, endpoint := range endpoints {