From f5f787057def26d5b0f5530f5f00c450a56623dc Mon Sep 17 00:00:00 2001 From: Michal Rostecki Date: Thu, 20 Sep 2018 11:06:50 +0200 Subject: [PATCH] plugins/meta: Add missing error checks Signed-off-by: Michal Rostecki --- plugins/meta/bandwidth/bandwidth_suite_test.go | 1 + plugins/meta/portmap/chain_test.go | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/meta/bandwidth/bandwidth_suite_test.go b/plugins/meta/bandwidth/bandwidth_suite_test.go index 5aea8763..d59bb594 100644 --- a/plugins/meta/bandwidth/bandwidth_suite_test.go +++ b/plugins/meta/bandwidth/bandwidth_suite_test.go @@ -167,6 +167,7 @@ func createVeth(hostNamespace string, hostVethIfName string, containerNamespace Expect(err).NotTo(HaveOccurred()) containerNs, err := ns.GetNS(containerNamespace) + Expect(err).NotTo(HaveOccurred()) err = containerNs.Do(func(_ ns.NetNS) error { peerAddr := &net.IPNet{ IP: hostIP, diff --git a/plugins/meta/portmap/chain_test.go b/plugins/meta/portmap/chain_test.go index e5f575e2..c9571736 100644 --- a/plugins/meta/portmap/chain_test.go +++ b/plugins/meta/portmap/chain_test.go @@ -1,4 +1,4 @@ -// Copyright 2017 CNI authors +// Copyright 2017-2018 CNI authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -178,6 +178,7 @@ var _ = Describe("chain tests", func() { Expect(err).NotTo(HaveOccurred()) chains, err := ipt.ListChains(TABLE) + Expect(err).NotTo(HaveOccurred()) for _, chain := range chains { if chain == testChain.name { Fail("Chain was not deleted") @@ -187,6 +188,7 @@ var _ = Describe("chain tests", func() { err = testChain.teardown(ipt) Expect(err).NotTo(HaveOccurred()) chains, err = ipt.ListChains(TABLE) + Expect(err).NotTo(HaveOccurred()) for _, chain := range chains { if chain == testChain.name { Fail("Chain was not deleted")