diff --git a/test/extended/cli/admin.go b/test/extended/cli/admin.go index 5c5f36567d8b..45e7d1be676e 100644 --- a/test/extended/cli/admin.go +++ b/test/extended/cli/admin.go @@ -48,7 +48,10 @@ var _ = g.Describe("[sig-cli] oc adm", func() { o.Expect(err).NotTo(o.HaveOccurred()) for _, m := range masters.Items { if hostname, ok := m.Labels["kubernetes.io/hostname"]; ok { - o.Expect(out).To(o.ContainSubstring(hostname)) + // Extract short hostname from FQDN (e.g., "ip-10-0-88-44.ec2.internal" -> "ip-10-0-88-44"). + // The node-logs will contains the normal hostname, but the FQDN isn't guaranteed. + shortHostname := strings.Split(hostname, ".")[0] + o.Expect(out).To(o.ContainSubstring(shortHostname)) } } diff --git a/test/extended/networking/egress_firewall.go b/test/extended/networking/egress_firewall.go index 489386be011e..6ba0f0b89b1d 100644 --- a/test/extended/networking/egress_firewall.go +++ b/test/extended/networking/egress_firewall.go @@ -135,8 +135,8 @@ func sendEgressFwTraffic(f *e2e.Framework, mgmtFw *e2e.Framework, oc *exutil.CLI // Test ICMP / Ping to Cloudfare DNS IP (1.1.1.1) should fail // because there is no allow cidr match for 1.1.1.1 g.By("sending traffic that does not match allow cidr rule") - _, err = oc.Run("exec").Args(pod, "--", "ping", "-c", "1", "1.1.1.1").Output() - expectError(err) + out, err := oc.Run("exec").Args(pod, "--", "ping", "-c", "1", "1.1.1.1").Output() + expectError(err, "ping to 1.1.1.1 should fail: %s", out) } // Test curl to redhat.com should pass // because we have allow dns rule for redhat.com