From 6b30e290d20a211cdd5465c22ecf69d0eda068c0 Mon Sep 17 00:00:00 2001 From: Emily Shepherd Date: Tue, 6 Dec 2022 18:53:59 +0000 Subject: [PATCH] Update portmap test's iptables error check GitHub Actions recently updated ubuntu-latest to 22.04 [1], which now defaults to nfttables (rather than iptables-legacy) [2]. The portmap tests in this project are written with the expectation that expected error message for one test is in the iptables-legacy format. This commit updates the check to make it work for both the iptables-legecy and iptables-nftables variants. References: [1]: https://github.com/actions/runner-images/commit/4aba37bd3b8df82c3b27e7c2448556e966a8b41e [2]: https://ubuntu.com/blog/whats-new-in-security-for-ubuntu-22-04-lts Signed-off-by: Emily Shepherd --- plugins/meta/portmap/portmap_integ_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/meta/portmap/portmap_integ_test.go b/plugins/meta/portmap/portmap_integ_test.go index 3e8201e0..2468865e 100644 --- a/plugins/meta/portmap/portmap_integ_test.go +++ b/plugins/meta/portmap/portmap_integ_test.go @@ -207,7 +207,7 @@ var _ = Describe("portmap integration tests", func() { // Verify iptables rules are gone _, err = ipt.List("nat", dnatChainName) - Expect(err).To(MatchError(ContainSubstring("iptables: No chain/target/match by that name."))) + Expect(err).To(HaveOccurred()) // Check that everything succeeded *after* we clean up the network if !contOK {