From 8bc60d852abd33cf9eb785cabf5f05a274a1c2c3 Mon Sep 17 00:00:00 2001 From: Mathew Merrick Date: Wed, 28 Apr 2021 13:29:06 -0700 Subject: [PATCH 01/19] use utilexec for syscalls --- .gitignore | 5 +- go.mod | 1 + npm/ipsm/ipsm.go | 43 +++++++-------- npm/ipsm/ipsm_test.go | 52 ++++++++++++------ npm/nameSpaceController.go | 7 +-- npm/nameSpaceController_test.go | 42 +++++++++------ npm/networkPolicyController_test.go | 34 ++++++------ npm/npm.go | 10 ++-- npm/npm_test.go | 43 +++++++++++++-- npm/plugin/main.go | 5 +- npm/podController.go | 4 +- npm/podController_test.go | 82 ++++++++++++++++++++++++----- 12 files changed, 231 insertions(+), 97 deletions(-) diff --git a/.gitignore b/.gitignore index ac260ece45..a5cb39d2a2 100644 --- a/.gitignore +++ b/.gitignore @@ -16,4 +16,7 @@ ipam-*.xml .idea/* # Logs -*.log \ No newline at end of file +*.log + +# debug test files +*.test \ No newline at end of file diff --git a/go.mod b/go.mod index 569f9a778a..cad7bb1181 100644 --- a/go.mod +++ b/go.mod @@ -40,6 +40,7 @@ require ( k8s.io/apimachinery v0.18.2 k8s.io/client-go v0.18.2 k8s.io/klog v1.0.0 + k8s.io/utils v0.0.0-20200324210504-a9aa75ae1b89 // indirect sigs.k8s.io/controller-runtime v0.6.0 software.sslmate.com/src/go-pkcs12 v0.0.0-20201102150903-66718f75db0e // indirect ) diff --git a/npm/ipsm/ipsm.go b/npm/ipsm/ipsm.go index da7412fee5..a4deafc73b 100644 --- a/npm/ipsm/ipsm.go +++ b/npm/ipsm/ipsm.go @@ -6,14 +6,13 @@ package ipsm import ( "fmt" "os" - "os/exec" "regexp" "strings" - "syscall" "github.com/Azure/azure-container-networking/log" "github.com/Azure/azure-container-networking/npm/metrics" "github.com/Azure/azure-container-networking/npm/util" + utilexec "k8s.io/utils/exec" ) type ipsEntry struct { @@ -25,6 +24,7 @@ type ipsEntry struct { // IpsetManager stores ipset states. type IpsetManager struct { + Exec utilexec.Interface ListMap map[string]*Ipset //tracks all set lists. SetMap map[string]*Ipset //label -> []ip } @@ -45,8 +45,9 @@ func NewIpset(setName string) *Ipset { } // NewIpsetManager creates a new instance for IpsetManager object. -func NewIpsetManager() *IpsetManager { +func NewIpsetManager(exec utilexec.Interface) *IpsetManager { return &IpsetManager{ + Exec: exec, ListMap: make(map[string]*Ipset), SetMap: make(map[string]*Ipset), } @@ -477,14 +478,10 @@ func (ipsMgr *IpsetManager) Run(entry *ipsEntry) (int, error) { cmdArgs = util.DropEmptyFields(cmdArgs) log.Logf("Executing ipset command %s %v", cmdName, cmdArgs) - _, err := exec.Command(cmdName, cmdArgs...).Output() - if msg, failed := err.(*exec.ExitError); failed { - errCode := msg.Sys().(syscall.WaitStatus).ExitStatus() - if errCode > 0 { - metrics.SendErrorLogAndMetric(util.IpsmID, "Error: There was an error running command: [%s %v] Stderr: [%v, %s]", cmdName, strings.Join(cmdArgs, " "), err, strings.TrimSuffix(string(msg.Stderr), "\n")) - } - return errCode, err + errbytes, err := ipsMgr.Exec.Command(cmdName, cmdArgs...).CombinedOutput() + if err != nil { + metrics.SendErrorLogAndMetric(util.IpsmID, "Error: There was an error running command: [%s %v] Stderr: [%v, %s]", cmdName, strings.Join(cmdArgs, " "), err, strings.TrimSuffix(string(errbytes), "\n")) } return 0, nil @@ -496,9 +493,10 @@ func (ipsMgr *IpsetManager) Save(configFile string) error { configFile = util.IpsetConfigFile } - cmd := exec.Command(util.Ipset, util.IpsetSaveFlag, util.IpsetFileFlag, configFile) - if err := cmd.Start(); err != nil { - metrics.SendErrorLogAndMetric(util.IpsmID, "Error: failed to save ipset to file.") + cmd := ipsMgr.Exec.Command(util.Ipset, util.IpsetSaveFlag, util.IpsetFileFlag, configFile) + errbytes, err := cmd.CombinedOutput() + if err != nil { + metrics.SendErrorLogAndMetric(util.IpsmID, "Error: failed to save ipset to file with err %v, stderr: %v", err, string(errbytes)) return err } cmd.Wait() @@ -524,12 +522,11 @@ func (ipsMgr *IpsetManager) Restore(configFile string) error { } } - cmd := exec.Command(util.Ipset, util.IpsetRestoreFlag, util.IpsetFileFlag, configFile) - if err := cmd.Start(); err != nil { - metrics.SendErrorLogAndMetric(util.IpsmID, "Error: failed to to restore ipset from file.") + reply, err := ipsMgr.Exec.Command(util.Ipset, util.IpsetRestoreFlag, util.IpsetFileFlag, configFile).CombinedOutput() + if err != nil { + metrics.SendErrorLogAndMetric(util.IpsmID, "Error: failed to to restore ipset from file with err %v, stderr %v", err, string(reply)) return err } - cmd.Wait() //TODO based on the set name and number of entries in the config file, update IPSetInventory @@ -542,15 +539,13 @@ func (ipsMgr *IpsetManager) DestroyNpmIpsets() error { cmdName := util.Ipset cmdArgs := util.IPsetCheckListFlag - reply, err := exec.Command(cmdName, cmdArgs).Output() - if msg, failed := err.(*exec.ExitError); failed { - errCode := msg.Sys().(syscall.WaitStatus).ExitStatus() - if errCode > 0 { - metrics.SendErrorLogAndMetric(util.IpsmID, "{DestroyNpmIpsets} Error: There was an error running command: [%s] Stderr: [%v, %s]", cmdName, err, strings.TrimSuffix(string(msg.Stderr), "\n")) - } - + reply, err := ipsMgr.Exec.Command(cmdName, cmdArgs).CombinedOutput() + if err != nil { + metrics.SendErrorLogAndMetric(util.IpsmID, "{DestroyNpmIpsets} Error: There was an error running command: [%s] Stderr: [%v, %s]", cmdName, err, strings.TrimSuffix(string(reply), "\n")) return err } + + // todo: verify destroy reply response if reply == nil { metrics.SendErrorLogAndMetric(util.IpsmID, "{DestroyNpmIpsets} Received empty string from ipset list while destroying azure-npm ipsets") return nil diff --git a/npm/ipsm/ipsm_test.go b/npm/ipsm/ipsm_test.go index 5f98876d9f..959428701d 100644 --- a/npm/ipsm/ipsm_test.go +++ b/npm/ipsm/ipsm_test.go @@ -10,17 +10,20 @@ import ( "github.com/Azure/azure-container-networking/npm/metrics" "github.com/Azure/azure-container-networking/npm/metrics/promutil" "github.com/Azure/azure-container-networking/npm/util" + fakeexec "k8s.io/utils/exec/testing" ) func TestSave(t *testing.T) { - ipsMgr := NewIpsetManager() + fexec := fakeexec.FakeExec{} + ipsMgr := NewIpsetManager(&fexec) if err := ipsMgr.Save(util.IpsetTestConfigFile); err != nil { t.Errorf("TestSave failed @ ipsMgr.Save") } } func TestRestore(t *testing.T) { - ipsMgr := NewIpsetManager() + fexec := fakeexec.FakeExec{} + ipsMgr := NewIpsetManager(&fexec) if err := ipsMgr.Save(util.IpsetTestConfigFile); err != nil { t.Errorf("TestRestore failed @ ipsMgr.Save") } @@ -31,7 +34,8 @@ func TestRestore(t *testing.T) { } func TestCreateList(t *testing.T) { - ipsMgr := NewIpsetManager() + fexec := fakeexec.FakeExec{} + ipsMgr := NewIpsetManager(&fexec) if err := ipsMgr.Save(util.IpsetTestConfigFile); err != nil { t.Errorf("TestCreateList failed @ ipsMgr.Save") } @@ -48,7 +52,8 @@ func TestCreateList(t *testing.T) { } func TestDeleteList(t *testing.T) { - ipsMgr := NewIpsetManager() + fexec := fakeexec.FakeExec{} + ipsMgr := NewIpsetManager(&fexec) if err := ipsMgr.Save(util.IpsetTestConfigFile); err != nil { t.Errorf("TestDeleteList failed @ ipsMgr.Save") } @@ -69,7 +74,8 @@ func TestDeleteList(t *testing.T) { } func TestAddToList(t *testing.T) { - ipsMgr := NewIpsetManager() + fexec := fakeexec.FakeExec{} + ipsMgr := NewIpsetManager(&fexec) if err := ipsMgr.Save(util.IpsetTestConfigFile); err != nil { t.Errorf("TestAddToList failed @ ipsMgr.Save") } @@ -90,7 +96,8 @@ func TestAddToList(t *testing.T) { } func TestDeleteFromList(t *testing.T) { - ipsMgr := NewIpsetManager() + fexec := fakeexec.FakeExec{} + ipsMgr := NewIpsetManager(&fexec) if err := ipsMgr.Save(util.IpsetTestConfigFile); err != nil { t.Errorf("TestDeleteFromList failed @ ipsMgr.Save") } @@ -189,7 +196,8 @@ func TestDeleteFromList(t *testing.T) { func TestCreateSet(t *testing.T) { metrics.NumIPSetEntries.Set(0) - ipsMgr := NewIpsetManager() + fexec := fakeexec.FakeExec{} + ipsMgr := NewIpsetManager(&fexec) if err := ipsMgr.Save(util.IpsetTestConfigFile); err != nil { t.Errorf("TestCreateSet failed @ ipsMgr.Save") } @@ -243,7 +251,8 @@ func TestCreateSet(t *testing.T) { func TestDeleteSet(t *testing.T) { metrics.NumIPSetEntries.Set(0) - ipsMgr := NewIpsetManager() + fexec := fakeexec.FakeExec{} + ipsMgr := NewIpsetManager(&fexec) if err := ipsMgr.Save(util.IpsetTestConfigFile); err != nil { t.Errorf("TestDeleteSet failed @ ipsMgr.Save") } @@ -279,7 +288,8 @@ func TestDeleteSet(t *testing.T) { func TestAddToSet(t *testing.T) { metrics.NumIPSetEntries.Set(0) - ipsMgr := NewIpsetManager() + fexec := fakeexec.FakeExec{} + ipsMgr := NewIpsetManager(&fexec) if err := ipsMgr.Save(util.IpsetTestConfigFile); err != nil { t.Fatalf("TestAddToSet failed @ ipsMgr.Save") } @@ -328,7 +338,8 @@ func TestAddToSet(t *testing.T) { } func TestAddToSetWithCachePodInfo(t *testing.T) { - ipsMgr := NewIpsetManager() + fexec := fakeexec.FakeExec{} + ipsMgr := NewIpsetManager(&fexec) if err := ipsMgr.Save(util.IpsetTestConfigFile); err != nil { t.Errorf("TestAddToSetWithCachePodInfo failed @ ipsMgr.Save") } @@ -369,7 +380,8 @@ func TestAddToSetWithCachePodInfo(t *testing.T) { func TestDeleteFromSet(t *testing.T) { metrics.NumIPSetEntries.Set(0) - ipsMgr := NewIpsetManager() + fexec := fakeexec.FakeExec{} + ipsMgr := NewIpsetManager(&fexec) if err := ipsMgr.Save(util.IpsetTestConfigFile); err != nil { t.Errorf("TestDeleteFromSet failed @ ipsMgr.Save") } @@ -407,7 +419,8 @@ func TestDeleteFromSet(t *testing.T) { } func TestDeleteFromSetWithPodCache(t *testing.T) { - ipsMgr := NewIpsetManager() + fexec := fakeexec.FakeExec{} + ipsMgr := NewIpsetManager(&fexec) if err := ipsMgr.Save(util.IpsetTestConfigFile); err != nil { t.Errorf("TestDeleteFromSetWithPodCache failed @ ipsMgr.Save") } @@ -466,7 +479,8 @@ func TestDeleteFromSetWithPodCache(t *testing.T) { } func TestClean(t *testing.T) { - ipsMgr := NewIpsetManager() + fexec := fakeexec.FakeExec{} + ipsMgr := NewIpsetManager(&fexec) if err := ipsMgr.Save(util.IpsetTestConfigFile); err != nil { t.Errorf("TestClean failed @ ipsMgr.Save") } @@ -487,7 +501,8 @@ func TestClean(t *testing.T) { } func TestDestroy(t *testing.T) { - ipsMgr := NewIpsetManager() + fexec := fakeexec.FakeExec{} + ipsMgr := NewIpsetManager(&fexec) if err := ipsMgr.Save(util.IpsetTestConfigFile); err != nil { t.Errorf("TestDestroy failed @ ipsMgr.Save") } @@ -530,7 +545,8 @@ func TestDestroy(t *testing.T) { } func TestRun(t *testing.T) { - ipsMgr := NewIpsetManager() + fexec := fakeexec.FakeExec{} + ipsMgr := NewIpsetManager(&fexec) if err := ipsMgr.Save(util.IpsetTestConfigFile); err != nil { t.Errorf("TestRun failed @ ipsMgr.Save") } @@ -552,7 +568,8 @@ func TestRun(t *testing.T) { } func TestDestroyNpmIpsets(t *testing.T) { - ipsMgr := NewIpsetManager() + fexec := fakeexec.FakeExec{} + ipsMgr := NewIpsetManager(&fexec) err := ipsMgr.CreateSet("azure-npm-123456", []string{"nethash"}) if err != nil { @@ -818,7 +835,8 @@ func TestIPSetCannotBeAddedAsElementDoesNotExist(t *testing.T) { */ func TestMain(m *testing.M) { metrics.InitializeAll() - ipsMgr := NewIpsetManager() + fexec := fakeexec.FakeExec{} + ipsMgr := NewIpsetManager(&fexec) ipsMgr.Save(util.IpsetConfigFile) exitCode := m.Run() diff --git a/npm/nameSpaceController.go b/npm/nameSpaceController.go index dfb3c10848..3e50e5f97b 100644 --- a/npm/nameSpaceController.go +++ b/npm/nameSpaceController.go @@ -23,6 +23,7 @@ import ( "k8s.io/client-go/tools/cache" "k8s.io/client-go/util/workqueue" "k8s.io/klog" + utilexec "k8s.io/utils/exec" ) type LabelAppendOperation bool @@ -41,12 +42,12 @@ type Namespace struct { } // newNS constructs a new namespace object. -func newNs(name string) (*Namespace, error) { +func newNs(name string, exec utilexec.Interface) (*Namespace, error) { ns := &Namespace{ name: name, LabelsMap: make(map[string]string), SetMap: make(map[string]string), - IpsMgr: ipsm.NewIpsetManager(), + IpsMgr: ipsm.NewIpsetManager(exec), iptMgr: iptm.NewIptablesManager(), } @@ -336,7 +337,7 @@ func (nsc *nameSpaceController) syncAddNameSpace(nsObj *corev1.Namespace) error return err } - npmNs, _ := newNs(corev1NsName) + npmNs, _ := newNs(corev1NsName, ipsMgr.Exec) nsc.npMgr.NsMap[corev1NsName] = npmNs // Add the namespace to its label's ipset list. diff --git a/npm/nameSpaceController_test.go b/npm/nameSpaceController_test.go index 57c76ad67a..db41d11cfa 100644 --- a/npm/nameSpaceController_test.go +++ b/npm/nameSpaceController_test.go @@ -17,6 +17,8 @@ import ( k8sfake "k8s.io/client-go/kubernetes/fake" core "k8s.io/client-go/testing" "k8s.io/client-go/tools/cache" + utilexec "k8s.io/utils/exec" + fakeexec "k8s.io/utils/exec/testing" ) var ( @@ -48,13 +50,13 @@ type nameSpaceFixture struct { kubeInformer kubeinformers.SharedInformerFactory } -func newNsFixture(t *testing.T) *nameSpaceFixture { +func newNsFixture(t *testing.T, exec utilexec.Interface) *nameSpaceFixture { f := &nameSpaceFixture{ t: t, nsLister: []*corev1.Namespace{}, kubeobjects: []runtime.Object{}, - npMgr: newNPMgr(t), - ipsMgr: ipsm.NewIpsetManager(), + npMgr: newNPMgr(t, exec), + ipsMgr: ipsm.NewIpsetManager(exec), } return f } @@ -151,13 +153,15 @@ func deleteNamespace(t *testing.T, f *nameSpaceFixture, nsObj *corev1.Namespace, } func TestNewNs(t *testing.T) { - if _, err := newNs("test"); err != nil { + fexec := fakeexec.FakeExec{} + if _, err := newNs("test", &fexec); err != nil { t.Errorf("TestnewNs failed @ newNs") } } func TestAddNamespace(t *testing.T) { - f := newNsFixture(t) + fexec := fakeexec.FakeExec{} + f := newNsFixture(t, &fexec) f.ipSetSave(util.IpsetTestConfigFile) defer f.ipSetRestore(util.IpsetTestConfigFile) @@ -188,7 +192,8 @@ func TestAddNamespace(t *testing.T) { } func TestUpdateNamespace(t *testing.T) { - f := newNsFixture(t) + fexec := fakeexec.FakeExec{} + f := newNsFixture(t, &fexec) f.ipSetSave(util.IpsetTestConfigFile) defer f.ipSetRestore(util.IpsetTestConfigFile) @@ -233,7 +238,8 @@ func TestUpdateNamespace(t *testing.T) { } func TestAddNamespaceLabel(t *testing.T) { - f := newNsFixture(t) + fexec := fakeexec.FakeExec{} + f := newNsFixture(t, &fexec) f.ipSetSave(util.IpsetTestConfigFile) defer f.ipSetRestore(util.IpsetTestConfigFile) @@ -278,7 +284,8 @@ func TestAddNamespaceLabel(t *testing.T) { } func TestAddNamespaceLabelSameRv(t *testing.T) { - f := newNsFixture(t) + fexec := fakeexec.FakeExec{} + f := newNsFixture(t, &fexec) f.ipSetSave(util.IpsetTestConfigFile) defer f.ipSetRestore(util.IpsetTestConfigFile) @@ -324,7 +331,8 @@ func TestAddNamespaceLabelSameRv(t *testing.T) { } func TestDeleteandUpdateNamespaceLabel(t *testing.T) { - f := newNsFixture(t) + fexec := fakeexec.FakeExec{} + f := newNsFixture(t, &fexec) f.ipSetSave(util.IpsetTestConfigFile) defer f.ipSetRestore(util.IpsetTestConfigFile) @@ -375,7 +383,8 @@ func TestDeleteandUpdateNamespaceLabel(t *testing.T) { // this happens when NSA delete event is missed and deleted from NPMLocalCache, // but NSA gets added again. This will result in an update event with old and new with different UUIDs func TestNewNameSpaceUpdate(t *testing.T) { - f := newNsFixture(t) + fexec := fakeexec.FakeExec{} + f := newNsFixture(t, &fexec) f.ipSetSave(util.IpsetTestConfigFile) defer f.ipSetRestore(util.IpsetTestConfigFile) @@ -425,7 +434,8 @@ func TestNewNameSpaceUpdate(t *testing.T) { } func TestDeleteNamespace(t *testing.T) { - f := newNsFixture(t) + fexec := fakeexec.FakeExec{} + f := newNsFixture(t, &fexec) f.ipSetSave(util.IpsetTestConfigFile) defer f.ipSetRestore(util.IpsetTestConfigFile) @@ -455,7 +465,8 @@ func TestDeleteNamespace(t *testing.T) { } func TestDeleteNamespaceWithTombstone(t *testing.T) { - f := newNsFixture(t) + fexec := fakeexec.FakeExec{} + f := newNsFixture(t, &fexec) f.ipSetSave(util.IpsetTestConfigFile) defer f.ipSetRestore(util.IpsetTestConfigFile) stopCh := make(chan struct{}) @@ -490,8 +501,8 @@ func TestDeleteNamespaceWithTombstoneAfterAddingNameSpace(t *testing.T) { "app": "test-namespace", }, ) - - f := newNsFixture(t) + fexec := fakeexec.FakeExec{} + f := newNsFixture(t, &fexec) f.nsLister = append(f.nsLister, nsObj) f.kubeobjects = append(f.kubeobjects, nsObj) stopCh := make(chan struct{}) @@ -506,7 +517,8 @@ func TestDeleteNamespaceWithTombstoneAfterAddingNameSpace(t *testing.T) { } func TestGetNamespaceObjFromNsObj(t *testing.T) { - ns, _ := newNs("test-ns") + fexec := fakeexec.FakeExec{} + ns, _ := newNs("test-ns", &fexec) ns.LabelsMap = map[string]string{ "test": "new", } diff --git a/npm/networkPolicyController_test.go b/npm/networkPolicyController_test.go index 5ac4f74837..091d5ca12b 100644 --- a/npm/networkPolicyController_test.go +++ b/npm/networkPolicyController_test.go @@ -21,6 +21,8 @@ import ( k8sfake "k8s.io/client-go/kubernetes/fake" core "k8s.io/client-go/testing" "k8s.io/client-go/tools/cache" + utilexec "k8s.io/utils/exec" + fakeexec "k8s.io/utils/exec/testing" ) type netPolFixture struct { @@ -46,13 +48,13 @@ type netPolFixture struct { isEnqueueEventIntoWorkQueue bool } -func newNetPolFixture(t *testing.T) *netPolFixture { +func newNetPolFixture(t *testing.T, exec utilexec.Interface) *netPolFixture { f := &netPolFixture{ t: t, netPolLister: []*networkingv1.NetworkPolicy{}, kubeobjects: []runtime.Object{}, - npMgr: newNPMgr(t), - ipsMgr: ipsm.NewIpsetManager(), + npMgr: newNPMgr(t, exec), + ipsMgr: ipsm.NewIpsetManager(exec), iptMgr: iptm.NewIptablesManager(), isEnqueueEventIntoWorkQueue: true, } @@ -262,6 +264,7 @@ func checkNetPolTestResult(testName string, f *netPolFixture, testCases []expect } func TestAddMultipleNetworkPolicies(t *testing.T) { + fexec := fakeexec.FakeExec{} netPolObj1 := createNetPol() // deep copy netPolObj1 and change namespace, name, and porttype (to namedPort) since current createNetPol is not flexble. @@ -271,7 +274,7 @@ func TestAddMultipleNetworkPolicies(t *testing.T) { // namedPort netPolObj2.Spec.Ingress[0].Ports[0].Port = &intstr.IntOrString{StrVal: fmt.Sprintf("%s", netPolObj2.Name)} - f := newNetPolFixture(t) + f := newNetPolFixture(t, &fexec) f.netPolLister = append(f.netPolLister, netPolObj1, netPolObj2) f.kubeobjects = append(f.kubeobjects, netPolObj1, netPolObj2) stopCh := make(chan struct{}) @@ -289,8 +292,8 @@ func TestAddMultipleNetworkPolicies(t *testing.T) { func TestAddNetworkPolicy(t *testing.T) { netPolObj := createNetPol() - - f := newNetPolFixture(t) + fexec := fakeexec.FakeExec{} + f := newNetPolFixture(t, &fexec) f.netPolLister = append(f.netPolLister, netPolObj) f.kubeobjects = append(f.kubeobjects, netPolObj) stopCh := make(chan struct{}) @@ -307,8 +310,8 @@ func TestAddNetworkPolicy(t *testing.T) { func TestDeleteNetworkPolicy(t *testing.T) { netPolObj := createNetPol() - - f := newNetPolFixture(t) + fexec := fakeexec.FakeExec{} + f := newNetPolFixture(t, &fexec) f.netPolLister = append(f.netPolLister, netPolObj) f.kubeobjects = append(f.kubeobjects, netPolObj) stopCh := make(chan struct{}) @@ -324,8 +327,8 @@ func TestDeleteNetworkPolicy(t *testing.T) { func TestDeleteNetworkPolicyWithTombstone(t *testing.T) { netPolObj := createNetPol() - - f := newNetPolFixture(t) + fexec := fakeexec.FakeExec{} + f := newNetPolFixture(t, &fexec) f.isEnqueueEventIntoWorkQueue = false f.netPolLister = append(f.netPolLister, netPolObj) f.kubeobjects = append(f.kubeobjects, netPolObj) @@ -349,7 +352,8 @@ func TestDeleteNetworkPolicyWithTombstone(t *testing.T) { func TestDeleteNetworkPolicyWithTombstoneAfterAddingNetworkPolicy(t *testing.T) { netPolObj := createNetPol() - f := newNetPolFixture(t) + fexec := fakeexec.FakeExec{} + f := newNetPolFixture(t, &fexec) f.netPolLister = append(f.netPolLister, netPolObj) f.kubeobjects = append(f.kubeobjects, netPolObj) stopCh := make(chan struct{}) @@ -367,8 +371,8 @@ func TestDeleteNetworkPolicyWithTombstoneAfterAddingNetworkPolicy(t *testing.T) // Check it with expectedEnqueueEventIntoWorkQueue variable. func TestUpdateNetworkPolicy(t *testing.T) { oldNetPolObj := createNetPol() - - f := newNetPolFixture(t) + fexec := fakeexec.FakeExec{} + f := newNetPolFixture(t, &fexec) f.netPolLister = append(f.netPolLister, oldNetPolObj) f.kubeobjects = append(f.kubeobjects, oldNetPolObj) stopCh := make(chan struct{}) @@ -389,8 +393,8 @@ func TestUpdateNetworkPolicy(t *testing.T) { func TestLabelUpdateNetworkPolicy(t *testing.T) { oldNetPolObj := createNetPol() - - f := newNetPolFixture(t) + fexec := fakeexec.FakeExec{} + f := newNetPolFixture(t, &fexec) f.netPolLister = append(f.netPolLister, oldNetPolObj) f.kubeobjects = append(f.kubeobjects, oldNetPolObj) stopCh := make(chan struct{}) diff --git a/npm/npm.go b/npm/npm.go index 2f6429308a..99ed6138c9 100644 --- a/npm/npm.go +++ b/npm/npm.go @@ -24,6 +24,7 @@ import ( networkinginformers "k8s.io/client-go/informers/networking/v1" "k8s.io/client-go/kubernetes" "k8s.io/client-go/tools/cache" + utilexec "k8s.io/utils/exec" ) var aiMetadata string @@ -42,6 +43,8 @@ const ( // NetworkPolicyManager contains informers for pod, namespace and networkpolicy. type NetworkPolicyManager struct { sync.Mutex + + Exec utilexec.Interface clientset *kubernetes.Clientset informerFactory informers.SharedInformerFactory @@ -198,14 +201,14 @@ func (npMgr *NetworkPolicyManager) Start(stopCh <-chan struct{}) error { } // NewNetworkPolicyManager creates a NetworkPolicyManager -func NewNetworkPolicyManager(clientset *kubernetes.Clientset, informerFactory informers.SharedInformerFactory, npmVersion string) *NetworkPolicyManager { +func NewNetworkPolicyManager(clientset *kubernetes.Clientset, informerFactory informers.SharedInformerFactory, exec utilexec.Interface, npmVersion string) *NetworkPolicyManager { // Clear out left over iptables states log.Logf("Azure-NPM creating, cleaning iptables") iptMgr := iptm.NewIptablesManager() iptMgr.UninitNpmChains() log.Logf("Azure-NPM creating, cleaning existing Azure NPM IPSets") - ipsm.NewIpsetManager().DestroyNpmIpsets() + ipsm.NewIpsetManager(exec).DestroyNpmIpsets() var ( podInformer = informerFactory.Core().V1().Pods() @@ -234,6 +237,7 @@ func NewNetworkPolicyManager(clientset *kubernetes.Clientset, informerFactory in } npMgr := &NetworkPolicyManager{ + Exec: exec, clientset: clientset, informerFactory: informerFactory, podInformer: podInformer, @@ -254,7 +258,7 @@ func NewNetworkPolicyManager(clientset *kubernetes.Clientset, informerFactory in TelemetryEnabled: true, } - allNs, _ := newNs(util.KubeAllNamespacesFlag) + allNs, _ := newNs(util.KubeAllNamespacesFlag, npMgr.Exec) npMgr.NsMap[util.KubeAllNamespacesFlag] = allNs // Create ipset for the namespace. diff --git a/npm/npm_test.go b/npm/npm_test.go index 10978d5183..dcb7ef8595 100644 --- a/npm/npm_test.go +++ b/npm/npm_test.go @@ -1,7 +1,9 @@ package npm import ( + "log" "os" + "reflect" "testing" "github.com/Azure/azure-container-networking/npm/ipsm" @@ -9,6 +11,8 @@ import ( "github.com/Azure/azure-container-networking/npm/metrics" "github.com/Azure/azure-container-networking/npm/util" "k8s.io/client-go/tools/cache" + utilexec "k8s.io/utils/exec" + fakeexec "k8s.io/utils/exec/testing" ) // To indicate the object is needed to be DeletedFinalStateUnknown Object @@ -28,25 +32,48 @@ func getKey(obj interface{}, t *testing.T) string { return key } -func newNPMgr(t *testing.T) *NetworkPolicyManager { +func newNPMgr(t *testing.T, exec utilexec.Interface) *NetworkPolicyManager { npMgr := &NetworkPolicyManager{ + Exec: exec, NsMap: make(map[string]*Namespace), PodMap: make(map[string]*NpmPod), TelemetryEnabled: false, } // This initialization important as without this NPM will panic - allNs, _ := newNs(util.KubeAllNamespacesFlag) + allNs, _ := newNs(util.KubeAllNamespacesFlag, npMgr.Exec) npMgr.NsMap[util.KubeAllNamespacesFlag] = allNs return npMgr } func TestMain(m *testing.M) { + metrics.InitializeAll() iptMgr := iptm.NewIptablesManager() iptMgr.Save(util.IptablesConfigFile) - ipsMgr := ipsm.NewIpsetManager() + // calls we're planning on making + calls := [][]string{ + {"ipset", "save", "-file", "/var/log/ipset.conf"}, + {"ipset", "restore", "-file", "/var/log/ipset.conf"}, + } + + // errors we're planning on getting + fcmd := fakeexec.FakeCmd{ + CombinedOutputScript: []fakeexec.FakeAction{ + func() ([]byte, []byte, error) { return nil, nil, nil }, + func() ([]byte, []byte, error) { return nil, nil, nil }, + }, + } + + fexec := fakeexec.FakeExec{ + CommandScript: []fakeexec.FakeCommandAction{ + func(cmd string, args ...string) utilexec.Cmd { return fakeexec.InitFakeCmd(&fcmd, cmd, args...) }, + func(cmd string, args ...string) utilexec.Cmd { return fakeexec.InitFakeCmd(&fcmd, cmd, args...) }, + }, + } + + ipsMgr := ipsm.NewIpsetManager(&fexec) ipsMgr.Save(util.IpsetConfigFile) exitCode := m.Run() @@ -54,5 +81,15 @@ func TestMain(m *testing.M) { iptMgr.Restore(util.IptablesConfigFile) ipsMgr.Restore(util.IpsetConfigFile) + if fcmd.CombinedOutputCalls != len(calls) { + log.Fatalf("Mismatched calls, expected %v, actual %v", len(calls), fcmd.CombinedOutputCalls) + } + + for i, call := range calls { + if !reflect.DeepEqual(call, fcmd.CombinedOutputLog[i]) { + log.Fatalf("Mismatched call, expected %v, actual %v", call, fcmd.CombinedOutputLog[i]) + } + } + os.Exit(exitCode) } diff --git a/npm/plugin/main.go b/npm/plugin/main.go index 31a3c5adae..1964f0824a 100644 --- a/npm/plugin/main.go +++ b/npm/plugin/main.go @@ -14,6 +14,7 @@ import ( "k8s.io/client-go/informers" "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" + "k8s.io/utils/exec" ) const ( @@ -73,7 +74,9 @@ func main() { log.Logf("[INFO] Resync period for NPM pod is set to %d.", int(resyncPeriod/time.Minute)) factory := informers.NewSharedInformerFactory(clientset, resyncPeriod) - npMgr := npm.NewNetworkPolicyManager(clientset, factory, version) + exec := exec.New() + + npMgr := npm.NewNetworkPolicyManager(clientset, factory, exec, version) metrics.CreateTelemetryHandle(npMgr.GetAppVersion(), npm.GetAIMetadata()) restserver := restserver.NewNpmRestServer(restserver.DefaultHTTPListeningAddress) diff --git a/npm/podController.go b/npm/podController.go index f931c0ac8f..30b6df4e1e 100644 --- a/npm/podController.go +++ b/npm/podController.go @@ -388,7 +388,7 @@ func (c *podController) syncAddedPod(podObj *corev1.Pod) error { var err error if _, exists := c.npMgr.NsMap[podNs]; !exists { // (TODO): need to change newNS function. It always returns "nil" - c.npMgr.NsMap[podNs], _ = newNs(podNs) + c.npMgr.NsMap[podNs], _ = newNs(podNs, ipsMgr.Exec) klog.Infof("Creating set: %v, hashedSet: %v", podNs, util.GetHashedName(podNs)) if err = ipsMgr.CreateSet(podNs, append([]string{util.IpsetNetHashFlag})); err != nil { return fmt.Errorf("[syncAddedPod] Error: creating ipset %s with err: %v", podNs, err) @@ -443,7 +443,7 @@ func (c *podController) syncAddAndUpdatePod(newPodObj *corev1.Pod) error { var err error if _, exists := c.npMgr.NsMap[newPodObjNs]; !exists { // (TODO): need to change newNS function. It always returns "nil" - c.npMgr.NsMap[newPodObjNs], _ = newNs(newPodObjNs) + c.npMgr.NsMap[newPodObjNs], _ = newNs(newPodObjNs, ipsMgr.Exec) klog.Infof("Creating set: %v, hashedSet: %v", newPodObjNs, util.GetHashedName(newPodObjNs)) if err = ipsMgr.CreateSet(newPodObjNs, []string{util.IpsetNetHashFlag}); err != nil { return fmt.Errorf("[syncAddAndUpdatePod] Error: creating ipset %s with err: %v", newPodObjNs, err) diff --git a/npm/podController_test.go b/npm/podController_test.go index 8543959896..afc8347524 100644 --- a/npm/podController_test.go +++ b/npm/podController_test.go @@ -9,7 +9,11 @@ import ( "testing" "github.com/Azure/azure-container-networking/npm/ipsm" + "github.com/Azure/azure-container-networking/npm/util" + "github.com/stretchr/testify/assert" corev1 "k8s.io/api/core/v1" + utilexec "k8s.io/utils/exec" + fakeexec "k8s.io/utils/exec/testing" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" @@ -42,13 +46,13 @@ type podFixture struct { kubeInformer kubeinformers.SharedInformerFactory } -func newFixture(t *testing.T) *podFixture { +func newFixture(t *testing.T, exec utilexec.Interface) *podFixture { f := &podFixture{ t: t, podLister: []*corev1.Pod{}, kubeobjects: []runtime.Object{}, - npMgr: newNPMgr(t), - ipsMgr: ipsm.NewIpsetManager(), + npMgr: newNPMgr(t, exec), + ipsMgr: ipsm.NewIpsetManager(exec), } return f } @@ -211,7 +215,8 @@ func TestAddMultiplePods(t *testing.T) { podObj1 := createPod("test-pod-1", "test-namespace", "0", "1.2.3.4", labels, NonHostNetwork, corev1.PodRunning) podObj2 := createPod("test-pod-2", "test-namespace", "0", "1.2.3.5", labels, NonHostNetwork, corev1.PodRunning) - f := newFixture(t) + fexec := fakeexec.FakeExec{} + f := newFixture(t, &fexec) f.podLister = append(f.podLister, podObj1, podObj2) f.kubeobjects = append(f.kubeobjects, podObj1, podObj2) stopCh := make(chan struct{}) @@ -230,12 +235,52 @@ func TestAddMultiplePods(t *testing.T) { } func TestAddPod(t *testing.T) { + assert := assert.New(t) + labels := map[string]string{ "app": "test-pod", } podObj := createPod("test-pod", "test-namespace", "0", "1.2.3.4", labels, NonHostNetwork, corev1.PodRunning) - f := newFixture(t) + calls := [][]string{ + {"ipset", "-N", "-exist", util.GetHashedName("ns-test-namespace"), "nethash"}, + {"ipset", "-A", "-exist", util.GetHashedName("ns-test-namespace"), "1.2.3.4"}, + {"ipset", "-N", "-exist", util.GetHashedName("app"), "nethash"}, + {"ipset", "-A", "-exist", util.GetHashedName("app"), "1.2.3.4"}, + {"ipset", "-N", "-exist", util.GetHashedName("app:test-pod"), "nethash"}, + {"ipset", "-A", "-exist", util.GetHashedName("app:test-pod"), "1.2.3.4"}, + {"ipset", "-N", "-exist", util.GetHashedName("namedport:app:test-pod"), "hash:ip,port"}, + {"ipset", "-A", "-exist", util.GetHashedName("namedport:app:test-pod"), "1.2.3.4,8080"}, + } + + fcmd := fakeexec.FakeCmd{ + CombinedOutputScript: []fakeexec.FakeAction{ + func() ([]byte, []byte, error) { return nil, nil, nil }, + func() ([]byte, []byte, error) { return nil, nil, nil }, + func() ([]byte, []byte, error) { return nil, nil, nil }, + func() ([]byte, []byte, error) { return nil, nil, nil }, + func() ([]byte, []byte, error) { return nil, nil, nil }, + func() ([]byte, []byte, error) { return nil, nil, nil }, + func() ([]byte, []byte, error) { return nil, nil, nil }, + func() ([]byte, []byte, error) { return nil, nil, nil }, + }, + } + + fexec := fakeexec.FakeExec{ + CommandScript: []fakeexec.FakeCommandAction{ + func(cmd string, args ...string) utilexec.Cmd { return fakeexec.InitFakeCmd(&fcmd, cmd, args...) }, + func(cmd string, args ...string) utilexec.Cmd { return fakeexec.InitFakeCmd(&fcmd, cmd, args...) }, + func(cmd string, args ...string) utilexec.Cmd { return fakeexec.InitFakeCmd(&fcmd, cmd, args...) }, + func(cmd string, args ...string) utilexec.Cmd { return fakeexec.InitFakeCmd(&fcmd, cmd, args...) }, + func(cmd string, args ...string) utilexec.Cmd { return fakeexec.InitFakeCmd(&fcmd, cmd, args...) }, + func(cmd string, args ...string) utilexec.Cmd { return fakeexec.InitFakeCmd(&fcmd, cmd, args...) }, + func(cmd string, args ...string) utilexec.Cmd { return fakeexec.InitFakeCmd(&fcmd, cmd, args...) }, + func(cmd string, args ...string) utilexec.Cmd { return fakeexec.InitFakeCmd(&fcmd, cmd, args...) }, + }, + CommandCalls: 0, + } + + f := newFixture(t, &fexec) f.podLister = append(f.podLister, podObj) f.kubeobjects = append(f.kubeobjects, podObj) stopCh := make(chan struct{}) @@ -243,11 +288,14 @@ func TestAddPod(t *testing.T) { f.newPodController(stopCh) addPod(t, f, podObj) + fmt.Println(fcmd.CombinedOutputLog) testCases := []expectedValues{ {1, 2, 0}, } checkPodTestResult("TestAddPod", f, testCases) checkNpmPodWithInput("TestAddPod", f, podObj) + + assert.Equal(fcmd.CombinedOutputLog, calls) } func TestAddHostNetworkPod(t *testing.T) { @@ -257,7 +305,8 @@ func TestAddHostNetworkPod(t *testing.T) { podObj := createPod("test-pod", "test-namespace", "0", "1.2.3.4", labels, HostNetwork, corev1.PodRunning) podKey := getKey(podObj, t) - f := newFixture(t) + fexec := fakeexec.FakeExec{} + f := newFixture(t, &fexec) f.podLister = append(f.podLister, podObj) f.kubeobjects = append(f.kubeobjects, podObj) stopCh := make(chan struct{}) @@ -282,7 +331,8 @@ func TestDeletePod(t *testing.T) { podObj := createPod("test-pod", "test-namespace", "0", "1.2.3.4", labels, NonHostNetwork, corev1.PodRunning) podKey := getKey(podObj, t) - f := newFixture(t) + fexec := fakeexec.FakeExec{} + f := newFixture(t, &fexec) f.podLister = append(f.podLister, podObj) f.kubeobjects = append(f.kubeobjects, podObj) stopCh := make(chan struct{}) @@ -306,7 +356,8 @@ func TestDeleteHostNetworkPod(t *testing.T) { podObj := createPod("test-pod", "test-namespace", "0", "1.2.3.4", labels, HostNetwork, corev1.PodRunning) podKey := getKey(podObj, t) - f := newFixture(t) + fexec := fakeexec.FakeExec{} + f := newFixture(t, &fexec) f.podLister = append(f.podLister, podObj) f.kubeobjects = append(f.kubeobjects, podObj) stopCh := make(chan struct{}) @@ -328,7 +379,8 @@ func TestDeletePodWithTombstone(t *testing.T) { "app": "test-pod", } podObj := createPod("test-pod", "test-namespace", "0", "1.2.3.4", labels, NonHostNetwork, corev1.PodRunning) - f := newFixture(t) + fexec := fakeexec.FakeExec{} + f := newFixture(t, &fexec) stopCh := make(chan struct{}) defer close(stopCh) f.newPodController(stopCh) @@ -352,7 +404,8 @@ func TestDeletePodWithTombstoneAfterAddingPod(t *testing.T) { } podObj := createPod("test-pod", "test-namespace", "0", "1.2.3.4", labels, NonHostNetwork, corev1.PodRunning) - f := newFixture(t) + fexec := fakeexec.FakeExec{} + f := newFixture(t, &fexec) f.podLister = append(f.podLister, podObj) f.kubeobjects = append(f.kubeobjects, podObj) stopCh := make(chan struct{}) @@ -372,7 +425,8 @@ func TestLabelUpdatePod(t *testing.T) { } oldPodObj := createPod("test-pod", "test-namespace", "0", "1.2.3.4", labels, NonHostNetwork, corev1.PodRunning) - f := newFixture(t) + fexec := fakeexec.FakeExec{} + f := newFixture(t, &fexec) f.podLister = append(f.podLister, oldPodObj) f.kubeobjects = append(f.kubeobjects, oldPodObj) stopCh := make(chan struct{}) @@ -401,7 +455,8 @@ func TestIPAddressUpdatePod(t *testing.T) { } oldPodObj := createPod("test-pod", "test-namespace", "0", "1.2.3.4", labels, NonHostNetwork, corev1.PodRunning) - f := newFixture(t) + fexec := fakeexec.FakeExec{} + f := newFixture(t, &fexec) f.podLister = append(f.podLister, oldPodObj) f.kubeobjects = append(f.kubeobjects, oldPodObj) stopCh := make(chan struct{}) @@ -430,7 +485,8 @@ func TestPodStatusUpdatePod(t *testing.T) { oldPodObj := createPod("test-pod", "test-namespace", "0", "1.2.3.4", labels, NonHostNetwork, corev1.PodRunning) podKey := getKey(oldPodObj, t) - f := newFixture(t) + fexec := fakeexec.FakeExec{} + f := newFixture(t, &fexec) f.podLister = append(f.podLister, oldPodObj) f.kubeobjects = append(f.kubeobjects, oldPodObj) stopCh := make(chan struct{}) From 4c5e17542c80d9b0d4d53a87c8b8ab344f3161cc Mon Sep 17 00:00:00 2001 From: Mathew Merrick Date: Wed, 28 Apr 2021 16:36:10 -0700 Subject: [PATCH 02/19] more pod controller tests --- npm/ipsm/ipsm.go | 5 +- npm/nameSpaceController_test.go | 37 +++- npm/podController_test.go | 372 ++++++++++++++++++++++++++++---- 3 files changed, 361 insertions(+), 53 deletions(-) diff --git a/npm/ipsm/ipsm.go b/npm/ipsm/ipsm.go index a4deafc73b..f1a87443c5 100644 --- a/npm/ipsm/ipsm.go +++ b/npm/ipsm/ipsm.go @@ -479,12 +479,13 @@ func (ipsMgr *IpsetManager) Run(entry *ipsEntry) (int, error) { log.Logf("Executing ipset command %s %v", cmdName, cmdArgs) - errbytes, err := ipsMgr.Exec.Command(cmdName, cmdArgs...).CombinedOutput() + cmd := ipsMgr.Exec.Command(cmdName, cmdArgs...) + errbytes, err := cmd.CombinedOutput() if err != nil { metrics.SendErrorLogAndMetric(util.IpsmID, "Error: There was an error running command: [%s %v] Stderr: [%v, %s]", cmdName, strings.Join(cmdArgs, " "), err, strings.TrimSuffix(string(errbytes), "\n")) } - return 0, nil + return 0, nil } // Save saves ipset to file. diff --git a/npm/nameSpaceController_test.go b/npm/nameSpaceController_test.go index db41d11cfa..d3a7bfe532 100644 --- a/npm/nameSpaceController_test.go +++ b/npm/nameSpaceController_test.go @@ -9,6 +9,7 @@ import ( "github.com/Azure/azure-container-networking/npm/ipsm" "github.com/Azure/azure-container-networking/npm/util" + "github.com/stretchr/testify/require" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -160,10 +161,7 @@ func TestNewNs(t *testing.T) { } func TestAddNamespace(t *testing.T) { - fexec := fakeexec.FakeExec{} - f := newNsFixture(t, &fexec) - f.ipSetSave(util.IpsetTestConfigFile) - defer f.ipSetRestore(util.IpsetTestConfigFile) + require := require.New(t) nsObj := newNameSpace( "test-namespace", @@ -172,6 +170,31 @@ func TestAddNamespace(t *testing.T) { "app": "test-namespace", }, ) + + var calls = []struct { + cmd []string + err error + }{ + {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("ns-test-namespace"), "nethash"}, err: nil}, + {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("all-namespaces"), "setlist"}, err: nil}, + {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("all-namespaces"), util.GetHashedName("ns-test-namespace")}, err: nil}, + {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("ns-app"), "setlist"}, err: nil}, + {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("ns-app"), util.GetHashedName("ns-test-namespace")}, err: nil}, + {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("ns-app:test-namespace"), "setlist"}, err: nil}, + {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("ns-app:test-namespace"), util.GetHashedName("ns-test-namespace")}, err: nil}, + } + + fcmd := fakeexec.FakeCmd{CombinedOutputScript: []fakeexec.FakeAction{}} + fexec := fakeexec.FakeExec{CommandScript: []fakeexec.FakeCommandAction{}} + + // expect happy path, each call returns no errors + for _, call := range calls { + fcmd.CombinedOutputScript = append(fcmd.CombinedOutputScript, func() ([]byte, []byte, error) { return nil, nil, call.err }) + fexec.CommandScript = append(fexec.CommandScript, func(cmd string, args ...string) utilexec.Cmd { return fakeexec.InitFakeCmd(&fcmd, cmd, args...) }) + } + + f := newNsFixture(t, &fexec) + f.nsLister = append(f.nsLister, nsObj) f.kubeobjects = append(f.kubeobjects, nsObj) @@ -189,6 +212,12 @@ func TestAddNamespace(t *testing.T) { if _, exists := f.npMgr.NsMap[util.GetNSNameWithPrefix(nsObj.Name)]; !exists { t.Errorf("TestAddNamespace failed @ npMgr.nsMap check") } + + require.Equal(len(calls), len(fcmd.CombinedOutputLog)) + require.Equal(len(calls), len(fcmd.CombinedOutputLog)) + for i, call := range calls { + require.Equalf(call.cmd, fcmd.CombinedOutputLog[i], "Call [%d] doesn't match expected", i) + } } func TestUpdateNamespace(t *testing.T) { diff --git a/npm/podController_test.go b/npm/podController_test.go index afc8347524..84bb9f3c0b 100644 --- a/npm/podController_test.go +++ b/npm/podController_test.go @@ -10,7 +10,7 @@ import ( "github.com/Azure/azure-container-networking/npm/ipsm" "github.com/Azure/azure-container-networking/npm/util" - "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" corev1 "k8s.io/api/core/v1" utilexec "k8s.io/utils/exec" fakeexec "k8s.io/utils/exec/testing" @@ -209,13 +209,42 @@ func checkNpmPodWithInput(testName string, f *podFixture, inputPodObj *corev1.Po } func TestAddMultiplePods(t *testing.T) { + require := require.New(t) + labels := map[string]string{ "app": "test-pod", } podObj1 := createPod("test-pod-1", "test-namespace", "0", "1.2.3.4", labels, NonHostNetwork, corev1.PodRunning) podObj2 := createPod("test-pod-2", "test-namespace", "0", "1.2.3.5", labels, NonHostNetwork, corev1.PodRunning) - fexec := fakeexec.FakeExec{} + var calls = []struct { + cmd []string + err error + }{ + {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("ns-test-namespace"), "nethash"}, err: nil}, + {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("ns-test-namespace"), "1.2.3.4"}, err: nil}, + {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("app"), "nethash"}, err: nil}, + {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("app"), "1.2.3.4"}, err: nil}, + {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("app:test-pod"), "nethash"}, err: nil}, + {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("app:test-pod"), "1.2.3.4"}, err: nil}, + {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("namedport:app:test-pod"), "hash:ip,port"}, err: nil}, + {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("namedport:app:test-pod"), "1.2.3.4,8080"}, err: nil}, + {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("ns-test-namespace"), "1.2.3.5"}, err: nil}, + {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("app"), "1.2.3.5"}, err: nil}, + {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("app:test-pod"), "1.2.3.5"}, err: nil}, + {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("namedport:app:test-pod"), "hash:ip,port"}, err: nil}, + {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("namedport:app:test-pod"), "1.2.3.5,8080"}, err: nil}, + } + + fcmd := fakeexec.FakeCmd{CombinedOutputScript: []fakeexec.FakeAction{}} + fexec := fakeexec.FakeExec{CommandScript: []fakeexec.FakeCommandAction{}} + + // expect happy path, each call returns no errors + for _, call := range calls { + fcmd.CombinedOutputScript = append(fcmd.CombinedOutputScript, func() ([]byte, []byte, error) { return nil, nil, call.err }) + fexec.CommandScript = append(fexec.CommandScript, func(cmd string, args ...string) utilexec.Cmd { return fakeexec.InitFakeCmd(&fcmd, cmd, args...) }) + } + f := newFixture(t, &fexec) f.podLister = append(f.podLister, podObj1, podObj2) f.kubeobjects = append(f.kubeobjects, podObj1, podObj2) @@ -232,52 +261,41 @@ func TestAddMultiplePods(t *testing.T) { checkPodTestResult("TestAddMultiplePods", f, testCases) checkNpmPodWithInput("TestAddMultiplePods", f, podObj1) checkNpmPodWithInput("TestAddMultiplePods", f, podObj2) + + require.Equal(len(calls), len(fcmd.CombinedOutputLog)) + for i, call := range calls { + require.Equalf(call.cmd, fcmd.CombinedOutputLog[i], "Call [%d] doesn't match expected", i) + } } func TestAddPod(t *testing.T) { - assert := assert.New(t) - labels := map[string]string{ "app": "test-pod", } podObj := createPod("test-pod", "test-namespace", "0", "1.2.3.4", labels, NonHostNetwork, corev1.PodRunning) - calls := [][]string{ - {"ipset", "-N", "-exist", util.GetHashedName("ns-test-namespace"), "nethash"}, - {"ipset", "-A", "-exist", util.GetHashedName("ns-test-namespace"), "1.2.3.4"}, - {"ipset", "-N", "-exist", util.GetHashedName("app"), "nethash"}, - {"ipset", "-A", "-exist", util.GetHashedName("app"), "1.2.3.4"}, - {"ipset", "-N", "-exist", util.GetHashedName("app:test-pod"), "nethash"}, - {"ipset", "-A", "-exist", util.GetHashedName("app:test-pod"), "1.2.3.4"}, - {"ipset", "-N", "-exist", util.GetHashedName("namedport:app:test-pod"), "hash:ip,port"}, - {"ipset", "-A", "-exist", util.GetHashedName("namedport:app:test-pod"), "1.2.3.4,8080"}, - } - - fcmd := fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeAction{ - func() ([]byte, []byte, error) { return nil, nil, nil }, - func() ([]byte, []byte, error) { return nil, nil, nil }, - func() ([]byte, []byte, error) { return nil, nil, nil }, - func() ([]byte, []byte, error) { return nil, nil, nil }, - func() ([]byte, []byte, error) { return nil, nil, nil }, - func() ([]byte, []byte, error) { return nil, nil, nil }, - func() ([]byte, []byte, error) { return nil, nil, nil }, - func() ([]byte, []byte, error) { return nil, nil, nil }, - }, + require := require.New(t) + var calls = []struct { + cmd []string + err error + }{ + {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("ns-test-namespace"), "nethash"}, err: nil}, + {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("ns-test-namespace"), "1.2.3.4"}, err: nil}, + {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("app"), "nethash"}, err: nil}, + {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("app"), "1.2.3.4"}, err: nil}, + {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("app:test-pod"), "nethash"}, err: nil}, + {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("app:test-pod"), "1.2.3.4"}, err: nil}, + {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("namedport:app:test-pod"), "hash:ip,port"}, err: nil}, + {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("namedport:app:test-pod"), "1.2.3.4,8080"}, err: nil}, } - fexec := fakeexec.FakeExec{ - CommandScript: []fakeexec.FakeCommandAction{ - func(cmd string, args ...string) utilexec.Cmd { return fakeexec.InitFakeCmd(&fcmd, cmd, args...) }, - func(cmd string, args ...string) utilexec.Cmd { return fakeexec.InitFakeCmd(&fcmd, cmd, args...) }, - func(cmd string, args ...string) utilexec.Cmd { return fakeexec.InitFakeCmd(&fcmd, cmd, args...) }, - func(cmd string, args ...string) utilexec.Cmd { return fakeexec.InitFakeCmd(&fcmd, cmd, args...) }, - func(cmd string, args ...string) utilexec.Cmd { return fakeexec.InitFakeCmd(&fcmd, cmd, args...) }, - func(cmd string, args ...string) utilexec.Cmd { return fakeexec.InitFakeCmd(&fcmd, cmd, args...) }, - func(cmd string, args ...string) utilexec.Cmd { return fakeexec.InitFakeCmd(&fcmd, cmd, args...) }, - func(cmd string, args ...string) utilexec.Cmd { return fakeexec.InitFakeCmd(&fcmd, cmd, args...) }, - }, - CommandCalls: 0, + fcmd := fakeexec.FakeCmd{CombinedOutputScript: []fakeexec.FakeAction{}} + fexec := fakeexec.FakeExec{CommandScript: []fakeexec.FakeCommandAction{}} + + // expect happy path, each call returns no errors + for _, call := range calls { + fcmd.CombinedOutputScript = append(fcmd.CombinedOutputScript, func() ([]byte, []byte, error) { return nil, nil, call.err }) + fexec.CommandScript = append(fexec.CommandScript, func(cmd string, args ...string) utilexec.Cmd { return fakeexec.InitFakeCmd(&fcmd, cmd, args...) }) } f := newFixture(t, &fexec) @@ -295,7 +313,10 @@ func TestAddPod(t *testing.T) { checkPodTestResult("TestAddPod", f, testCases) checkNpmPodWithInput("TestAddPod", f, podObj) - assert.Equal(fcmd.CombinedOutputLog, calls) + require.Equal(len(calls), len(fcmd.CombinedOutputLog)) + for i, call := range calls { + require.Equalf(call.cmd, fcmd.CombinedOutputLog[i], "Call [%d] doesn't match expected", i) + } } func TestAddHostNetworkPod(t *testing.T) { @@ -305,7 +326,21 @@ func TestAddHostNetworkPod(t *testing.T) { podObj := createPod("test-pod", "test-namespace", "0", "1.2.3.4", labels, HostNetwork, corev1.PodRunning) podKey := getKey(podObj, t) - fexec := fakeexec.FakeExec{} + require := require.New(t) + var calls = []struct { + cmd []string + err error + }{} + + fcmd := fakeexec.FakeCmd{CombinedOutputScript: []fakeexec.FakeAction{}} + fexec := fakeexec.FakeExec{CommandScript: []fakeexec.FakeCommandAction{}} + + // expect happy path, each call returns no errors + for _, call := range calls { + fcmd.CombinedOutputScript = append(fcmd.CombinedOutputScript, func() ([]byte, []byte, error) { return nil, nil, call.err }) + fexec.CommandScript = append(fexec.CommandScript, func(cmd string, args ...string) utilexec.Cmd { return fakeexec.InitFakeCmd(&fcmd, cmd, args...) }) + } + f := newFixture(t, &fexec) f.podLister = append(f.podLister, podObj) f.kubeobjects = append(f.kubeobjects, podObj) @@ -322,6 +357,11 @@ func TestAddHostNetworkPod(t *testing.T) { if _, exists := f.npMgr.PodMap[podKey]; exists { t.Error("TestAddHostNetworkPod failed @ cached pod obj exists check") } + + require.Equal(len(calls), len(fcmd.CombinedOutputLog)) + for i, call := range calls { + require.Equalf(call.cmd, fcmd.CombinedOutputLog[i], "Call [%d] doesn't match expected", i) + } } func TestDeletePod(t *testing.T) { @@ -331,7 +371,41 @@ func TestDeletePod(t *testing.T) { podObj := createPod("test-pod", "test-namespace", "0", "1.2.3.4", labels, NonHostNetwork, corev1.PodRunning) podKey := getKey(podObj, t) - fexec := fakeexec.FakeExec{} + require := require.New(t) + var calls = []struct { + cmd []string + err error + }{ + // add pod + {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("ns-test-namespace"), "nethash"}, err: nil}, + {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("ns-test-namespace"), "1.2.3.4"}, err: nil}, + {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("app"), "nethash"}, err: nil}, + {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("app"), "1.2.3.4"}, err: nil}, + {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("app:test-pod"), "nethash"}, err: nil}, + {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("app:test-pod"), "1.2.3.4"}, err: nil}, + {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("namedport:app:test-pod"), "hash:ip,port"}, err: nil}, + {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("namedport:app:test-pod"), "1.2.3.4,8080"}, err: nil}, + + // delete pod + {cmd: []string{"ipset", "-D", "-exist", util.GetHashedName("ns-test-namespace"), "1.2.3.4"}, err: nil}, + {cmd: []string{"ipset", "-X", "-exist", util.GetHashedName("ns-test-namespace")}, err: nil}, + {cmd: []string{"ipset", "-D", "-exist", util.GetHashedName("app"), "1.2.3.4"}, err: nil}, + {cmd: []string{"ipset", "-X", "-exist", util.GetHashedName("app")}, err: nil}, + {cmd: []string{"ipset", "-D", "-exist", util.GetHashedName("app:test-pod"), "1.2.3.4"}, err: nil}, + {cmd: []string{"ipset", "-X", "-exist", util.GetHashedName("app:test-pod")}, err: nil}, + {cmd: []string{"ipset", "-D", "-exist", util.GetHashedName("namedport:app:test-pod"), "1.2.3.4,8080"}, err: nil}, + {cmd: []string{"ipset", "-X", "-exist", util.GetHashedName("namedport:app:test-pod")}, err: nil}, + } + + fcmd := fakeexec.FakeCmd{CombinedOutputScript: []fakeexec.FakeAction{}} + fexec := fakeexec.FakeExec{CommandScript: []fakeexec.FakeCommandAction{}} + + // expect happy path, each call returns no errors + for _, call := range calls { + fcmd.CombinedOutputScript = append(fcmd.CombinedOutputScript, func() ([]byte, []byte, error) { return nil, nil, call.err }) + fexec.CommandScript = append(fexec.CommandScript, func(cmd string, args ...string) utilexec.Cmd { return fakeexec.InitFakeCmd(&fcmd, cmd, args...) }) + } + f := newFixture(t, &fexec) f.podLister = append(f.podLister, podObj) f.kubeobjects = append(f.kubeobjects, podObj) @@ -347,6 +421,11 @@ func TestDeletePod(t *testing.T) { if _, exists := f.npMgr.PodMap[podKey]; exists { t.Error("TestDeletePod failed @ cached pod obj exists check") } + + require.Equal(len(calls), len(fcmd.CombinedOutputLog)) + for i, call := range calls { + require.Equalf(call.cmd, fcmd.CombinedOutputLog[i], "Call [%d] doesn't match expected", i) + } } func TestDeleteHostNetworkPod(t *testing.T) { @@ -356,7 +435,20 @@ func TestDeleteHostNetworkPod(t *testing.T) { podObj := createPod("test-pod", "test-namespace", "0", "1.2.3.4", labels, HostNetwork, corev1.PodRunning) podKey := getKey(podObj, t) - fexec := fakeexec.FakeExec{} + require := require.New(t) + var calls = []struct { + cmd []string + err error + }{} + + fcmd := fakeexec.FakeCmd{CombinedOutputScript: []fakeexec.FakeAction{}} + fexec := fakeexec.FakeExec{CommandScript: []fakeexec.FakeCommandAction{}} + + // expect happy path, each call returns no errors + for _, call := range calls { + fcmd.CombinedOutputScript = append(fcmd.CombinedOutputScript, func() ([]byte, []byte, error) { return nil, nil, call.err }) + fexec.CommandScript = append(fexec.CommandScript, func(cmd string, args ...string) utilexec.Cmd { return fakeexec.InitFakeCmd(&fcmd, cmd, args...) }) + } f := newFixture(t, &fexec) f.podLister = append(f.podLister, podObj) f.kubeobjects = append(f.kubeobjects, podObj) @@ -372,6 +464,11 @@ func TestDeleteHostNetworkPod(t *testing.T) { if _, exists := f.npMgr.PodMap[podKey]; exists { t.Error("TestDeleteHostNetworkPod failed @ cached pod obj exists check") } + + require.Equal(len(calls), len(fcmd.CombinedOutputLog)) + for i, call := range calls { + require.Equalf(call.cmd, fcmd.CombinedOutputLog[i], "Call [%d] doesn't match expected", i) + } } func TestDeletePodWithTombstone(t *testing.T) { @@ -379,7 +476,22 @@ func TestDeletePodWithTombstone(t *testing.T) { "app": "test-pod", } podObj := createPod("test-pod", "test-namespace", "0", "1.2.3.4", labels, NonHostNetwork, corev1.PodRunning) - fexec := fakeexec.FakeExec{} + + require := require.New(t) + var calls = []struct { + cmd []string + err error + }{} + + fcmd := fakeexec.FakeCmd{CombinedOutputScript: []fakeexec.FakeAction{}} + fexec := fakeexec.FakeExec{CommandScript: []fakeexec.FakeCommandAction{}} + + // expect happy path, each call returns no errors + for _, call := range calls { + fcmd.CombinedOutputScript = append(fcmd.CombinedOutputScript, func() ([]byte, []byte, error) { return nil, nil, call.err }) + fexec.CommandScript = append(fexec.CommandScript, func(cmd string, args ...string) utilexec.Cmd { return fakeexec.InitFakeCmd(&fcmd, cmd, args...) }) + } + f := newFixture(t, &fexec) stopCh := make(chan struct{}) defer close(stopCh) @@ -396,6 +508,11 @@ func TestDeletePodWithTombstone(t *testing.T) { {0, 1, 0}, } checkPodTestResult("TestDeletePodWithTombstone", f, testCases) + + require.Equal(len(calls), len(fcmd.CombinedOutputLog)) + for i, call := range calls { + require.Equalf(call.cmd, fcmd.CombinedOutputLog[i], "Call [%d] doesn't match expected", i) + } } func TestDeletePodWithTombstoneAfterAddingPod(t *testing.T) { @@ -404,7 +521,41 @@ func TestDeletePodWithTombstoneAfterAddingPod(t *testing.T) { } podObj := createPod("test-pod", "test-namespace", "0", "1.2.3.4", labels, NonHostNetwork, corev1.PodRunning) - fexec := fakeexec.FakeExec{} + require := require.New(t) + var calls = []struct { + cmd []string + err error + }{ + // add pod + {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("ns-test-namespace"), "nethash"}, err: nil}, + {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("ns-test-namespace"), "1.2.3.4"}, err: nil}, + {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("app"), "nethash"}, err: nil}, + {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("app"), "1.2.3.4"}, err: nil}, + {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("app:test-pod"), "nethash"}, err: nil}, + {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("app:test-pod"), "1.2.3.4"}, err: nil}, + {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("namedport:app:test-pod"), "hash:ip,port"}, err: nil}, + {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("namedport:app:test-pod"), "1.2.3.4,8080"}, err: nil}, + + // delete pod + {cmd: []string{"ipset", "-D", "-exist", util.GetHashedName("ns-test-namespace"), "1.2.3.4"}, err: nil}, + {cmd: []string{"ipset", "-X", "-exist", util.GetHashedName("ns-test-namespace")}, err: nil}, + {cmd: []string{"ipset", "-D", "-exist", util.GetHashedName("app"), "1.2.3.4"}, err: nil}, + {cmd: []string{"ipset", "-X", "-exist", util.GetHashedName("app")}, err: nil}, + {cmd: []string{"ipset", "-D", "-exist", util.GetHashedName("app:test-pod"), "1.2.3.4"}, err: nil}, + {cmd: []string{"ipset", "-X", "-exist", util.GetHashedName("app:test-pod")}, err: nil}, + {cmd: []string{"ipset", "-D", "-exist", util.GetHashedName("namedport:app:test-pod"), "1.2.3.4,8080"}, err: nil}, + {cmd: []string{"ipset", "-X", "-exist", util.GetHashedName("namedport:app:test-pod")}, err: nil}, + } + + fcmd := fakeexec.FakeCmd{CombinedOutputScript: []fakeexec.FakeAction{}} + fexec := fakeexec.FakeExec{CommandScript: []fakeexec.FakeCommandAction{}} + + // expect happy path, each call returns no errors + for _, call := range calls { + fcmd.CombinedOutputScript = append(fcmd.CombinedOutputScript, func() ([]byte, []byte, error) { return nil, nil, call.err }) + fexec.CommandScript = append(fexec.CommandScript, func(cmd string, args ...string) utilexec.Cmd { return fakeexec.InitFakeCmd(&fcmd, cmd, args...) }) + } + f := newFixture(t, &fexec) f.podLister = append(f.podLister, podObj) f.kubeobjects = append(f.kubeobjects, podObj) @@ -413,10 +564,16 @@ func TestDeletePodWithTombstoneAfterAddingPod(t *testing.T) { f.newPodController(stopCh) deletePod(t, f, podObj, DeletedFinalStateUnknownObject) + testCases := []expectedValues{ {0, 2, 0}, } checkPodTestResult("TestDeletePodWithTombstoneAfterAddingPod", f, testCases) + + require.Equal(len(calls), len(fcmd.CombinedOutputLog)) + for i, call := range calls { + require.Equalf(call.cmd, fcmd.CombinedOutputLog[i], "Call [%d] doesn't match expected", i) + } } func TestLabelUpdatePod(t *testing.T) { @@ -425,7 +582,37 @@ func TestLabelUpdatePod(t *testing.T) { } oldPodObj := createPod("test-pod", "test-namespace", "0", "1.2.3.4", labels, NonHostNetwork, corev1.PodRunning) - fexec := fakeexec.FakeExec{} + require := require.New(t) + var calls = []struct { + cmd []string + err error + }{ + // add pod + {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("ns-test-namespace"), "nethash"}, err: nil}, + {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("ns-test-namespace"), "1.2.3.4"}, err: nil}, + {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("app"), "nethash"}, err: nil}, + {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("app"), "1.2.3.4"}, err: nil}, + {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("app:test-pod"), "nethash"}, err: nil}, + {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("app:test-pod"), "1.2.3.4"}, err: nil}, + {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("namedport:app:test-pod"), "hash:ip,port"}, err: nil}, + {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("namedport:app:test-pod"), "1.2.3.4,8080"}, err: nil}, + + // update pod + {cmd: []string{"ipset", "-D", "-exist", util.GetHashedName("app:test-pod"), "1.2.3.4"}, err: nil}, + {cmd: []string{"ipset", "-X", "-exist", util.GetHashedName("app:test-pod")}, err: nil}, + {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("app:new-test-pod"), "nethash"}, err: nil}, + {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("app:new-test-pod"), "1.2.3.4"}, err: nil}, + } + + fcmd := fakeexec.FakeCmd{CombinedOutputScript: []fakeexec.FakeAction{}} + fexec := fakeexec.FakeExec{CommandScript: []fakeexec.FakeCommandAction{}} + + // expect happy path, each call returns no errors + for _, call := range calls { + fcmd.CombinedOutputScript = append(fcmd.CombinedOutputScript, func() ([]byte, []byte, error) { return nil, nil, call.err }) + fexec.CommandScript = append(fexec.CommandScript, func(cmd string, args ...string) utilexec.Cmd { return fakeexec.InitFakeCmd(&fcmd, cmd, args...) }) + } + f := newFixture(t, &fexec) f.podLister = append(f.podLister, oldPodObj) f.kubeobjects = append(f.kubeobjects, oldPodObj) @@ -447,6 +634,11 @@ func TestLabelUpdatePod(t *testing.T) { } checkPodTestResult("TestLabelUpdatePod", f, testCases) checkNpmPodWithInput("TestLabelUpdatePod", f, newPodObj) + + require.Equal(len(calls), len(fcmd.CombinedOutputLog)) + for i, call := range calls { + require.Equalf(call.cmd, fcmd.CombinedOutputLog[i], "Call [%d] doesn't match expected", i) + } } func TestIPAddressUpdatePod(t *testing.T) { @@ -455,7 +647,49 @@ func TestIPAddressUpdatePod(t *testing.T) { } oldPodObj := createPod("test-pod", "test-namespace", "0", "1.2.3.4", labels, NonHostNetwork, corev1.PodRunning) - fexec := fakeexec.FakeExec{} + require := require.New(t) + var calls = []struct { + cmd []string + err error + }{ + // add pod + {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("ns-test-namespace"), "nethash"}, err: nil}, + {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("ns-test-namespace"), "1.2.3.4"}, err: nil}, + {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("app"), "nethash"}, err: nil}, + {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("app"), "1.2.3.4"}, err: nil}, + {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("app:test-pod"), "nethash"}, err: nil}, + {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("app:test-pod"), "1.2.3.4"}, err: nil}, + {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("namedport:app:test-pod"), "hash:ip,port"}, err: nil}, + {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("namedport:app:test-pod"), "1.2.3.4,8080"}, err: nil}, + + // update pod + {cmd: []string{"ipset", "-D", "-exist", util.GetHashedName("ns-test-namespace"), "1.2.3.4"}, err: nil}, + {cmd: []string{"ipset", "-X", "-exist", util.GetHashedName("ns-test-namespace")}, err: nil}, + {cmd: []string{"ipset", "-D", "-exist", util.GetHashedName("app"), "1.2.3.4"}, err: nil}, + {cmd: []string{"ipset", "-X", "-exist", util.GetHashedName("app")}, err: nil}, + {cmd: []string{"ipset", "-D", "-exist", util.GetHashedName("app:test-pod"), "1.2.3.4"}, err: nil}, + {cmd: []string{"ipset", "-X", "-exist", util.GetHashedName("app:test-pod")}, err: nil}, + {cmd: []string{"ipset", "-D", "-exist", util.GetHashedName("namedport:app:test-pod"), "1.2.3.4,8080"}, err: nil}, + {cmd: []string{"ipset", "-X", "-exist", util.GetHashedName("namedport:app:test-pod")}, err: nil}, + {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("ns-test-namespace"), "nethash"}, err: nil}, + {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("ns-test-namespace"), "4.3.2.1"}, err: nil}, + {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("app"), "nethash"}, err: nil}, + {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("app"), "4.3.2.1"}, err: nil}, + {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("app:test-pod"), "nethash"}, err: nil}, + {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("app:test-pod"), "4.3.2.1"}, err: nil}, + {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("namedport:app:test-pod"), "hash:ip,port"}, err: nil}, + {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("namedport:app:test-pod"), "4.3.2.1,8080"}, err: nil}, + } + + fcmd := fakeexec.FakeCmd{CombinedOutputScript: []fakeexec.FakeAction{}} + fexec := fakeexec.FakeExec{CommandScript: []fakeexec.FakeCommandAction{}} + + // expect happy path, each call returns no errors + for _, call := range calls { + fcmd.CombinedOutputScript = append(fcmd.CombinedOutputScript, func() ([]byte, []byte, error) { return nil, nil, call.err }) + fexec.CommandScript = append(fexec.CommandScript, func(cmd string, args ...string) utilexec.Cmd { return fakeexec.InitFakeCmd(&fcmd, cmd, args...) }) + } + f := newFixture(t, &fexec) f.podLister = append(f.podLister, oldPodObj) f.kubeobjects = append(f.kubeobjects, oldPodObj) @@ -476,6 +710,11 @@ func TestIPAddressUpdatePod(t *testing.T) { } checkPodTestResult("TestIPAddressUpdatePod", f, testCases) checkNpmPodWithInput("TestIPAddressUpdatePod", f, newPodObj) + + require.Equal(len(calls), len(fcmd.CombinedOutputLog)) + for i, call := range calls { + require.Equalf(call.cmd, fcmd.CombinedOutputLog[i], "Call [%d] doesn't match expected", i) + } } func TestPodStatusUpdatePod(t *testing.T) { @@ -485,7 +724,41 @@ func TestPodStatusUpdatePod(t *testing.T) { oldPodObj := createPod("test-pod", "test-namespace", "0", "1.2.3.4", labels, NonHostNetwork, corev1.PodRunning) podKey := getKey(oldPodObj, t) - fexec := fakeexec.FakeExec{} + require := require.New(t) + var calls = []struct { + cmd []string + err error + }{ + // add pod + {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("ns-test-namespace"), "nethash"}, err: nil}, + {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("ns-test-namespace"), "1.2.3.4"}, err: nil}, + {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("app"), "nethash"}, err: nil}, + {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("app"), "1.2.3.4"}, err: nil}, + {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("app:test-pod"), "nethash"}, err: nil}, + {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("app:test-pod"), "1.2.3.4"}, err: nil}, + {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("namedport:app:test-pod"), "hash:ip,port"}, err: nil}, + {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("namedport:app:test-pod"), "1.2.3.4,8080"}, err: nil}, + + // update pod + {cmd: []string{"ipset", "-D", "-exist", util.GetHashedName("ns-test-namespace"), "1.2.3.4"}, err: nil}, + {cmd: []string{"ipset", "-X", "-exist", util.GetHashedName("ns-test-namespace")}, err: nil}, + {cmd: []string{"ipset", "-D", "-exist", util.GetHashedName("app"), "1.2.3.4"}, err: nil}, + {cmd: []string{"ipset", "-X", "-exist", util.GetHashedName("app")}, err: nil}, + {cmd: []string{"ipset", "-D", "-exist", util.GetHashedName("app:test-pod"), "1.2.3.4"}, err: nil}, + {cmd: []string{"ipset", "-X", "-exist", util.GetHashedName("app:test-pod")}, err: nil}, + {cmd: []string{"ipset", "-D", "-exist", util.GetHashedName("namedport:app:test-pod"), "1.2.3.4,8080"}, err: nil}, + {cmd: []string{"ipset", "-X", "-exist", util.GetHashedName("namedport:app:test-pod")}, err: nil}, + } + + fcmd := fakeexec.FakeCmd{CombinedOutputScript: []fakeexec.FakeAction{}} + fexec := fakeexec.FakeExec{CommandScript: []fakeexec.FakeCommandAction{}} + + // expect happy path, each call returns no errors + for _, call := range calls { + fcmd.CombinedOutputScript = append(fcmd.CombinedOutputScript, func() ([]byte, []byte, error) { return nil, nil, call.err }) + fexec.CommandScript = append(fexec.CommandScript, func(cmd string, args ...string) utilexec.Cmd { return fakeexec.InitFakeCmd(&fcmd, cmd, args...) }) + } + f := newFixture(t, &fexec) f.podLister = append(f.podLister, oldPodObj) f.kubeobjects = append(f.kubeobjects, oldPodObj) @@ -509,6 +782,11 @@ func TestPodStatusUpdatePod(t *testing.T) { if _, exists := f.npMgr.PodMap[podKey]; exists { t.Error("TestPodStatusUpdatePod failed @ cached pod obj exists check") } + + require.Equal(len(calls), len(fcmd.CombinedOutputLog)) + for i, call := range calls { + require.Equalf(call.cmd, fcmd.CombinedOutputLog[i], "Call [%d] doesn't match expected", i) + } } func TestHasValidPodIP(t *testing.T) { From 220d064c5670b8c338981202aae5336b671fd4b1 Mon Sep 17 00:00:00 2001 From: Mathew Merrick Date: Thu, 29 Apr 2021 10:10:11 -0700 Subject: [PATCH 03/19] remove fakeexecs, limit to podcontroller --- go.mod | 2 +- npm/ipsm/ipsm.go | 24 +++++----- npm/ipsm/ipsm_test.go | 70 ++++++++++++++--------------- npm/nameSpaceController_test.go | 41 ++++++++--------- npm/networkPolicyController_test.go | 30 ++++++------- npm/npm_test.go | 29 +++++------- 6 files changed, 97 insertions(+), 99 deletions(-) diff --git a/go.mod b/go.mod index cad7bb1181..d0b81e3cdd 100644 --- a/go.mod +++ b/go.mod @@ -40,7 +40,7 @@ require ( k8s.io/apimachinery v0.18.2 k8s.io/client-go v0.18.2 k8s.io/klog v1.0.0 - k8s.io/utils v0.0.0-20200324210504-a9aa75ae1b89 // indirect + k8s.io/utils v0.0.0-20200324210504-a9aa75ae1b89 sigs.k8s.io/controller-runtime v0.6.0 software.sslmate.com/src/go-pkcs12 v0.0.0-20201102150903-66718f75db0e // indirect ) diff --git a/npm/ipsm/ipsm.go b/npm/ipsm/ipsm.go index f1a87443c5..208dc323ad 100644 --- a/npm/ipsm/ipsm.go +++ b/npm/ipsm/ipsm.go @@ -480,12 +480,12 @@ func (ipsMgr *IpsetManager) Run(entry *ipsEntry) (int, error) { log.Logf("Executing ipset command %s %v", cmdName, cmdArgs) cmd := ipsMgr.Exec.Command(cmdName, cmdArgs...) - errbytes, err := cmd.CombinedOutput() + output, err := cmd.CombinedOutput() if err != nil { - metrics.SendErrorLogAndMetric(util.IpsmID, "Error: There was an error running command: [%s %v] Stderr: [%v, %s]", cmdName, strings.Join(cmdArgs, " "), err, strings.TrimSuffix(string(errbytes), "\n")) + metrics.SendErrorLogAndMetric(util.IpsmID, "Error: There was an error running command: [%s %v] Stderr: [%v, %s]", cmdName, strings.Join(cmdArgs, " "), err, strings.TrimSuffix(string(output), "\n")) } - return 0, nil + return 0, nil } // Save saves ipset to file. @@ -495,9 +495,9 @@ func (ipsMgr *IpsetManager) Save(configFile string) error { } cmd := ipsMgr.Exec.Command(util.Ipset, util.IpsetSaveFlag, util.IpsetFileFlag, configFile) - errbytes, err := cmd.CombinedOutput() + output, err := cmd.CombinedOutput() if err != nil { - metrics.SendErrorLogAndMetric(util.IpsmID, "Error: failed to save ipset to file with err %v, stderr: %v", err, string(errbytes)) + metrics.SendErrorLogAndMetric(util.IpsmID, "Error: failed to save ipset to file with err %v, stderr: %v", err, string(output)) return err } cmd.Wait() @@ -523,9 +523,10 @@ func (ipsMgr *IpsetManager) Restore(configFile string) error { } } - reply, err := ipsMgr.Exec.Command(util.Ipset, util.IpsetRestoreFlag, util.IpsetFileFlag, configFile).CombinedOutput() + cmd := ipsMgr.Exec.Command(util.Ipset, util.IpsetRestoreFlag, util.IpsetFileFlag, configFile) + output, err := cmd.CombinedOutput() if err != nil { - metrics.SendErrorLogAndMetric(util.IpsmID, "Error: failed to to restore ipset from file with err %v, stderr %v", err, string(reply)) + metrics.SendErrorLogAndMetric(util.IpsmID, "Error: failed to to restore ipset from file with err %v, stderr %v", err, string(output)) return err } @@ -540,20 +541,21 @@ func (ipsMgr *IpsetManager) DestroyNpmIpsets() error { cmdName := util.Ipset cmdArgs := util.IPsetCheckListFlag - reply, err := ipsMgr.Exec.Command(cmdName, cmdArgs).CombinedOutput() + cmd := ipsMgr.Exec.Command(cmdName, cmdArgs) + output, err := cmd.CombinedOutput() if err != nil { - metrics.SendErrorLogAndMetric(util.IpsmID, "{DestroyNpmIpsets} Error: There was an error running command: [%s] Stderr: [%v, %s]", cmdName, err, strings.TrimSuffix(string(reply), "\n")) + metrics.SendErrorLogAndMetric(util.IpsmID, "{DestroyNpmIpsets} Error: There was an error running command: [%s] Stderr: [%v, %s]", cmdName, err, strings.TrimSuffix(string(output), "\n")) return err } // todo: verify destroy reply response - if reply == nil { + if output == nil { metrics.SendErrorLogAndMetric(util.IpsmID, "{DestroyNpmIpsets} Received empty string from ipset list while destroying azure-npm ipsets") return nil } re := regexp.MustCompile("Name: (" + util.AzureNpmPrefix + "\\d+)") - ipsetRegexSlice := re.FindAllSubmatch(reply, -1) + ipsetRegexSlice := re.FindAllSubmatch(output, -1) if len(ipsetRegexSlice) == 0 { log.Logf("No Azure-NPM IPsets are found in the Node.") diff --git a/npm/ipsm/ipsm_test.go b/npm/ipsm/ipsm_test.go index 959428701d..4b9c0a1ec0 100644 --- a/npm/ipsm/ipsm_test.go +++ b/npm/ipsm/ipsm_test.go @@ -10,20 +10,20 @@ import ( "github.com/Azure/azure-container-networking/npm/metrics" "github.com/Azure/azure-container-networking/npm/metrics/promutil" "github.com/Azure/azure-container-networking/npm/util" - fakeexec "k8s.io/utils/exec/testing" + "k8s.io/utils/exec" ) func TestSave(t *testing.T) { - fexec := fakeexec.FakeExec{} - ipsMgr := NewIpsetManager(&fexec) + fexec := exec.New() + ipsMgr := NewIpsetManager(fexec) if err := ipsMgr.Save(util.IpsetTestConfigFile); err != nil { t.Errorf("TestSave failed @ ipsMgr.Save") } } func TestRestore(t *testing.T) { - fexec := fakeexec.FakeExec{} - ipsMgr := NewIpsetManager(&fexec) + fexec := exec.New() + ipsMgr := NewIpsetManager(fexec) if err := ipsMgr.Save(util.IpsetTestConfigFile); err != nil { t.Errorf("TestRestore failed @ ipsMgr.Save") } @@ -34,8 +34,8 @@ func TestRestore(t *testing.T) { } func TestCreateList(t *testing.T) { - fexec := fakeexec.FakeExec{} - ipsMgr := NewIpsetManager(&fexec) + fexec := exec.New() + ipsMgr := NewIpsetManager(fexec) if err := ipsMgr.Save(util.IpsetTestConfigFile); err != nil { t.Errorf("TestCreateList failed @ ipsMgr.Save") } @@ -52,8 +52,8 @@ func TestCreateList(t *testing.T) { } func TestDeleteList(t *testing.T) { - fexec := fakeexec.FakeExec{} - ipsMgr := NewIpsetManager(&fexec) + fexec := exec.New() + ipsMgr := NewIpsetManager(fexec) if err := ipsMgr.Save(util.IpsetTestConfigFile); err != nil { t.Errorf("TestDeleteList failed @ ipsMgr.Save") } @@ -74,8 +74,8 @@ func TestDeleteList(t *testing.T) { } func TestAddToList(t *testing.T) { - fexec := fakeexec.FakeExec{} - ipsMgr := NewIpsetManager(&fexec) + fexec := exec.New() + ipsMgr := NewIpsetManager(fexec) if err := ipsMgr.Save(util.IpsetTestConfigFile); err != nil { t.Errorf("TestAddToList failed @ ipsMgr.Save") } @@ -96,8 +96,8 @@ func TestAddToList(t *testing.T) { } func TestDeleteFromList(t *testing.T) { - fexec := fakeexec.FakeExec{} - ipsMgr := NewIpsetManager(&fexec) + fexec := exec.New() + ipsMgr := NewIpsetManager(fexec) if err := ipsMgr.Save(util.IpsetTestConfigFile); err != nil { t.Errorf("TestDeleteFromList failed @ ipsMgr.Save") } @@ -196,8 +196,8 @@ func TestDeleteFromList(t *testing.T) { func TestCreateSet(t *testing.T) { metrics.NumIPSetEntries.Set(0) - fexec := fakeexec.FakeExec{} - ipsMgr := NewIpsetManager(&fexec) + fexec := exec.New() + ipsMgr := NewIpsetManager(fexec) if err := ipsMgr.Save(util.IpsetTestConfigFile); err != nil { t.Errorf("TestCreateSet failed @ ipsMgr.Save") } @@ -251,8 +251,8 @@ func TestCreateSet(t *testing.T) { func TestDeleteSet(t *testing.T) { metrics.NumIPSetEntries.Set(0) - fexec := fakeexec.FakeExec{} - ipsMgr := NewIpsetManager(&fexec) + fexec := exec.New() + ipsMgr := NewIpsetManager(fexec) if err := ipsMgr.Save(util.IpsetTestConfigFile); err != nil { t.Errorf("TestDeleteSet failed @ ipsMgr.Save") } @@ -288,8 +288,8 @@ func TestDeleteSet(t *testing.T) { func TestAddToSet(t *testing.T) { metrics.NumIPSetEntries.Set(0) - fexec := fakeexec.FakeExec{} - ipsMgr := NewIpsetManager(&fexec) + fexec := exec.New() + ipsMgr := NewIpsetManager(fexec) if err := ipsMgr.Save(util.IpsetTestConfigFile); err != nil { t.Fatalf("TestAddToSet failed @ ipsMgr.Save") } @@ -338,8 +338,8 @@ func TestAddToSet(t *testing.T) { } func TestAddToSetWithCachePodInfo(t *testing.T) { - fexec := fakeexec.FakeExec{} - ipsMgr := NewIpsetManager(&fexec) + fexec := exec.New() + ipsMgr := NewIpsetManager(fexec) if err := ipsMgr.Save(util.IpsetTestConfigFile); err != nil { t.Errorf("TestAddToSetWithCachePodInfo failed @ ipsMgr.Save") } @@ -380,8 +380,8 @@ func TestAddToSetWithCachePodInfo(t *testing.T) { func TestDeleteFromSet(t *testing.T) { metrics.NumIPSetEntries.Set(0) - fexec := fakeexec.FakeExec{} - ipsMgr := NewIpsetManager(&fexec) + fexec := exec.New() + ipsMgr := NewIpsetManager(fexec) if err := ipsMgr.Save(util.IpsetTestConfigFile); err != nil { t.Errorf("TestDeleteFromSet failed @ ipsMgr.Save") } @@ -419,8 +419,8 @@ func TestDeleteFromSet(t *testing.T) { } func TestDeleteFromSetWithPodCache(t *testing.T) { - fexec := fakeexec.FakeExec{} - ipsMgr := NewIpsetManager(&fexec) + fexec := exec.New() + ipsMgr := NewIpsetManager(fexec) if err := ipsMgr.Save(util.IpsetTestConfigFile); err != nil { t.Errorf("TestDeleteFromSetWithPodCache failed @ ipsMgr.Save") } @@ -479,8 +479,8 @@ func TestDeleteFromSetWithPodCache(t *testing.T) { } func TestClean(t *testing.T) { - fexec := fakeexec.FakeExec{} - ipsMgr := NewIpsetManager(&fexec) + fexec := exec.New() + ipsMgr := NewIpsetManager(fexec) if err := ipsMgr.Save(util.IpsetTestConfigFile); err != nil { t.Errorf("TestClean failed @ ipsMgr.Save") } @@ -501,8 +501,8 @@ func TestClean(t *testing.T) { } func TestDestroy(t *testing.T) { - fexec := fakeexec.FakeExec{} - ipsMgr := NewIpsetManager(&fexec) + fexec := exec.New() + ipsMgr := NewIpsetManager(fexec) if err := ipsMgr.Save(util.IpsetTestConfigFile); err != nil { t.Errorf("TestDestroy failed @ ipsMgr.Save") } @@ -545,8 +545,8 @@ func TestDestroy(t *testing.T) { } func TestRun(t *testing.T) { - fexec := fakeexec.FakeExec{} - ipsMgr := NewIpsetManager(&fexec) + fexec := exec.New() + ipsMgr := NewIpsetManager(fexec) if err := ipsMgr.Save(util.IpsetTestConfigFile); err != nil { t.Errorf("TestRun failed @ ipsMgr.Save") } @@ -568,8 +568,8 @@ func TestRun(t *testing.T) { } func TestDestroyNpmIpsets(t *testing.T) { - fexec := fakeexec.FakeExec{} - ipsMgr := NewIpsetManager(&fexec) + fexec := exec.New() + ipsMgr := NewIpsetManager(fexec) err := ipsMgr.CreateSet("azure-npm-123456", []string{"nethash"}) if err != nil { @@ -835,8 +835,8 @@ func TestIPSetCannotBeAddedAsElementDoesNotExist(t *testing.T) { */ func TestMain(m *testing.M) { metrics.InitializeAll() - fexec := fakeexec.FakeExec{} - ipsMgr := NewIpsetManager(&fexec) + fexec := exec.New() + ipsMgr := NewIpsetManager(fexec) ipsMgr.Save(util.IpsetConfigFile) exitCode := m.Run() diff --git a/npm/nameSpaceController_test.go b/npm/nameSpaceController_test.go index d3a7bfe532..910ae1073e 100644 --- a/npm/nameSpaceController_test.go +++ b/npm/nameSpaceController_test.go @@ -18,6 +18,7 @@ import ( k8sfake "k8s.io/client-go/kubernetes/fake" core "k8s.io/client-go/testing" "k8s.io/client-go/tools/cache" + "k8s.io/utils/exec" utilexec "k8s.io/utils/exec" fakeexec "k8s.io/utils/exec/testing" ) @@ -154,8 +155,8 @@ func deleteNamespace(t *testing.T, f *nameSpaceFixture, nsObj *corev1.Namespace, } func TestNewNs(t *testing.T) { - fexec := fakeexec.FakeExec{} - if _, err := newNs("test", &fexec); err != nil { + fexec := exec.New() + if _, err := newNs("test", fexec); err != nil { t.Errorf("TestnewNs failed @ newNs") } } @@ -221,8 +222,8 @@ func TestAddNamespace(t *testing.T) { } func TestUpdateNamespace(t *testing.T) { - fexec := fakeexec.FakeExec{} - f := newNsFixture(t, &fexec) + fexec := exec.New() + f := newNsFixture(t, fexec) f.ipSetSave(util.IpsetTestConfigFile) defer f.ipSetRestore(util.IpsetTestConfigFile) @@ -267,8 +268,8 @@ func TestUpdateNamespace(t *testing.T) { } func TestAddNamespaceLabel(t *testing.T) { - fexec := fakeexec.FakeExec{} - f := newNsFixture(t, &fexec) + fexec := exec.New() + f := newNsFixture(t, fexec) f.ipSetSave(util.IpsetTestConfigFile) defer f.ipSetRestore(util.IpsetTestConfigFile) @@ -313,8 +314,8 @@ func TestAddNamespaceLabel(t *testing.T) { } func TestAddNamespaceLabelSameRv(t *testing.T) { - fexec := fakeexec.FakeExec{} - f := newNsFixture(t, &fexec) + fexec := exec.New() + f := newNsFixture(t, fexec) f.ipSetSave(util.IpsetTestConfigFile) defer f.ipSetRestore(util.IpsetTestConfigFile) @@ -360,8 +361,8 @@ func TestAddNamespaceLabelSameRv(t *testing.T) { } func TestDeleteandUpdateNamespaceLabel(t *testing.T) { - fexec := fakeexec.FakeExec{} - f := newNsFixture(t, &fexec) + fexec := exec.New() + f := newNsFixture(t, fexec) f.ipSetSave(util.IpsetTestConfigFile) defer f.ipSetRestore(util.IpsetTestConfigFile) @@ -412,8 +413,8 @@ func TestDeleteandUpdateNamespaceLabel(t *testing.T) { // this happens when NSA delete event is missed and deleted from NPMLocalCache, // but NSA gets added again. This will result in an update event with old and new with different UUIDs func TestNewNameSpaceUpdate(t *testing.T) { - fexec := fakeexec.FakeExec{} - f := newNsFixture(t, &fexec) + fexec := exec.New() + f := newNsFixture(t, fexec) f.ipSetSave(util.IpsetTestConfigFile) defer f.ipSetRestore(util.IpsetTestConfigFile) @@ -463,8 +464,8 @@ func TestNewNameSpaceUpdate(t *testing.T) { } func TestDeleteNamespace(t *testing.T) { - fexec := fakeexec.FakeExec{} - f := newNsFixture(t, &fexec) + fexec := exec.New() + f := newNsFixture(t, fexec) f.ipSetSave(util.IpsetTestConfigFile) defer f.ipSetRestore(util.IpsetTestConfigFile) @@ -494,8 +495,8 @@ func TestDeleteNamespace(t *testing.T) { } func TestDeleteNamespaceWithTombstone(t *testing.T) { - fexec := fakeexec.FakeExec{} - f := newNsFixture(t, &fexec) + fexec := exec.New() + f := newNsFixture(t, fexec) f.ipSetSave(util.IpsetTestConfigFile) defer f.ipSetRestore(util.IpsetTestConfigFile) stopCh := make(chan struct{}) @@ -530,8 +531,8 @@ func TestDeleteNamespaceWithTombstoneAfterAddingNameSpace(t *testing.T) { "app": "test-namespace", }, ) - fexec := fakeexec.FakeExec{} - f := newNsFixture(t, &fexec) + fexec := exec.New() + f := newNsFixture(t, fexec) f.nsLister = append(f.nsLister, nsObj) f.kubeobjects = append(f.kubeobjects, nsObj) stopCh := make(chan struct{}) @@ -546,8 +547,8 @@ func TestDeleteNamespaceWithTombstoneAfterAddingNameSpace(t *testing.T) { } func TestGetNamespaceObjFromNsObj(t *testing.T) { - fexec := fakeexec.FakeExec{} - ns, _ := newNs("test-ns", &fexec) + fexec := exec.New() + ns, _ := newNs("test-ns", fexec) ns.LabelsMap = map[string]string{ "test": "new", } diff --git a/npm/networkPolicyController_test.go b/npm/networkPolicyController_test.go index 091d5ca12b..7544fce48b 100644 --- a/npm/networkPolicyController_test.go +++ b/npm/networkPolicyController_test.go @@ -21,8 +21,8 @@ import ( k8sfake "k8s.io/client-go/kubernetes/fake" core "k8s.io/client-go/testing" "k8s.io/client-go/tools/cache" + "k8s.io/utils/exec" utilexec "k8s.io/utils/exec" - fakeexec "k8s.io/utils/exec/testing" ) type netPolFixture struct { @@ -264,7 +264,7 @@ func checkNetPolTestResult(testName string, f *netPolFixture, testCases []expect } func TestAddMultipleNetworkPolicies(t *testing.T) { - fexec := fakeexec.FakeExec{} + fexec := exec.New() netPolObj1 := createNetPol() // deep copy netPolObj1 and change namespace, name, and porttype (to namedPort) since current createNetPol is not flexble. @@ -274,7 +274,7 @@ func TestAddMultipleNetworkPolicies(t *testing.T) { // namedPort netPolObj2.Spec.Ingress[0].Ports[0].Port = &intstr.IntOrString{StrVal: fmt.Sprintf("%s", netPolObj2.Name)} - f := newNetPolFixture(t, &fexec) + f := newNetPolFixture(t, fexec) f.netPolLister = append(f.netPolLister, netPolObj1, netPolObj2) f.kubeobjects = append(f.kubeobjects, netPolObj1, netPolObj2) stopCh := make(chan struct{}) @@ -292,8 +292,8 @@ func TestAddMultipleNetworkPolicies(t *testing.T) { func TestAddNetworkPolicy(t *testing.T) { netPolObj := createNetPol() - fexec := fakeexec.FakeExec{} - f := newNetPolFixture(t, &fexec) + fexec := exec.New() + f := newNetPolFixture(t, fexec) f.netPolLister = append(f.netPolLister, netPolObj) f.kubeobjects = append(f.kubeobjects, netPolObj) stopCh := make(chan struct{}) @@ -310,8 +310,8 @@ func TestAddNetworkPolicy(t *testing.T) { func TestDeleteNetworkPolicy(t *testing.T) { netPolObj := createNetPol() - fexec := fakeexec.FakeExec{} - f := newNetPolFixture(t, &fexec) + fexec := exec.New() + f := newNetPolFixture(t, fexec) f.netPolLister = append(f.netPolLister, netPolObj) f.kubeobjects = append(f.kubeobjects, netPolObj) stopCh := make(chan struct{}) @@ -327,8 +327,8 @@ func TestDeleteNetworkPolicy(t *testing.T) { func TestDeleteNetworkPolicyWithTombstone(t *testing.T) { netPolObj := createNetPol() - fexec := fakeexec.FakeExec{} - f := newNetPolFixture(t, &fexec) + fexec := exec.New() + f := newNetPolFixture(t, fexec) f.isEnqueueEventIntoWorkQueue = false f.netPolLister = append(f.netPolLister, netPolObj) f.kubeobjects = append(f.kubeobjects, netPolObj) @@ -352,8 +352,8 @@ func TestDeleteNetworkPolicyWithTombstone(t *testing.T) { func TestDeleteNetworkPolicyWithTombstoneAfterAddingNetworkPolicy(t *testing.T) { netPolObj := createNetPol() - fexec := fakeexec.FakeExec{} - f := newNetPolFixture(t, &fexec) + fexec := exec.New() + f := newNetPolFixture(t, fexec) f.netPolLister = append(f.netPolLister, netPolObj) f.kubeobjects = append(f.kubeobjects, netPolObj) stopCh := make(chan struct{}) @@ -371,8 +371,8 @@ func TestDeleteNetworkPolicyWithTombstoneAfterAddingNetworkPolicy(t *testing.T) // Check it with expectedEnqueueEventIntoWorkQueue variable. func TestUpdateNetworkPolicy(t *testing.T) { oldNetPolObj := createNetPol() - fexec := fakeexec.FakeExec{} - f := newNetPolFixture(t, &fexec) + fexec := exec.New() + f := newNetPolFixture(t, fexec) f.netPolLister = append(f.netPolLister, oldNetPolObj) f.kubeobjects = append(f.kubeobjects, oldNetPolObj) stopCh := make(chan struct{}) @@ -393,8 +393,8 @@ func TestUpdateNetworkPolicy(t *testing.T) { func TestLabelUpdateNetworkPolicy(t *testing.T) { oldNetPolObj := createNetPol() - fexec := fakeexec.FakeExec{} - f := newNetPolFixture(t, &fexec) + fexec := exec.New() + f := newNetPolFixture(t, fexec) f.netPolLister = append(f.netPolLister, oldNetPolObj) f.kubeobjects = append(f.kubeobjects, oldNetPolObj) stopCh := make(chan struct{}) diff --git a/npm/npm_test.go b/npm/npm_test.go index dcb7ef8595..c4c54d050c 100644 --- a/npm/npm_test.go +++ b/npm/npm_test.go @@ -52,27 +52,22 @@ func TestMain(m *testing.M) { iptMgr := iptm.NewIptablesManager() iptMgr.Save(util.IptablesConfigFile) - // calls we're planning on making - calls := [][]string{ - {"ipset", "save", "-file", "/var/log/ipset.conf"}, - {"ipset", "restore", "-file", "/var/log/ipset.conf"}, + var calls = []struct { + cmd []string + err error + }{ + {cmd: []string{"ipset", "save", "-file", "/var/log/ipset.conf"}, err: nil}, + {cmd: []string{"ipset", "restore", "-file", "/var/log/ipset.conf"}, err: nil}, } - // errors we're planning on getting - fcmd := fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeAction{ - func() ([]byte, []byte, error) { return nil, nil, nil }, - func() ([]byte, []byte, error) { return nil, nil, nil }, - }, - } + fcmd := fakeexec.FakeCmd{CombinedOutputScript: []fakeexec.FakeAction{}} + fexec := fakeexec.FakeExec{CommandScript: []fakeexec.FakeCommandAction{}} - fexec := fakeexec.FakeExec{ - CommandScript: []fakeexec.FakeCommandAction{ - func(cmd string, args ...string) utilexec.Cmd { return fakeexec.InitFakeCmd(&fcmd, cmd, args...) }, - func(cmd string, args ...string) utilexec.Cmd { return fakeexec.InitFakeCmd(&fcmd, cmd, args...) }, - }, + // expect happy path, each call returns no errors + for _, call := range calls { + fcmd.CombinedOutputScript = append(fcmd.CombinedOutputScript, func() ([]byte, []byte, error) { return nil, nil, call.err }) + fexec.CommandScript = append(fexec.CommandScript, func(cmd string, args ...string) utilexec.Cmd { return fakeexec.InitFakeCmd(&fcmd, cmd, args...) }) } - ipsMgr := ipsm.NewIpsetManager(&fexec) ipsMgr.Save(util.IpsetConfigFile) From 570c9cc54e997c6c5913ac301acf9e39ae1a8f22 Mon Sep 17 00:00:00 2001 From: Mathew Merrick Date: Thu, 29 Apr 2021 10:44:11 -0700 Subject: [PATCH 04/19] test fix --- npm/ipsm/ipsm_test.go | 21 +++++++++++++++++++-- npm/podController_test.go | 8 ++++---- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/npm/ipsm/ipsm_test.go b/npm/ipsm/ipsm_test.go index 4b9c0a1ec0..a90dead601 100644 --- a/npm/ipsm/ipsm_test.go +++ b/npm/ipsm/ipsm_test.go @@ -11,6 +11,7 @@ import ( "github.com/Azure/azure-container-networking/npm/metrics/promutil" "github.com/Azure/azure-container-networking/npm/util" "k8s.io/utils/exec" + fakeexec "k8s.io/utils/exec/testing" ) func TestSave(t *testing.T) { @@ -22,8 +23,24 @@ func TestSave(t *testing.T) { } func TestRestore(t *testing.T) { - fexec := exec.New() - ipsMgr := NewIpsetManager(fexec) + var calls = []struct { + cmd []string + err error + }{ + {cmd: []string{"ipset", "save"}, err: nil}, + {cmd: []string{"ipset", "restore"}, err: nil}, + } + + fcmd := fakeexec.FakeCmd{CombinedOutputScript: []fakeexec.FakeAction{}} + fexec := fakeexec.FakeExec{CommandScript: []fakeexec.FakeCommandAction{}} + + // expect happy path, each call returns no errors + for _, call := range calls { + fcmd.CombinedOutputScript = append(fcmd.CombinedOutputScript, func() ([]byte, []byte, error) { return nil, nil, call.err }) + fexec.CommandScript = append(fexec.CommandScript, func(cmd string, args ...string) exec.Cmd { return fakeexec.InitFakeCmd(&fcmd, cmd, args...) }) + } + + ipsMgr := NewIpsetManager(&fexec) if err := ipsMgr.Save(util.IpsetTestConfigFile); err != nil { t.Errorf("TestRestore failed @ ipsMgr.Save") } diff --git a/npm/podController_test.go b/npm/podController_test.go index 84bb9f3c0b..d66e76a7ee 100644 --- a/npm/podController_test.go +++ b/npm/podController_test.go @@ -227,13 +227,13 @@ func TestAddMultiplePods(t *testing.T) { {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("app"), "1.2.3.4"}, err: nil}, {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("app:test-pod"), "nethash"}, err: nil}, {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("app:test-pod"), "1.2.3.4"}, err: nil}, - {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("namedport:app:test-pod"), "hash:ip,port"}, err: nil}, - {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("namedport:app:test-pod"), "1.2.3.4,8080"}, err: nil}, + {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("namedport:app:test-pod-1"), "hash:ip,port"}, err: nil}, + {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("namedport:app:test-pod-1"), "1.2.3.4,8080"}, err: nil}, {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("ns-test-namespace"), "1.2.3.5"}, err: nil}, {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("app"), "1.2.3.5"}, err: nil}, {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("app:test-pod"), "1.2.3.5"}, err: nil}, - {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("namedport:app:test-pod"), "hash:ip,port"}, err: nil}, - {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("namedport:app:test-pod"), "1.2.3.5,8080"}, err: nil}, + {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("namedport:app:test-pod-2"), "hash:ip,port"}, err: nil}, + {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("namedport:app:test-pod-2"), "1.2.3.5,8080"}, err: nil}, } fcmd := fakeexec.FakeCmd{CombinedOutputScript: []fakeexec.FakeAction{}} From 04070b91419310567f0749ff03e60a8e77cb2b76 Mon Sep 17 00:00:00 2001 From: Mathew Merrick Date: Thu, 29 Apr 2021 10:55:21 -0700 Subject: [PATCH 05/19] test fixes --- npm/ipsm/ipsm_test.go | 40 +++++++++++++++++++++++++++++----------- 1 file changed, 29 insertions(+), 11 deletions(-) diff --git a/npm/ipsm/ipsm_test.go b/npm/ipsm/ipsm_test.go index a90dead601..b326dfc5b2 100644 --- a/npm/ipsm/ipsm_test.go +++ b/npm/ipsm/ipsm_test.go @@ -10,6 +10,7 @@ import ( "github.com/Azure/azure-container-networking/npm/metrics" "github.com/Azure/azure-container-networking/npm/metrics/promutil" "github.com/Azure/azure-container-networking/npm/util" + "github.com/stretchr/testify/require" "k8s.io/utils/exec" fakeexec "k8s.io/utils/exec/testing" ) @@ -23,12 +24,13 @@ func TestSave(t *testing.T) { } func TestRestore(t *testing.T) { + require := require.New(t) var calls = []struct { cmd []string err error }{ - {cmd: []string{"ipset", "save"}, err: nil}, - {cmd: []string{"ipset", "restore"}, err: nil}, + {cmd: []string{"ipset", "save", "-file", "/var/log/ipset-test.conf"}, err: nil}, + {cmd: []string{"ipset", "restore", "-file", "/var/log/ipset-test.conf"}, err: nil}, } fcmd := fakeexec.FakeCmd{CombinedOutputScript: []fakeexec.FakeAction{}} @@ -48,24 +50,40 @@ func TestRestore(t *testing.T) { if err := ipsMgr.Restore(util.IpsetTestConfigFile); err != nil { t.Errorf("TestRestore failed @ ipsMgr.Restore") } + + require.Equal(len(calls), len(fcmd.CombinedOutputLog)) + for i, call := range calls { + require.Equalf(call.cmd, fcmd.CombinedOutputLog[i], "Call [%d] doesn't match expected", i) + } } func TestCreateList(t *testing.T) { - fexec := exec.New() - ipsMgr := NewIpsetManager(fexec) - if err := ipsMgr.Save(util.IpsetTestConfigFile); err != nil { - t.Errorf("TestCreateList failed @ ipsMgr.Save") + require := require.New(t) + var calls = []struct { + cmd []string + err error + }{ + {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("test-list"), "setlist"}, err: nil}, } - defer func() { - if err := ipsMgr.Restore(util.IpsetTestConfigFile); err != nil { - t.Errorf("TestCreateList failed @ ipsMgr.Restore") - } - }() + fcmd := fakeexec.FakeCmd{CombinedOutputScript: []fakeexec.FakeAction{}} + fexec := fakeexec.FakeExec{CommandScript: []fakeexec.FakeCommandAction{}} + + // expect happy path, each call returns no errors + for _, call := range calls { + fcmd.CombinedOutputScript = append(fcmd.CombinedOutputScript, func() ([]byte, []byte, error) { return nil, nil, call.err }) + fexec.CommandScript = append(fexec.CommandScript, func(cmd string, args ...string) exec.Cmd { return fakeexec.InitFakeCmd(&fcmd, cmd, args...) }) + } + + ipsMgr := NewIpsetManager(&fexec) if err := ipsMgr.CreateList("test-list"); err != nil { t.Errorf("TestCreateList failed @ ipsMgr.CreateList") } + require.Equal(len(calls), len(fcmd.CombinedOutputLog)) + for i, call := range calls { + require.Equalf(call.cmd, fcmd.CombinedOutputLog[i], "Call [%d] doesn't match expected", i) + } } func TestDeleteList(t *testing.T) { From 31874ac34fa7d576dd5c8caa3bf1eba6d6dd634c Mon Sep 17 00:00:00 2001 From: Mathew Merrick Date: Thu, 29 Apr 2021 19:27:46 +0000 Subject: [PATCH 06/19] old test --- npm/ipsm/ipsm_test.go | 114 ++++++++++++------------------------------ 1 file changed, 31 insertions(+), 83 deletions(-) diff --git a/npm/ipsm/ipsm_test.go b/npm/ipsm/ipsm_test.go index b326dfc5b2..1814e52f22 100644 --- a/npm/ipsm/ipsm_test.go +++ b/npm/ipsm/ipsm_test.go @@ -10,39 +10,18 @@ import ( "github.com/Azure/azure-container-networking/npm/metrics" "github.com/Azure/azure-container-networking/npm/metrics/promutil" "github.com/Azure/azure-container-networking/npm/util" - "github.com/stretchr/testify/require" "k8s.io/utils/exec" - fakeexec "k8s.io/utils/exec/testing" ) func TestSave(t *testing.T) { - fexec := exec.New() - ipsMgr := NewIpsetManager(fexec) + ipsMgr := NewIpsetManager(exec.New()) if err := ipsMgr.Save(util.IpsetTestConfigFile); err != nil { t.Errorf("TestSave failed @ ipsMgr.Save") } } func TestRestore(t *testing.T) { - require := require.New(t) - var calls = []struct { - cmd []string - err error - }{ - {cmd: []string{"ipset", "save", "-file", "/var/log/ipset-test.conf"}, err: nil}, - {cmd: []string{"ipset", "restore", "-file", "/var/log/ipset-test.conf"}, err: nil}, - } - - fcmd := fakeexec.FakeCmd{CombinedOutputScript: []fakeexec.FakeAction{}} - fexec := fakeexec.FakeExec{CommandScript: []fakeexec.FakeCommandAction{}} - - // expect happy path, each call returns no errors - for _, call := range calls { - fcmd.CombinedOutputScript = append(fcmd.CombinedOutputScript, func() ([]byte, []byte, error) { return nil, nil, call.err }) - fexec.CommandScript = append(fexec.CommandScript, func(cmd string, args ...string) exec.Cmd { return fakeexec.InitFakeCmd(&fcmd, cmd, args...) }) - } - - ipsMgr := NewIpsetManager(&fexec) + ipsMgr := NewIpsetManager(exec.New()) if err := ipsMgr.Save(util.IpsetTestConfigFile); err != nil { t.Errorf("TestRestore failed @ ipsMgr.Save") } @@ -50,45 +29,27 @@ func TestRestore(t *testing.T) { if err := ipsMgr.Restore(util.IpsetTestConfigFile); err != nil { t.Errorf("TestRestore failed @ ipsMgr.Restore") } - - require.Equal(len(calls), len(fcmd.CombinedOutputLog)) - for i, call := range calls { - require.Equalf(call.cmd, fcmd.CombinedOutputLog[i], "Call [%d] doesn't match expected", i) - } } func TestCreateList(t *testing.T) { - require := require.New(t) - var calls = []struct { - cmd []string - err error - }{ - {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("test-list"), "setlist"}, err: nil}, - } - - fcmd := fakeexec.FakeCmd{CombinedOutputScript: []fakeexec.FakeAction{}} - fexec := fakeexec.FakeExec{CommandScript: []fakeexec.FakeCommandAction{}} - - // expect happy path, each call returns no errors - for _, call := range calls { - fcmd.CombinedOutputScript = append(fcmd.CombinedOutputScript, func() ([]byte, []byte, error) { return nil, nil, call.err }) - fexec.CommandScript = append(fexec.CommandScript, func(cmd string, args ...string) exec.Cmd { return fakeexec.InitFakeCmd(&fcmd, cmd, args...) }) + ipsMgr := NewIpsetManager(exec.New()) + if err := ipsMgr.Save(util.IpsetTestConfigFile); err != nil { + t.Errorf("TestCreateList failed @ ipsMgr.Save") } - ipsMgr := NewIpsetManager(&fexec) + defer func() { + if err := ipsMgr.Restore(util.IpsetTestConfigFile); err != nil { + t.Errorf("TestCreateList failed @ ipsMgr.Restore") + } + }() if err := ipsMgr.CreateList("test-list"); err != nil { t.Errorf("TestCreateList failed @ ipsMgr.CreateList") } - require.Equal(len(calls), len(fcmd.CombinedOutputLog)) - for i, call := range calls { - require.Equalf(call.cmd, fcmd.CombinedOutputLog[i], "Call [%d] doesn't match expected", i) - } } func TestDeleteList(t *testing.T) { - fexec := exec.New() - ipsMgr := NewIpsetManager(fexec) + ipsMgr := NewIpsetManager(exec.New()) if err := ipsMgr.Save(util.IpsetTestConfigFile); err != nil { t.Errorf("TestDeleteList failed @ ipsMgr.Save") } @@ -109,8 +70,7 @@ func TestDeleteList(t *testing.T) { } func TestAddToList(t *testing.T) { - fexec := exec.New() - ipsMgr := NewIpsetManager(fexec) + ipsMgr := NewIpsetManager(exec.New()) if err := ipsMgr.Save(util.IpsetTestConfigFile); err != nil { t.Errorf("TestAddToList failed @ ipsMgr.Save") } @@ -131,8 +91,7 @@ func TestAddToList(t *testing.T) { } func TestDeleteFromList(t *testing.T) { - fexec := exec.New() - ipsMgr := NewIpsetManager(fexec) + ipsMgr := NewIpsetManager(exec.New()) if err := ipsMgr.Save(util.IpsetTestConfigFile); err != nil { t.Errorf("TestDeleteFromList failed @ ipsMgr.Save") } @@ -231,8 +190,7 @@ func TestDeleteFromList(t *testing.T) { func TestCreateSet(t *testing.T) { metrics.NumIPSetEntries.Set(0) - fexec := exec.New() - ipsMgr := NewIpsetManager(fexec) + ipsMgr := NewIpsetManager(exec.New()) if err := ipsMgr.Save(util.IpsetTestConfigFile); err != nil { t.Errorf("TestCreateSet failed @ ipsMgr.Save") } @@ -286,8 +244,7 @@ func TestCreateSet(t *testing.T) { func TestDeleteSet(t *testing.T) { metrics.NumIPSetEntries.Set(0) - fexec := exec.New() - ipsMgr := NewIpsetManager(fexec) + ipsMgr := NewIpsetManager(exec.New()) if err := ipsMgr.Save(util.IpsetTestConfigFile); err != nil { t.Errorf("TestDeleteSet failed @ ipsMgr.Save") } @@ -323,8 +280,7 @@ func TestDeleteSet(t *testing.T) { func TestAddToSet(t *testing.T) { metrics.NumIPSetEntries.Set(0) - fexec := exec.New() - ipsMgr := NewIpsetManager(fexec) + ipsMgr := NewIpsetManager(exec.New()) if err := ipsMgr.Save(util.IpsetTestConfigFile); err != nil { t.Fatalf("TestAddToSet failed @ ipsMgr.Save") } @@ -373,8 +329,7 @@ func TestAddToSet(t *testing.T) { } func TestAddToSetWithCachePodInfo(t *testing.T) { - fexec := exec.New() - ipsMgr := NewIpsetManager(fexec) + ipsMgr := NewIpsetManager(exec.New()) if err := ipsMgr.Save(util.IpsetTestConfigFile); err != nil { t.Errorf("TestAddToSetWithCachePodInfo failed @ ipsMgr.Save") } @@ -415,8 +370,7 @@ func TestAddToSetWithCachePodInfo(t *testing.T) { func TestDeleteFromSet(t *testing.T) { metrics.NumIPSetEntries.Set(0) - fexec := exec.New() - ipsMgr := NewIpsetManager(fexec) + ipsMgr := NewIpsetManager(exec.New()) if err := ipsMgr.Save(util.IpsetTestConfigFile); err != nil { t.Errorf("TestDeleteFromSet failed @ ipsMgr.Save") } @@ -454,8 +408,7 @@ func TestDeleteFromSet(t *testing.T) { } func TestDeleteFromSetWithPodCache(t *testing.T) { - fexec := exec.New() - ipsMgr := NewIpsetManager(fexec) + ipsMgr := NewIpsetManager(exec.New()) if err := ipsMgr.Save(util.IpsetTestConfigFile); err != nil { t.Errorf("TestDeleteFromSetWithPodCache failed @ ipsMgr.Save") } @@ -514,8 +467,7 @@ func TestDeleteFromSetWithPodCache(t *testing.T) { } func TestClean(t *testing.T) { - fexec := exec.New() - ipsMgr := NewIpsetManager(fexec) + ipsMgr := NewIpsetManager(exec.New()) if err := ipsMgr.Save(util.IpsetTestConfigFile); err != nil { t.Errorf("TestClean failed @ ipsMgr.Save") } @@ -536,8 +488,7 @@ func TestClean(t *testing.T) { } func TestDestroy(t *testing.T) { - fexec := exec.New() - ipsMgr := NewIpsetManager(fexec) + ipsMgr := NewIpsetManager(exec.New()) if err := ipsMgr.Save(util.IpsetTestConfigFile); err != nil { t.Errorf("TestDestroy failed @ ipsMgr.Save") } @@ -580,8 +531,7 @@ func TestDestroy(t *testing.T) { } func TestRun(t *testing.T) { - fexec := exec.New() - ipsMgr := NewIpsetManager(fexec) + ipsMgr := NewIpsetManager(exec.New()) if err := ipsMgr.Save(util.IpsetTestConfigFile); err != nil { t.Errorf("TestRun failed @ ipsMgr.Save") } @@ -603,8 +553,7 @@ func TestRun(t *testing.T) { } func TestDestroyNpmIpsets(t *testing.T) { - fexec := exec.New() - ipsMgr := NewIpsetManager(fexec) + ipsMgr := NewIpsetManager(exec.New()) err := ipsMgr.CreateSet("azure-npm-123456", []string{"nethash"}) if err != nil { @@ -641,7 +590,7 @@ func GetIPSetName() string { // "Set cannot be destroyed: it is in use by a kernel component" func TestSetCannotBeDestroyed(t *testing.T) { - ipsMgr := NewIpsetManager() + ipsMgr := NewIpsetManager(exec.New()) if err := ipsMgr.Save(util.IpsetTestConfigFile); err != nil { t.Errorf("TestAddToList failed @ ipsMgr.Save") } @@ -676,7 +625,7 @@ func TestSetCannotBeDestroyed(t *testing.T) { } func TestElemSeparatorSupportsNone(t *testing.T) { - ipsMgr := NewIpsetManager() + ipsMgr := NewIpsetManager(exec.New()) if err := ipsMgr.Save(util.IpsetTestConfigFile); err != nil { t.Errorf("TestAddToList failed @ ipsMgr.Save") } @@ -705,7 +654,7 @@ func TestElemSeparatorSupportsNone(t *testing.T) { } func TestIPSetWithGivenNameDoesNotExist(t *testing.T) { - ipsMgr := NewIpsetManager() + ipsMgr := NewIpsetManager(exec.New()) if err := ipsMgr.Save(util.IpsetTestConfigFile); err != nil { t.Errorf("TestAddToList failed @ ipsMgr.Save with err %+v", err) } @@ -732,7 +681,7 @@ func TestIPSetWithGivenNameDoesNotExist(t *testing.T) { } func TestIPSetWithGivenNameAlreadyExists(t *testing.T) { - ipsMgr := NewIpsetManager() + ipsMgr := NewIpsetManager(exec.New()) if err := ipsMgr.Save(util.IpsetTestConfigFile); err != nil { t.Errorf("TestAddToList failed @ ipsMgr.Save with err %+v", err) } @@ -771,7 +720,7 @@ func TestIPSetWithGivenNameAlreadyExists(t *testing.T) { } func TestIPSetSecondElementIsMissingWhenAddingIpWithNoPort(t *testing.T) { - ipsMgr := NewIpsetManager() + ipsMgr := NewIpsetManager(exec.New()) if err := ipsMgr.Save(util.IpsetTestConfigFile); err != nil { t.Errorf("TestAddToList failed @ ipsMgr.Save with err: %+v", err) } @@ -801,7 +750,7 @@ func TestIPSetSecondElementIsMissingWhenAddingIpWithNoPort(t *testing.T) { } func TestIPSetMissingSecondMandatoryArgument(t *testing.T) { - ipsMgr := NewIpsetManager() + ipsMgr := NewIpsetManager(exec.New()) if err := ipsMgr.Save(util.IpsetTestConfigFile); err != nil { t.Errorf("TestAddToList failed @ ipsMgr.Save") } @@ -831,7 +780,7 @@ func TestIPSetMissingSecondMandatoryArgument(t *testing.T) { } func TestIPSetCannotBeAddedAsElementDoesNotExist(t *testing.T) { - ipsMgr := NewIpsetManager() + ipsMgr := NewIpsetManager(exec.New()) if err := ipsMgr.Save(util.IpsetTestConfigFile); err != nil { t.Errorf("TestAddToList failed @ ipsMgr.Save") } @@ -870,8 +819,7 @@ func TestIPSetCannotBeAddedAsElementDoesNotExist(t *testing.T) { */ func TestMain(m *testing.M) { metrics.InitializeAll() - fexec := exec.New() - ipsMgr := NewIpsetManager(fexec) + ipsMgr := NewIpsetManager(exec.New()) ipsMgr.Save(util.IpsetConfigFile) exitCode := m.Run() From 85e8206dc12582d49dae69699d85fb60fc4cf19e Mon Sep 17 00:00:00 2001 From: Mathew Merrick Date: Thu, 29 Apr 2021 20:14:18 +0000 Subject: [PATCH 07/19] restore --- npm/ipsm/ipsm_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/npm/ipsm/ipsm_test.go b/npm/ipsm/ipsm_test.go index 1814e52f22..0b6808e9f0 100644 --- a/npm/ipsm/ipsm_test.go +++ b/npm/ipsm/ipsm_test.go @@ -20,6 +20,7 @@ func TestSave(t *testing.T) { } } +/* func TestRestore(t *testing.T) { ipsMgr := NewIpsetManager(exec.New()) if err := ipsMgr.Save(util.IpsetTestConfigFile); err != nil { @@ -30,6 +31,7 @@ func TestRestore(t *testing.T) { t.Errorf("TestRestore failed @ ipsMgr.Restore") } } +*/ func TestCreateList(t *testing.T) { ipsMgr := NewIpsetManager(exec.New()) From fd47ea55b5f9906b4ddfce15334b7c8f1fef948e Mon Sep 17 00:00:00 2001 From: Mathew Merrick Date: Thu, 29 Apr 2021 21:15:31 +0000 Subject: [PATCH 08/19] fix delete tests --- npm/ipsm/ipsm_test.go | 33 ++++++++++++++------ npm/nameSpaceController_test.go | 47 +++++------------------------ npm/networkPolicyController_test.go | 14 ++++++--- npm/npm_test.go | 33 ++------------------ npm/podController_test.go | 1 + 5 files changed, 43 insertions(+), 85 deletions(-) diff --git a/npm/ipsm/ipsm_test.go b/npm/ipsm/ipsm_test.go index 0b6808e9f0..66d070ad1e 100644 --- a/npm/ipsm/ipsm_test.go +++ b/npm/ipsm/ipsm_test.go @@ -4,6 +4,7 @@ package ipsm import ( "fmt" + "log" "os" "testing" @@ -23,12 +24,16 @@ func TestSave(t *testing.T) { /* func TestRestore(t *testing.T) { ipsMgr := NewIpsetManager(exec.New()) + + if err != nil { + t.Error(err) + } if err := ipsMgr.Save(util.IpsetTestConfigFile); err != nil { - t.Errorf("TestRestore failed @ ipsMgr.Save") + t.Errorf("TestRestore failed @ ipsMgr.Save with err %v", err) } if err := ipsMgr.Restore(util.IpsetTestConfigFile); err != nil { - t.Errorf("TestRestore failed @ ipsMgr.Restore") + t.Errorf("TestRestore failed @ ipsMgr.Restore with err %v", err) } } */ @@ -104,6 +109,11 @@ func TestDeleteFromList(t *testing.T) { } }() + listName := "test-list" + if err := ipsMgr.CreateList(listName); err != nil { + t.Errorf("TestDeleteFromList failed @ ipsMgr.CreateSet") + } + // Create set and validate set is created. setName := "test-set" if err := ipsMgr.CreateSet(setName, append([]string{util.IpsetNetHashFlag})); err != nil { @@ -120,7 +130,7 @@ func TestDeleteFromList(t *testing.T) { } // Create list, add set to list and validate set is in the list. - listName := "test-list" + if err := ipsMgr.AddToList(listName, setName); err != nil { t.Errorf("TestDeleteFromList failed @ ipsMgr.AddToList") } @@ -156,13 +166,13 @@ func TestDeleteFromList(t *testing.T) { spec: append([]string{util.GetHashedName(setName)}), } - if _, err := ipsMgr.Run(entry); err == nil { + if _, err := ipsMgr.Run(entry); err != nil { t.Errorf("TestDeleteFromList failed @ ipsMgr.DeleteFromList since %s still exist in %s set", listName, setName) } // Delete List and validate list is not exist. - if err := ipsMgr.DeleteSet(listName); err != nil { + if err := ipsMgr.DeleteList(listName); err != nil { t.Errorf("TestDeleteSet failed @ ipsMgr.DeleteSet") } @@ -171,7 +181,7 @@ func TestDeleteFromList(t *testing.T) { set: util.GetHashedName(listName), } - if _, err := ipsMgr.Run(entry); err == nil { + if _, err := ipsMgr.Run(entry); err != nil { t.Errorf("TestDeleteFromList failed @ ipsMgr.DeleteSet since %s still exist in kernel", listName) } @@ -185,7 +195,7 @@ func TestDeleteFromList(t *testing.T) { set: util.GetHashedName(setName), } - if _, err := ipsMgr.Run(entry); err == nil { + if _, err := ipsMgr.Run(entry); err != nil { t.Errorf("TestDeleteFromList failed @ ipsMgr.DeleteSet since %s still exist in kernel", setName) } } @@ -515,7 +525,7 @@ func TestDestroy(t *testing.T) { set: util.GetHashedName(setName), } - if _, err := ipsMgr.Run(entry); err == nil { + if _, err := ipsMgr.Run(entry); err != nil { t.Errorf("TestDestroy failed @ ipsMgr.Destroy since %s still exist in kernel with err %+v", setName, err) } } else { @@ -526,7 +536,7 @@ func TestDestroy(t *testing.T) { spec: append([]string{testIP}), } - if _, err := ipsMgr.Run(entry); err == nil { + if _, err := ipsMgr.Run(entry); err != nil { t.Errorf("TestDestroy failed @ ipsMgr.Destroy since %s still exist in ipset with err %+v", testIP, err) } } @@ -822,7 +832,10 @@ func TestIPSetCannotBeAddedAsElementDoesNotExist(t *testing.T) { func TestMain(m *testing.M) { metrics.InitializeAll() ipsMgr := NewIpsetManager(exec.New()) - ipsMgr.Save(util.IpsetConfigFile) + if err := ipsMgr.Destroy(); err != nil { + log.Fatalf("Failed to destroy with %v", err) + os.Exit(1) + } exitCode := m.Run() diff --git a/npm/nameSpaceController_test.go b/npm/nameSpaceController_test.go index 910ae1073e..d83897e98a 100644 --- a/npm/nameSpaceController_test.go +++ b/npm/nameSpaceController_test.go @@ -9,8 +9,8 @@ import ( "github.com/Azure/azure-container-networking/npm/ipsm" "github.com/Azure/azure-container-networking/npm/util" - "github.com/stretchr/testify/require" corev1 "k8s.io/api/core/v1" + "k8s.io/utils/exec" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" @@ -18,9 +18,6 @@ import ( k8sfake "k8s.io/client-go/kubernetes/fake" core "k8s.io/client-go/testing" "k8s.io/client-go/tools/cache" - "k8s.io/utils/exec" - utilexec "k8s.io/utils/exec" - fakeexec "k8s.io/utils/exec/testing" ) var ( @@ -52,13 +49,13 @@ type nameSpaceFixture struct { kubeInformer kubeinformers.SharedInformerFactory } -func newNsFixture(t *testing.T, exec utilexec.Interface) *nameSpaceFixture { +func newNsFixture(t *testing.T, utilexec exec.Interface) *nameSpaceFixture { f := &nameSpaceFixture{ t: t, nsLister: []*corev1.Namespace{}, kubeobjects: []runtime.Object{}, - npMgr: newNPMgr(t, exec), - ipsMgr: ipsm.NewIpsetManager(exec), + npMgr: newNPMgr(t, utilexec), + ipsMgr: ipsm.NewIpsetManager(utilexec), } return f } @@ -162,7 +159,10 @@ func TestNewNs(t *testing.T) { } func TestAddNamespace(t *testing.T) { - require := require.New(t) + fexec := exec.New() + f := newNsFixture(t, fexec) + f.ipSetSave(util.IpsetTestConfigFile) + defer f.ipSetRestore(util.IpsetTestConfigFile) nsObj := newNameSpace( "test-namespace", @@ -171,31 +171,6 @@ func TestAddNamespace(t *testing.T) { "app": "test-namespace", }, ) - - var calls = []struct { - cmd []string - err error - }{ - {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("ns-test-namespace"), "nethash"}, err: nil}, - {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("all-namespaces"), "setlist"}, err: nil}, - {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("all-namespaces"), util.GetHashedName("ns-test-namespace")}, err: nil}, - {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("ns-app"), "setlist"}, err: nil}, - {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("ns-app"), util.GetHashedName("ns-test-namespace")}, err: nil}, - {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("ns-app:test-namespace"), "setlist"}, err: nil}, - {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("ns-app:test-namespace"), util.GetHashedName("ns-test-namespace")}, err: nil}, - } - - fcmd := fakeexec.FakeCmd{CombinedOutputScript: []fakeexec.FakeAction{}} - fexec := fakeexec.FakeExec{CommandScript: []fakeexec.FakeCommandAction{}} - - // expect happy path, each call returns no errors - for _, call := range calls { - fcmd.CombinedOutputScript = append(fcmd.CombinedOutputScript, func() ([]byte, []byte, error) { return nil, nil, call.err }) - fexec.CommandScript = append(fexec.CommandScript, func(cmd string, args ...string) utilexec.Cmd { return fakeexec.InitFakeCmd(&fcmd, cmd, args...) }) - } - - f := newNsFixture(t, &fexec) - f.nsLister = append(f.nsLister, nsObj) f.kubeobjects = append(f.kubeobjects, nsObj) @@ -213,12 +188,6 @@ func TestAddNamespace(t *testing.T) { if _, exists := f.npMgr.NsMap[util.GetNSNameWithPrefix(nsObj.Name)]; !exists { t.Errorf("TestAddNamespace failed @ npMgr.nsMap check") } - - require.Equal(len(calls), len(fcmd.CombinedOutputLog)) - require.Equal(len(calls), len(fcmd.CombinedOutputLog)) - for i, call := range calls { - require.Equalf(call.cmd, fcmd.CombinedOutputLog[i], "Call [%d] doesn't match expected", i) - } } func TestUpdateNamespace(t *testing.T) { diff --git a/npm/networkPolicyController_test.go b/npm/networkPolicyController_test.go index 7544fce48b..e6f13b8a25 100644 --- a/npm/networkPolicyController_test.go +++ b/npm/networkPolicyController_test.go @@ -22,7 +22,6 @@ import ( core "k8s.io/client-go/testing" "k8s.io/client-go/tools/cache" "k8s.io/utils/exec" - utilexec "k8s.io/utils/exec" ) type netPolFixture struct { @@ -48,13 +47,13 @@ type netPolFixture struct { isEnqueueEventIntoWorkQueue bool } -func newNetPolFixture(t *testing.T, exec utilexec.Interface) *netPolFixture { +func newNetPolFixture(t *testing.T, utilexec exec.Interface) *netPolFixture { f := &netPolFixture{ t: t, netPolLister: []*networkingv1.NetworkPolicy{}, kubeobjects: []runtime.Object{}, - npMgr: newNPMgr(t, exec), - ipsMgr: ipsm.NewIpsetManager(exec), + npMgr: newNPMgr(t, utilexec), + ipsMgr: ipsm.NewIpsetManager(utilexec), iptMgr: iptm.NewIptablesManager(), isEnqueueEventIntoWorkQueue: true, } @@ -264,7 +263,6 @@ func checkNetPolTestResult(testName string, f *netPolFixture, testCases []expect } func TestAddMultipleNetworkPolicies(t *testing.T) { - fexec := exec.New() netPolObj1 := createNetPol() // deep copy netPolObj1 and change namespace, name, and porttype (to namedPort) since current createNetPol is not flexble. @@ -274,6 +272,7 @@ func TestAddMultipleNetworkPolicies(t *testing.T) { // namedPort netPolObj2.Spec.Ingress[0].Ports[0].Port = &intstr.IntOrString{StrVal: fmt.Sprintf("%s", netPolObj2.Name)} + fexec := exec.New() f := newNetPolFixture(t, fexec) f.netPolLister = append(f.netPolLister, netPolObj1, netPolObj2) f.kubeobjects = append(f.kubeobjects, netPolObj1, netPolObj2) @@ -292,6 +291,7 @@ func TestAddMultipleNetworkPolicies(t *testing.T) { func TestAddNetworkPolicy(t *testing.T) { netPolObj := createNetPol() + fexec := exec.New() f := newNetPolFixture(t, fexec) f.netPolLister = append(f.netPolLister, netPolObj) @@ -310,6 +310,7 @@ func TestAddNetworkPolicy(t *testing.T) { func TestDeleteNetworkPolicy(t *testing.T) { netPolObj := createNetPol() + fexec := exec.New() f := newNetPolFixture(t, fexec) f.netPolLister = append(f.netPolLister, netPolObj) @@ -327,6 +328,7 @@ func TestDeleteNetworkPolicy(t *testing.T) { func TestDeleteNetworkPolicyWithTombstone(t *testing.T) { netPolObj := createNetPol() + fexec := exec.New() f := newNetPolFixture(t, fexec) f.isEnqueueEventIntoWorkQueue = false @@ -371,6 +373,7 @@ func TestDeleteNetworkPolicyWithTombstoneAfterAddingNetworkPolicy(t *testing.T) // Check it with expectedEnqueueEventIntoWorkQueue variable. func TestUpdateNetworkPolicy(t *testing.T) { oldNetPolObj := createNetPol() + fexec := exec.New() f := newNetPolFixture(t, fexec) f.netPolLister = append(f.netPolLister, oldNetPolObj) @@ -393,6 +396,7 @@ func TestUpdateNetworkPolicy(t *testing.T) { func TestLabelUpdateNetworkPolicy(t *testing.T) { oldNetPolObj := createNetPol() + fexec := exec.New() f := newNetPolFixture(t, fexec) f.netPolLister = append(f.netPolLister, oldNetPolObj) diff --git a/npm/npm_test.go b/npm/npm_test.go index c4c54d050c..2a4847b9f2 100644 --- a/npm/npm_test.go +++ b/npm/npm_test.go @@ -1,9 +1,7 @@ package npm import ( - "log" "os" - "reflect" "testing" "github.com/Azure/azure-container-networking/npm/ipsm" @@ -11,8 +9,8 @@ import ( "github.com/Azure/azure-container-networking/npm/metrics" "github.com/Azure/azure-container-networking/npm/util" "k8s.io/client-go/tools/cache" + "k8s.io/utils/exec" utilexec "k8s.io/utils/exec" - fakeexec "k8s.io/utils/exec/testing" ) // To indicate the object is needed to be DeletedFinalStateUnknown Object @@ -47,28 +45,11 @@ func newNPMgr(t *testing.T, exec utilexec.Interface) *NetworkPolicyManager { } func TestMain(m *testing.M) { - metrics.InitializeAll() iptMgr := iptm.NewIptablesManager() iptMgr.Save(util.IptablesConfigFile) - var calls = []struct { - cmd []string - err error - }{ - {cmd: []string{"ipset", "save", "-file", "/var/log/ipset.conf"}, err: nil}, - {cmd: []string{"ipset", "restore", "-file", "/var/log/ipset.conf"}, err: nil}, - } - - fcmd := fakeexec.FakeCmd{CombinedOutputScript: []fakeexec.FakeAction{}} - fexec := fakeexec.FakeExec{CommandScript: []fakeexec.FakeCommandAction{}} - - // expect happy path, each call returns no errors - for _, call := range calls { - fcmd.CombinedOutputScript = append(fcmd.CombinedOutputScript, func() ([]byte, []byte, error) { return nil, nil, call.err }) - fexec.CommandScript = append(fexec.CommandScript, func(cmd string, args ...string) utilexec.Cmd { return fakeexec.InitFakeCmd(&fcmd, cmd, args...) }) - } - ipsMgr := ipsm.NewIpsetManager(&fexec) + ipsMgr := ipsm.NewIpsetManager(exec.New()) ipsMgr.Save(util.IpsetConfigFile) exitCode := m.Run() @@ -76,15 +57,5 @@ func TestMain(m *testing.M) { iptMgr.Restore(util.IptablesConfigFile) ipsMgr.Restore(util.IpsetConfigFile) - if fcmd.CombinedOutputCalls != len(calls) { - log.Fatalf("Mismatched calls, expected %v, actual %v", len(calls), fcmd.CombinedOutputCalls) - } - - for i, call := range calls { - if !reflect.DeepEqual(call, fcmd.CombinedOutputLog[i]) { - log.Fatalf("Mismatched call, expected %v, actual %v", call, fcmd.CombinedOutputLog[i]) - } - } - os.Exit(exitCode) } diff --git a/npm/podController_test.go b/npm/podController_test.go index d66e76a7ee..960d3565ed 100644 --- a/npm/podController_test.go +++ b/npm/podController_test.go @@ -417,6 +417,7 @@ func TestDeletePod(t *testing.T) { testCases := []expectedValues{ {0, 2, 0}, } + checkPodTestResult("TestDeletePod", f, testCases) if _, exists := f.npMgr.PodMap[podKey]; exists { t.Error("TestDeletePod failed @ cached pod obj exists check") From d6d0c8ad833dc8c2ea45725dee4ca0400a53c591 Mon Sep 17 00:00:00 2001 From: Mathew Merrick Date: Fri, 30 Apr 2021 21:57:01 +0000 Subject: [PATCH 09/19] restore --- npm/ipsm/ipsm.go | 1 + npm/ipsm/ipsm_test.go | 7 ------- npm/npm.go | 2 -- 3 files changed, 1 insertion(+), 9 deletions(-) diff --git a/npm/ipsm/ipsm.go b/npm/ipsm/ipsm.go index 208dc323ad..b84750e6b4 100644 --- a/npm/ipsm/ipsm.go +++ b/npm/ipsm/ipsm.go @@ -483,6 +483,7 @@ func (ipsMgr *IpsetManager) Run(entry *ipsEntry) (int, error) { output, err := cmd.CombinedOutput() if err != nil { metrics.SendErrorLogAndMetric(util.IpsmID, "Error: There was an error running command: [%s %v] Stderr: [%v, %s]", cmdName, strings.Join(cmdArgs, " "), err, strings.TrimSuffix(string(output), "\n")) + return 1, nil } return 0, nil diff --git a/npm/ipsm/ipsm_test.go b/npm/ipsm/ipsm_test.go index 66d070ad1e..5588515893 100644 --- a/npm/ipsm/ipsm_test.go +++ b/npm/ipsm/ipsm_test.go @@ -21,13 +21,9 @@ func TestSave(t *testing.T) { } } -/* func TestRestore(t *testing.T) { ipsMgr := NewIpsetManager(exec.New()) - if err != nil { - t.Error(err) - } if err := ipsMgr.Save(util.IpsetTestConfigFile); err != nil { t.Errorf("TestRestore failed @ ipsMgr.Save with err %v", err) } @@ -36,7 +32,6 @@ func TestRestore(t *testing.T) { t.Errorf("TestRestore failed @ ipsMgr.Restore with err %v", err) } } -*/ func TestCreateList(t *testing.T) { ipsMgr := NewIpsetManager(exec.New()) @@ -839,7 +834,5 @@ func TestMain(m *testing.M) { exitCode := m.Run() - ipsMgr.Restore(util.IpsetConfigFile) - os.Exit(exitCode) } diff --git a/npm/npm.go b/npm/npm.go index 99ed6138c9..4b804fd9ee 100644 --- a/npm/npm.go +++ b/npm/npm.go @@ -11,7 +11,6 @@ import ( "github.com/Azure/azure-container-networking/aitelemetry" "github.com/Azure/azure-container-networking/log" - "github.com/Azure/azure-container-networking/npm/ipsm" "github.com/Azure/azure-container-networking/npm/iptm" "github.com/Azure/azure-container-networking/npm/metrics" "github.com/Azure/azure-container-networking/npm/util" @@ -208,7 +207,6 @@ func NewNetworkPolicyManager(clientset *kubernetes.Clientset, informerFactory in iptMgr.UninitNpmChains() log.Logf("Azure-NPM creating, cleaning existing Azure NPM IPSets") - ipsm.NewIpsetManager(exec).DestroyNpmIpsets() var ( podInformer = informerFactory.Core().V1().Pods() From dc515b12955d5b17e1fa1aa9184435c106666e47 Mon Sep 17 00:00:00 2001 From: Mathew Merrick Date: Fri, 30 Apr 2021 22:13:58 +0000 Subject: [PATCH 10/19] uninit iptables chains --- npm/ipsm/ipsm_test.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/npm/ipsm/ipsm_test.go b/npm/ipsm/ipsm_test.go index 5588515893..4388de2ba5 100644 --- a/npm/ipsm/ipsm_test.go +++ b/npm/ipsm/ipsm_test.go @@ -8,6 +8,7 @@ import ( "os" "testing" + "github.com/Azure/azure-container-networking/npm/iptm" "github.com/Azure/azure-container-networking/npm/metrics" "github.com/Azure/azure-container-networking/npm/metrics/promutil" "github.com/Azure/azure-container-networking/npm/util" @@ -826,9 +827,17 @@ func TestIPSetCannotBeAddedAsElementDoesNotExist(t *testing.T) { */ func TestMain(m *testing.M) { metrics.InitializeAll() + + iptm := iptm.NewIptablesManager() + iptm.UninitNpmChains() + if err := iptm.UninitNpmChains(); err != nil { + log.Fatalf("Failed to destroy iptables with %v", err) + os.Exit(1) + } + ipsMgr := NewIpsetManager(exec.New()) if err := ipsMgr.Destroy(); err != nil { - log.Fatalf("Failed to destroy with %v", err) + log.Fatalf("Failed to destroy ipsets with %v", err) os.Exit(1) } From ccdebea9aaaec779dc9a2b9b10ed1d9ea446c03c Mon Sep 17 00:00:00 2001 From: Mathew Merrick Date: Fri, 30 Apr 2021 22:29:14 +0000 Subject: [PATCH 11/19] return err --- npm/ipsm/ipsm.go | 2 +- npm/ipsm/ipsm_test.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/npm/ipsm/ipsm.go b/npm/ipsm/ipsm.go index b84750e6b4..f5dbd20993 100644 --- a/npm/ipsm/ipsm.go +++ b/npm/ipsm/ipsm.go @@ -483,7 +483,7 @@ func (ipsMgr *IpsetManager) Run(entry *ipsEntry) (int, error) { output, err := cmd.CombinedOutput() if err != nil { metrics.SendErrorLogAndMetric(util.IpsmID, "Error: There was an error running command: [%s %v] Stderr: [%v, %s]", cmdName, strings.Join(cmdArgs, " "), err, strings.TrimSuffix(string(output), "\n")) - return 1, nil + return 1, err } return 0, nil diff --git a/npm/ipsm/ipsm_test.go b/npm/ipsm/ipsm_test.go index 4388de2ba5..561284bda9 100644 --- a/npm/ipsm/ipsm_test.go +++ b/npm/ipsm/ipsm_test.go @@ -828,13 +828,14 @@ func TestIPSetCannotBeAddedAsElementDoesNotExist(t *testing.T) { func TestMain(m *testing.M) { metrics.InitializeAll() + log.Printf("Uniniting iptables") iptm := iptm.NewIptablesManager() - iptm.UninitNpmChains() if err := iptm.UninitNpmChains(); err != nil { log.Fatalf("Failed to destroy iptables with %v", err) os.Exit(1) } + log.Printf("Uniniting ipsets") ipsMgr := NewIpsetManager(exec.New()) if err := ipsMgr.Destroy(); err != nil { log.Fatalf("Failed to destroy ipsets with %v", err) From ee795b98aa49cd1a7453ba025adffb7adc0a8028 Mon Sep 17 00:00:00 2001 From: Mathew Merrick Date: Fri, 30 Apr 2021 22:56:12 +0000 Subject: [PATCH 12/19] delete from list --- npm/ipsm/ipsm_test.go | 99 +++++++++++++------------------------------ 1 file changed, 30 insertions(+), 69 deletions(-) diff --git a/npm/ipsm/ipsm_test.go b/npm/ipsm/ipsm_test.go index 561284bda9..0f407e3948 100644 --- a/npm/ipsm/ipsm_test.go +++ b/npm/ipsm/ipsm_test.go @@ -12,7 +12,9 @@ import ( "github.com/Azure/azure-container-networking/npm/metrics" "github.com/Azure/azure-container-networking/npm/metrics/promutil" "github.com/Azure/azure-container-networking/npm/util" + "github.com/stretchr/testify/require" "k8s.io/utils/exec" + fakeexec "k8s.io/utils/exec/testing" ) func TestSave(t *testing.T) { @@ -94,53 +96,42 @@ func TestAddToList(t *testing.T) { } func TestDeleteFromList(t *testing.T) { - ipsMgr := NewIpsetManager(exec.New()) - if err := ipsMgr.Save(util.IpsetTestConfigFile); err != nil { - t.Errorf("TestDeleteFromList failed @ ipsMgr.Save") + require := require.New(t) + var calls = []struct { + cmd []string + err error + }{ + {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("test-set"), "nethash"}, err: nil}, + {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("test-list"), "setlist"}, err: nil}, + {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("test-list"), util.GetHashedName("test-set")}, err: nil}, + {cmd: []string{"ipset", "-D", "-exist", util.GetHashedName("test-list"), util.GetHashedName("test-set")}, err: nil}, + {cmd: []string{"ipset", "-X", "-exist", util.GetHashedName("test-list")}, err: nil}, + {cmd: []string{"ipset", "-X", "-exist", util.GetHashedName("test-set")}, err: nil}, } - defer func() { - if err := ipsMgr.Restore(util.IpsetTestConfigFile); err != nil { - t.Errorf("TestDeleteFromList failed @ ipsMgr.Restore") - } - }() + fcmd := fakeexec.FakeCmd{CombinedOutputScript: []fakeexec.FakeAction{}} + fexec := fakeexec.FakeExec{CommandScript: []fakeexec.FakeCommandAction{}} - listName := "test-list" - if err := ipsMgr.CreateList(listName); err != nil { - t.Errorf("TestDeleteFromList failed @ ipsMgr.CreateSet") + // expect happy path, each call returns no errors + for _, call := range calls { + fcmd.CombinedOutputScript = append(fcmd.CombinedOutputScript, func() ([]byte, []byte, error) { return nil, nil, call.err }) + fexec.CommandScript = append(fexec.CommandScript, func(cmd string, args ...string) exec.Cmd { return fakeexec.InitFakeCmd(&fcmd, cmd, args...) }) } + ipsMgr := NewIpsetManager(&fexec) + // Create set and validate set is created. setName := "test-set" if err := ipsMgr.CreateSet(setName, append([]string{util.IpsetNetHashFlag})); err != nil { t.Errorf("TestDeleteFromList failed @ ipsMgr.CreateSet") } - entry := &ipsEntry{ - operationFlag: util.IPsetCheckListFlag, - set: util.GetHashedName(setName), - } - - if _, err := ipsMgr.Run(entry); err != nil { - t.Errorf("TestDeleteFromList failed @ ipsMgr.CreateSet since %s not exist in kernel", setName) - } - // Create list, add set to list and validate set is in the list. - + listName := "test-list" if err := ipsMgr.AddToList(listName, setName); err != nil { t.Errorf("TestDeleteFromList failed @ ipsMgr.AddToList") } - entry = &ipsEntry{ - operationFlag: util.IpsetTestFlag, - set: util.GetHashedName(listName), - spec: append([]string{util.GetHashedName(setName)}), - } - - if _, err := ipsMgr.Run(entry); err != nil { - t.Errorf("TestDeleteFromList failed @ ipsMgr.AddToList since %s not exist in %s set", listName, setName) - } - // Delete set from list and validate set is not in list anymore. if err := ipsMgr.DeleteFromList(listName, setName); err != nil { t.Errorf("TestDeleteFromList failed @ ipsMgr.DeleteFromList %v", err) @@ -156,43 +147,20 @@ func TestDeleteFromList(t *testing.T) { t.Errorf("TestDeleteFromList failed @ ipsMgr.DeleteFromList %v", err) } - entry = &ipsEntry{ - operationFlag: util.IpsetTestFlag, - set: util.GetHashedName(listName), - spec: append([]string{util.GetHashedName(setName)}), - } - - if _, err := ipsMgr.Run(entry); err != nil { - t.Errorf("TestDeleteFromList failed @ ipsMgr.DeleteFromList since %s still exist in %s set", listName, setName) - } - // Delete List and validate list is not exist. - if err := ipsMgr.DeleteList(listName); err != nil { + if err := ipsMgr.DeleteSet(listName); err != nil { t.Errorf("TestDeleteSet failed @ ipsMgr.DeleteSet") } - entry = &ipsEntry{ - operationFlag: util.IPsetCheckListFlag, - set: util.GetHashedName(listName), - } - - if _, err := ipsMgr.Run(entry); err != nil { - t.Errorf("TestDeleteFromList failed @ ipsMgr.DeleteSet since %s still exist in kernel", listName) - } - // Delete set and validate set is not exist. if err := ipsMgr.DeleteSet(setName); err != nil { t.Errorf("TestDeleteSet failed @ ipsMgr.DeleteSet") } - entry = &ipsEntry{ - operationFlag: util.IPsetCheckListFlag, - set: util.GetHashedName(setName), - } - - if _, err := ipsMgr.Run(entry); err != nil { - t.Errorf("TestDeleteFromList failed @ ipsMgr.DeleteSet since %s still exist in kernel", setName) + require.Equal(len(calls), len(fcmd.CombinedOutputLog)) + for i, call := range calls { + require.Equalf(call.cmd, fcmd.CombinedOutputLog[i], "Call [%d] doesn't match expected", i) } } @@ -521,7 +489,7 @@ func TestDestroy(t *testing.T) { set: util.GetHashedName(setName), } - if _, err := ipsMgr.Run(entry); err != nil { + if _, err := ipsMgr.Run(entry); err == nil { t.Errorf("TestDestroy failed @ ipsMgr.Destroy since %s still exist in kernel with err %+v", setName, err) } } else { @@ -532,7 +500,7 @@ func TestDestroy(t *testing.T) { spec: append([]string{testIP}), } - if _, err := ipsMgr.Run(entry); err != nil { + if _, err := ipsMgr.Run(entry); err == nil { t.Errorf("TestDestroy failed @ ipsMgr.Destroy since %s still exist in ipset with err %+v", testIP, err) } } @@ -830,17 +798,10 @@ func TestMain(m *testing.M) { log.Printf("Uniniting iptables") iptm := iptm.NewIptablesManager() - if err := iptm.UninitNpmChains(); err != nil { - log.Fatalf("Failed to destroy iptables with %v", err) - os.Exit(1) - } - + iptm.UninitNpmChains() log.Printf("Uniniting ipsets") ipsMgr := NewIpsetManager(exec.New()) - if err := ipsMgr.Destroy(); err != nil { - log.Fatalf("Failed to destroy ipsets with %v", err) - os.Exit(1) - } + ipsMgr.Destroy() exitCode := m.Run() From 573be3ad04e5aa97ef5024c3e6cbdf0629fec965 Mon Sep 17 00:00:00 2001 From: Mathew Merrick Date: Fri, 30 Apr 2021 23:32:32 +0000 Subject: [PATCH 13/19] uninit --- npm/ipsm/ipsm_test.go | 4 +- npm/npm_test.go | 7 +- output.txt | 5362 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 5366 insertions(+), 7 deletions(-) create mode 100644 output.txt diff --git a/npm/ipsm/ipsm_test.go b/npm/ipsm/ipsm_test.go index 0f407e3948..7ef787a91b 100644 --- a/npm/ipsm/ipsm_test.go +++ b/npm/ipsm/ipsm_test.go @@ -509,12 +509,12 @@ func TestDestroy(t *testing.T) { func TestRun(t *testing.T) { ipsMgr := NewIpsetManager(exec.New()) if err := ipsMgr.Save(util.IpsetTestConfigFile); err != nil { - t.Errorf("TestRun failed @ ipsMgr.Save") + t.Errorf("TestRun failed @ ipsMgr.Save with err %v", err) } defer func() { if err := ipsMgr.Restore(util.IpsetTestConfigFile); err != nil { - t.Errorf("TestRun failed @ ipsMgr.Restore") + t.Errorf("TestRun failed @ ipsMgr.Restore with err %v", err) } }() diff --git a/npm/npm_test.go b/npm/npm_test.go index 2a4847b9f2..0bf248fcd4 100644 --- a/npm/npm_test.go +++ b/npm/npm_test.go @@ -47,15 +47,12 @@ func newNPMgr(t *testing.T, exec utilexec.Interface) *NetworkPolicyManager { func TestMain(m *testing.M) { metrics.InitializeAll() iptMgr := iptm.NewIptablesManager() - iptMgr.Save(util.IptablesConfigFile) + iptMgr.UninitNpmChains() ipsMgr := ipsm.NewIpsetManager(exec.New()) - ipsMgr.Save(util.IpsetConfigFile) + ipsMgr.Destroy() exitCode := m.Run() - iptMgr.Restore(util.IptablesConfigFile) - ipsMgr.Restore(util.IpsetConfigFile) - os.Exit(exitCode) } diff --git a/output.txt b/output.txt new file mode 100644 index 0000000000..befb3b5a64 --- /dev/null +++ b/output.txt @@ -0,0 +1,5362 @@ +go test -coverpkg=./... -v -race -covermode atomic -failfast -coverprofile=coverage.out ./... +TestST LogDir configuration succeeded +=== RUN TestEmptyAIKey +--- PASS: TestEmptyAIKey (0.00s) +=== RUN TestNewAITelemetry +--- PASS: TestNewAITelemetry (0.00s) +=== RUN TestTrackMetric +--- PASS: TestTrackMetric (0.00s) +=== RUN TestTrackLog +--- PASS: TestTrackLog (0.00s) +=== RUN TestTrackEvent +--- PASS: TestTrackEvent (0.00s) +=== RUN TestClose +--- PASS: TestClose (0.46s) +=== RUN TestClosewithoutSend +--- PASS: TestClosewithoutSend (0.00s) +PASS +coverage: 2.5% of statements in ./... +ok github.com/Azure/azure-container-networking/aitelemetry 0.600s coverage: 2.5% of statements in ./... +? github.com/Azure/azure-container-networking/cni [no test files] +=== RUN TestIpam +Running Suite: Ipam Suite +========================= +Random Seed: 1619825477 +Will run 14 of 14 specs + +2021/04/30 23:31:18 [1636] [Listener] Started listening on localhost:42424. +•2021/04/30 23:31:18 [1636] [cni-ipam] Plugin ipamtest version . +2021/04/30 23:31:18 [1636] [cni-ipam] Running on Linux version 4.15.0-142-generic (buildd@lgw01-amd64-036) (gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)) #146-Ubuntu SMP Tue Apr 13 01:11:19 UTC 2021 +2021/04/30 23:31:18 [1636] [ipam] ipam store is nil +2021/04/30 23:31:18 [1636] [ipam] Starting source azure. +2021/04/30 23:31:18 [1636] [cni-ipam] Plugin started. +•2021/04/30 23:31:18 [1636] [cni-ipam] Processing ADD command with args {ContainerID: Netns: IfName: Args: Path: StdinData:{ + "cniversion": "0.4.0", + "ipam": { + "type": "internal", + "subnet": "", + "ipAddress": "" + } + }}. +2021/04/30 23:31:18 [1636] [cni-ipam] Read network configuration &{CNIVersion:0.4.0 Name: Type: Mode: Master: AdapterName: Bridge: LogLevel: LogTarget: InfraVnetAddressSpace: IPV6Mode: ServiceCidrs: VnetCidrs: PodNamespaceForDualNetwork:[] IPsToRouteViaHost:[] MultiTenancy:false EnableSnatOnHost:false EnableExactMatchForPodName:false DisableHairpinOnHostInterface:false DisableIPTableLock:false CNSUrl: ExecutionMode: Ipam:{Type:internal Environment: AddrSpace: Subnet: Address: QueryInterval:} DNS:{Nameservers:[] Domain: Search:[] Options:[]} RuntimeConfig:{PortMappings:[] DNS:{Servers:[] Searches:[] Options:[]}} AdditionalArgs:[]}. +2021/04/30 23:31:18 [1636] [ipam] Starting source azure. +2021/04/30 23:31:18 [1636] [ipam] Refreshing address source. +2021/04/30 23:31:18 [1636] [Utils] Initializing HTTP client with connection timeout: 10, response header timeout: 10 +2021/04/30 23:31:18 [1636] [ipam] Wireserver call http://localhost:42424 to retrieve IP List +2021/04/30 23:31:18 [1636] [ipam] got 3 addresses from interface lo, subnet 10.0.0.0/16 +2021/04/30 23:31:18 [1636] [ipam] ipam store is nil. +2021/04/30 23:31:18 [1636] [ipam] Requesting pool with poolId: options:map[azure.address.id: azure.interface.name:] v6:false. +2021/04/30 23:31:18 [1636] [ipam] Checking pool 10.0.0.0/16. +2021/04/30 23:31:18 [1636] [ipam] Pool 10.0.0.0/16 matches requirements. +2021/04/30 23:31:18 [1636] [ipam] Pool request completed with pool:&{as:0xc00033f650 Id:10.0.0.0/16 IfName:lo Subnet:{IP:10.0.0.0 Mask:ffff0000} Gateway:10.0.0.1 Addresses:map[10.0.0.5:0xc00008b440 10.0.0.6:0xc00008b480 10.0.0.7:0xc00008b4c0] addrsByID:map[] IsIPv6:false Priority:0 RefCount:1 epoch:0} err:. +2021/04/30 23:31:18 [1636] [ipam] ipam store is nil. +2021/04/30 23:31:18 [1636] [cni-ipam] Allocated address poolID 10.0.0.0/16 with subnet 10.0.0.0/16. +2021/04/30 23:31:18 [1636] [ipam] Refreshing address source. +2021/04/30 23:31:18 [1636] [ipam] Requesting address with address: options:map[azure.address.id: azure.interface.name:]. +2021/04/30 23:31:18 [1636] [ipam] Address request completed with address:10.0.0.5/16 +2021/04/30 23:31:18 [1636] [ipam] ipam store is nil. +2021/04/30 23:31:18 [1636] [cni-ipam] Allocated address 10.0.0.5/16. +2021/04/30 23:31:18 [1636] [cni-ipam] ADD command completed with result:IP:[{Version:4 Interface: Address:{IP:10.0.0.5 Mask:ffff0000} Gateway:10.0.0.1}], Routes:[{Dst:{IP:0.0.0.0 Mask:00000000} GW:10.0.0.1}], DNS:{Nameservers:[168.63.129.16] Domain: Search:[] Options:[]} err:. +•2021/04/30 23:31:18 [1636] [cni-ipam] Processing DEL command with args {ContainerID: Netns: IfName: Args: Path: StdinData:{ + "cniversion": "0.4.0", + "ipam": { + "type": "internal", + "subnet": "10.0.0.0/16", + "ipAddress": "10.0.0.5" + } + }}. +2021/04/30 23:31:18 [1636] [cni-ipam] Read network configuration &{CNIVersion:0.4.0 Name: Type: Mode: Master: AdapterName: Bridge: LogLevel: LogTarget: InfraVnetAddressSpace: IPV6Mode: ServiceCidrs: VnetCidrs: PodNamespaceForDualNetwork:[] IPsToRouteViaHost:[] MultiTenancy:false EnableSnatOnHost:false EnableExactMatchForPodName:false DisableHairpinOnHostInterface:false DisableIPTableLock:false CNSUrl: ExecutionMode: Ipam:{Type:internal Environment: AddrSpace: Subnet:10.0.0.0/16 Address:10.0.0.5 QueryInterval:} DNS:{Nameservers:[] Domain: Search:[] Options:[]} RuntimeConfig:{PortMappings:[] DNS:{Servers:[] Searches:[] Options:[]}} AdditionalArgs:[]}. +2021/04/30 23:31:18 [1636] [ipam] Starting source azure. +2021/04/30 23:31:18 [1636] [ipam] Refreshing address source. +2021/04/30 23:31:18 [1636] [Utils] Initializing HTTP client with connection timeout: 10, response header timeout: 10 +2021/04/30 23:31:18 [1636] [ipam] Wireserver call http://localhost:42424 to retrieve IP List +2021/04/30 23:31:18 [1636] [ipam] got 3 addresses from interface lo, subnet 10.0.0.0/16 +2021/04/30 23:31:18 [1636] [ipam] merging address space +2021/04/30 23:31:18 [1636] [ipam] ipam store is nil. +2021/04/30 23:31:18 [1636] [ipam] Releasing address with address:10.0.0.5 options:map[azure.address.id:]. +2021/04/30 23:31:18 [1636] [ipam] Address release completed with address:10.0.0.5 err:. +2021/04/30 23:31:18 [1636] [ipam] ipam store is nil. +2021/04/30 23:31:18 [1636] [cni-ipam] DEL command completed with err:. +•2021/04/30 23:31:18 [1636] [cni-ipam] Processing DEL command with args {ContainerID: Netns: IfName: Args: Path: StdinData:{ + "cniversion": "0.4.0", + "ipam": { + "type": "internal", + "subnet": "10.0.0.0/16", + "ipAddress": "" + } + }}. +2021/04/30 23:31:18 [1636] [cni-ipam] Read network configuration &{CNIVersion:0.4.0 Name: Type: Mode: Master: AdapterName: Bridge: LogLevel: LogTarget: InfraVnetAddressSpace: IPV6Mode: ServiceCidrs: VnetCidrs: PodNamespaceForDualNetwork:[] IPsToRouteViaHost:[] MultiTenancy:false EnableSnatOnHost:false EnableExactMatchForPodName:false DisableHairpinOnHostInterface:false DisableIPTableLock:false CNSUrl: ExecutionMode: Ipam:{Type:internal Environment: AddrSpace: Subnet:10.0.0.0/16 Address: QueryInterval:} DNS:{Nameservers:[] Domain: Search:[] Options:[]} RuntimeConfig:{PortMappings:[] DNS:{Servers:[] Searches:[] Options:[]}} AdditionalArgs:[]}. +2021/04/30 23:31:18 [1636] [ipam] Starting source azure. +2021/04/30 23:31:18 [1636] [ipam] Refreshing address source. +2021/04/30 23:31:18 [1636] [Utils] Initializing HTTP client with connection timeout: 10, response header timeout: 10 +2021/04/30 23:31:18 [1636] [ipam] Wireserver call http://localhost:42424 to retrieve IP List +2021/04/30 23:31:18 [1636] [ipam] got 3 addresses from interface lo, subnet 10.0.0.0/16 +2021/04/30 23:31:18 [1636] [ipam] merging address space +2021/04/30 23:31:18 [1636] [ipam] ipam store is nil. +2021/04/30 23:31:18 [1636] [ipam] Releasing address with address: options:map[azure.address.id:]. +2021/04/30 23:31:18 [1636] Address not found. Not Returning error +2021/04/30 23:31:18 [1636] [ipam] Address release completed with address: err:. +2021/04/30 23:31:18 [1636] [ipam] ipam store is nil. +2021/04/30 23:31:18 [1636] [cni-ipam] DEL command completed with err:. +•2021/04/30 23:31:18 [1636] [cni-ipam] Processing ADD command with args {ContainerID: Netns: IfName: Args: Path: StdinData:{ + "cniversion": "0.4.0", + "ipam": { + "type": "internal", + "subnet": "", + "ipAddress": "10.0.0.6" + } + }}. +2021/04/30 23:31:18 [1636] [cni-ipam] Read network configuration &{CNIVersion:0.4.0 Name: Type: Mode: Master: AdapterName: Bridge: LogLevel: LogTarget: InfraVnetAddressSpace: IPV6Mode: ServiceCidrs: VnetCidrs: PodNamespaceForDualNetwork:[] IPsToRouteViaHost:[] MultiTenancy:false EnableSnatOnHost:false EnableExactMatchForPodName:false DisableHairpinOnHostInterface:false DisableIPTableLock:false CNSUrl: ExecutionMode: Ipam:{Type:internal Environment: AddrSpace: Subnet: Address:10.0.0.6 QueryInterval:} DNS:{Nameservers:[] Domain: Search:[] Options:[]} RuntimeConfig:{PortMappings:[] DNS:{Servers:[] Searches:[] Options:[]}} AdditionalArgs:[]}. +2021/04/30 23:31:18 [1636] [ipam] Starting source azure. +2021/04/30 23:31:18 [1636] [ipam] Refreshing address source. +2021/04/30 23:31:18 [1636] [Utils] Initializing HTTP client with connection timeout: 10, response header timeout: 10 +2021/04/30 23:31:18 [1636] [ipam] Wireserver call http://localhost:42424 to retrieve IP List +2021/04/30 23:31:18 [1636] [ipam] got 3 addresses from interface lo, subnet 10.0.0.0/16 +2021/04/30 23:31:18 [1636] [ipam] merging address space +2021/04/30 23:31:18 [1636] [ipam] ipam store is nil. +2021/04/30 23:31:18 [1636] [ipam] Requesting pool with poolId: options:map[azure.address.id: azure.interface.name:] v6:false. +2021/04/30 23:31:18 [1636] [ipam] Checking pool 10.0.0.0/16. +2021/04/30 23:31:18 [1636] [ipam] Pool 10.0.0.0/16 is in use. +2021/04/30 23:31:18 [1636] [ipam] Releasing pool 10.0.0.0/16 as there are no allocations +2021/04/30 23:31:18 [1636] [ipam] Pool 10.0.0.0/16 matches requirements. +2021/04/30 23:31:18 [1636] [ipam] Pool request completed with pool:&{as:0xc00033f650 Id:10.0.0.0/16 IfName:lo Subnet:{IP:10.0.0.0 Mask:ffff0000} Gateway:10.0.0.1 Addresses:map[10.0.0.5:0xc00008b440 10.0.0.6:0xc00008b480 10.0.0.7:0xc00008b4c0] addrsByID:map[] IsIPv6:false Priority:0 RefCount:1 epoch:3} err:. +2021/04/30 23:31:18 [1636] [ipam] ipam store is nil. +2021/04/30 23:31:18 [1636] [cni-ipam] Allocated address poolID 10.0.0.0/16 with subnet 10.0.0.0/16. +2021/04/30 23:31:18 [1636] [ipam] Refreshing address source. +2021/04/30 23:31:18 [1636] [ipam] Requesting address with address:10.0.0.6 options:map[azure.address.id: azure.interface.name:]. +2021/04/30 23:31:18 [1636] [ipam] Address request completed with address:10.0.0.6/16 +2021/04/30 23:31:18 [1636] [ipam] ipam store is nil. +2021/04/30 23:31:18 [1636] [cni-ipam] Allocated address 10.0.0.6/16. +2021/04/30 23:31:18 [1636] [cni-ipam] ADD command completed with result:IP:[{Version:4 Interface: Address:{IP:10.0.0.6 Mask:ffff0000} Gateway:10.0.0.1}], Routes:[{Dst:{IP:0.0.0.0 Mask:00000000} GW:10.0.0.1}], DNS:{Nameservers:[168.63.129.16] Domain: Search:[] Options:[]} err:. +•2021/04/30 23:31:18 [1636] [cni-ipam] Processing ADD command with args {ContainerID: Netns: IfName: Args: Path: StdinData:{ + "cniversion": "0.4.0", + "ipam": { + "type": "internal", + "subnet": "10.0.0.0/16", + "ipAddress": "" + } + }}. +2021/04/30 23:31:18 [1636] [cni-ipam] Read network configuration &{CNIVersion:0.4.0 Name: Type: Mode: Master: AdapterName: Bridge: LogLevel: LogTarget: InfraVnetAddressSpace: IPV6Mode: ServiceCidrs: VnetCidrs: PodNamespaceForDualNetwork:[] IPsToRouteViaHost:[] MultiTenancy:false EnableSnatOnHost:false EnableExactMatchForPodName:false DisableHairpinOnHostInterface:false DisableIPTableLock:false CNSUrl: ExecutionMode: Ipam:{Type:internal Environment: AddrSpace: Subnet:10.0.0.0/16 Address: QueryInterval:} DNS:{Nameservers:[] Domain: Search:[] Options:[]} RuntimeConfig:{PortMappings:[] DNS:{Servers:[] Searches:[] Options:[]}} AdditionalArgs:[]}. +2021/04/30 23:31:18 [1636] [ipam] Starting source azure. +2021/04/30 23:31:18 [1636] [ipam] Refreshing address source. +2021/04/30 23:31:18 [1636] [Utils] Initializing HTTP client with connection timeout: 10, response header timeout: 10 +2021/04/30 23:31:18 [1636] [ipam] Wireserver call http://localhost:42424 to retrieve IP List +2021/04/30 23:31:18 [1636] [ipam] got 3 addresses from interface lo, subnet 10.0.0.0/16 +2021/04/30 23:31:18 [1636] [ipam] merging address space +2021/04/30 23:31:18 [1636] [ipam] ipam store is nil. +2021/04/30 23:31:18 [1636] [ipam] Requesting address with address: options:map[azure.address.id:]. +2021/04/30 23:31:18 [1636] [ipam] Address request completed with address:10.0.0.7/16 +2021/04/30 23:31:18 [1636] [ipam] ipam store is nil. +2021/04/30 23:31:18 [1636] [cni-ipam] Allocated address 10.0.0.7/16. +2021/04/30 23:31:18 [1636] [cni-ipam] ADD command completed with result:IP:[{Version:4 Interface: Address:{IP:10.0.0.7 Mask:ffff0000} Gateway:10.0.0.1}], Routes:[{Dst:{IP:0.0.0.0 Mask:00000000} GW:10.0.0.1}], DNS:{Nameservers:[168.63.129.16] Domain: Search:[] Options:[]} err:. +•2021/04/30 23:31:18 [1636] [cni-ipam] Processing ADD command with args {ContainerID:25074be3-cea9-461a-aa6b-926714477f11 Netns: IfName: Args: Path: StdinData:{ + "cniversion": "0.4.0", + "ipam": { + "type": "internal", + "subnet": "10.0.0.0/16", + "ipAddress": "" + } + }}. +2021/04/30 23:31:18 [1636] [cni-ipam] Read network configuration &{CNIVersion:0.4.0 Name: Type: Mode: Master: AdapterName: Bridge: LogLevel: LogTarget: InfraVnetAddressSpace: IPV6Mode: ServiceCidrs: VnetCidrs: PodNamespaceForDualNetwork:[] IPsToRouteViaHost:[] MultiTenancy:false EnableSnatOnHost:false EnableExactMatchForPodName:false DisableHairpinOnHostInterface:false DisableIPTableLock:false CNSUrl: ExecutionMode: Ipam:{Type:internal Environment: AddrSpace: Subnet:10.0.0.0/16 Address: QueryInterval:} DNS:{Nameservers:[] Domain: Search:[] Options:[]} RuntimeConfig:{PortMappings:[] DNS:{Servers:[] Searches:[] Options:[]}} AdditionalArgs:[]}. +2021/04/30 23:31:18 [1636] [ipam] Starting source azure. +2021/04/30 23:31:18 [1636] [ipam] Refreshing address source. +2021/04/30 23:31:18 [1636] [Utils] Initializing HTTP client with connection timeout: 10, response header timeout: 10 +2021/04/30 23:31:18 [1636] [ipam] Wireserver call http://localhost:42424 to retrieve IP List +2021/04/30 23:31:18 [1636] [ipam] got 3 addresses from interface lo, subnet 10.0.0.0/16 +2021/04/30 23:31:18 [1636] [ipam] merging address space +2021/04/30 23:31:18 [1636] [ipam] ipam store is nil. +2021/04/30 23:31:18 [1636] [ipam] Requesting address with address: options:map[azure.address.id:25074be3-cea9-461a-aa6b-926714477f11]. +2021/04/30 23:31:18 [1636] [ipam] Address request completed with address:10.0.0.5/16 +2021/04/30 23:31:18 [1636] [ipam] ipam store is nil. +2021/04/30 23:31:18 [1636] [cni-ipam] Allocated address 10.0.0.5/16. +2021/04/30 23:31:18 [1636] [cni-ipam] ADD command completed with result:IP:[{Version:4 Interface: Address:{IP:10.0.0.5 Mask:ffff0000} Gateway:10.0.0.1}], Routes:[{Dst:{IP:0.0.0.0 Mask:00000000} GW:10.0.0.1}], DNS:{Nameservers:[168.63.129.16] Domain: Search:[] Options:[]} err:. +•2021/04/30 23:31:18 [1636] [cni-ipam] Processing DEL command with args {ContainerID:25074be3-cea9-461a-aa6b-926714477f11 Netns: IfName: Args: Path: StdinData:{ + "cniversion": "0.4.0", + "ipam": { + "type": "internal", + "subnet": "10.0.0.0/16", + "ipAddress": "" + } + }}. +2021/04/30 23:31:18 [1636] [cni-ipam] Read network configuration &{CNIVersion:0.4.0 Name: Type: Mode: Master: AdapterName: Bridge: LogLevel: LogTarget: InfraVnetAddressSpace: IPV6Mode: ServiceCidrs: VnetCidrs: PodNamespaceForDualNetwork:[] IPsToRouteViaHost:[] MultiTenancy:false EnableSnatOnHost:false EnableExactMatchForPodName:false DisableHairpinOnHostInterface:false DisableIPTableLock:false CNSUrl: ExecutionMode: Ipam:{Type:internal Environment: AddrSpace: Subnet:10.0.0.0/16 Address: QueryInterval:} DNS:{Nameservers:[] Domain: Search:[] Options:[]} RuntimeConfig:{PortMappings:[] DNS:{Servers:[] Searches:[] Options:[]}} AdditionalArgs:[]}. +2021/04/30 23:31:18 [1636] [ipam] Starting source azure. +2021/04/30 23:31:18 [1636] [ipam] Refreshing address source. +2021/04/30 23:31:18 [1636] [Utils] Initializing HTTP client with connection timeout: 10, response header timeout: 10 +2021/04/30 23:31:18 [1636] [ipam] Wireserver call http://localhost:42424 to retrieve IP List +2021/04/30 23:31:18 [1636] [ipam] got 3 addresses from interface lo, subnet 10.0.0.0/16 +2021/04/30 23:31:18 [1636] [ipam] merging address space +2021/04/30 23:31:18 [1636] [ipam] ipam store is nil. +2021/04/30 23:31:18 [1636] [ipam] Releasing address with address: options:map[azure.address.id:25074be3-cea9-461a-aa6b-926714477f11]. +2021/04/30 23:31:18 [1636] [ipam] Address release completed with address:10.0.0.5 err:. +2021/04/30 23:31:18 [1636] [ipam] ipam store is nil. +2021/04/30 23:31:18 [1636] [cni-ipam] DEL command completed with err:. +•2021/04/30 23:31:18 [1636] [cni-ipam] Processing DEL command with args {ContainerID: Netns: IfName: Args: Path: StdinData:{ + "cniversion": "0.4.0", + "ipam": { + "type": "internal", + "subnet": "10.0.0.0/16", + "ipAddress": "10.0.0.6" + } + }}. +2021/04/30 23:31:18 [1636] [cni-ipam] Read network configuration &{CNIVersion:0.4.0 Name: Type: Mode: Master: AdapterName: Bridge: LogLevel: LogTarget: InfraVnetAddressSpace: IPV6Mode: ServiceCidrs: VnetCidrs: PodNamespaceForDualNetwork:[] IPsToRouteViaHost:[] MultiTenancy:false EnableSnatOnHost:false EnableExactMatchForPodName:false DisableHairpinOnHostInterface:false DisableIPTableLock:false CNSUrl: ExecutionMode: Ipam:{Type:internal Environment: AddrSpace: Subnet:10.0.0.0/16 Address:10.0.0.6 QueryInterval:} DNS:{Nameservers:[] Domain: Search:[] Options:[]} RuntimeConfig:{PortMappings:[] DNS:{Servers:[] Searches:[] Options:[]}} AdditionalArgs:[]}. +2021/04/30 23:31:18 [1636] [ipam] Starting source azure. +2021/04/30 23:31:18 [1636] [ipam] Refreshing address source. +2021/04/30 23:31:18 [1636] [Utils] Initializing HTTP client with connection timeout: 10, response header timeout: 10 +2021/04/30 23:31:18 [1636] [ipam] Wireserver call http://localhost:42424 to retrieve IP List +2021/04/30 23:31:18 [1636] [ipam] got 3 addresses from interface lo, subnet 10.0.0.0/16 +2021/04/30 23:31:18 [1636] [ipam] merging address space +2021/04/30 23:31:18 [1636] [ipam] ipam store is nil. +2021/04/30 23:31:18 [1636] [ipam] Releasing address with address:10.0.0.6 options:map[azure.address.id:]. +2021/04/30 23:31:18 [1636] [ipam] Address release completed with address:10.0.0.6 err:. +2021/04/30 23:31:18 [1636] [ipam] ipam store is nil. +2021/04/30 23:31:18 [1636] [cni-ipam] DEL command completed with err:. +•2021/04/30 23:31:18 [1636] [cni-ipam] Processing ADD command with args {ContainerID: Netns: IfName: Args: Path: StdinData:{ + "cniversion": "0.4.0", + "ipam": { + "type": "internal", + "subnet": "", + "ipAddress": "" + } + }}. +2021/04/30 23:31:18 [1636] [cni-ipam] Read network configuration &{CNIVersion:0.4.0 Name: Type: Mode: Master: AdapterName: Bridge: LogLevel: LogTarget: InfraVnetAddressSpace: IPV6Mode: ServiceCidrs: VnetCidrs: PodNamespaceForDualNetwork:[] IPsToRouteViaHost:[] MultiTenancy:false EnableSnatOnHost:false EnableExactMatchForPodName:false DisableHairpinOnHostInterface:false DisableIPTableLock:false CNSUrl: ExecutionMode: Ipam:{Type:internal Environment: AddrSpace: Subnet: Address: QueryInterval:} DNS:{Nameservers:[] Domain: Search:[] Options:[]} RuntimeConfig:{PortMappings:[] DNS:{Servers:[] Searches:[] Options:[]}} AdditionalArgs:[]}. +2021/04/30 23:31:18 [1636] [ipam] Starting source azure. +2021/04/30 23:31:18 [1636] [ipam] Refreshing address source. +2021/04/30 23:31:18 [1636] [Utils] Initializing HTTP client with connection timeout: 10, response header timeout: 10 +2021/04/30 23:31:18 [1636] [ipam] Wireserver call http://localhost:42424 to retrieve IP List +2021/04/30 23:31:18 [1636] [ipam] got 3 addresses from interface lo, subnet 10.0.0.0/16 +2021/04/30 23:31:18 [1636] [ipam] merging address space +2021/04/30 23:31:18 [1636] [ipam] ipam store is nil. +2021/04/30 23:31:18 [1636] [ipam] Requesting pool with poolId: options:map[azure.address.id: azure.interface.name:] v6:false. +2021/04/30 23:31:18 [1636] [ipam] Checking pool 10.0.0.0/16. +2021/04/30 23:31:18 [1636] [ipam] Pool 10.0.0.0/16 is in use. +2021/04/30 23:31:18 [1636] [ipam] Skip releasing pool with poolId:10.0.0.0/16. due to address being in use +2021/04/30 23:31:18 [1636] [ipam] Pool request completed with pool: err:No available address pools. +2021/04/30 23:31:18 [1636] [ipamtest] Failed to allocate pool: No available address pools. +2021/04/30 23:31:18 [1636] [cni-ipam] ADD command completed with result: err:Failed to allocate pool: No available address pools. +•2021/04/30 23:31:18 [1636] [cni-ipam] Processing DEL command with args {ContainerID: Netns: IfName: Args: Path: StdinData:{ + "cniversion": "0.4.0", + "ipam": { + "type": "internal", + "subnet": "10.0.0.0/16", + "ipAddress": "10.0.0.7" + } + }}. +2021/04/30 23:31:18 [1636] [cni-ipam] Read network configuration &{CNIVersion:0.4.0 Name: Type: Mode: Master: AdapterName: Bridge: LogLevel: LogTarget: InfraVnetAddressSpace: IPV6Mode: ServiceCidrs: VnetCidrs: PodNamespaceForDualNetwork:[] IPsToRouteViaHost:[] MultiTenancy:false EnableSnatOnHost:false EnableExactMatchForPodName:false DisableHairpinOnHostInterface:false DisableIPTableLock:false CNSUrl: ExecutionMode: Ipam:{Type:internal Environment: AddrSpace: Subnet:10.0.0.0/16 Address:10.0.0.7 QueryInterval:} DNS:{Nameservers:[] Domain: Search:[] Options:[]} RuntimeConfig:{PortMappings:[] DNS:{Servers:[] Searches:[] Options:[]}} AdditionalArgs:[]}. +2021/04/30 23:31:18 [1636] [ipam] Starting source azure. +2021/04/30 23:31:18 [1636] [ipam] Refreshing address source. +2021/04/30 23:31:18 [1636] [Utils] Initializing HTTP client with connection timeout: 10, response header timeout: 10 +2021/04/30 23:31:18 [1636] [ipam] Wireserver call http://localhost:42424 to retrieve IP List +2021/04/30 23:31:18 [1636] [ipam] got 3 addresses from interface lo, subnet 10.0.0.0/16 +2021/04/30 23:31:18 [1636] [ipam] merging address space +2021/04/30 23:31:18 [1636] [ipam] ipam store is nil. +2021/04/30 23:31:18 [1636] [ipam] Releasing address with address:10.0.0.7 options:map[azure.address.id:]. +2021/04/30 23:31:18 [1636] [ipam] Address release completed with address:10.0.0.7 err:. +2021/04/30 23:31:18 [1636] [ipam] ipam store is nil. +2021/04/30 23:31:18 [1636] [cni-ipam] DEL command completed with err:. +•2021/04/30 23:31:18 [1636] [cni-ipam] Processing DEL command with args {ContainerID: Netns: IfName: Args: Path: StdinData:{ + "cniversion": "0.4.0", + "ipam": { + "type": "internal", + "subnet": "10.0.0.0/16", + "ipAddress": "" + } + }}. +2021/04/30 23:31:18 [1636] [cni-ipam] Read network configuration &{CNIVersion:0.4.0 Name: Type: Mode: Master: AdapterName: Bridge: LogLevel: LogTarget: InfraVnetAddressSpace: IPV6Mode: ServiceCidrs: VnetCidrs: PodNamespaceForDualNetwork:[] IPsToRouteViaHost:[] MultiTenancy:false EnableSnatOnHost:false EnableExactMatchForPodName:false DisableHairpinOnHostInterface:false DisableIPTableLock:false CNSUrl: ExecutionMode: Ipam:{Type:internal Environment: AddrSpace: Subnet:10.0.0.0/16 Address: QueryInterval:} DNS:{Nameservers:[] Domain: Search:[] Options:[]} RuntimeConfig:{PortMappings:[] DNS:{Servers:[] Searches:[] Options:[]}} AdditionalArgs:[]}. +2021/04/30 23:31:18 [1636] [ipam] Starting source azure. +2021/04/30 23:31:18 [1636] [ipam] Refreshing address source. +2021/04/30 23:31:18 [1636] [Utils] Initializing HTTP client with connection timeout: 10, response header timeout: 10 +2021/04/30 23:31:18 [1636] [ipam] Wireserver call http://localhost:42424 to retrieve IP List +2021/04/30 23:31:18 [1636] [ipam] got 3 addresses from interface lo, subnet 10.0.0.0/16 +2021/04/30 23:31:18 [1636] [ipam] merging address space +2021/04/30 23:31:18 [1636] [ipam] ipam store is nil. +2021/04/30 23:31:18 [1636] [ipam] Releasing address with address: options:map[azure.address.id:]. +2021/04/30 23:31:18 [1636] Address not found. Not Returning error +2021/04/30 23:31:18 [1636] [ipam] Address release completed with address: err:. +2021/04/30 23:31:18 [1636] [ipam] ipam store is nil. +2021/04/30 23:31:18 [1636] [cni-ipam] DEL command completed with err:. +•2021/04/30 23:31:18 [1636] [cni-ipam] Processing ADD command with args {ContainerID: Netns: IfName: Args: Path: StdinData:{ + "cniversion": "0.4.0", + "ipam": { + "type": "internal", + "subnet": "", + "ipAddress": "" + } + }}. +2021/04/30 23:31:18 [1636] [cni-ipam] Read network configuration &{CNIVersion:0.4.0 Name: Type: Mode: Master: AdapterName: Bridge: LogLevel: LogTarget: InfraVnetAddressSpace: IPV6Mode: ServiceCidrs: VnetCidrs: PodNamespaceForDualNetwork:[] IPsToRouteViaHost:[] MultiTenancy:false EnableSnatOnHost:false EnableExactMatchForPodName:false DisableHairpinOnHostInterface:false DisableIPTableLock:false CNSUrl: ExecutionMode: Ipam:{Type:internal Environment: AddrSpace: Subnet: Address: QueryInterval:} DNS:{Nameservers:[] Domain: Search:[] Options:[]} RuntimeConfig:{PortMappings:[] DNS:{Servers:[] Searches:[] Options:[]}} AdditionalArgs:[]}. +2021/04/30 23:31:18 [1636] [ipam] Starting source azure. +2021/04/30 23:31:18 [1636] [ipam] Refreshing address source. +2021/04/30 23:31:18 [1636] [Utils] Initializing HTTP client with connection timeout: 10, response header timeout: 10 +2021/04/30 23:31:18 [1636] [ipam] Wireserver call http://localhost:42424 to retrieve IP List +2021/04/30 23:31:18 [1636] [ipam] got 3 addresses from interface lo, subnet 10.0.0.0/16 +2021/04/30 23:31:18 [1636] [ipam] merging address space +2021/04/30 23:31:18 [1636] [ipam] ipam store is nil. +2021/04/30 23:31:18 [1636] [ipam] Requesting pool with poolId: options:map[azure.address.id: azure.interface.name:] v6:false. +2021/04/30 23:31:18 [1636] [ipam] Checking pool 10.0.0.0/16. +2021/04/30 23:31:18 [1636] [ipam] Pool 10.0.0.0/16 is in use. +2021/04/30 23:31:18 [1636] [ipam] Releasing pool 10.0.0.0/16 as there are no allocations +2021/04/30 23:31:18 [1636] [ipam] Pool 10.0.0.0/16 matches requirements. +2021/04/30 23:31:18 [1636] [ipam] Pool request completed with pool:&{as:0xc00033f650 Id:10.0.0.0/16 IfName:lo Subnet:{IP:10.0.0.0 Mask:ffff0000} Gateway:10.0.0.1 Addresses:map[10.0.0.5:0xc00008b440 10.0.0.6:0xc00008b480 10.0.0.7:0xc00008b4c0] addrsByID:map[] IsIPv6:false Priority:0 RefCount:1 epoch:11} err:. +2021/04/30 23:31:18 [1636] [ipam] ipam store is nil. +2021/04/30 23:31:18 [1636] [cni-ipam] Allocated address poolID 10.0.0.0/16 with subnet 10.0.0.0/16. +2021/04/30 23:31:18 [1636] [ipam] Refreshing address source. +2021/04/30 23:31:18 [1636] [ipam] Requesting address with address: options:map[azure.address.id: azure.interface.name:]. +2021/04/30 23:31:18 [1636] [ipam] Address request completed with address:10.0.0.7/16 +2021/04/30 23:31:18 [1636] [ipam] ipam store is nil. +2021/04/30 23:31:18 [1636] [cni-ipam] Allocated address 10.0.0.7/16. +2021/04/30 23:31:18 [1636] [cni-ipam] ADD command completed with result:IP:[{Version:4 Interface: Address:{IP:10.0.0.7 Mask:ffff0000} Gateway:10.0.0.1}], Routes:[{Dst:{IP:0.0.0.0 Mask:00000000} GW:10.0.0.1}], DNS:{Nameservers:[168.63.129.16] Domain: Search:[] Options:[]} err:. +•2021/04/30 23:31:18 [1636] [cni-ipam] Plugin stopped. +2021/04/30 23:31:18 [1636] [Listener] Stopped listening on localhost:42424 + +Ran 14 of 14 Specs in 1.061 seconds +SUCCESS! -- 14 Passed | 0 Failed | 0 Pending | 0 Skipped +--- PASS: TestIpam (1.06s) +PASS +coverage: 4.2% of statements in ./... +ok github.com/Azure/azure-container-networking/cni/ipam 1.233s coverage: 4.2% of statements in ./... +? github.com/Azure/azure-container-networking/cni/ipam/plugin [no test files] +? github.com/Azure/azure-container-networking/cni/ipam/pluginv6 [no test files] +=== RUN TestPlugin + +2021/04/30 23:31:18 [1704] [cni-net] Processing DEL command with args {ContainerID:test-container Netns:test-container IfName:azure0 Args:K8S_POD_NAME=test-pod;K8S_POD_NAMESPACE=test-pod-namespace Path:, StdinData:{"name":"test-nwcfg","type":"azure-vnet","mode":"bridge","ipsToRouteViaHost":["169.254.20.10"],"ipam":{"type":"azure-cns"},"dns":{},"runtimeConfig":{"dns":{}}}}. +2021/04/30 23:31:18 [1704] [cni-net] Read network configuration &{CNIVersion:0.2.0 Name:test-nwcfg Type:azure-vnet Mode:bridge Master: AdapterName: Bridge: LogLevel: LogTarget: InfraVnetAddressSpace: IPV6Mode: ServiceCidrs: VnetCidrs: PodNamespaceForDualNetwork:[] IPsToRouteViaHost:[169.254.20.10] MultiTenancy:false EnableSnatOnHost:false EnableExactMatchForPodName:false DisableHairpinOnHostInterface:false DisableIPTableLock:false CNSUrl: ExecutionMode: Ipam:{Type:azure-cns Environment: AddrSpace: Subnet: Address: QueryInterval:} DNS:{Nameservers:[] Domain: Search:[] Options:[]} RuntimeConfig:{PortMappings:[] DNS:{Servers:[] Searches:[] Options:[]}} AdditionalArgs:[]}. +2021/04/30 23:31:18 [1704] Execution mode : +2021/04/30 23:31:18 [1704] release ip:192.168.0.0 +2021/04/30 23:31:18 [1704] ReleaseIPAddress url http://localhost:10090/network/releaseipconfig +2021/04/30 23:31:18 [1704] [Azure CNSClient] HTTP Post returned error Post "http://localhost:10090/network/releaseipconfig": dial tcp 127.0.0.1:10090: connect: connection refused +2021/04/30 23:31:18 [1704] [testplugin] Failed to release address {192.168.0.0 ffffff00} with error: Post "http://localhost:10090/network/releaseipconfig": dial tcp 127.0.0.1:10090: connect: connection refused. +2021/04/30 23:31:18 [1704] [cni-net] DEL command completed with err:Failed to release address {192.168.0.0 ffffff00} with error: Post "http://localhost:10090/network/releaseipconfig": dial tcp 127.0.0.1:10090: connect: connection refused. +--- PASS: TestPlugin (0.00s) +PASS +coverage: 1.9% of statements in ./... +ok github.com/Azure/azure-container-networking/cni/network 0.128s coverage: 1.9% of statements in ./... +? github.com/Azure/azure-container-networking/cni/network/plugin [no test files] +? github.com/Azure/azure-container-networking/cni/telemetry/service [no test files] +? github.com/Azure/azure-container-networking/cni/utils [no test files] +? github.com/Azure/azure-container-networking/cnm [no test files] +2021/04/30 23:31:19 [1763] [Listener] Started listening on localhost:42424. +2021/04/30 23:31:19 [1763] [ipam] ipam store is nil +2021/04/30 23:31:19 [1763] [ipam] Starting source azure. +2021/04/30 23:31:19 [1763] [ipam] Plugin started. +=== RUN TestActivate +2021/04/30 23:31:19 [1763] [azure-vnet-ipam] Received *cnm.activateRequest &{}. +2021/04/30 23:31:19 [1763] [azure-vnet-ipam] Sent *cnm.ActivateResponse &{Err: Implements:[IpamDriver]}. +--- PASS: TestActivate (0.00s) +=== RUN TestGetCapabilities +2021/04/30 23:31:19 [1763] [azure-vnet-ipam] Received *ipam.GetCapabilitiesRequest &{}. +2021/04/30 23:31:19 [1763] [azure-vnet-ipam] Sent *ipam.GetCapabilitiesResponse &{Err: RequiresMACAddress:false RequiresRequestReplay:false}. +--- PASS: TestGetCapabilities (0.00s) +=== RUN TestGetDefaultAddressSpaces +2021/04/30 23:31:19 [1763] [azure-vnet-ipam] Received *ipam.GetDefaultAddressSpacesRequest &{}. +2021/04/30 23:31:19 [1763] [ipam] Refreshing address source. +2021/04/30 23:31:19 [1763] [Utils] Initializing HTTP client with connection timeout: 10, response header timeout: 10 +2021/04/30 23:31:19 [1763] [ipam] Wireserver call http://localhost:42424 to retrieve IP List +2021/04/30 23:31:19 [1763] [ipam] got 5 addresses from interface lo, subnet 10.0.0.0/16 +2021/04/30 23:31:19 [1763] [ipam] ipam store is nil. +2021/04/30 23:31:19 [1763] [azure-vnet-ipam] Sent *ipam.GetDefaultAddressSpacesResponse &{Err: LocalDefaultAddressSpace:local GlobalDefaultAddressSpace:}. +--- PASS: TestGetDefaultAddressSpaces (0.00s) +=== RUN TestRequestPool +2021/04/30 23:31:19 [1763] [azure-vnet-ipam] Received *ipam.RequestPoolRequest &{AddressSpace:local Pool: SubPool: Options:map[] V6:false}. +2021/04/30 23:31:19 [1763] [ipam] Refreshing address source. +2021/04/30 23:31:19 [1763] [ipam] Requesting pool with poolId: options:map[] v6:false. +2021/04/30 23:31:19 [1763] [ipam] Checking pool 10.0.0.0/16. +2021/04/30 23:31:19 [1763] [ipam] Pool 10.0.0.0/16 matches requirements. +2021/04/30 23:31:19 [1763] [ipam] Pool request completed with pool:&{as:0xc0005846f0 Id:10.0.0.0/16 IfName:lo Subnet:{IP:10.0.0.0 Mask:ffff0000} Gateway:10.0.0.1 Addresses:map[10.0.0.5:0xc0000d54c0 10.0.0.6:0xc0000d5500 10.0.0.7:0xc0000d5540 10.0.0.8:0xc0000d5580 10.0.0.9:0xc0000d55c0] addrsByID:map[] IsIPv6:false Priority:0 RefCount:1 epoch:0} err:. +2021/04/30 23:31:19 [1763] [ipam] ipam store is nil. +2021/04/30 23:31:19 [1763] [azure-vnet-ipam] Sent *ipam.RequestPoolResponse &{Err: PoolID:local|10.0.0.0/16 Pool:10.0.0.0/16 Data:map[]}. +--- PASS: TestRequestPool (0.00s) +=== RUN TestRequestAddress +2021/04/30 23:31:19 [1763] [azure-vnet-ipam] Received *ipam.RequestAddressRequest &{PoolID:local|10.0.0.0/16 Address: Options:map[]}. +2021/04/30 23:31:19 [1763] [ipam] Refreshing address source. +2021/04/30 23:31:19 [1763] [ipam] Requesting address with address: options:map[azure.address.id:]. +2021/04/30 23:31:19 [1763] [ipam] Address request completed with address:10.0.0.5/16 +2021/04/30 23:31:19 [1763] [ipam] ipam store is nil. +2021/04/30 23:31:19 [1763] [azure-vnet-ipam] Sent *ipam.RequestAddressResponse &{Err: Address:10.0.0.5/16 Data:map[]}. +--- PASS: TestRequestAddress (0.00s) +=== RUN TestGetPoolInfo +2021/04/30 23:31:19 [1763] [azure-vnet-ipam] Received *ipam.GetPoolInfoRequest &{PoolID:local|10.0.0.0/16}. +2021/04/30 23:31:19 [1763] [azure-vnet-ipam] Sent *ipam.GetPoolInfoResponse &{Err: Capacity:5 Available:4 UnhealthyAddresses:[]}. +--- PASS: TestGetPoolInfo (0.00s) +=== RUN TestReleaseAddress +2021/04/30 23:31:19 [1763] [azure-vnet-ipam] Received *ipam.ReleaseAddressRequest &{PoolID:local|10.0.0.0/16 Address:10.0.0.5 Options:map[]}. +2021/04/30 23:31:19 [1763] [ipam] Refreshing address source. +2021/04/30 23:31:19 [1763] [ipam] Releasing address with address:10.0.0.5 options:map[]. +2021/04/30 23:31:19 [1763] [ipam] Address release completed with address:10.0.0.5 err:. +2021/04/30 23:31:19 [1763] [ipam] ipam store is nil. +2021/04/30 23:31:19 [1763] [azure-vnet-ipam] Sent *ipam.ReleaseAddressResponse &{Err:}. +--- PASS: TestReleaseAddress (0.00s) +=== RUN TestReleasePool +2021/04/30 23:31:19 [1763] [azure-vnet-ipam] Received *ipam.ReleasePoolRequest &{PoolID:local|10.0.0.0/16}. +2021/04/30 23:31:19 [1763] [ipam] Refreshing address source. +2021/04/30 23:31:19 [1763] [ipam] Releasing pool 10.0.0.0/16 as there are no allocations +2021/04/30 23:31:19 [1763] [ipam] ipam store is nil. +2021/04/30 23:31:19 [1763] [azure-vnet-ipam] Sent *ipam.ReleasePoolResponse &{Err:}. +--- PASS: TestReleasePool (0.00s) +=== RUN TestRequestAddressWithID +2021/04/30 23:31:19 [1763] [azure-vnet-ipam] Received *ipam.RequestAddressRequest &{PoolID:local|10.0.0.0/16 Address: Options:map[azure.address.id:id0]}. +2021/04/30 23:31:19 [1763] [ipam] Refreshing address source. +2021/04/30 23:31:19 [1763] [ipam] Requesting address with address: options:map[azure.address.id:id0]. +2021/04/30 23:31:19 [1763] [ipam] Address request completed with address:10.0.0.7/16 +2021/04/30 23:31:19 [1763] [ipam] ipam store is nil. +2021/04/30 23:31:19 [1763] [azure-vnet-ipam] Sent *ipam.RequestAddressResponse &{Err: Address:10.0.0.7/16 Data:map[]}. +2021/04/30 23:31:19 [1763] [azure-vnet-ipam] Received *ipam.RequestAddressRequest &{PoolID:local|10.0.0.0/16 Address: Options:map[azure.address.id:id0]}. +2021/04/30 23:31:19 [1763] [ipam] Refreshing address source. +2021/04/30 23:31:19 [1763] [ipam] Requesting address with address: options:map[azure.address.id:id0]. +2021/04/30 23:31:19 [1763] [ipam] Address request completed with address:10.0.0.7/16 +2021/04/30 23:31:19 [1763] [ipam] ipam store is nil. +2021/04/30 23:31:19 [1763] [azure-vnet-ipam] Sent *ipam.RequestAddressResponse &{Err: Address:10.0.0.7/16 Data:map[]}. +2021/04/30 23:31:19 [1763] [azure-vnet-ipam] Received *ipam.RequestAddressRequest &{PoolID:local|10.0.0.0/16 Address: Options:map[azure.address.id:id1]}. +2021/04/30 23:31:19 [1763] [ipam] Refreshing address source. +2021/04/30 23:31:19 [1763] [ipam] Requesting address with address: options:map[azure.address.id:id1]. +2021/04/30 23:31:19 [1763] [ipam] Address request completed with address:10.0.0.8/16 +2021/04/30 23:31:19 [1763] [ipam] ipam store is nil. +2021/04/30 23:31:19 [1763] [azure-vnet-ipam] Sent *ipam.RequestAddressResponse &{Err: Address:10.0.0.8/16 Data:map[]}. +2021/04/30 23:31:19 [1763] [azure-vnet-ipam] Received *ipam.RequestAddressRequest &{PoolID:local|10.0.0.0/16 Address: Options:map[azure.address.id:id1]}. +2021/04/30 23:31:19 [1763] [ipam] Refreshing address source. +2021/04/30 23:31:19 [1763] [ipam] Requesting address with address: options:map[azure.address.id:id1]. +2021/04/30 23:31:19 [1763] [ipam] Address request completed with address:10.0.0.8/16 +2021/04/30 23:31:19 [1763] [ipam] ipam store is nil. +2021/04/30 23:31:19 [1763] [azure-vnet-ipam] Sent *ipam.RequestAddressResponse &{Err: Address:10.0.0.8/16 Data:map[]}. +2021/04/30 23:31:19 [1763] [azure-vnet-ipam] Received *ipam.ReleaseAddressRequest &{PoolID:local|10.0.0.0/16 Address:10.0.0.7 Options:map[]}. +2021/04/30 23:31:19 [1763] [ipam] Refreshing address source. +2021/04/30 23:31:19 [1763] [ipam] Releasing address with address:10.0.0.7 options:map[]. +2021/04/30 23:31:19 [1763] [ipam] Address release completed with address:10.0.0.7 err:. +2021/04/30 23:31:19 [1763] [ipam] ipam store is nil. +2021/04/30 23:31:19 [1763] [azure-vnet-ipam] Sent *ipam.ReleaseAddressResponse &{Err:}. +2021/04/30 23:31:19 [1763] [azure-vnet-ipam] Received *ipam.ReleaseAddressRequest &{PoolID:local|10.0.0.0/16 Address:10.0.0.8 Options:map[]}. +2021/04/30 23:31:19 [1763] [ipam] Refreshing address source. +2021/04/30 23:31:19 [1763] [ipam] Releasing address with address:10.0.0.8 options:map[]. +2021/04/30 23:31:19 [1763] [ipam] Address release completed with address:10.0.0.8 err:. +2021/04/30 23:31:19 [1763] [ipam] ipam store is nil. +2021/04/30 23:31:19 [1763] [azure-vnet-ipam] Sent *ipam.ReleaseAddressResponse &{Err:}. +--- PASS: TestRequestAddressWithID (0.00s) +=== RUN TestReleaseAddressWithID +2021/04/30 23:31:19 [1763] [azure-vnet-ipam] Received *ipam.RequestAddressRequest &{PoolID:local|10.0.0.0/16 Address: Options:map[azure.address.id:id1]}. +2021/04/30 23:31:19 [1763] [ipam] Refreshing address source. +2021/04/30 23:31:19 [1763] [ipam] Requesting address with address: options:map[azure.address.id:id1]. +2021/04/30 23:31:19 [1763] [ipam] Address request completed with address:10.0.0.8/16 +2021/04/30 23:31:19 [1763] [ipam] ipam store is nil. +2021/04/30 23:31:19 [1763] [azure-vnet-ipam] Sent *ipam.RequestAddressResponse &{Err: Address:10.0.0.8/16 Data:map[]}. +2021/04/30 23:31:19 [1763] [azure-vnet-ipam] Received *ipam.ReleaseAddressRequest &{PoolID:local|10.0.0.0/16 Address: Options:map[azure.address.id:id1]}. +2021/04/30 23:31:19 [1763] [ipam] Refreshing address source. +2021/04/30 23:31:19 [1763] [ipam] Releasing address with address: options:map[azure.address.id:id1]. +2021/04/30 23:31:19 [1763] [ipam] Address release completed with address:10.0.0.8 err:. +2021/04/30 23:31:19 [1763] [ipam] ipam store is nil. +2021/04/30 23:31:19 [1763] [azure-vnet-ipam] Sent *ipam.ReleaseAddressResponse &{Err:}. +--- PASS: TestReleaseAddressWithID (0.00s) +PASS +coverage: 4.4% of statements in ./... +2021/04/30 23:31:19 [1763] [ipam] Plugin stopped. +2021/04/30 23:31:19 [1763] [Listener] Stopped listening on localhost:42424 +ok github.com/Azure/azure-container-networking/cnm/ipam 0.133s coverage: 4.4% of statements in ./... +2021/04/30 23:31:19 [1777] [Listener] Started listening on /run/docker/plugins/test.sock. +2021/04/30 23:31:19 [1777] [net] network store is nil +2021/04/30 23:31:19 [1777] [net] Plugin started. +2021/04/30 23:31:19 [1777] [net] Added ExternalInterface dummy for subnet 192.168.1.0/24. +=== RUN TestActivate +2021/04/30 23:31:19 [1777] [test] Received *cnm.activateRequest &{}. +2021/04/30 23:31:19 [1777] [test] Sent *cnm.ActivateResponse &{Err: Implements:[NetworkDriver]}. +--- PASS: TestActivate (0.01s) +=== RUN TestGetCapabilities +2021/04/30 23:31:19 [1777] [test] Received *network.getCapabilitiesRequest &{}. +2021/04/30 23:31:19 [1777] [test] Sent *network.getCapabilitiesResponse &{Err: Scope:local}. +--- PASS: TestGetCapabilities (0.00s) +=== RUN TestCNM +2021/04/30 23:31:19 [1777] /sbin/ip netns add 22212 +2021/04/30 23:31:19 [1777] ###CreateNetwork##################################################################################### +2021/04/30 23:31:19 [1777] [test] Received *network.createNetworkRequest &{NetworkID:N1 Options:map[] IPv4Data:[{AddressSpace: Pool:192.168.1.0/24 Gateway: AuxAddresses:map[]}] IPv6Data:[]}. +2021/04/30 23:31:19 [1777] [net] Creating network &{MasterIfName: AdapterName: Id:N1 Mode: Subnets:[{Family:10 Prefix:{IP:192.168.1.0 Mask:ffffff00} Gateway: PrimaryIP:}] PodSubnet:{Family:0 Prefix:{IP: Mask:} Gateway: PrimaryIP:} DNS:{Suffix: Servers:[] Options:[]} Policies:[] BridgeName: EnableSnatOnHost:false NetNs: Options:map[] DisableHairpinOnHostInterface:false IPV6Mode: IPAMType: ServiceCidrs:}. +2021/04/30 23:31:19 [1777] opt map[] options map[] +2021/04/30 23:31:19 [1777] create bridge +2021/04/30 23:31:19 [1777] [net] Connecting interface dummy. +2021/04/30 23:31:19 [1777] [net] Creating bridge azure111. +2021/04/30 23:31:19 [1777] [Azure-Utils] sysctl -w net.ipv6.conf.azure111.accept_ra=0 +2021/04/30 23:31:19 [1777] [net] Deleting IP address 192.168.1.4/24 from interface dummy. +2021/04/30 23:31:19 [1777] [net] Saved interface IP configuration &{Name:dummy Networks:map[] Subnets:[192.168.1.0/24] BridgeName: DNSInfo:{Suffix: Servers:[] Options:[]} MacAddress:c6:5e:b2:ee:9d:b4 IPAddresses:[192.168.1.4/24] Routes:[] IPv4Gateway:0.0.0.0 IPv6Gateway:::}. +2021/04/30 23:31:19 [1777] [net] OSInfo: map[BUG_REPORT_URL:"https://bugs.launchpad.net/ubuntu/" HOME_URL:"https://www.ubuntu.com/" ID:ubuntu ID_LIKE:debian NAME:"Ubuntu" PRETTY_NAME:"Ubuntu 18.04.4 LTS" PRIVACY_POLICY_URL:"https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" SUPPORT_URL:"https://help.ubuntu.com/" UBUNTU_CODENAME:bionic VERSION:"18.04.4 LTS (Bionic Beaver)" VERSION_CODENAME:bionic VERSION_ID:"18.04"] +2021/04/30 23:31:19 [1777] [net] Saving dns config from dummy +2021/04/30 23:31:19 [1777] [Azure-Utils] systemd-resolve --status dummy +2021/04/30 23:31:19 [1777] [net] console output for above cmd: Link 111 (dummy) + Current Scopes: none + LLMNR setting: yes +MulticastDNS setting: no + DNSSEC setting: no + DNSSEC supported: no +2021/04/30 23:31:19 [1777] [net] Failed to read dns info {Suffix: Servers:[] Options:[]} from interface dummy: +2021/04/30 23:31:19 [1777] [net] Setting link dummy state down. +2021/04/30 23:31:19 [1777] [net] Setting link dummy master azure111. +2021/04/30 23:31:19 [1777] [net] Setting link dummy state up. +2021/04/30 23:31:19 [1777] [net] Setting link azure111 state up. +2021/04/30 23:31:19 [1777] [net] Adding SNAT rule for egress traffic on dummy. +2021/04/30 23:31:19 [1777] [Azure-Utils] ebtables -t nat -A POSTROUTING -s unicast -o dummy -j snat --to-src c6:5e:b2:ee:9d:b4 --snat-arp --snat-target ACCEPT +2021/04/30 23:31:19 [1777] [net] Adding ARP reply rule for primary IP address 192.168.1.4. +2021/04/30 23:31:19 [1777] [Azure-Utils] ebtables -t nat -A PREROUTING -p ARP --arp-op Request --arp-ip-dst 192.168.1.4 -j arpreply --arpreply-mac c6:5e:b2:ee:9d:b4 --arpreply-target DROP +2021/04/30 23:31:19 [1777] [net] Adding DNAT rule for ingress ARP traffic on interface dummy. +2021/04/30 23:31:19 [1777] [Azure-Utils] ebtables -t nat -A PREROUTING -p ARP -i dummy --arp-op Reply -j dnat --to-dst ff:ff:ff:ff:ff:ff --dnat-target ACCEPT +2021/04/30 23:31:19 [1777] [net] Enabling VEPA mode for dummy. +2021/04/30 23:31:19 [1777] [Azure-Utils] ebtables -t nat -A PREROUTING -i az+ -j dnat --to-dst 12:34:56:78:9a:bc --dnat-target ACCEPT +2021/04/30 23:31:19 [1777] [net] Setting link dummy hairpin on. +2021/04/30 23:31:19 [1777] [net] Adding IP address 192.168.1.4/24 to interface azure111. +2021/04/30 23:31:19 [1777] [net] Applying dns config on azure111 +2021/04/30 23:31:19 [1777] [net] Applied dns config { [] []} on azure111 +2021/04/30 23:31:19 [1777] [net] Connected interface dummy to bridge azure111. +2021/04/30 23:31:19 [1777] [net] Connecting interface dummy completed with err:. +2021/04/30 23:31:19 [1777] [net] Created network N1 on interface dummy. +2021/04/30 23:31:19 [1777] [test] Sent *network.createNetworkResponse &{Err:}. +2021/04/30 23:31:19 [1777] ###CreateEndpoint#################################################################################### +2021/04/30 23:31:19 [1777] [test] Received *network.createEndpointRequest &{NetworkID:N1 EndpointID:E1-xxxx Options:map[] Interface:{Address:192.168.1.0/24 AddressIPv6: MacAddress:}}. +2021/04/30 23:31:19 [1777] [net] Creating endpoint &{Id:E1-xxxx ContainerID: NetNsPath: IfName: SandboxKey: IfIndex:0 MacAddress: DNS:{Suffix: Servers:[] Options:[]} IPAddresses:[{IP:192.168.1.0 Mask:ffffff00}] IPsToRouteViaHost:[] InfraVnetIP:{IP: Mask:} Routes:[] Policies:[] Gateways:[] EnableSnatOnHost:false EnableInfraVnet:false EnableMultiTenancy:false EnableSnatForDns:false AllowInboundFromHostToNC:false AllowInboundFromNCToHost:false NetworkContainerID: PODName: PODNameSpace: Data:map[] InfraVnetAddressSpace: SkipHotAttachEp:true IPV6Mode: VnetCidrs: ServiceCidrs:} in network N1. +2021/04/30 23:31:19 [1777] Generate veth name based on endpoint id +2021/04/30 23:31:19 [1777] Bridge client +2021/04/30 23:31:19 [1777] [net] Creating veth pair azvE1-xxxx azvE1-xxxx-2. +2021/04/30 23:31:19 [1777] [net] Setting link azvE1-xxxx state up. +2021/04/30 23:31:19 [1777] [Azure-Utils] sysctl -w net.ipv6.conf.azvE1-xxxx.accept_ra=0 +2021/04/30 23:31:19 [1777] [net] Setting link azvE1-xxxx master azure111. +2021/04/30 23:31:19 [1777] [net] Adding ARP reply rule for IP address 192.168.1.0/24 +2021/04/30 23:31:19 [1777] [Azure-Utils] ebtables -t nat -A PREROUTING -p ARP --arp-op Request --arp-ip-dst 192.168.1.0 -j arpreply --arpreply-mac 12:34:56:78:9a:bc --arpreply-target DROP +2021/04/30 23:31:19 [1777] [net] Adding MAC DNAT rule for IP address 192.168.1.0/24 +2021/04/30 23:31:19 [1777] [Azure-Utils] ebtables -t nat -A PREROUTING -p IPv4 -i dummy --ip-dst 192.168.1.0 -j dnat --to-dst fe:66:52:a5:06:c0 --dnat-target ACCEPT +2021/04/30 23:31:19 [1777] [net] Setting hairpin for hostveth azvE1-xxxx +2021/04/30 23:31:19 [1777] [net] Adding IP address 192.168.1.0/24 to link azvE1-xxxx-2. +2021/04/30 23:31:19 [1777] [net] Created endpoint &{Id:E1-xxxx HnsId: SandboxKey: IfName:azvE1-xxxx-2 HostIfName:azvE1-xxxx MacAddress:fe:66:52:a5:06:c0 InfraVnetIP:{IP: Mask:} LocalIP: IPAddresses:[{IP:192.168.1.0 Mask:ffffff00}] Gateways:[0.0.0.0] DNS:{Suffix: Servers:[] Options:[]} Routes:[] VlanID:0 EnableSnatOnHost:false EnableInfraVnet:false EnableMultitenancy:false AllowInboundFromHostToNC:false AllowInboundFromNCToHost:false NetworkContainerID: NetworkNameSpace: ContainerID: PODName: PODNameSpace: InfraVnetAddressSpace: NetNs:}. +2021/04/30 23:31:19 [1777] [test] Sent *network.createEndpointResponse &{Err: Interface:{Address: AddressIPv6: MacAddress:}}. +2021/04/30 23:31:19 [1777] ###EndpointOperInfo##################################################################################### +2021/04/30 23:31:19 [1777] [test] Received *network.endpointOperInfoRequest &{NetworkID:N1 EndpointID:E1-xxxx}. +2021/04/30 23:31:19 [1777] Trying to retrieve endpoint id E1-xxxx +2021/04/30 23:31:19 [1777] [test] Sent *network.endpointOperInfoResponse &{Err: Value:map[]}. +2021/04/30 23:31:19 [1777] ###DeleteEndpoint##################################################################################### +2021/04/30 23:31:19 [1777] [test] Received *network.deleteEndpointRequest &{NetworkID:N1 EndpointID:E1-xxxx}. +2021/04/30 23:31:19 [1777] [net] Deleting endpoint E1-xxxx from network N1. +2021/04/30 23:31:19 [1777] Trying to retrieve endpoint id E1-xxxx +2021/04/30 23:31:19 [1777] [net] Deleting ARP reply rule for IP address 192.168.1.0/24 on E1-xxxx. +2021/04/30 23:31:19 [1777] [Azure-Utils] ebtables -t nat -D PREROUTING -p ARP --arp-op Request --arp-ip-dst 192.168.1.0 -j arpreply --arpreply-mac 12:34:56:78:9a:bc --arpreply-target DROP +2021/04/30 23:31:19 [1777] [net] Deleting MAC DNAT rule for IP address 192.168.1.0/24 on E1-xxxx. +2021/04/30 23:31:19 [1777] [Azure-Utils] ebtables -t nat -D PREROUTING -p IPv4 -i dummy --ip-dst 192.168.1.0 -j dnat --to-dst fe:66:52:a5:06:c0 --dnat-target ACCEPT +2021/04/30 23:31:19 [1777] [net] Deleting veth pair azvE1-xxxx azvE1-xxxx-2. +2021/04/30 23:31:19 [1777] [net] Deleted endpoint &{Id:E1-xxxx HnsId: SandboxKey: IfName:azvE1-xxxx-2 HostIfName:azvE1-xxxx MacAddress:fe:66:52:a5:06:c0 InfraVnetIP:{IP: Mask:} LocalIP: IPAddresses:[{IP:192.168.1.0 Mask:ffffff00}] Gateways:[0.0.0.0] DNS:{Suffix: Servers:[] Options:[]} Routes:[] VlanID:0 EnableSnatOnHost:false EnableInfraVnet:false EnableMultitenancy:false AllowInboundFromHostToNC:false AllowInboundFromNCToHost:false NetworkContainerID: NetworkNameSpace: ContainerID: PODName: PODNameSpace: InfraVnetAddressSpace: NetNs:}. +2021/04/30 23:31:19 [1777] [test] Sent *network.deleteEndpointResponse &{Err:}. +2021/04/30 23:31:19 [1777] ###DeleteNetwork##################################################################################### +--- PASS: TestCNM (0.37s) +PASS +coverage: 8.0% of statements in ./... +2021/04/30 23:31:19 [1777] [Listener] Stopped listening on /run/docker/plugins/test.sock +2021/04/30 23:31:19 [1777] [net] Plugin stopped. +ok github.com/Azure/azure-container-networking/cnm/network 0.569s coverage: 8.0% of statements in ./... +? github.com/Azure/azure-container-networking/cnm/plugin [no test files] +? github.com/Azure/azure-container-networking/cnms/cnmspackage [no test files] +=== RUN TestAddMissingRule +2021/04/30 23:31:19 [1839] [ADD] Found unmatched rule chain POSTROUTING rule -s Unicast -o eth0 -j snat --to-src 00:0d:12:3a:5d:32 --snat-arp --snat-target ACCEPT itr 0. Giving one more iteration. +2021/04/30 23:31:19 [1839] [Azure-Utils] ebtables -t nat -A POSTROUTING -s Unicast -o eth0 -j snat --to-src 00:0d:12:3a:5d:32 --snat-arp --snat-target ACCEPT +2021/04/30 23:31:19 [1839] [monitor] Adding Ebtable rule as it existed in state rules but not in current chain rules for 1 iterations chain POSTROUTING rule -s Unicast -o eth0 -j snat --to-src 00:0d:12:3a:5d:32 --snat-arp --snat-target ACCEPT +--- PASS: TestAddMissingRule (0.03s) +=== RUN TestDeleteInvalidRule +2021/04/30 23:31:19 [1839] [DELETE] Found unmatched rule chain PREROUTING rule -p ARP -i eth0 --arp-op Reply -j dnat --to-dst ff:ff:ff:ff:ff:ff --dnat-target ACCEPT itr 0. Giving one more iteration. +2021/04/30 23:31:19 [1839] [Azure-Utils] ebtables -t nat -D PREROUTING -p ARP -i eth0 --arp-op Reply -j dnat --to-dst ff:ff:ff:ff:ff:ff --dnat-target ACCEPT +2021/04/30 23:31:19 [1839] [monitor] Error while deleting ebtable rule exit status 255:Sorry, rule does not exist. +--- PASS: TestDeleteInvalidRule (0.02s) +PASS +coverage: 1.2% of statements in ./... +ok github.com/Azure/azure-container-networking/cnms/service 0.188s coverage: 1.2% of statements in ./... +? github.com/Azure/azure-container-networking/cns [no test files] +logdir: /tmp/cns-719870598Test logger file: /tmp/cns-719870598/azure-cns.logTest state :/tmp/cns-659312387.json2021/04/30 23:31:20 [1911] HTTP listener will be started later after CNS state has been reconciled +2021/04/30 23:31:20 [1911] [Azure CNS] restoreState +2021/04/30 23:31:20 [1911] [Azure CNS] store not initialized. +2021/04/30 23:31:20 [1911] [Azure CNS] Enter Restoring Network State +2021/04/30 23:31:20 [1911] [Azure CNS] Store is not initialized, nothing to restore for network state. +2021/04/30 23:31:20 [1911] [Utils] Initializing HTTP client with connection timeout: 0, response header timeout: 0 +2021/04/30 23:31:20 [1911] SetContext details called with: orchestrator nodeID +2021/04/30 23:31:20 [1911] [Azure CNS] Listening. +2021/04/30 23:31:20 [1911] [Listener] Started listening on localhost:10090. +2021/04/30 23:31:20 [1911] [Azure CNS] setOrchestratorType +2021/04/30 23:31:20 [1911] SetContext details called with: KubernetesCRD orchestrator nodeID +2021/04/30 23:31:20 [1911] [Azure CNS] saveState +2021/04/30 23:31:20 [1911] [Azure CNS] store not initialized. +&{200 OK 200 HTTP/1.1 1 1 map[Content-Length:[30] Content-Type:[application/json; charset=UTF-8] Date:[Fri, 30 Apr 2021 23:31:20 GMT]] 0xc00030c200 30 [] false false map[] 0xc0004cc100 } +=== RUN TestCNSClientRequestAndRelease +2021/04/30 23:31:20 [1911] [Azure-Cns] Set IP 10.0.0.5 version to -1, programmed host nc version is -1 +2021/04/30 23:31:20 [1911] [Azure-Cns] Add IP 10.0.0.5 as Available +2021/04/30 23:31:20 [1911] [Azure CNS] saveState +2021/04/30 23:31:20 [1911] [Azure CNS] store not initialized. +2021/04/30 23:31:20 [1911] ReleaseIPAddress url http://localhost:10090/network/releaseipconfig +2021/04/30 23:31:20 [1911] [releaseIPConfig] SetIPConfigAsAvailable failed to release, no allocation found for pod [{PodName:testpodname PodNamespace:testpodnamespace}] +2021/04/30 23:31:20 [1911] [updateIPConfigState] Changing IpId [aced6459-4c14-4787-9cde-bed238b2c7f4] state to [Allocated], orchestratorContext [{"PodName":"testpodname","PodNamespace":"testpodnamespace"}]. Current config [IPConfigurationStatus: Id: [aced6459-4c14-4787-9cde-bed238b2c7f4], NcId: [testNcId1], IpAddress: [10.0.0.5], State: [Available], OrchestratorContext: []] +2021/04/30 23:31:20 [1911] [Azure CNS] GetPrimaryInterfaceInfoFromMemory +2021/04/30 23:31:20 [1911] [Azure CNS] GetPrimaryInterfaceInfoFromHost +2021/04/30 23:31:20 [1911] GetIPAddressesMatchingStates url http://localhost:10090/debug/getipaddresses + cnsclient_test.go:277: [IPConfigurationStatus: Id: [aced6459-4c14-4787-9cde-bed238b2c7f4], NcId: [testNcId1], IpAddress: [10.0.0.5], State: [Allocated], OrchestratorContext: [{"PodName":"testpodname","PodNamespace":"testpodnamespace"}]] +2021/04/30 23:31:20 [1911] ReleaseIPAddress url http://localhost:10090/network/releaseipconfig +2021/04/30 23:31:20 [1911] [releaseIPConfig] Releasing IP 10.0.0.5 for pod {PodName:testpodname PodNamespace:testpodnamespace} +2021/04/30 23:31:20 [1911] [updateIPConfigState] Changing IpId [aced6459-4c14-4787-9cde-bed238b2c7f4] state to [Available], orchestratorContext []. Current config [IPConfigurationStatus: Id: [aced6459-4c14-4787-9cde-bed238b2c7f4], NcId: [testNcId1], IpAddress: [10.0.0.5], State: [Allocated], OrchestratorContext: [{"PodName":"testpodname","PodNamespace":"testpodnamespace"}]] +2021/04/30 23:31:20 [1911] [setIPConfigAsAvailable] Deleted outdated pod info testpodname:testpodnamespace from PodIPIDByOrchestratorContext since IP 10.0.0.5 with ID aced6459-4c14-4787-9cde-bed238b2c7f4 will be released and set as Available +2021/04/30 23:31:20 [1911] [releaseIPConfig] Released IP 10.0.0.5 for pod {PodName:testpodname PodNamespace:testpodnamespace} +--- PASS: TestCNSClientRequestAndRelease (0.01s) +=== RUN TestCNSClientPodContextApi +2021/04/30 23:31:20 [1911] [Azure-Cns] Delete the PodIpConfigState, IpId: aced6459-4c14-4787-9cde-bed238b2c7f4, IPConfigStatus: IPConfigurationStatus: Id: [aced6459-4c14-4787-9cde-bed238b2c7f4], NcId: [testNcId1], IpAddress: [10.0.0.5], State: [Available], OrchestratorContext: [] +2021/04/30 23:31:20 [1911] [Azure-Cns] Set IP 10.0.0.5 version to -1, programmed host nc version is -1 +2021/04/30 23:31:20 [1911] [Azure-Cns] Add IP 10.0.0.5 as Available +2021/04/30 23:31:20 [1911] [Azure CNS] saveState +2021/04/30 23:31:20 [1911] [Azure CNS] store not initialized. +2021/04/30 23:31:20 [1911] [updateIPConfigState] Changing IpId [5c27d823-a148-41a1-8191-dff3a9e403d1] state to [Allocated], orchestratorContext [{"PodName":"testpodname","PodNamespace":"testpodnamespace"}]. Current config [IPConfigurationStatus: Id: [5c27d823-a148-41a1-8191-dff3a9e403d1], NcId: [testNcId1], IpAddress: [10.0.0.5], State: [Available], OrchestratorContext: []] +2021/04/30 23:31:20 [1911] [Azure CNS] GetPrimaryInterfaceInfoFromMemory +2021/04/30 23:31:20 [1911] [Azure CNS] GetPrimaryInterfaceInfoFromHost +2021/04/30 23:31:20 [1911] GetPodIPOrchestratorContext url http://localhost:10090/debug/getpodcontext + cnsclient_test.go:317: map[testpodname:testpodnamespace:5c27d823-a148-41a1-8191-dff3a9e403d1] +2021/04/30 23:31:20 [1911] ReleaseIPAddress url http://localhost:10090/network/releaseipconfig +2021/04/30 23:31:20 [1911] [releaseIPConfig] Releasing IP 10.0.0.5 for pod {PodName:testpodname PodNamespace:testpodnamespace} +2021/04/30 23:31:20 [1911] [updateIPConfigState] Changing IpId [5c27d823-a148-41a1-8191-dff3a9e403d1] state to [Available], orchestratorContext []. Current config [IPConfigurationStatus: Id: [5c27d823-a148-41a1-8191-dff3a9e403d1], NcId: [testNcId1], IpAddress: [10.0.0.5], State: [Allocated], OrchestratorContext: [{"PodName":"testpodname","PodNamespace":"testpodnamespace"}]] +2021/04/30 23:31:20 [1911] [setIPConfigAsAvailable] Deleted outdated pod info testpodname:testpodnamespace from PodIPIDByOrchestratorContext since IP 10.0.0.5 with ID 5c27d823-a148-41a1-8191-dff3a9e403d1 will be released and set as Available +2021/04/30 23:31:20 [1911] [releaseIPConfig] Released IP 10.0.0.5 for pod {PodName:testpodname PodNamespace:testpodnamespace} +--- PASS: TestCNSClientPodContextApi (0.00s) +=== RUN TestCNSClientDebugAPI +2021/04/30 23:31:20 [1911] [Azure-Cns] Delete the PodIpConfigState, IpId: 5c27d823-a148-41a1-8191-dff3a9e403d1, IPConfigStatus: IPConfigurationStatus: Id: [5c27d823-a148-41a1-8191-dff3a9e403d1], NcId: [testNcId1], IpAddress: [10.0.0.5], State: [Available], OrchestratorContext: [] +2021/04/30 23:31:20 [1911] [Azure-Cns] Set IP 10.0.0.5 version to -1, programmed host nc version is -1 +2021/04/30 23:31:20 [1911] [Azure-Cns] Add IP 10.0.0.5 as Available +2021/04/30 23:31:20 [1911] [Azure CNS] saveState +2021/04/30 23:31:20 [1911] [Azure CNS] store not initialized. +2021/04/30 23:31:20 [1911] [updateIPConfigState] Changing IpId [8f5769a1-e970-420b-af83-bfdc92aa25d7] state to [Allocated], orchestratorContext [{"PodName":"testpodname","PodNamespace":"testpodnamespace"}]. Current config [IPConfigurationStatus: Id: [8f5769a1-e970-420b-af83-bfdc92aa25d7], NcId: [testNcId1], IpAddress: [10.0.0.5], State: [Available], OrchestratorContext: []] +2021/04/30 23:31:20 [1911] [Azure CNS] GetPrimaryInterfaceInfoFromMemory +2021/04/30 23:31:20 [1911] [Azure CNS] GetPrimaryInterfaceInfoFromHost +2021/04/30 23:31:20 [1911] GetHTTPServiceStruct url http://localhost:10090/debug/getrestdata + cnsclient_test.go:388: In-memory Data: + cnsclient_test.go:389: PodIPIDByOrchestratorContext: map[testpodname:testpodnamespace:8f5769a1-e970-420b-af83-bfdc92aa25d7] + cnsclient_test.go:390: PodIPConfigState: map[8f5769a1-e970-420b-af83-bfdc92aa25d7:IPConfigurationStatus: Id: [8f5769a1-e970-420b-af83-bfdc92aa25d7], NcId: [testNcId1], IpAddress: [10.0.0.5], State: [Allocated], OrchestratorContext: [{"PodName":"testpodname","PodNamespace":"testpodnamespace"}]] + cnsclient_test.go:391: IPAMPoolMonitor: {MinimumFreeIps:10 MaximumFreeIps:20 UpdatingIpsNotInUseCount:13 CachedNNC:{TypeMeta:{Kind: APIVersion:} ObjectMeta:{Name: GenerateName: Namespace: SelfLink: UID: ResourceVersion: Generation:0 CreationTimestamp:0001-01-01 00:00:00 +0000 UTC DeletionTimestamp: DeletionGracePeriodSeconds: Labels:map[] Annotations:map[] OwnerReferences:[] Finalizers:[] ClusterName: ManagedFields:[]} Spec:{RequestedIPCount:16 IPsNotInUse:[abc]} Status:{Scaler:{BatchSize:10 ReleaseThresholdPercent:50 RequestThresholdPercent:40 MaxIPCount:0} NetworkContainers:[{ID:nc1 PrimaryIP:10.0.0.11 SubnetName:sub1 IPAssignments:[{Name:ip1 IP:10.0.0.10}] DefaultGateway:10.0.0.1 SubnetAddressSpace:10.0.0.0/24 Version:2}]}}} +--- PASS: TestCNSClientDebugAPI (0.00s) +PASS +coverage: 5.1% of statements in ./... +ok github.com/Azure/azure-container-networking/cns/cnsclient 0.137s coverage: 5.1% of statements in ./... +? github.com/Azure/azure-container-networking/cns/cnsclient/httpapi [no test files] +? github.com/Azure/azure-container-networking/cns/common [no test files] +? github.com/Azure/azure-container-networking/cns/configuration [no test files] +? github.com/Azure/azure-container-networking/cns/dockerclient [no test files] +? github.com/Azure/azure-container-networking/cns/fakes [no test files] +? github.com/Azure/azure-container-networking/cns/hnsclient [no test files] +? github.com/Azure/azure-container-networking/cns/imdsclient [no test files] +2021/04/30 23:31:21 [1931] [Listener] Started listening on localhost:42424. +=== RUN TestAddressSpaces +2021/04/30 23:31:21 [1931] [Azure CNS] GetAddressSpace Request +--- PASS: TestAddressSpaces (0.00s) +=== RUN TestGetPoolID +2021/04/30 23:31:21 [1931] [Azure CNS] GetAddressSpace Request +2021/04/30 23:31:21 [1931] [Azure CNS] GetPoolID Request +--- PASS: TestGetPoolID (0.00s) +=== RUN TestReserveIP +2021/04/30 23:31:21 [1931] [Azure CNS] GetAddressSpace Request +2021/04/30 23:31:21 [1931] [Azure CNS] GetPoolID Request +2021/04/30 23:31:21 [1931] [Azure CNS] ReserveIpAddress +2021/04/30 23:31:21 [1931] [Azure CNS] ReserveIpAddress +--- PASS: TestReserveIP (0.00s) +=== RUN TestReleaseIP +2021/04/30 23:31:21 [1931] [Azure CNS] GetAddressSpace Request +2021/04/30 23:31:21 [1931] [Azure CNS] GetPoolID Request +2021/04/30 23:31:21 [1931] [Azure CNS] ReserveIpAddress +2021/04/30 23:31:21 [1931] [Azure CNS] ReleaseIpAddress +2021/04/30 23:31:21 [1931] [Azure CNS] ReleaseIP invalid http status code: 404 +--- PASS: TestReleaseIP (0.00s) +=== RUN TestIPAddressUtilization +2021/04/30 23:31:21 [1931] [Azure CNS] GetAddressSpace Request +2021/04/30 23:31:21 [1931] [Azure CNS] GetPoolID Request +2021/04/30 23:31:21 [1931] [Azure CNS] GetIPAddressUtilization +2021/04/30 23:31:21 Capacity 10 Available 7 Unhealthy [10.0.0.5 10.0.0.6 10.0.0.7] +--- PASS: TestIPAddressUtilization (0.00s) +PASS +coverage: 1.6% of statements in ./... +2021/04/30 23:31:21 [1931] [Listener] Stopped listening on localhost:42424 +ok github.com/Azure/azure-container-networking/cns/ipamclient 0.243s coverage: 1.6% of statements in ./... +=== RUN TestPoolSizeIncrease +2021/04/30 23:31:21 [1946] NewCNSIPAMPoolMonitor: Create IPAM Pool Monitor +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Update spec {RequestedIPCount:10 IPsNotInUse:[]}, pm.MinimumFreeIps 3, pm.MaximumFreeIps 15 +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Increasing pool size...[ipam-pool-monitor] Pool Size: 10, Goal Size: 10, BatchSize: 10, MaxIPCount: 30, MinFree: 3, MaxFree:15, Allocated: 8, Available: 2, Pending Release: 0, Free: 2, Pending Program: 0 +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Increasing pool size, Current Pool Size: 10, Updated Requested IP Count: 20, Pods with IP's:8, ToBeDeleted Count: 0 +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Increasing pool size: UpdateCRDSpec succeeded for spec {RequestedIPCount:20 IPsNotInUse:[]} +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Update spec {RequestedIPCount:10 IPsNotInUse:[]}, pm.MinimumFreeIps 3, pm.MaximumFreeIps 15 +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Increasing pool size...[ipam-pool-monitor] Pool Size: 20, Goal Size: 10, BatchSize: 10, MaxIPCount: 30, MinFree: 3, MaxFree:15, Allocated: 8, Available: 12, Pending Release: 0, Free: 2, Pending Program: 0 +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Increasing pool size, Current Pool Size: 20, Updated Requested IP Count: 20, Pods with IP's:8, ToBeDeleted Count: 0 +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Increasing pool size: UpdateCRDSpec succeeded for spec {RequestedIPCount:20 IPsNotInUse:[]} + ipampoolmonitor_test.go:86: Pool size 20, Target pool size 20, Allocated IP's 8, +--- PASS: TestPoolSizeIncrease (0.00s) +=== RUN TestPoolIncreaseDoesntChangeWhenIncreaseIsAlreadyInProgress +2021/04/30 23:31:21 [1946] NewCNSIPAMPoolMonitor: Create IPAM Pool Monitor +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Update spec {RequestedIPCount:10 IPsNotInUse:[]}, pm.MinimumFreeIps 3, pm.MaximumFreeIps 15 +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Increasing pool size...[ipam-pool-monitor] Pool Size: 10, Goal Size: 10, BatchSize: 10, MaxIPCount: 30, MinFree: 3, MaxFree:15, Allocated: 8, Available: 2, Pending Release: 0, Free: 2, Pending Program: 0 +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Increasing pool size, Current Pool Size: 10, Updated Requested IP Count: 20, Pods with IP's:8, ToBeDeleted Count: 0 +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Increasing pool size: UpdateCRDSpec succeeded for spec {RequestedIPCount:20 IPsNotInUse:[]} +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Update spec {RequestedIPCount:10 IPsNotInUse:[]}, pm.MinimumFreeIps 3, pm.MaximumFreeIps 15 +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Increasing pool size...[ipam-pool-monitor] Pool Size: 20, Goal Size: 10, BatchSize: 10, MaxIPCount: 30, MinFree: 3, MaxFree:15, Allocated: 9, Available: 11, Pending Release: 0, Free: 1, Pending Program: 0 +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Increasing pool size, Current Pool Size: 20, Updated Requested IP Count: 20, Pods with IP's:9, ToBeDeleted Count: 0 +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Increasing pool size: UpdateCRDSpec succeeded for spec {RequestedIPCount:20 IPsNotInUse:[]} + ipampoolmonitor_test.go:152: Pool size 20, Target pool size 20, Allocated IP's 9, +--- PASS: TestPoolIncreaseDoesntChangeWhenIncreaseIsAlreadyInProgress (0.00s) +=== RUN TestPoolSizeIncreaseIdempotency +2021/04/30 23:31:21 [1946] NewCNSIPAMPoolMonitor: Create IPAM Pool Monitor +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Update spec {RequestedIPCount:10 IPsNotInUse:[]}, pm.MinimumFreeIps 3, pm.MaximumFreeIps 15 + ipampoolmonitor_test.go:166: Minimum free IPs to request: 3 + ipampoolmonitor_test.go:167: Maximum free IPs to release: 15 +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Increasing pool size...[ipam-pool-monitor] Pool Size: 10, Goal Size: 10, BatchSize: 10, MaxIPCount: 30, MinFree: 3, MaxFree:15, Allocated: 8, Available: 2, Pending Release: 0, Free: 2, Pending Program: 0 +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Increasing pool size, Current Pool Size: 10, Updated Requested IP Count: 20, Pods with IP's:8, ToBeDeleted Count: 0 +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Increasing pool size: UpdateCRDSpec succeeded for spec {RequestedIPCount:20 IPsNotInUse:[]} +--- PASS: TestPoolSizeIncreaseIdempotency (0.00s) +=== RUN TestPoolIncreasePastNodeLimit +2021/04/30 23:31:21 [1946] NewCNSIPAMPoolMonitor: Create IPAM Pool Monitor +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Update spec {RequestedIPCount:16 IPsNotInUse:[]}, pm.MinimumFreeIps 8, pm.MaximumFreeIps 24 + ipampoolmonitor_test.go:209: Minimum free IPs to request: 8 + ipampoolmonitor_test.go:210: Maximum free IPs to release: 24 +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Increasing pool size...[ipam-pool-monitor] Pool Size: 16, Goal Size: 16, BatchSize: 16, MaxIPCount: 30, MinFree: 8, MaxFree:24, Allocated: 9, Available: 7, Pending Release: 0, Free: 7, Pending Program: 0 +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Requested IP count (32) is over max limit (30), requesting max limit instead. +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Increasing pool size, Current Pool Size: 16, Updated Requested IP Count: 30, Pods with IP's:9, ToBeDeleted Count: 0 +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Increasing pool size: UpdateCRDSpec succeeded for spec {RequestedIPCount:30 IPsNotInUse:[]} +--- PASS: TestPoolIncreasePastNodeLimit (0.00s) +=== RUN TestPoolIncreaseBatchSizeGreaterThanMaxPodIPCount +2021/04/30 23:31:21 [1946] NewCNSIPAMPoolMonitor: Create IPAM Pool Monitor +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Update spec {RequestedIPCount:16 IPsNotInUse:[]}, pm.MinimumFreeIps 15, pm.MaximumFreeIps 45 + ipampoolmonitor_test.go:241: Minimum free IPs to request: 15 + ipampoolmonitor_test.go:242: Maximum free IPs to release: 45 +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Increasing pool size...[ipam-pool-monitor] Pool Size: 16, Goal Size: 16, BatchSize: 30, MaxIPCount: 30, MinFree: 15, MaxFree:45, Allocated: 16, Available: 0, Pending Release: 0, Free: 0, Pending Program: 0 +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Requested IP count (46) is over max limit (30), requesting max limit instead. +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Increasing pool size, Current Pool Size: 16, Updated Requested IP Count: 30, Pods with IP's:16, ToBeDeleted Count: 0 +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Increasing pool size: UpdateCRDSpec succeeded for spec {RequestedIPCount:30 IPsNotInUse:[]} +--- PASS: TestPoolIncreaseBatchSizeGreaterThanMaxPodIPCount (0.00s) +=== RUN TestPoolIncreaseMaxIPCountSetToZero +2021/04/30 23:31:21 [1946] NewCNSIPAMPoolMonitor: Create IPAM Pool Monitor +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Update spec {RequestedIPCount:16 IPsNotInUse:[]}, pm.MinimumFreeIps 8, pm.MaximumFreeIps 24 +--- PASS: TestPoolIncreaseMaxIPCountSetToZero (0.00s) +=== RUN TestPoolDecrease +2021/04/30 23:31:21 [1946] NewCNSIPAMPoolMonitor: Create IPAM Pool Monitor +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Update spec {RequestedIPCount:20 IPsNotInUse:[]}, pm.MinimumFreeIps 3, pm.MaximumFreeIps 15 +2021/04/30 23:31:21 Min free IP's 3 +2021/04/30 23:31:21 Max free IP 15 +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Decreasing pool size...[ipam-pool-monitor] Pool Size: 20, Goal Size: 20, BatchSize: 10, MaxIPCount: 30, MinFree: 3, MaxFree:15, Allocated: 4, Available: 16, Pending Release: 0, Free: 16, Pending Program: 0 +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Previously RequestedIP Count 20 +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Batch size : 10 +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] modResult of (previously requested IP count mod batch size) = 0 +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] updatedRequestedIPCount 10 +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Marking IPs as PendingRelease, ipsToBeReleasedCount 10 +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Releasing IPCount in this batch 10, updatingPendingIpsNotInUse count 10 +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Decreasing pool size, Current Pool Size: 20, Requested IP Count: 10, Pods with IP's: 4, ToBeDeleted Count: 10 +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Decreasing pool size: UpdateCRDSpec succeeded for spec {RequestedIPCount:10 IPsNotInUse:[6d6779ae-ec6a-4346-b010-b9655f826d2e 8d55e09e-3ba7-499d-8065-f5e1702dc405 739b00c5-4884-46c9-adb3-c8f8876fb9da f43f7c68-b2a1-45a1-b34f-56acc113923f 9c78bc81-71c6-4b62-bf59-75cc4405aed6 d0074938-3f33-4754-b600-9ba9a681ca1e 2bcbed58-8cb2-49ec-974a-5e928bfe7ce8 cdd4922e-d597-47a4-96cb-f82d5012e97f c9cbf1f9-a09d-478a-808f-e6aa781f2898 ed916137-a352-4568-a6cc-9c4129e5abb7]} +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] cleaning the updatingPendingIpsNotInUse, existing length 10 +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Update spec {RequestedIPCount:10 IPsNotInUse:[]}, pm.MinimumFreeIps 3, pm.MaximumFreeIps 15 +--- PASS: TestPoolDecrease (0.00s) +=== RUN TestPoolSizeDecreaseWhenDecreaseHasAlreadyBeenRequested +2021/04/30 23:31:21 [1946] NewCNSIPAMPoolMonitor: Create IPAM Pool Monitor +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Update spec {RequestedIPCount:20 IPsNotInUse:[]}, pm.MinimumFreeIps 3, pm.MaximumFreeIps 10 +2021/04/30 23:31:21 Min free IP's 3 +2021/04/30 23:31:21 Max free IP 10 +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Decreasing pool size...[ipam-pool-monitor] Pool Size: 20, Goal Size: 20, BatchSize: 10, MaxIPCount: 30, MinFree: 3, MaxFree:10, Allocated: 5, Available: 15, Pending Release: 0, Free: 15, Pending Program: 0 +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Previously RequestedIP Count 20 +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Batch size : 10 +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] modResult of (previously requested IP count mod batch size) = 0 +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] updatedRequestedIPCount 10 +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Marking IPs as PendingRelease, ipsToBeReleasedCount 10 +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Releasing IPCount in this batch 10, updatingPendingIpsNotInUse count 10 +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Decreasing pool size, Current Pool Size: 20, Requested IP Count: 10, Pods with IP's: 5, ToBeDeleted Count: 10 +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Decreasing pool size: UpdateCRDSpec succeeded for spec {RequestedIPCount:10 IPsNotInUse:[b6093b04-6b47-4648-b3dc-b9108d849005 80e35579-000d-4858-93a4-3dbaa6cb7d5f dea6699f-b6ee-47a7-a84d-a660ca08ab1f 54802a1d-d2f8-4854-b461-ad4d6f137e54 b5af4d57-075e-4b13-979a-f6f8668f5701 0148bc7e-cb7c-49ef-aec8-b40357e18f7d 3c63a897-04f0-415a-8c20-d309d0c5ac3a ad4cdef7-68a9-4b0c-b595-61eb680f713b cb35f5bb-443a-41a3-9a28-62d9b333a36e cd932371-6444-48e5-b426-957f066a4d1e]} +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] cleaning the updatingPendingIpsNotInUse, existing length 10 +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Update spec {RequestedIPCount:10 IPsNotInUse:[]}, pm.MinimumFreeIps 3, pm.MaximumFreeIps 10 +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Removing Pending Release IP's from CRD...[ipam-pool-monitor] Pool Size: 10, Goal Size: 10, BatchSize: 10, MaxIPCount: 30, MinFree: 3, MaxFree:10, Allocated: 6, Available: 4, Pending Release: 0, Free: 4, Pending Program: 0 +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] cleanPendingRelease: UpdateCRDSpec succeeded for spec {RequestedIPCount:10 IPsNotInUse:[]} +--- PASS: TestPoolSizeDecreaseWhenDecreaseHasAlreadyBeenRequested (0.00s) +=== RUN TestPoolSizeDecreaseToReallyLow +2021/04/30 23:31:21 [1946] NewCNSIPAMPoolMonitor: Create IPAM Pool Monitor +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Update spec {RequestedIPCount:30 IPsNotInUse:[]}, pm.MinimumFreeIps 3, pm.MaximumFreeIps 10 +2021/04/30 23:31:21 Min free IP's 3 +2021/04/30 23:31:21 Max free IP 10 + ipampoolmonitor_test.go:437: Reconcile after Allocated count from 33 -> 3, Exepected free count = 10 +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Decreasing pool size...[ipam-pool-monitor] Pool Size: 30, Goal Size: 30, BatchSize: 10, MaxIPCount: 30, MinFree: 3, MaxFree:10, Allocated: 3, Available: 27, Pending Release: 0, Free: 27, Pending Program: 0 +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Previously RequestedIP Count 30 +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Batch size : 10 +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] modResult of (previously requested IP count mod batch size) = 0 +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] updatedRequestedIPCount 20 +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Marking IPs as PendingRelease, ipsToBeReleasedCount 10 +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Releasing IPCount in this batch 10, updatingPendingIpsNotInUse count 10 +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Decreasing pool size, Current Pool Size: 30, Requested IP Count: 20, Pods with IP's: 3, ToBeDeleted Count: 10 +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Decreasing pool size: UpdateCRDSpec succeeded for spec {RequestedIPCount:20 IPsNotInUse:[e614a67b-56d0-489e-a75f-3dbfe19c2745 99f971c7-2907-4305-bb58-6b67d87704de ae5238c1-5ac7-48a7-98e1-4f3148bb32d2 755a514b-17f9-42ea-9d55-268d90743a8f 52524f90-fbc3-4abe-84d4-526a95305fdd bb94164a-cd72-4e20-890e-68af5105f0b9 bc2d1ede-3132-4f73-8c66-86817e2281ce fbf89ec8-6246-48d7-9584-7aaa63fa96bd 352ea257-f8d6-4b20-95e9-57f0bf4fbd2b 64b09d05-2e02-4095-a3ca-62350da4f8cb]} +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] cleaning the updatingPendingIpsNotInUse, existing length 10 + ipampoolmonitor_test.go:454: Reconcile again - 2, Exepected free count = 20 +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Decreasing pool size...[ipam-pool-monitor] Pool Size: 30, Goal Size: 20, BatchSize: 10, MaxIPCount: 30, MinFree: 3, MaxFree:10, Allocated: 3, Available: 17, Pending Release: 10, Free: 17, Pending Program: 0 +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Previously RequestedIP Count 20 +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Batch size : 10 +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] modResult of (previously requested IP count mod batch size) = 0 +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] updatedRequestedIPCount 10 +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Marking IPs as PendingRelease, ipsToBeReleasedCount 10 +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Releasing IPCount in this batch 10, updatingPendingIpsNotInUse count 20 +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Decreasing pool size, Current Pool Size: 30, Requested IP Count: 10, Pods with IP's: 3, ToBeDeleted Count: 20 +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Decreasing pool size: UpdateCRDSpec succeeded for spec {RequestedIPCount:10 IPsNotInUse:[352ea257-f8d6-4b20-95e9-57f0bf4fbd2b 64b09d05-2e02-4095-a3ca-62350da4f8cb 62d9f933-4ba5-4e79-981a-853e0dab3107 e614a67b-56d0-489e-a75f-3dbfe19c2745 ae5238c1-5ac7-48a7-98e1-4f3148bb32d2 28dfc0fa-bff1-4074-ac75-776755fd21e0 5dc2c8b5-27a9-47dd-a3ab-1cba4901c38a 5e04e5e7-ac34-4f94-b92b-02c946d76a36 700d6611-6e4f-42d2-b939-72f574da73f9 bc2d1ede-3132-4f73-8c66-86817e2281ce fbf89ec8-6246-48d7-9584-7aaa63fa96bd 5bb1cb98-ed43-4646-be67-0c111430b56a 5b226262-60a1-4a9c-b9dd-4da633edf829 18b00350-8779-4ccf-90b2-051736d574e8 9a162413-572b-41a0-b76a-15cdf8535de5 99f971c7-2907-4305-bb58-6b67d87704de 755a514b-17f9-42ea-9d55-268d90743a8f 52524f90-fbc3-4abe-84d4-526a95305fdd bb94164a-cd72-4e20-890e-68af5105f0b9 e31452d1-f623-41f6-8c2e-2b621850f2b9]} +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] cleaning the updatingPendingIpsNotInUse, existing length 20 + ipampoolmonitor_test.go:470: Update Request Controller +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Update spec {RequestedIPCount:10 IPsNotInUse:[]}, pm.MinimumFreeIps 3, pm.MaximumFreeIps 10 +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Removing Pending Release IP's from CRD...[ipam-pool-monitor] Pool Size: 10, Goal Size: 10, BatchSize: 10, MaxIPCount: 30, MinFree: 3, MaxFree:10, Allocated: 3, Available: 7, Pending Release: 0, Free: 7, Pending Program: 0 +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] cleanPendingRelease: UpdateCRDSpec succeeded for spec {RequestedIPCount:10 IPsNotInUse:[]} +--- PASS: TestPoolSizeDecreaseToReallyLow (0.01s) +=== RUN TestDecreaseAfterNodeLimitReached +2021/04/30 23:31:21 [1946] NewCNSIPAMPoolMonitor: Create IPAM Pool Monitor +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Update spec {RequestedIPCount:30 IPsNotInUse:[]}, pm.MinimumFreeIps 8, pm.MaximumFreeIps 24 + ipampoolmonitor_test.go:500: Minimum free IPs to request: 8 + ipampoolmonitor_test.go:501: Maximum free IPs to release: 24 +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Decreasing pool size...[ipam-pool-monitor] Pool Size: 30, Goal Size: 30, BatchSize: 16, MaxIPCount: 30, MinFree: 8, MaxFree:24, Allocated: 5, Available: 25, Pending Release: 0, Free: 25, Pending Program: 0 +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Previously RequestedIP Count 30 +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Batch size : 16 +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] modResult of (previously requested IP count mod batch size) = 14 +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] updatedRequestedIPCount 16 +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Marking IPs as PendingRelease, ipsToBeReleasedCount 14 +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Releasing IPCount in this batch 14, updatingPendingIpsNotInUse count 14 +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Decreasing pool size, Current Pool Size: 30, Requested IP Count: 16, Pods with IP's: 5, ToBeDeleted Count: 14 +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Decreasing pool size: UpdateCRDSpec succeeded for spec {RequestedIPCount:16 IPsNotInUse:[c654d2b8-9ec3-4b29-b05e-6e81a211db15 8a8e0d70-711f-459b-8019-f46436d46eac c9211380-218d-4102-86e5-a61a648b0686 927c39c3-dfbc-4a56-964f-7779b0a6fd2b 09f9b0a9-08f7-41d3-ac14-f6361b0b673c 24cfc897-1f00-4000-ade0-d1022321558b fb931d6c-04a2-4fa7-8d90-9a5b9bb6bb37 cdf714f2-f231-4ab3-98a8-740063fa1550 bb813f28-f86b-42b3-9a21-7dbeebe340e6 06909b8e-ecbb-4d76-98bf-5c8fb01490e2 37eca699-15ba-4a9e-b3c3-3acacf56ee8a 92c9d54a-e9c4-4353-b3e5-b13beecd51b6 371a7d62-e561-48b1-adb7-82cded3ebbc4 03818ade-c847-4e5b-abf5-b5fe26086403]} +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] cleaning the updatingPendingIpsNotInUse, existing length 14 +--- PASS: TestDecreaseAfterNodeLimitReached (0.00s) +=== RUN TestPoolDecreaseBatchSizeGreaterThanMaxPodIPCount +2021/04/30 23:31:21 [1946] NewCNSIPAMPoolMonitor: Create IPAM Pool Monitor +2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Update spec {RequestedIPCount:30 IPsNotInUse:[]}, pm.MinimumFreeIps 15, pm.MaximumFreeIps 45 + ipampoolmonitor_test.go:546: Minimum free IPs to request: 15 + ipampoolmonitor_test.go:547: Maximum free IPs to release: 45 +--- PASS: TestPoolDecreaseBatchSizeGreaterThanMaxPodIPCount (0.00s) +PASS +coverage: 2.8% of statements in ./... +ok github.com/Azure/azure-container-networking/cns/ipampoolmonitor 0.176s coverage: 2.8% of statements in ./... +? github.com/Azure/azure-container-networking/cns/logger [no test files] +? github.com/Azure/azure-container-networking/cns/networkcontainers [no test files] +? github.com/Azure/azure-container-networking/cns/nmagentclient [no test files] +? github.com/Azure/azure-container-networking/cns/requestcontroller [no test files] +=== RUN TestNewCrdRequestController +--- PASS: TestNewCrdRequestController (0.00s) +=== RUN TestGetNonExistingNodeNetConfig +--- PASS: TestGetNonExistingNodeNetConfig (0.00s) +=== RUN TestGetExistingNodeNetConfig +--- PASS: TestGetExistingNodeNetConfig (0.00s) +=== RUN TestUpdateNonExistingNodeNetConfig +--- PASS: TestUpdateNonExistingNodeNetConfig (0.00s) +=== RUN TestUpdateExistingNodeNetConfig +--- PASS: TestUpdateExistingNodeNetConfig (0.00s) +=== RUN TestUpdateSpecOnNonExistingNodeNetConfig +2021/04/30 23:31:21 [1945] [cns-rc] Error getting CRD when updating spec Node Net Config not found in mock store +--- PASS: TestUpdateSpecOnNonExistingNodeNetConfig (0.00s) +=== RUN TestUpdateSpecOnExistingNodeNetConfig +2021/04/30 23:31:21 [1945] [cns-rc] Received update for IP count {RequestedIPCount:10 IPsNotInUse:[539970a2-c2dd-11ea-b3de-0242ac130004 01a5dd00-cd5d-11ea-87d0-0242ac130003]} +2021/04/30 23:31:21 [1945] [cns-rc] After deep copy {RequestedIPCount:10 IPsNotInUse:[539970a2-c2dd-11ea-b3de-0242ac130004 01a5dd00-cd5d-11ea-87d0-0242ac130003]} +--- PASS: TestUpdateSpecOnExistingNodeNetConfig (0.00s) +=== RUN TestGetExistingNNCDirectClient +--- PASS: TestGetExistingNNCDirectClient (0.00s) +=== RUN TestGetNonExistingNNCDirectClient +--- PASS: TestGetNonExistingNNCDirectClient (0.00s) +=== RUN TestGetPodsExistingNodeDirectClient +--- PASS: TestGetPodsExistingNodeDirectClient (0.00s) +=== RUN TestGetPodsNonExistingNodeDirectClient +--- PASS: TestGetPodsNonExistingNodeDirectClient (0.00s) +=== RUN TestInitRequestController +2021/04/30 23:31:21 [1945] Set NC request info with NetworkContainerid 24fcd232-0364-41b0-8027-6e6ef9aeabc6, NetworkContainerType Docker, NC Version 1 +--- PASS: TestInitRequestController (0.00s) +=== RUN TestStatusToNCRequestMalformedPrimaryIP +--- PASS: TestStatusToNCRequestMalformedPrimaryIP (0.00s) +=== RUN TestStatusToNCRequestMalformedIPAssignment +--- PASS: TestStatusToNCRequestMalformedIPAssignment (0.00s) +=== RUN TestStatusToNCRequestPrimaryIPInCIDR +--- PASS: TestStatusToNCRequestPrimaryIPInCIDR (0.00s) +=== RUN TestStatusToNCRequestIPAssignmentNotCIDR +--- PASS: TestStatusToNCRequestIPAssignmentNotCIDR (0.00s) +=== RUN TestStatusToNCRequestWithIncorrectSubnetAddressSpace +--- PASS: TestStatusToNCRequestWithIncorrectSubnetAddressSpace (0.00s) +=== RUN TestStatusToNCRequestSuccess +2021/04/30 23:31:21 [1945] Set NC request info with NetworkContainerid 160005ba-cd02-11ea-87d0-0242ac130003, NetworkContainerType Docker, NC Version 1 +--- PASS: TestStatusToNCRequestSuccess (0.00s) +PASS +coverage: 1.6% of statements in ./... +ok github.com/Azure/azure-container-networking/cns/requestcontroller/kubecontroller 0.146s coverage: 1.6% of statements in ./... +2021/04/30 23:31:22 [2008] HTTP listener will be started later after CNS state has been reconciled +2021/04/30 23:31:22 [2008] [Azure CNS] restoreState +2021/04/30 23:31:22 [2008] [Azure CNS] Failed to restore state, err:EOF. Removing azure-cns.json +2021/04/30 23:31:22 [2008] [Azure CNS] Enter Restoring Network State +2021/04/30 23:31:22 [2008] os.stat() for file azure-cns.json failed: stat azure-cns.json: no such file or directory +2021/04/30 23:31:22 [2008] [Utils] Initializing HTTP client with connection timeout: 0, response header timeout: 0 +2021/04/30 23:31:22 [2008] SetContext details called with: orchestrator nodeID +2021/04/30 23:31:22 [2008] [Azure CNS] Listening. +2021/04/30 23:31:22 [2008] [Listener] Started listening on localhost:10090. +2021/04/30 23:31:22 [2008] [Listener] Started listening on localhost:9000. +=== RUN TestSetEnvironment +Test: SetEnvironment +2021/04/30 23:31:22 [2008] [Azure CNS] setEnvironment +2021/04/30 23:31:22 [2008] [Azure CNS] POST received for SetEnvironment. +2021/04/30 23:31:22 [2008] [Azure CNS] saveState +2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. +SetEnvironment Responded with {ReturnCode:0 Message:} +--- PASS: TestSetEnvironment (0.00s) +=== RUN TestSetOrchestratorType +Test: TestSetOrchestratorType +2021/04/30 23:31:22 [2008] [Azure CNS] setEnvironment +2021/04/30 23:31:22 [2008] [Azure CNS] POST received for SetEnvironment. +2021/04/30 23:31:22 [2008] [Azure CNS] saveState +2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. +2021/04/30 23:31:22 [2008] [Azure CNS] setOrchestratorType +2021/04/30 23:31:22 [2008] SetContext details called with: Kubernetes orchestrator nodeID +2021/04/30 23:31:22 [2008] [Azure CNS] saveState +2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. +Raw response: setOrchestratorType passed with response {ReturnCode:0 Message:} Err:setOrchestratorType succeeded with response {ReturnCode:0 Message:} +--- PASS: TestSetOrchestratorType (0.00s) +=== RUN TestCreateNetworkContainer +Test: TestCreateNetworkContainer +2021/04/30 23:31:22 [2008] [Azure CNS] setEnvironment +2021/04/30 23:31:22 [2008] [Azure CNS] POST received for SetEnvironment. +2021/04/30 23:31:22 [2008] [Azure CNS] saveState +2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. +2021/04/30 23:31:22 [2008] [Azure CNS] setOrchestratorType +2021/04/30 23:31:22 [2008] SetContext details called with: ServiceFabric orchestrator nodeID +2021/04/30 23:31:22 [2008] [Azure CNS] saveState +2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. +Raw response: setOrchestratorType passed with response {ReturnCode:0 Message:} Err:setOrchestratorType succeeded with response {ReturnCode:0 Message:} +TestCreateNetworkContainer: JobObject +2021/04/30 23:31:22 [2008] [Azure CNS] createOrUpdateNetworkContainer +2021/04/30 23:31:22 [2008] Pod info {testpod testpodnamespace} +2021/04/30 23:31:22 [2008] [Azure CNS] saveState +2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. +Raw response: CreateNetworkContainerRequest passed with response {Response:{ReturnCode:0 Message:}} Err:CreateNetworkContainerRequest succeeded with response {Response:{ReturnCode:0 Message:}} +Deleting the saved goal state for network container of type JobObject +2021/04/30 23:31:22 [2008] [Azure CNS] deleteNetworkContainer +2021/04/30 23:31:22 [2008] [Azure CNS] saveState +2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. +DeleteNetworkContainer succeded with response {Response:{ReturnCode:0 Message:}} +TestCreateNetworkContainer: WebApps +2021/04/30 23:31:22 [2008] [Azure CNS] createOrUpdateNetworkContainer +2021/04/30 23:31:22 [2008] [Azure CNS] NetworkContainers.Create called for NC: Swift_ethWebApp +2021/04/30 23:31:22 [2008] [Azure CNS] NetworkContainers.Create completed for NC: Swift_ethWebApp with error: +2021/04/30 23:31:22 [2008] Pod info {testpod testpodnamespace} +2021/04/30 23:31:22 [2008] [Azure CNS] saveState +2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. +Raw response: CreateNetworkContainerRequest passed with response {Response:{ReturnCode:0 Message:}} Err:CreateNetworkContainerRequest succeeded with response {Response:{ReturnCode:0 Message:}} +2021/04/30 23:31:22 [2008] [Azure CNS] createOrUpdateNetworkContainer +2021/04/30 23:31:22 [2008] Pod info {testpod testpodnamespace} +2021/04/30 23:31:22 [2008] [Azure CNS] saveState +2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. +Raw response: CreateNetworkContainerRequest passed with response {Response:{ReturnCode:0 Message:}} Err:CreateNetworkContainerRequest succeeded with response {Response:{ReturnCode:0 Message:}} +Now calling DeleteNetworkContainer +2021/04/30 23:31:22 [2008] [Azure CNS] deleteNetworkContainer +2021/04/30 23:31:22 [2008] [Azure CNS] NetworkContainers.Delete called for NC: Swift_ethWebApp +2021/04/30 23:31:22 [2008] [Azure CNS] NetworkContainers.Delete completed for NC: Swift_ethWebApp with error: +2021/04/30 23:31:22 [2008] [Azure CNS] saveState +2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. +DeleteNetworkContainer succeded with response {Response:{ReturnCode:0 Message:}} +2021/04/30 23:31:22 [2008] [Azure CNS] createOrUpdateNetworkContainer +2021/04/30 23:31:22 [2008] Pod info {testpod testpodnamespace} +2021/04/30 23:31:22 [2008] [Azure CNS] saveState +2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. +Raw response: CreateNetworkContainerRequest passed with response {Response:{ReturnCode:0 Message:}} Err:CreateNetworkContainerRequest succeeded with response {Response:{ReturnCode:0 Message:}} +Deleting the saved goal state for network container of type COW +2021/04/30 23:31:22 [2008] [Azure CNS] deleteNetworkContainer +2021/04/30 23:31:22 [2008] [Azure CNS] saveState +2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. +DeleteNetworkContainer succeded with response {Response:{ReturnCode:0 Message:}} +--- PASS: TestCreateNetworkContainer (0.02s) +=== RUN TestGetNetworkContainerByOrchestratorContext +Test: TestGetNetworkContainerByOrchestratorContext +2021/04/30 23:31:22 [2008] [Azure CNS] setEnvironment +2021/04/30 23:31:22 [2008] [Azure CNS] POST received for SetEnvironment. +2021/04/30 23:31:22 [2008] [Azure CNS] saveState +2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. +2021/04/30 23:31:22 [2008] [Azure CNS] setOrchestratorType +2021/04/30 23:31:22 [2008] SetContext details called with: Kubernetes orchestrator nodeID +2021/04/30 23:31:22 [2008] [Azure CNS] saveState +2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. +Raw response: setOrchestratorType passed with response {ReturnCode:0 Message:} Err:setOrchestratorType succeeded with response {ReturnCode:0 Message:} +2021/04/30 23:31:22 [2008] [Azure CNS] createOrUpdateNetworkContainer +2021/04/30 23:31:22 [2008] Pod info {testpod testpodnamespace} +2021/04/30 23:31:22 [2008] [Azure CNS] saveState +2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. +Raw response: CreateNetworkContainerRequest passed with response {Response:{ReturnCode:0 Message:}} Err:CreateNetworkContainerRequest succeeded with response {Response:{ReturnCode:0 Message:}} +Now calling getNetworkContainerByContext +2021/04/30 23:31:22 [2008] [Azure CNS] getNetworkContainerByOrchestratorContext +2021/04/30 23:31:22 [2008] pod info {PodName:testpod PodNamespace:testpodnamespace} +2021/04/30 23:31:22 [2008] [Azure CNS] getNCVersionURL for Network container Swift_ethWebApp not found. Skipping GetNCVersionStatus check from NMAgent +2021/04/30 23:31:22 [2008] containerid Swift_ethWebApp +**GetNetworkContainerByContext succeded with response {NetworkContainerID:Swift_ethWebApp IPConfiguration:{IPSubnet:{IPAddress:11.0.0.5 PrefixLength:24} DNSServers:[8.8.8.8 8.8.4.4] GatewayIPAddress:11.0.0.1} Routes:[] CnetAddressSpace:[] MultiTenancyInfo:{EncapType: ID:0} PrimaryInterfaceIdentifier:11.0.0.7 LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} Response:{ReturnCode:0 Message:} AllowHostToNCCommunication:false AllowNCToHostCommunication:false}, raw: +Now calling DeleteNetworkContainer +2021/04/30 23:31:22 [2008] [Azure CNS] deleteNetworkContainer +2021/04/30 23:31:22 [2008] [Azure CNS] saveState +2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. +DeleteNetworkContainer succeded with response {Response:{ReturnCode:0 Message:}} +2021/04/30 23:31:22 [2008] [Azure CNS] getNetworkContainerByOrchestratorContext +2021/04/30 23:31:22 [2008] pod info {PodName:testpod PodNamespace:testpodnamespace} +2021/04/30 23:31:22 [2008] containerid +2021/04/30 23:31:22 [2008] [cns-test-server] Code:UnknownContainerID, {NetworkContainerID: IPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} Routes:[] CnetAddressSpace:[] MultiTenancyInfo:{EncapType: ID:0} PrimaryInterfaceIdentifier: LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} Response:{ReturnCode:18 Message:NetworkContainer doesn't exist.} AllowHostToNCCommunication:false AllowNCToHostCommunication:false}. +**GetNonExistNetworkContainerByContext succeded with response {NetworkContainerID: IPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} Routes:[] CnetAddressSpace:[] MultiTenancyInfo:{EncapType: ID:0} PrimaryInterfaceIdentifier: LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} Response:{ReturnCode:18 Message:NetworkContainer doesn't exist.} AllowHostToNCCommunication:false AllowNCToHostCommunication:false}, raw: +--- PASS: TestGetNetworkContainerByOrchestratorContext (0.01s) +=== RUN TestGetInterfaceForNetworkContainer +Test: TestCreateNetworkContainer +2021/04/30 23:31:22 [2008] [Azure CNS] setEnvironment +2021/04/30 23:31:22 [2008] [Azure CNS] POST received for SetEnvironment. +2021/04/30 23:31:22 [2008] [Azure CNS] saveState +2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. +2021/04/30 23:31:22 [2008] [Azure CNS] setOrchestratorType +2021/04/30 23:31:22 [2008] SetContext details called with: Kubernetes orchestrator nodeID +2021/04/30 23:31:22 [2008] [Azure CNS] saveState +2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. +Raw response: setOrchestratorType passed with response {ReturnCode:0 Message:} Err:setOrchestratorType succeeded with response {ReturnCode:0 Message:} +2021/04/30 23:31:22 [2008] [Azure CNS] createOrUpdateNetworkContainer +2021/04/30 23:31:22 [2008] [Azure CNS] NetworkContainers.Create called for NC: Swift_ethWebApp +2021/04/30 23:31:22 [2008] [Azure CNS] NetworkContainers.Create completed for NC: Swift_ethWebApp with error: +2021/04/30 23:31:22 [2008] Pod info {testpod testpodnamespace} +2021/04/30 23:31:22 [2008] [Azure CNS] saveState +2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. +Raw response: CreateNetworkContainerRequest passed with response {Response:{ReturnCode:0 Message:}} Err:CreateNetworkContainerRequest succeeded with response {Response:{ReturnCode:0 Message:}} +Now calling getInterfaceForContainer +2021/04/30 23:31:22 [2008] [Azure CNS] getInterfaceForContainer +**GetInterfaceForContainer succeded with response {NetworkContainerVersion:0 NetworkInterface:{Name:Swift_ethWebApp IPAddress:11.0.0.5} CnetAddressSpace:[] DNSServers:[8.8.8.8 8.8.4.4] Response:{ReturnCode:0 Message:}}, raw: +Now calling DeleteNetworkContainer +2021/04/30 23:31:22 [2008] [Azure CNS] deleteNetworkContainer +2021/04/30 23:31:22 [2008] [Azure CNS] NetworkContainers.Delete called for NC: Swift_ethWebApp +2021/04/30 23:31:22 [2008] [Azure CNS] NetworkContainers.Delete completed for NC: Swift_ethWebApp with error: +2021/04/30 23:31:22 [2008] [Azure CNS] saveState +2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. +DeleteNetworkContainer succeded with response {Response:{ReturnCode:0 Message:}} +--- PASS: TestGetInterfaceForNetworkContainer (0.01s) +=== RUN TestGetNumOfCPUCores +Test: getNumberOfCPUCores +2021/04/30 23:31:22 [2008] [Azure-CNS] getNumberOfCPUCores +getNumberOfCPUCores Responded with {Response:{ReturnCode:0 Message:} NumOfCPUCores:4} +--- PASS: TestGetNumOfCPUCores (0.00s) +=== RUN TestGetNetworkContainerVersionStatus +Test: TestGetNetworkContainerVersionStatus +2021/04/30 23:31:22 [2008] [Azure CNS] setEnvironment +2021/04/30 23:31:22 [2008] [Azure CNS] POST received for SetEnvironment. +2021/04/30 23:31:22 [2008] [Azure CNS] saveState +2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. +2021/04/30 23:31:22 [2008] [Azure CNS] setOrchestratorType +2021/04/30 23:31:22 [2008] SetContext details called with: Kubernetes orchestrator nodeID +2021/04/30 23:31:22 [2008] [Azure CNS] saveState +2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. +Raw response: setOrchestratorType passed with response {ReturnCode:0 Message:} Err:setOrchestratorType succeeded with response {ReturnCode:0 Message:} +2021/04/30 23:31:22 [2008] [Azure CNS] createOrUpdateNetworkContainer +2021/04/30 23:31:22 [2008] Pod info {testpod testpodnamespace} +2021/04/30 23:31:22 [2008] [Azure CNS] saveState +2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. +Raw response: CreateNetworkContainerRequest passed with response {Response:{ReturnCode:0 Message:}} Err:CreateNetworkContainerRequest succeeded with response {Response:{ReturnCode:0 Message:}} +2021/04/30 23:31:22 [2008] [Azure-CNS] PublishNetworkContainer +2021/04/30 23:31:22 [2008] [NMAgentClient] JoinNetwork: vnet1 +2021/04/30 23:31:22 [2008] [NMAgentClient][Response] Join network: vnet1. Response: &{Status:200 OK StatusCode:200 Proto:HTTP/1.1 ProtoMajor:1 ProtoMinor:1 Header:map[Content-Length:[0] Content-Type:[application/json; charset=UTF-8] Date:[Fri, 30 Apr 2021 23:31:22 GMT]] Body:{} ContentLength:0 TransferEncoding:[] Close:false Uncompressed:false Trailer:map[] Request:0xc000122200 TLS:}. Error: +2021/04/30 23:31:22 [2008] [Azure-CNS] setNetworkStateJoined for network: vnet1 +2021/04/30 23:31:22 [2008] [NMAgentClient] PublishNetworkContainer NC: nc-nma-success +2021/04/30 23:31:22 [2008] [NMAgentClient][Response] Publish NC: nc-nma-success. Response: &{Status:200 OK StatusCode:200 Proto:HTTP/1.1 ProtoMajor:1 ProtoMinor:1 Header:map[Content-Length:[0] Content-Type:[application/json; charset=UTF-8] Date:[Fri, 30 Apr 2021 23:31:22 GMT]] Body:{} ContentLength:0 TransferEncoding:[] Close:false Uncompressed:false Trailer:map[] Request:0xc0004ac900 TLS:}. Error: +PublishNetworkContainer succeded with response {Response:{ReturnCode:0 Message:} PublishErrorStr: PublishStatusCode:200 PublishResponseBody:[]}, raw: +2021/04/30 23:31:22 [2008] [Azure CNS] getNetworkContainerByOrchestratorContext +2021/04/30 23:31:22 [2008] pod info {PodName:testpod PodNamespace:testpodnamespace} +2021/04/30 23:31:22 [2008] [NMAgentClient] GetNetworkContainerVersion NC: Swift_nc-nma-success +2021/04/30 23:31:22 [2008] [NMAgentClient][Response] GetNetworkContainerVersion NC: Swift_nc-nma-success. Response: &{Status:200 OK StatusCode:200 Proto:HTTP/1.1 ProtoMajor:1 ProtoMinor:1 Header:map[Content-Length:[76] Content-Type:[application/json; charset=UTF-8] Date:[Fri, 30 Apr 2021 23:31:22 GMT]] Body:0xc000457300 ContentLength:76 TransferEncoding:[] Close:false Uncompressed:false Trailer:map[] Request:0xc0004acc00 TLS:}. Error: +2021/04/30 23:31:22 [2008] [Azure CNS] Vfp programming complete for NC: Swift_nc-nma-success with version: 0 +2021/04/30 23:31:22 [2008] [Azure-CNS] Setting VfpUpdateComplete to true for NC: Swift_nc-nma-success +2021/04/30 23:31:22 [2008] [Azure CNS] saveState +2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. +2021/04/30 23:31:22 [2008] containerid Swift_nc-nma-success +**GetNetworkContainerByContext succeded with response {NetworkContainerID:Swift_nc-nma-success IPConfiguration:{IPSubnet:{IPAddress:11.0.0.5 PrefixLength:24} DNSServers:[8.8.8.8 8.8.4.4] GatewayIPAddress:11.0.0.1} Routes:[] CnetAddressSpace:[] MultiTenancyInfo:{EncapType: ID:0} PrimaryInterfaceIdentifier:11.0.0.7 LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} Response:{ReturnCode:0 Message:} AllowHostToNCCommunication:false AllowNCToHostCommunication:false}, raw: +2021/04/30 23:31:22 [2008] [Azure CNS] getNetworkContainerByOrchestratorContext +2021/04/30 23:31:22 [2008] pod info {PodName:testpod PodNamespace:testpodnamespace} +2021/04/30 23:31:22 [2008] [Azure CNS] Network container: Swift_nc-nma-success, version: 0 has VFP programming already completed +2021/04/30 23:31:22 [2008] containerid Swift_nc-nma-success +**GetNetworkContainerByContext succeded with response {NetworkContainerID:Swift_nc-nma-success IPConfiguration:{IPSubnet:{IPAddress:11.0.0.5 PrefixLength:24} DNSServers:[8.8.8.8 8.8.4.4] GatewayIPAddress:11.0.0.1} Routes:[] CnetAddressSpace:[] MultiTenancyInfo:{EncapType: ID:0} PrimaryInterfaceIdentifier:11.0.0.7 LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} Response:{ReturnCode:0 Message:} AllowHostToNCCommunication:false AllowNCToHostCommunication:false}, raw: +2021/04/30 23:31:22 [2008] [Azure CNS] deleteNetworkContainer +2021/04/30 23:31:22 [2008] [Azure CNS] saveState +2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. +DeleteNetworkContainer succeded with response {Response:{ReturnCode:0 Message:}} +2021/04/30 23:31:22 [2008] [Azure CNS] createOrUpdateNetworkContainer +2021/04/30 23:31:22 [2008] Pod info {testpod testpodnamespace} +2021/04/30 23:31:22 [2008] [Azure CNS] saveState +2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. +Raw response: CreateNetworkContainerRequest passed with response {Response:{ReturnCode:0 Message:}} Err:CreateNetworkContainerRequest succeeded with response {Response:{ReturnCode:0 Message:}} +2021/04/30 23:31:22 [2008] [Azure-CNS] PublishNetworkContainer +2021/04/30 23:31:22 [2008] [NMAgentClient] JoinNetwork: vnet1 +2021/04/30 23:31:22 [2008] [NMAgentClient][Response] Join network: vnet1. Response: &{Status:200 OK StatusCode:200 Proto:HTTP/1.1 ProtoMajor:1 ProtoMinor:1 Header:map[Content-Length:[0] Content-Type:[application/json; charset=UTF-8] Date:[Fri, 30 Apr 2021 23:31:22 GMT]] Body:{} ContentLength:0 TransferEncoding:[] Close:false Uncompressed:false Trailer:map[] Request:0xc0004ad300 TLS:}. Error: +2021/04/30 23:31:22 [2008] [Azure-CNS] setNetworkStateJoined for network: vnet1 +2021/04/30 23:31:22 [2008] [NMAgentClient] PublishNetworkContainer NC: nc-nma-fail-version-mismatch +2021/04/30 23:31:22 [2008] [NMAgentClient][Response] Publish NC: nc-nma-fail-version-mismatch. Response: &{Status:200 OK StatusCode:200 Proto:HTTP/1.1 ProtoMajor:1 ProtoMinor:1 Header:map[Content-Length:[0] Content-Type:[application/json; charset=UTF-8] Date:[Fri, 30 Apr 2021 23:31:22 GMT]] Body:{} ContentLength:0 TransferEncoding:[] Close:false Uncompressed:false Trailer:map[] Request:0xc000122400 TLS:}. Error: +PublishNetworkContainer succeded with response {Response:{ReturnCode:0 Message:} PublishErrorStr: PublishStatusCode:200 PublishResponseBody:[]}, raw: +2021/04/30 23:31:22 [2008] [Azure CNS] getNetworkContainerByOrchestratorContext +2021/04/30 23:31:22 [2008] pod info {PodName:testpod PodNamespace:testpodnamespace} +2021/04/30 23:31:22 [2008] [NMAgentClient] GetNetworkContainerVersion NC: Swift_nc-nma-fail-version-mismatch +2021/04/30 23:31:22 [2008] [NMAgentClient][Response] GetNetworkContainerVersion NC: Swift_nc-nma-fail-version-mismatch. Response: &{Status:200 OK StatusCode:200 Proto:HTTP/1.1 ProtoMajor:1 ProtoMinor:1 Header:map[Content-Length:[90] Content-Type:[application/json; charset=UTF-8] Date:[Fri, 30 Apr 2021 23:31:22 GMT]] Body:0xc00008ac00 ContentLength:90 TransferEncoding:[] Close:false Uncompressed:false Trailer:map[] Request:0xc000122700 TLS:}. Error: +2021/04/30 23:31:22 [2008] [Azure-CNS] isNCWaitingForUpdate failed for NC: Swift_nc-nma-fail-version-mismatch with error: Network container: Swift_nc-nma-fail-version-mismatch version: 1 is not yet programmed by NMAgent. Programmed version: 0 +2021/04/30 23:31:22 [2008] [cns-test-server] Code:NetworkContainerVfpProgramPending, {NetworkContainerID: IPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} Routes:[] CnetAddressSpace:[] MultiTenancyInfo:{EncapType: ID:0} PrimaryInterfaceIdentifier: LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} Response:{ReturnCode:31 Message:Network container: Swift_nc-nma-fail-version-mismatch version: 1 is not yet programmed by NMAgent. Programmed version: 0} AllowHostToNCCommunication:false AllowNCToHostCommunication:false}. +**getNetworkContainerByContextExpectedError succeded with response {NetworkContainerID: IPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} Routes:[] CnetAddressSpace:[] MultiTenancyInfo:{EncapType: ID:0} PrimaryInterfaceIdentifier: LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} Response:{ReturnCode:31 Message:Network container: Swift_nc-nma-fail-version-mismatch version: 1 is not yet programmed by NMAgent. Programmed version: 0} AllowHostToNCCommunication:false AllowNCToHostCommunication:false}, raw: +2021/04/30 23:31:22 [2008] [Azure CNS] deleteNetworkContainer +2021/04/30 23:31:22 [2008] [Azure CNS] saveState +2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. +DeleteNetworkContainer succeded with response {Response:{ReturnCode:0 Message:}} +2021/04/30 23:31:22 [2008] [Azure CNS] createOrUpdateNetworkContainer +2021/04/30 23:31:22 [2008] Pod info {testpod testpodnamespace} +2021/04/30 23:31:22 [2008] [Azure CNS] saveState +2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. +Raw response: CreateNetworkContainerRequest passed with response {Response:{ReturnCode:0 Message:}} Err:CreateNetworkContainerRequest succeeded with response {Response:{ReturnCode:0 Message:}} +2021/04/30 23:31:22 [2008] [Azure-CNS] PublishNetworkContainer +2021/04/30 23:31:22 [2008] [NMAgentClient] JoinNetwork: vnet1 +2021/04/30 23:31:22 [2008] [NMAgentClient][Response] Join network: vnet1. Response: &{Status:200 OK StatusCode:200 Proto:HTTP/1.1 ProtoMajor:1 ProtoMinor:1 Header:map[Content-Length:[0] Content-Type:[application/json; charset=UTF-8] Date:[Fri, 30 Apr 2021 23:31:22 GMT]] Body:{} ContentLength:0 TransferEncoding:[] Close:false Uncompressed:false Trailer:map[] Request:0xc000122d00 TLS:}. Error: +2021/04/30 23:31:22 [2008] [Azure-CNS] setNetworkStateJoined for network: vnet1 +2021/04/30 23:31:22 [2008] [NMAgentClient] PublishNetworkContainer NC: nc-nma-fail-500 +2021/04/30 23:31:22 [2008] [NMAgentClient][Response] Publish NC: nc-nma-fail-500. Response: &{Status:200 OK StatusCode:200 Proto:HTTP/1.1 ProtoMajor:1 ProtoMinor:1 Header:map[Content-Length:[0] Content-Type:[application/json; charset=UTF-8] Date:[Fri, 30 Apr 2021 23:31:22 GMT]] Body:{} ContentLength:0 TransferEncoding:[] Close:false Uncompressed:false Trailer:map[] Request:0xc000018100 TLS:}. Error: +PublishNetworkContainer succeded with response {Response:{ReturnCode:0 Message:} PublishErrorStr: PublishStatusCode:200 PublishResponseBody:[]}, raw: +2021/04/30 23:31:22 [2008] [Azure CNS] getNetworkContainerByOrchestratorContext +2021/04/30 23:31:22 [2008] pod info {PodName:testpod PodNamespace:testpodnamespace} +2021/04/30 23:31:22 [2008] [NMAgentClient] GetNetworkContainerVersion NC: Swift_nc-nma-fail-500 +2021/04/30 23:31:22 [2008] [NMAgentClient][Response] GetNetworkContainerVersion NC: Swift_nc-nma-fail-500. Response: &{Status:500 Internal Server Error StatusCode:500 Proto:HTTP/1.1 ProtoMajor:1 ProtoMinor:1 Header:map[Content-Length:[77] Content-Type:[application/json; charset=UTF-8] Date:[Fri, 30 Apr 2021 23:31:22 GMT]] Body:0xc000318380 ContentLength:77 TransferEncoding:[] Close:false Uncompressed:false Trailer:map[] Request:0xc000018400 TLS:}. Error: +2021/04/30 23:31:22 [2008] [Azure CNS] Failed to get NC version status from NMAgent with http status 500. Skipping GetNCVersionStatus check from NMAgent +2021/04/30 23:31:22 [2008] containerid Swift_nc-nma-fail-500 +**GetNetworkContainerByContext succeded with response {NetworkContainerID:Swift_nc-nma-fail-500 IPConfiguration:{IPSubnet:{IPAddress:11.0.0.5 PrefixLength:24} DNSServers:[8.8.8.8 8.8.4.4] GatewayIPAddress:11.0.0.1} Routes:[] CnetAddressSpace:[] MultiTenancyInfo:{EncapType: ID:0} PrimaryInterfaceIdentifier:11.0.0.7 LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} Response:{ReturnCode:0 Message:} AllowHostToNCCommunication:false AllowNCToHostCommunication:false}, raw: +2021/04/30 23:31:22 [2008] [Azure CNS] deleteNetworkContainer +2021/04/30 23:31:22 [2008] [Azure CNS] saveState +2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. +DeleteNetworkContainer succeded with response {Response:{ReturnCode:0 Message:}} +2021/04/30 23:31:22 [2008] [Azure CNS] createOrUpdateNetworkContainer +2021/04/30 23:31:22 [2008] Pod info {testpod testpodnamespace} +2021/04/30 23:31:22 [2008] [Azure CNS] saveState +2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. +Raw response: CreateNetworkContainerRequest passed with response {Response:{ReturnCode:0 Message:}} Err:CreateNetworkContainerRequest succeeded with response {Response:{ReturnCode:0 Message:}} +2021/04/30 23:31:22 [2008] [Azure-CNS] PublishNetworkContainer +2021/04/30 23:31:22 [2008] [NMAgentClient] JoinNetwork: vnet1 +2021/04/30 23:31:22 [2008] [NMAgentClient][Response] Join network: vnet1. Response: &{Status:200 OK StatusCode:200 Proto:HTTP/1.1 ProtoMajor:1 ProtoMinor:1 Header:map[Content-Length:[0] Content-Type:[application/json; charset=UTF-8] Date:[Fri, 30 Apr 2021 23:31:22 GMT]] Body:{} ContentLength:0 TransferEncoding:[] Close:false Uncompressed:false Trailer:map[] Request:0xc000018a00 TLS:}. Error: +2021/04/30 23:31:22 [2008] [Azure-CNS] setNetworkStateJoined for network: vnet1 +2021/04/30 23:31:22 [2008] [NMAgentClient] PublishNetworkContainer NC: nc-nma-fail-unavailable +2021/04/30 23:31:22 [2008] [NMAgentClient][Response] Publish NC: nc-nma-fail-unavailable. Response: &{Status:200 OK StatusCode:200 Proto:HTTP/1.1 ProtoMajor:1 ProtoMinor:1 Header:map[Content-Length:[0] Content-Type:[application/json; charset=UTF-8] Date:[Fri, 30 Apr 2021 23:31:22 GMT]] Body:{} ContentLength:0 TransferEncoding:[] Close:false Uncompressed:false Trailer:map[] Request:0xc000018c00 TLS:}. Error: +PublishNetworkContainer succeded with response {Response:{ReturnCode:0 Message:} PublishErrorStr: PublishStatusCode:200 PublishResponseBody:[]}, raw: +2021/04/30 23:31:22 [2008] [Azure CNS] getNetworkContainerByOrchestratorContext +2021/04/30 23:31:22 [2008] pod info {PodName:testpod PodNamespace:testpodnamespace} +2021/04/30 23:31:22 [2008] [NMAgentClient] GetNetworkContainerVersion NC: Swift_nc-nma-fail-unavailable +2021/04/30 23:31:22 [2008] [NMAgentClient][Response] GetNetworkContainerVersion NC: Swift_nc-nma-fail-unavailable. Response: &{Status:200 OK StatusCode:200 Proto:HTTP/1.1 ProtoMajor:1 ProtoMinor:1 Header:map[Content-Length:[85] Content-Type:[application/json; charset=UTF-8] Date:[Fri, 30 Apr 2021 23:31:22 GMT]] Body:0xc0003187c0 ContentLength:85 TransferEncoding:[] Close:false Uncompressed:false Trailer:map[] Request:0xc000123000 TLS:}. Error: +2021/04/30 23:31:22 [2008] [Azure-CNS] isNCWaitingForUpdate failed for NC: Swift_nc-nma-fail-unavailable with error: Failed to get NC version status from NMAgent. NC: Swift_nc-nma-fail-unavailable, Response {"httpStatusCode":"401","networkContainerId":"nc-nma-fail-unavailable","version":"0"} +2021/04/30 23:31:22 [2008] [cns-test-server] Code:NetworkContainerVfpProgramPending, {NetworkContainerID: IPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} Routes:[] CnetAddressSpace:[] MultiTenancyInfo:{EncapType: ID:0} PrimaryInterfaceIdentifier: LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} Response:{ReturnCode:31 Message:Failed to get NC version status from NMAgent. NC: Swift_nc-nma-fail-unavailable, Response {"httpStatusCode":"401","networkContainerId":"nc-nma-fail-unavailable","version":"0"}} AllowHostToNCCommunication:false AllowNCToHostCommunication:false}. +**getNetworkContainerByContextExpectedError succeded with response {NetworkContainerID: IPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} Routes:[] CnetAddressSpace:[] MultiTenancyInfo:{EncapType: ID:0} PrimaryInterfaceIdentifier: LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} Response:{ReturnCode:31 Message:Failed to get NC version status from NMAgent. NC: Swift_nc-nma-fail-unavailable, Response {"httpStatusCode":"401","networkContainerId":"nc-nma-fail-unavailable","version":"0"}} AllowHostToNCCommunication:false AllowNCToHostCommunication:false}, raw: +2021/04/30 23:31:22 [2008] [Azure CNS] deleteNetworkContainer +2021/04/30 23:31:22 [2008] [Azure CNS] saveState +2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. +DeleteNetworkContainer succeded with response {Response:{ReturnCode:0 Message:}} +--- PASS: TestGetNetworkContainerVersionStatus (0.26s) +=== RUN TestPublishNCViaCNS +Test: publishNetworkContainer +2021/04/30 23:31:22 [2008] [Azure-CNS] PublishNetworkContainer +2021/04/30 23:31:22 [2008] [NMAgentClient] JoinNetwork: vnet1 +2021/04/30 23:31:22 [2008] [NMAgentClient][Response] Join network: vnet1. Response: &{Status:200 OK StatusCode:200 Proto:HTTP/1.1 ProtoMajor:1 ProtoMinor:1 Header:map[Content-Length:[0] Content-Type:[application/json; charset=UTF-8] Date:[Fri, 30 Apr 2021 23:31:22 GMT]] Body:{} ContentLength:0 TransferEncoding:[] Close:false Uncompressed:false Trailer:map[] Request:0xc0004adb00 TLS:}. Error: +2021/04/30 23:31:22 [2008] [Azure-CNS] setNetworkStateJoined for network: vnet1 +2021/04/30 23:31:22 [2008] [NMAgentClient] PublishNetworkContainer NC: ethWebApp +2021/04/30 23:31:22 [2008] [NMAgentClient][Response] Publish NC: ethWebApp. Response: &{Status:200 OK StatusCode:200 Proto:HTTP/1.1 ProtoMajor:1 ProtoMinor:1 Header:map[Content-Length:[0] Content-Type:[application/json; charset=UTF-8] Date:[Fri, 30 Apr 2021 23:31:22 GMT]] Body:{} ContentLength:0 TransferEncoding:[] Close:false Uncompressed:false Trailer:map[] Request:0xc000018d00 TLS:}. Error: +PublishNetworkContainer succeded with response {Response:{ReturnCode:0 Message:} PublishErrorStr: PublishStatusCode:200 PublishResponseBody:[]}, raw: +--- PASS: TestPublishNCViaCNS (0.00s) +=== RUN TestExtractHost +--- PASS: TestExtractHost (0.00s) +=== RUN TestUnpublishNCViaCNS +Test: unpublishNetworkContainer +2021/04/30 23:31:22 [2008] [Azure-CNS] UnpublishNetworkContainer +2021/04/30 23:31:22 [2008] [NMAgentClient] UnpublishNetworkContainer NC: ethWebApp +2021/04/30 23:31:22 [2008] [NMAgentClient][Response] Unpublish NC: ethWebApp. Response: &{Status:200 OK StatusCode:200 Proto:HTTP/1.1 ProtoMajor:1 ProtoMinor:1 Header:map[Content-Length:[0] Content-Type:[application/json; charset=UTF-8] Date:[Fri, 30 Apr 2021 23:31:22 GMT]] Body:{} ContentLength:0 TransferEncoding:[] Close:false Uncompressed:false Trailer:map[] Request:0xc000123200 TLS:}. Error: +UnpublishNetworkContainer succeded with response {Response:{ReturnCode:0 Message:} UnpublishErrorStr: UnpublishStatusCode:200 UnpublishResponseBody:[]}, raw: +--- PASS: TestUnpublishNCViaCNS (0.00s) +=== RUN TestNmAgentSupportedApisHandler +Test: nmAgentSupportedApisHandler +nmAgentSupportedApisHandler Responded with {Response:{ReturnCode:0 Message:[Azure-CNS] NmAgentSupported API list expects a POST method.} SupportedApis:[]} +--- PASS: TestNmAgentSupportedApisHandler (0.00s) +=== RUN TestCreateHostNCApipaEndpoint +Test: createHostNCApipaEndpoint +2021/04/30 23:31:22 [2008] [Azure-CNS] createHostNCApipaEndpoint +2021/04/30 23:31:22 [2008] [cns-test-server] Code:UnknownContainerID, {Response:{ReturnCode:18 Message:CreateHostNCApipaEndpoint failed with error: Unable to find goal state for the given Network Container: } EndpointID:}. +createHostNCApipaEndpoint Responded with {Response:{ReturnCode:18 Message:CreateHostNCApipaEndpoint failed with error: Unable to find goal state for the given Network Container: } EndpointID:} +--- PASS: TestCreateHostNCApipaEndpoint (0.00s) +=== RUN TestCreateOrUpdateNetworkContainerInternal +Restart Service +2021/04/30 23:31:22 [2008] [Listener] Stopped listening on localhost:10090 +2021/04/30 23:31:22 [2008] [Azure CNS] Service stopped. +2021/04/30 23:31:22 [2008] HTTP listener will be started later after CNS state has been reconciled +2021/04/30 23:31:22 [2008] [Azure CNS] restoreState +2021/04/30 23:31:22 [2008] [Azure CNS] Failed to restore state, err:EOF. Removing azure-cns.json +2021/04/30 23:31:22 [2008] [Azure CNS] Enter Restoring Network State +2021/04/30 23:31:22 [2008] os.stat() for file azure-cns.json failed: stat azure-cns.json: no such file or directory +2021/04/30 23:31:22 [2008] [Utils] Initializing HTTP client with connection timeout: 0, response header timeout: 0 +2021/04/30 23:31:22 [2008] SetContext details called with: orchestrator nodeID +2021/04/30 23:31:22 [2008] [Azure CNS] Listening. +2021/04/30 23:31:22 [2008] [Listener] Started listening on localhost:10090. +2021/04/30 23:31:22 [2008] [Azure CNS] setEnvironment +2021/04/30 23:31:22 [2008] [Azure CNS] POST received for SetEnvironment. +2021/04/30 23:31:22 [2008] [Azure CNS] saveState +2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. +setOrchestratorTypeInternal +NC Request {Version:-1 NetworkContainerType:Docker NetworkContainerid:testNc1 PrimaryInterfaceIdentifier: AuthorizationToken: LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} OrchestratorContext:[] IPConfiguration:{IPSubnet:{IPAddress:10.0.0.5 PrefixLength:24} DNSServers:[8.8.8.8 8.8.4.4] GatewayIPAddress:10.0.0.1} SecondaryIPConfigs:map[2ac07740-55b2-4680-88f2-d8e67c7fac75:{IPAddress:10.0.0.7 NCVersion:-1} 682502f1-8a7c-404c-a42f-549ddc874b85:{IPAddress:10.0.0.6 NCVersion:-1}] MultiTenancyInfo:{EncapType: ID:0} CnetAddressSpace:[] Routes:[] AllowHostToNCCommunication:false AllowNCToHostCommunication:false EndpointPolicies:[]}2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.6 version to -1, programmed host nc version is -1 +2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.6 as Available +2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.7 version to -1, programmed host nc version is -1 +2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.7 as Available +2021/04/30 23:31:22 [2008] [Azure CNS] saveState +2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. + internalapi_test.go:406: NC version in container status is -1, HostVersion is -1 +Validate Scaleup +NC Request {Version:-1 NetworkContainerType:Docker NetworkContainerid:testNc1 PrimaryInterfaceIdentifier: AuthorizationToken: LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} OrchestratorContext:[] IPConfiguration:{IPSubnet:{IPAddress:10.0.0.5 PrefixLength:24} DNSServers:[8.8.8.8 8.8.4.4] GatewayIPAddress:10.0.0.1} SecondaryIPConfigs:map[2ac07740-55b2-4680-88f2-d8e67c7fac75:{IPAddress:10.0.0.7 NCVersion:-1} 682502f1-8a7c-404c-a42f-549ddc874b85:{IPAddress:10.0.0.6 NCVersion:-1} 897008b1-db88-41f7-8c67-4b1a4a458d2b:{IPAddress:10.0.0.8 NCVersion:-1} 9e457f2c-9106-44f9-89d8-b9f09b8ec0e1:{IPAddress:10.0.0.9 NCVersion:-1}] MultiTenancyInfo:{EncapType: ID:0} CnetAddressSpace:[] Routes:[] AllowHostToNCCommunication:false AllowNCToHostCommunication:false EndpointPolicies:[]}2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.7 version to -1, programmed host nc version is -1 +2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.8 version to -1, programmed host nc version is -1 +2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.8 as Available +2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.9 version to -1, programmed host nc version is -1 +2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.9 as Available +2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.6 version to -1, programmed host nc version is -1 +2021/04/30 23:31:22 [2008] [Azure CNS] saveState +2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. + internalapi_test.go:406: NC version in container status is -1, HostVersion is -1 +Validate Scale down +NC Request {Version:-1 NetworkContainerType:Docker NetworkContainerid:testNc1 PrimaryInterfaceIdentifier: AuthorizationToken: LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} OrchestratorContext:[] IPConfiguration:{IPSubnet:{IPAddress:10.0.0.5 PrefixLength:24} DNSServers:[8.8.8.8 8.8.4.4] GatewayIPAddress:10.0.0.1} SecondaryIPConfigs:map[9e457f2c-9106-44f9-89d8-b9f09b8ec0e1:{IPAddress:10.0.0.9 NCVersion:-1}] MultiTenancyInfo:{EncapType: ID:0} CnetAddressSpace:[] Routes:[] AllowHostToNCCommunication:false AllowNCToHostCommunication:false EndpointPolicies:[]}2021/04/30 23:31:22 [2008] [Azure-Cns] Delete the PodIpConfigState, IpId: 897008b1-db88-41f7-8c67-4b1a4a458d2b, IPConfigStatus: IPConfigurationStatus: Id: [897008b1-db88-41f7-8c67-4b1a4a458d2b], NcId: [testNc1], IpAddress: [10.0.0.8], State: [Available], OrchestratorContext: [] +2021/04/30 23:31:22 [2008] [Azure-Cns] Delete the PodIpConfigState, IpId: 682502f1-8a7c-404c-a42f-549ddc874b85, IPConfigStatus: IPConfigurationStatus: Id: [682502f1-8a7c-404c-a42f-549ddc874b85], NcId: [testNc1], IpAddress: [10.0.0.6], State: [Available], OrchestratorContext: [] +2021/04/30 23:31:22 [2008] [Azure-Cns] Delete the PodIpConfigState, IpId: 2ac07740-55b2-4680-88f2-d8e67c7fac75, IPConfigStatus: IPConfigurationStatus: Id: [2ac07740-55b2-4680-88f2-d8e67c7fac75], NcId: [testNc1], IpAddress: [10.0.0.7], State: [Available], OrchestratorContext: [] +2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.9 version to -1, programmed host nc version is -1 +2021/04/30 23:31:22 [2008] [Azure CNS] saveState +2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. + internalapi_test.go:406: NC version in container status is -1, HostVersion is -1 +Validate no SecondaryIpconfigs +NC Request {Version:-1 NetworkContainerType:Docker NetworkContainerid:testNc1 PrimaryInterfaceIdentifier: AuthorizationToken: LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} OrchestratorContext:[] IPConfiguration:{IPSubnet:{IPAddress:10.0.0.5 PrefixLength:24} DNSServers:[8.8.8.8 8.8.4.4] GatewayIPAddress:10.0.0.1} SecondaryIPConfigs:map[] MultiTenancyInfo:{EncapType: ID:0} CnetAddressSpace:[] Routes:[] AllowHostToNCCommunication:false AllowNCToHostCommunication:false EndpointPolicies:[]}2021/04/30 23:31:22 [2008] [Azure-Cns] Delete the PodIpConfigState, IpId: 9e457f2c-9106-44f9-89d8-b9f09b8ec0e1, IPConfigStatus: IPConfigurationStatus: Id: [9e457f2c-9106-44f9-89d8-b9f09b8ec0e1], NcId: [testNc1], IpAddress: [10.0.0.9], State: [Available], OrchestratorContext: [] +2021/04/30 23:31:22 [2008] [Azure CNS] saveState +2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. + internalapi_test.go:406: NC version in container status is -1, HostVersion is -1 +--- PASS: TestCreateOrUpdateNetworkContainerInternal (0.00s) +=== RUN TestCreateOrUpdateNCWithLargerVersionComparedToNMAgent +Restart Service +2021/04/30 23:31:22 [2008] [Listener] Stopped listening on localhost:10090 +2021/04/30 23:31:22 [2008] [Azure CNS] Service stopped. +2021/04/30 23:31:22 [2008] HTTP listener will be started later after CNS state has been reconciled +2021/04/30 23:31:22 [2008] [Azure CNS] restoreState +2021/04/30 23:31:22 [2008] [Azure CNS] Failed to restore state, err:EOF. Removing azure-cns.json +2021/04/30 23:31:22 [2008] [Azure CNS] Enter Restoring Network State +2021/04/30 23:31:22 [2008] os.stat() for file azure-cns.json failed: stat azure-cns.json: no such file or directory +2021/04/30 23:31:22 [2008] [Utils] Initializing HTTP client with connection timeout: 0, response header timeout: 0 +2021/04/30 23:31:22 [2008] SetContext details called with: orchestrator nodeID +2021/04/30 23:31:22 [2008] [Azure CNS] Listening. +2021/04/30 23:31:22 [2008] [Listener] Started listening on localhost:10090. +2021/04/30 23:31:22 [2008] [Azure CNS] setEnvironment +2021/04/30 23:31:22 [2008] [Azure CNS] POST received for SetEnvironment. +2021/04/30 23:31:22 [2008] [Azure CNS] saveState +2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. +setOrchestratorTypeInternal +NC Request {Version:1 NetworkContainerType:Docker NetworkContainerid:testNc1 PrimaryInterfaceIdentifier: AuthorizationToken: LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} OrchestratorContext:[] IPConfiguration:{IPSubnet:{IPAddress:10.0.0.5 PrefixLength:24} DNSServers:[8.8.8.8 8.8.4.4] GatewayIPAddress:10.0.0.1} SecondaryIPConfigs:map[3195cb51-ac69-441c-a973-3548b72fe3e6:{IPAddress:10.0.0.7 NCVersion:1} 521b9caf-6339-47dd-b5eb-41e27c2ccb1f:{IPAddress:10.0.0.6 NCVersion:1}] MultiTenancyInfo:{EncapType: ID:0} CnetAddressSpace:[] Routes:[] AllowHostToNCCommunication:false AllowNCToHostCommunication:false EndpointPolicies:[]}2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.6 version to 1, programmed host nc version is -1 +2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.6 as PendingProgramming +2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.7 version to 1, programmed host nc version is -1 +2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.7 as PendingProgramming +2021/04/30 23:31:22 [2008] [Azure CNS] saveState +2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. + internalapi_test.go:406: NC version in container status is 1, HostVersion is -1 +--- PASS: TestCreateOrUpdateNCWithLargerVersionComparedToNMAgent (0.01s) +=== RUN TestCreateAndUpdateNCWithSecondaryIPNCVersion +Restart Service +2021/04/30 23:31:22 [2008] [Listener] Stopped listening on localhost:10090 +2021/04/30 23:31:22 [2008] [Azure CNS] Service stopped. +2021/04/30 23:31:22 [2008] HTTP listener will be started later after CNS state has been reconciled +2021/04/30 23:31:22 [2008] [Azure CNS] restoreState +2021/04/30 23:31:22 [2008] [Azure CNS] Failed to restore state, err:EOF. Removing azure-cns.json +2021/04/30 23:31:22 [2008] [Azure CNS] Enter Restoring Network State +2021/04/30 23:31:22 [2008] os.stat() for file azure-cns.json failed: stat azure-cns.json: no such file or directory +2021/04/30 23:31:22 [2008] [Utils] Initializing HTTP client with connection timeout: 0, response header timeout: 0 +2021/04/30 23:31:22 [2008] SetContext details called with: orchestrator nodeID +2021/04/30 23:31:22 [2008] [Azure CNS] Listening. +2021/04/30 23:31:22 [2008] [Listener] Started listening on localhost:10090. +2021/04/30 23:31:22 [2008] [Azure CNS] setEnvironment +2021/04/30 23:31:22 [2008] [Azure CNS] POST received for SetEnvironment. +2021/04/30 23:31:22 [2008] [Azure CNS] saveState +2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. +setOrchestratorTypeInternal +NC Request {Version:0 NetworkContainerType:Docker NetworkContainerid:testNc1 PrimaryInterfaceIdentifier: AuthorizationToken: LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} OrchestratorContext:[] IPConfiguration:{IPSubnet:{IPAddress:10.0.0.5 PrefixLength:24} DNSServers:[8.8.8.8 8.8.4.4] GatewayIPAddress:10.0.0.1} SecondaryIPConfigs:map[bd59de26-a3a7-4ba6-98ce-8283c1a1ded7:{IPAddress:10.0.0.16 NCVersion:0}] MultiTenancyInfo:{EncapType: ID:0} CnetAddressSpace:[] Routes:[] AllowHostToNCCommunication:false AllowNCToHostCommunication:false EndpointPolicies:[]}2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.16 version to 0, programmed host nc version is -1 +2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.16 as PendingProgramming +2021/04/30 23:31:22 [2008] [Azure CNS] saveState +2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. +NC Request {Version:1 NetworkContainerType:Docker NetworkContainerid:testNc1 PrimaryInterfaceIdentifier: AuthorizationToken: LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} OrchestratorContext:[] IPConfiguration:{IPSubnet:{IPAddress:10.0.0.5 PrefixLength:24} DNSServers:[8.8.8.8 8.8.4.4] GatewayIPAddress:10.0.0.1} SecondaryIPConfigs:map[8f690f27-2671-4be6-97b0-07494c40b855:{IPAddress:10.0.0.17 NCVersion:1} bd59de26-a3a7-4ba6-98ce-8283c1a1ded7:{IPAddress:10.0.0.16 NCVersion:1}] MultiTenancyInfo:{EncapType: ID:0} CnetAddressSpace:[] Routes:[] AllowHostToNCCommunication:false AllowNCToHostCommunication:false EndpointPolicies:[]}2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.17 version to 1, programmed host nc version is -1 +2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.17 as PendingProgramming +2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.16 version to 0, programmed host nc version is -1 +2021/04/30 23:31:22 [2008] [Azure CNS] saveState +2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. +--- PASS: TestCreateAndUpdateNCWithSecondaryIPNCVersion (0.00s) +=== RUN TestSyncHostNCVersion +Restart Service +2021/04/30 23:31:22 [2008] [Listener] Stopped listening on localhost:10090 +2021/04/30 23:31:22 [2008] [Azure CNS] Service stopped. +2021/04/30 23:31:22 [2008] HTTP listener will be started later after CNS state has been reconciled +2021/04/30 23:31:22 [2008] [Azure CNS] restoreState +2021/04/30 23:31:22 [2008] [Azure CNS] Failed to restore state, err:EOF. Removing azure-cns.json +2021/04/30 23:31:22 [2008] [Azure CNS] Enter Restoring Network State +2021/04/30 23:31:22 [2008] os.stat() for file azure-cns.json failed: stat azure-cns.json: no such file or directory +2021/04/30 23:31:22 [2008] [Utils] Initializing HTTP client with connection timeout: 0, response header timeout: 0 +2021/04/30 23:31:22 [2008] SetContext details called with: orchestrator nodeID +2021/04/30 23:31:22 [2008] [Azure CNS] Listening. +2021/04/30 23:31:22 [2008] [Listener] Started listening on localhost:10090. +2021/04/30 23:31:22 [2008] [Azure CNS] setEnvironment +2021/04/30 23:31:22 [2008] [Azure CNS] POST received for SetEnvironment. +2021/04/30 23:31:22 [2008] [Azure CNS] saveState +2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. +setOrchestratorTypeInternal +NC Request {Version:0 NetworkContainerType:Docker NetworkContainerid:testNc1 PrimaryInterfaceIdentifier: AuthorizationToken: LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} OrchestratorContext:[] IPConfiguration:{IPSubnet:{IPAddress:10.0.0.5 PrefixLength:24} DNSServers:[8.8.8.8 8.8.4.4] GatewayIPAddress:10.0.0.1} SecondaryIPConfigs:map[f418a2f5-d16d-43b2-a687-bdc97f989c45:{IPAddress:10.0.0.16 NCVersion:0}] MultiTenancyInfo:{EncapType: ID:0} CnetAddressSpace:[] Routes:[] AllowHostToNCCommunication:false AllowNCToHostCommunication:false EndpointPolicies:[]}2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.16 version to 0, programmed host nc version is -1 +2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.16 as PendingProgramming +2021/04/30 23:31:22 [2008] [Azure CNS] saveState +2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. +2021/04/30 23:31:22 [2008] Updating version of the following NC IDs: [testNc1] +2021/04/30 23:31:22 [2008] Updated NC testNc1 host version from -1 to 0 +Restart Service +2021/04/30 23:31:22 [2008] [Listener] Stopped listening on localhost:10090 +2021/04/30 23:31:22 [2008] [Azure CNS] Service stopped. +2021/04/30 23:31:22 [2008] HTTP listener will be started later after CNS state has been reconciled +2021/04/30 23:31:22 [2008] [Azure CNS] restoreState +2021/04/30 23:31:22 [2008] [Azure CNS] Failed to restore state, err:EOF. Removing azure-cns.json +2021/04/30 23:31:22 [2008] [Azure CNS] Enter Restoring Network State +2021/04/30 23:31:22 [2008] os.stat() for file azure-cns.json failed: stat azure-cns.json: no such file or directory +2021/04/30 23:31:22 [2008] [Utils] Initializing HTTP client with connection timeout: 0, response header timeout: 0 +2021/04/30 23:31:22 [2008] SetContext details called with: orchestrator nodeID +2021/04/30 23:31:22 [2008] [Azure CNS] Listening. +2021/04/30 23:31:22 [2008] [Listener] Started listening on localhost:10090. +2021/04/30 23:31:22 [2008] [Azure CNS] setEnvironment +2021/04/30 23:31:22 [2008] [Azure CNS] POST received for SetEnvironment. +2021/04/30 23:31:22 [2008] [Azure CNS] saveState +2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. +setOrchestratorTypeInternal +NC Request {Version:0 NetworkContainerType:Docker NetworkContainerid:testNc1 PrimaryInterfaceIdentifier: AuthorizationToken: LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} OrchestratorContext:[] IPConfiguration:{IPSubnet:{IPAddress:10.0.0.5 PrefixLength:24} DNSServers:[8.8.8.8 8.8.4.4] GatewayIPAddress:10.0.0.1} SecondaryIPConfigs:map[f57eb521-49ac-4734-a9ad-545bbba43d94:{IPAddress:10.0.0.16 NCVersion:0}] MultiTenancyInfo:{EncapType: ID:0} CnetAddressSpace:[] Routes:[] AllowHostToNCCommunication:false AllowNCToHostCommunication:false EndpointPolicies:[]}2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.16 version to 0, programmed host nc version is -1 +2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.16 as PendingProgramming +2021/04/30 23:31:22 [2008] [Azure CNS] saveState +2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. +2021/04/30 23:31:22 [2008] Updating version of the following NC IDs: [testNc1] +2021/04/30 23:31:22 [2008] Updated NC testNc1 host version from -1 to 0 +--- PASS: TestSyncHostNCVersion (0.02s) +=== RUN TestPendingIPsGotUpdatedWhenSyncHostNCVersion +Restart Service +2021/04/30 23:31:22 [2008] [Listener] Stopped listening on localhost:10090 +2021/04/30 23:31:22 [2008] [Azure CNS] Service stopped. +2021/04/30 23:31:22 [2008] HTTP listener will be started later after CNS state has been reconciled +2021/04/30 23:31:22 [2008] [Azure CNS] restoreState +2021/04/30 23:31:22 [2008] [Azure CNS] Failed to restore state, err:EOF. Removing azure-cns.json +2021/04/30 23:31:22 [2008] [Azure CNS] Enter Restoring Network State +2021/04/30 23:31:22 [2008] os.stat() for file azure-cns.json failed: stat azure-cns.json: no such file or directory +2021/04/30 23:31:22 [2008] [Utils] Initializing HTTP client with connection timeout: 0, response header timeout: 0 +2021/04/30 23:31:22 [2008] SetContext details called with: orchestrator nodeID +2021/04/30 23:31:22 [2008] [Azure CNS] Listening. +2021/04/30 23:31:22 [2008] [Listener] Started listening on localhost:10090. +2021/04/30 23:31:22 [2008] [Azure CNS] setEnvironment +2021/04/30 23:31:22 [2008] [Azure CNS] POST received for SetEnvironment. +2021/04/30 23:31:22 [2008] [Azure CNS] saveState +2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. +setOrchestratorTypeInternal +NC Request {Version:0 NetworkContainerType:Docker NetworkContainerid:testNc1 PrimaryInterfaceIdentifier: AuthorizationToken: LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} OrchestratorContext:[] IPConfiguration:{IPSubnet:{IPAddress:10.0.0.5 PrefixLength:24} DNSServers:[8.8.8.8 8.8.4.4] GatewayIPAddress:10.0.0.1} SecondaryIPConfigs:map[4c099511-f5a3-46a7-bfa8-52dbd84f0341:{IPAddress:10.0.0.16 NCVersion:0}] MultiTenancyInfo:{EncapType: ID:0} CnetAddressSpace:[] Routes:[] AllowHostToNCCommunication:false AllowNCToHostCommunication:false EndpointPolicies:[]}2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.16 version to 0, programmed host nc version is -1 +2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.16 as PendingProgramming +2021/04/30 23:31:22 [2008] [Azure CNS] saveState +2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. +2021/04/30 23:31:22 [2008] Updating version of the following NC IDs: [testNc1] +2021/04/30 23:31:22 [2008] [updateIPConfigState] Changing IpId [4c099511-f5a3-46a7-bfa8-52dbd84f0341] state to [Available], orchestratorContext []. Current config [IPConfigurationStatus: Id: [4c099511-f5a3-46a7-bfa8-52dbd84f0341], NcId: [testNc1], IpAddress: [10.0.0.16], State: [PendingProgramming], OrchestratorContext: []] +2021/04/30 23:31:22 [2008] Change ip 10.0.0.16 with uuid 4c099511-f5a3-46a7-bfa8-52dbd84f0341 from pending programming to Available, current secondary ip configs is {IPAddress:10.0.0.16 NCVersion:0} +2021/04/30 23:31:22 [2008] Updated NC testNc1 host version from -1 to 0 +--- PASS: TestPendingIPsGotUpdatedWhenSyncHostNCVersion (0.00s) +=== RUN TestReconcileNCWithEmptyState +Restart Service +2021/04/30 23:31:22 [2008] [Listener] Stopped listening on localhost:10090 +2021/04/30 23:31:22 [2008] [Azure CNS] Service stopped. +2021/04/30 23:31:22 [2008] HTTP listener will be started later after CNS state has been reconciled +2021/04/30 23:31:22 [2008] [Azure CNS] restoreState +2021/04/30 23:31:22 [2008] [Azure CNS] Failed to restore state, err:EOF. Removing azure-cns.json +2021/04/30 23:31:22 [2008] [Azure CNS] Enter Restoring Network State +2021/04/30 23:31:22 [2008] os.stat() for file azure-cns.json failed: stat azure-cns.json: no such file or directory +2021/04/30 23:31:22 [2008] [Utils] Initializing HTTP client with connection timeout: 0, response header timeout: 0 +2021/04/30 23:31:22 [2008] SetContext details called with: orchestrator nodeID +2021/04/30 23:31:22 [2008] [Azure CNS] Listening. +2021/04/30 23:31:22 [2008] [Listener] Started listening on localhost:10090. +2021/04/30 23:31:22 [2008] [Azure CNS] setEnvironment +2021/04/30 23:31:22 [2008] [Azure CNS] POST received for SetEnvironment. +2021/04/30 23:31:22 [2008] [Azure CNS] saveState +2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. +setOrchestratorTypeInternal +2021/04/30 23:31:22 [2008] CNS starting with no NC state, podInfoMap count 0 +--- PASS: TestReconcileNCWithEmptyState (0.00s) +=== RUN TestReconcileNCWithExistingState +Restart Service +2021/04/30 23:31:22 [2008] [Listener] Stopped listening on localhost:10090 +2021/04/30 23:31:22 [2008] [Azure CNS] Service stopped. +2021/04/30 23:31:22 [2008] HTTP listener will be started later after CNS state has been reconciled +2021/04/30 23:31:22 [2008] [Azure CNS] restoreState +2021/04/30 23:31:22 [2008] [Azure CNS] Failed to restore state, err:EOF. Removing azure-cns.json +2021/04/30 23:31:22 [2008] [Azure CNS] Enter Restoring Network State +2021/04/30 23:31:22 [2008] os.stat() for file azure-cns.json failed: stat azure-cns.json: no such file or directory +2021/04/30 23:31:22 [2008] [Utils] Initializing HTTP client with connection timeout: 0, response header timeout: 0 +2021/04/30 23:31:22 [2008] SetContext details called with: orchestrator nodeID +2021/04/30 23:31:22 [2008] [Azure CNS] Listening. +2021/04/30 23:31:22 [2008] [Listener] Started listening on localhost:10090. +2021/04/30 23:31:22 [2008] [Azure CNS] setEnvironment +2021/04/30 23:31:22 [2008] [Azure CNS] POST received for SetEnvironment. +2021/04/30 23:31:22 [2008] [Azure CNS] saveState +2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. +setOrchestratorTypeInternal +NC Request {Version:-1 NetworkContainerType:Docker NetworkContainerid:reconcileNc1 PrimaryInterfaceIdentifier: AuthorizationToken: LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} OrchestratorContext:[] IPConfiguration:{IPSubnet:{IPAddress:10.0.0.5 PrefixLength:24} DNSServers:[8.8.8.8 8.8.4.4] GatewayIPAddress:10.0.0.1} SecondaryIPConfigs:map[2175b93d-5d81-4438-afa5-01ae96bf1a99:{IPAddress:10.0.0.8 NCVersion:-1} 39918656-0748-4060-becb-f7c4e972a75a:{IPAddress:10.0.0.7 NCVersion:-1} d11b5049-218f-4f5b-9e68-0ac8d17e4b21:{IPAddress:10.0.0.9 NCVersion:-1} dc18fb51-1234-4f05-9f77-490077cfa357:{IPAddress:10.0.0.6 NCVersion:-1}] MultiTenancyInfo:{EncapType: ID:0} CnetAddressSpace:[] Routes:[] AllowHostToNCCommunication:false AllowNCToHostCommunication:false EndpointPolicies:[]}2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.9 version to -1, programmed host nc version is -1 +2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.9 as Available +2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.6 version to -1, programmed host nc version is -1 +2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.6 as Available +2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.7 version to -1, programmed host nc version is -1 +2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.7 as Available +2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.8 version to -1, programmed host nc version is -1 +2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.8 as Available +2021/04/30 23:31:22 [2008] [Azure CNS] saveState +2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. +2021/04/30 23:31:22 [2008] SecondaryIP {IPAddress:10.0.0.8 NCVersion:-1} is not allocated. ncId: reconcileNc1 +2021/04/30 23:31:22 [2008] SecondaryIP {IPAddress:10.0.0.9 NCVersion:-1} is not allocated. ncId: reconcileNc1 +2021/04/30 23:31:22 [2008] SecondaryIP {IPAddress:10.0.0.6 NCVersion:-1} is allocated to Pod. {PodName:reconcilePod1 PodNamespace:PodNS1}, ncId: reconcileNc1 +2021/04/30 23:31:22 [2008] [updateIPConfigState] Changing IpId [dc18fb51-1234-4f05-9f77-490077cfa357] state to [Allocated], orchestratorContext [{"PodName":"reconcilePod1","PodNamespace":"PodNS1"}]. Current config [IPConfigurationStatus: Id: [dc18fb51-1234-4f05-9f77-490077cfa357], NcId: [reconcileNc1], IpAddress: [10.0.0.6], State: [Available], OrchestratorContext: []] +2021/04/30 23:31:22 [2008] [Azure CNS] GetPrimaryInterfaceInfoFromMemory +2021/04/30 23:31:22 [2008] [Azure CNS] GetPrimaryInterfaceInfoFromHost +2021/04/30 23:31:22 [2008] SecondaryIP {IPAddress:10.0.0.7 NCVersion:-1} is allocated to Pod. {PodName:reconcilePod2 PodNamespace:PodNS1}, ncId: reconcileNc1 +2021/04/30 23:31:22 [2008] [updateIPConfigState] Changing IpId [39918656-0748-4060-becb-f7c4e972a75a] state to [Allocated], orchestratorContext [{"PodName":"reconcilePod2","PodNamespace":"PodNS1"}]. Current config [IPConfigurationStatus: Id: [39918656-0748-4060-becb-f7c4e972a75a], NcId: [reconcileNc1], IpAddress: [10.0.0.7], State: [Available], OrchestratorContext: []] +2021/04/30 23:31:22 [2008] [Azure CNS] GetPrimaryInterfaceInfoFromMemory +2021/04/30 23:31:22 [2008] [Azure CNS] GetPrimaryInterfaceInfoFromHost + internalapi_test.go:406: NC version in container status is -1, HostVersion is -1 +--- PASS: TestReconcileNCWithExistingState (0.00s) +=== RUN TestReconcileNCWithSystemPods +Restart Service +2021/04/30 23:31:22 [2008] [Listener] Stopped listening on localhost:10090 +2021/04/30 23:31:22 [2008] [Azure CNS] Service stopped. +2021/04/30 23:31:22 [2008] HTTP listener will be started later after CNS state has been reconciled +2021/04/30 23:31:22 [2008] [Azure CNS] restoreState +2021/04/30 23:31:22 [2008] [Azure CNS] Failed to restore state, err:EOF. Removing azure-cns.json +2021/04/30 23:31:22 [2008] [Azure CNS] Enter Restoring Network State +2021/04/30 23:31:22 [2008] os.stat() for file azure-cns.json failed: stat azure-cns.json: no such file or directory +2021/04/30 23:31:22 [2008] [Utils] Initializing HTTP client with connection timeout: 0, response header timeout: 0 +2021/04/30 23:31:22 [2008] SetContext details called with: orchestrator nodeID +2021/04/30 23:31:22 [2008] [Azure CNS] Listening. +2021/04/30 23:31:22 [2008] [Listener] Started listening on localhost:10090. +2021/04/30 23:31:22 [2008] [Azure CNS] setEnvironment +2021/04/30 23:31:22 [2008] [Azure CNS] POST received for SetEnvironment. +2021/04/30 23:31:22 [2008] [Azure CNS] saveState +2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. +setOrchestratorTypeInternal +NC Request {Version:-1 NetworkContainerType:Docker NetworkContainerid:56e62d8f-a502-4fe8-a6e9-1657057b4fdb PrimaryInterfaceIdentifier: AuthorizationToken: LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} OrchestratorContext:[] IPConfiguration:{IPSubnet:{IPAddress:10.0.0.5 PrefixLength:24} DNSServers:[8.8.8.8 8.8.4.4] GatewayIPAddress:10.0.0.1} SecondaryIPConfigs:map[0fcb5205-5b6f-4c3c-8b3d-841c9ba46cb3:{IPAddress:10.0.0.9 NCVersion:-1} 3d56583e-e595-4665-afd7-73ae7ae87f64:{IPAddress:10.0.0.8 NCVersion:-1} 65374822-834b-49f8-b062-969ea6d81ef5:{IPAddress:10.0.0.7 NCVersion:-1} b73c215a-2872-4744-a76b-2d38fdcc9d91:{IPAddress:10.0.0.6 NCVersion:-1}] MultiTenancyInfo:{EncapType: ID:0} CnetAddressSpace:[] Routes:[] AllowHostToNCCommunication:false AllowNCToHostCommunication:false EndpointPolicies:[]}2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.8 version to -1, programmed host nc version is -1 +2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.8 as Available +2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.9 version to -1, programmed host nc version is -1 +2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.9 as Available +2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.6 version to -1, programmed host nc version is -1 +2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.6 as Available +2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.7 version to -1, programmed host nc version is -1 +2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.7 as Available +2021/04/30 23:31:22 [2008] [Azure CNS] saveState +2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. +2021/04/30 23:31:22 [2008] SecondaryIP {IPAddress:10.0.0.7 NCVersion:-1} is not allocated. ncId: 56e62d8f-a502-4fe8-a6e9-1657057b4fdb +2021/04/30 23:31:22 [2008] SecondaryIP {IPAddress:10.0.0.8 NCVersion:-1} is not allocated. ncId: 56e62d8f-a502-4fe8-a6e9-1657057b4fdb +2021/04/30 23:31:22 [2008] SecondaryIP {IPAddress:10.0.0.9 NCVersion:-1} is not allocated. ncId: 56e62d8f-a502-4fe8-a6e9-1657057b4fdb +2021/04/30 23:31:22 [2008] SecondaryIP {IPAddress:10.0.0.6 NCVersion:-1} is allocated to Pod. {PodName:customerpod1 PodNamespace:PodNS1}, ncId: 56e62d8f-a502-4fe8-a6e9-1657057b4fdb +2021/04/30 23:31:22 [2008] [updateIPConfigState] Changing IpId [b73c215a-2872-4744-a76b-2d38fdcc9d91] state to [Allocated], orchestratorContext [{"PodName":"customerpod1","PodNamespace":"PodNS1"}]. Current config [IPConfigurationStatus: Id: [b73c215a-2872-4744-a76b-2d38fdcc9d91], NcId: [56e62d8f-a502-4fe8-a6e9-1657057b4fdb], IpAddress: [10.0.0.6], State: [Available], OrchestratorContext: []] +2021/04/30 23:31:22 [2008] [Azure CNS] GetPrimaryInterfaceInfoFromMemory +2021/04/30 23:31:22 [2008] [Azure CNS] GetPrimaryInterfaceInfoFromHost + internalapi_test.go:406: NC version in container status is -1, HostVersion is -1 +--- PASS: TestReconcileNCWithSystemPods (0.00s) +=== RUN TestIPAMGetAvailableIPConfig +setOrchestratorTypeInternal +NC Request {Version:-1 NetworkContainerType:Docker NetworkContainerid:06867cf3-332d-409d-8819-ed70d2c116b0 PrimaryInterfaceIdentifier: AuthorizationToken: LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} OrchestratorContext:[] IPConfiguration:{IPSubnet:{IPAddress:10.0.0.5 PrefixLength:24} DNSServers:[8.8.8.8 8.8.4.4] GatewayIPAddress:10.0.0.1} SecondaryIPConfigs:map[898fb8f1-f93e-4c96-9c31-6b89098949a3:{IPAddress:10.0.0.1 NCVersion:-1}] MultiTenancyInfo:{EncapType: ID:0} CnetAddressSpace:[] Routes:[] AllowHostToNCCommunication:false AllowNCToHostCommunication:false EndpointPolicies:[]}2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.1 version to -1, programmed host nc version is -1 +2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.1 as Available +2021/04/30 23:31:22 [2008] [Azure CNS] saveState +2021/04/30 23:31:22 [2008] [Azure CNS] store not initialized. + internalapi_test.go:406: NC version in container status is -1, HostVersion is -1 +2021/04/30 23:31:22 [2008] [updateIPConfigState] Changing IpId [898fb8f1-f93e-4c96-9c31-6b89098949a3] state to [Allocated], orchestratorContext [{"PodName":"testpod1","PodNamespace":"testpod1namespace"}]. Current config [IPConfigurationStatus: Id: [898fb8f1-f93e-4c96-9c31-6b89098949a3], NcId: [06867cf3-332d-409d-8819-ed70d2c116b0], IpAddress: [10.0.0.1], State: [Available], OrchestratorContext: []] +2021/04/30 23:31:22 [2008] [Azure CNS] GetPrimaryInterfaceInfoFromMemory +2021/04/30 23:31:22 [2008] [Azure CNS] GetPrimaryInterfaceInfoFromHost +--- PASS: TestIPAMGetAvailableIPConfig (0.00s) +=== RUN TestIPAMGetNextAvailableIPConfig +setOrchestratorTypeInternal +NC Request {Version:-1 NetworkContainerType:Docker NetworkContainerid:06867cf3-332d-409d-8819-ed70d2c116b0 PrimaryInterfaceIdentifier: AuthorizationToken: LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} OrchestratorContext:[] IPConfiguration:{IPSubnet:{IPAddress:10.0.0.5 PrefixLength:24} DNSServers:[8.8.8.8 8.8.4.4] GatewayIPAddress:10.0.0.1} SecondaryIPConfigs:map[898fb8f1-f93e-4c96-9c31-6b89098949a3:{IPAddress:10.0.0.1 NCVersion:-1} b21e1ee1-fb7e-4e6d-8c68-22ee5049944e:{IPAddress:10.0.0.2 NCVersion:-1}] MultiTenancyInfo:{EncapType: ID:0} CnetAddressSpace:[] Routes:[] AllowHostToNCCommunication:false AllowNCToHostCommunication:false EndpointPolicies:[]}2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.2 version to -1, programmed host nc version is -1 +2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.2 as Available +2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.1 version to -1, programmed host nc version is -1 +2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.1 as Available +2021/04/30 23:31:22 [2008] [Azure CNS] saveState +2021/04/30 23:31:22 [2008] [Azure CNS] store not initialized. + internalapi_test.go:406: NC version in container status is -1, HostVersion is -1 +2021/04/30 23:31:22 [2008] [updateIPConfigState] Changing IpId [b21e1ee1-fb7e-4e6d-8c68-22ee5049944e] state to [Allocated], orchestratorContext [{"PodName":"testpod2","PodNamespace":"testpod2namespace"}]. Current config [IPConfigurationStatus: Id: [b21e1ee1-fb7e-4e6d-8c68-22ee5049944e], NcId: [06867cf3-332d-409d-8819-ed70d2c116b0], IpAddress: [10.0.0.2], State: [Available], OrchestratorContext: []] +2021/04/30 23:31:22 [2008] [Azure CNS] GetPrimaryInterfaceInfoFromMemory +2021/04/30 23:31:22 [2008] [Azure CNS] GetPrimaryInterfaceInfoFromHost +--- PASS: TestIPAMGetNextAvailableIPConfig (0.00s) +=== RUN TestIPAMGetAlreadyAllocatedIPConfigForSamePod +setOrchestratorTypeInternal +NC Request {Version:-1 NetworkContainerType:Docker NetworkContainerid:06867cf3-332d-409d-8819-ed70d2c116b0 PrimaryInterfaceIdentifier: AuthorizationToken: LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} OrchestratorContext:[] IPConfiguration:{IPSubnet:{IPAddress:10.0.0.5 PrefixLength:24} DNSServers:[8.8.8.8 8.8.4.4] GatewayIPAddress:10.0.0.1} SecondaryIPConfigs:map[898fb8f1-f93e-4c96-9c31-6b89098949a3:{IPAddress:10.0.0.1 NCVersion:-1}] MultiTenancyInfo:{EncapType: ID:0} CnetAddressSpace:[] Routes:[] AllowHostToNCCommunication:false AllowNCToHostCommunication:false EndpointPolicies:[]}2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.1 version to -1, programmed host nc version is -1 +2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.1 as Available +2021/04/30 23:31:22 [2008] [Azure CNS] saveState +2021/04/30 23:31:22 [2008] [Azure CNS] store not initialized. + internalapi_test.go:406: NC version in container status is -1, HostVersion is -1 +2021/04/30 23:31:22 [2008] [Azure CNS] GetPrimaryInterfaceInfoFromMemory +2021/04/30 23:31:22 [2008] [Azure CNS] GetPrimaryInterfaceInfoFromHost +--- PASS: TestIPAMGetAlreadyAllocatedIPConfigForSamePod (0.00s) +=== RUN TestIPAMAttemptToRequestIPNotFoundInPool +setOrchestratorTypeInternal +NC Request {Version:-1 NetworkContainerType:Docker NetworkContainerid:06867cf3-332d-409d-8819-ed70d2c116b0 PrimaryInterfaceIdentifier: AuthorizationToken: LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} OrchestratorContext:[] IPConfiguration:{IPSubnet:{IPAddress:10.0.0.5 PrefixLength:24} DNSServers:[8.8.8.8 8.8.4.4] GatewayIPAddress:10.0.0.1} SecondaryIPConfigs:map[898fb8f1-f93e-4c96-9c31-6b89098949a3:{IPAddress:10.0.0.1 NCVersion:-1}] MultiTenancyInfo:{EncapType: ID:0} CnetAddressSpace:[] Routes:[] AllowHostToNCCommunication:false AllowNCToHostCommunication:false EndpointPolicies:[]}2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.1 version to -1, programmed host nc version is -1 +2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.1 as Available +2021/04/30 23:31:22 [2008] [Azure CNS] saveState +2021/04/30 23:31:22 [2008] [Azure CNS] store not initialized. + internalapi_test.go:406: NC version in container status is -1, HostVersion is -1 +--- PASS: TestIPAMAttemptToRequestIPNotFoundInPool (0.00s) +=== RUN TestIPAMGetDesiredIPConfigWithSpecfiedIP +setOrchestratorTypeInternal +NC Request {Version:-1 NetworkContainerType:Docker NetworkContainerid:06867cf3-332d-409d-8819-ed70d2c116b0 PrimaryInterfaceIdentifier: AuthorizationToken: LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} OrchestratorContext:[] IPConfiguration:{IPSubnet:{IPAddress:10.0.0.5 PrefixLength:24} DNSServers:[8.8.8.8 8.8.4.4] GatewayIPAddress:10.0.0.1} SecondaryIPConfigs:map[898fb8f1-f93e-4c96-9c31-6b89098949a3:{IPAddress:10.0.0.1 NCVersion:-1}] MultiTenancyInfo:{EncapType: ID:0} CnetAddressSpace:[] Routes:[] AllowHostToNCCommunication:false AllowNCToHostCommunication:false EndpointPolicies:[]}2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.1 version to -1, programmed host nc version is -1 +2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.1 as Available +2021/04/30 23:31:22 [2008] [Azure CNS] saveState +2021/04/30 23:31:22 [2008] [Azure CNS] store not initialized. + internalapi_test.go:406: NC version in container status is -1, HostVersion is -1 +2021/04/30 23:31:22 [2008] [updateIPConfigState] Changing IpId [898fb8f1-f93e-4c96-9c31-6b89098949a3] state to [Allocated], orchestratorContext [{"PodName":"testpod1","PodNamespace":"testpod1namespace"}]. Current config [IPConfigurationStatus: Id: [898fb8f1-f93e-4c96-9c31-6b89098949a3], NcId: [06867cf3-332d-409d-8819-ed70d2c116b0], IpAddress: [10.0.0.1], State: [Available], OrchestratorContext: []] +2021/04/30 23:31:22 [2008] [Azure CNS] GetPrimaryInterfaceInfoFromMemory +2021/04/30 23:31:22 [2008] [Azure CNS] GetPrimaryInterfaceInfoFromHost +--- PASS: TestIPAMGetDesiredIPConfigWithSpecfiedIP (0.00s) +=== RUN TestIPAMFailToGetDesiredIPConfigWithAlreadyAllocatedSpecfiedIP +setOrchestratorTypeInternal +NC Request {Version:-1 NetworkContainerType:Docker NetworkContainerid:06867cf3-332d-409d-8819-ed70d2c116b0 PrimaryInterfaceIdentifier: AuthorizationToken: LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} OrchestratorContext:[] IPConfiguration:{IPSubnet:{IPAddress:10.0.0.5 PrefixLength:24} DNSServers:[8.8.8.8 8.8.4.4] GatewayIPAddress:10.0.0.1} SecondaryIPConfigs:map[898fb8f1-f93e-4c96-9c31-6b89098949a3:{IPAddress:10.0.0.1 NCVersion:-1}] MultiTenancyInfo:{EncapType: ID:0} CnetAddressSpace:[] Routes:[] AllowHostToNCCommunication:false AllowNCToHostCommunication:false EndpointPolicies:[]}2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.1 version to -1, programmed host nc version is -1 +2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.1 as Available +2021/04/30 23:31:22 [2008] [Azure CNS] saveState +2021/04/30 23:31:22 [2008] [Azure CNS] store not initialized. + internalapi_test.go:406: NC version in container status is -1, HostVersion is -1 +--- PASS: TestIPAMFailToGetDesiredIPConfigWithAlreadyAllocatedSpecfiedIP (0.00s) +=== RUN TestIPAMFailToGetIPWhenAllIPsAreAllocated +setOrchestratorTypeInternal +NC Request {Version:-1 NetworkContainerType:Docker NetworkContainerid:06867cf3-332d-409d-8819-ed70d2c116b0 PrimaryInterfaceIdentifier: AuthorizationToken: LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} OrchestratorContext:[] IPConfiguration:{IPSubnet:{IPAddress:10.0.0.5 PrefixLength:24} DNSServers:[8.8.8.8 8.8.4.4] GatewayIPAddress:10.0.0.1} SecondaryIPConfigs:map[898fb8f1-f93e-4c96-9c31-6b89098949a3:{IPAddress:10.0.0.1 NCVersion:-1} b21e1ee1-fb7e-4e6d-8c68-22ee5049944e:{IPAddress:10.0.0.2 NCVersion:-1}] MultiTenancyInfo:{EncapType: ID:0} CnetAddressSpace:[] Routes:[] AllowHostToNCCommunication:false AllowNCToHostCommunication:false EndpointPolicies:[]}2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.1 version to -1, programmed host nc version is -1 +2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.1 as Available +2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.2 version to -1, programmed host nc version is -1 +2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.2 as Available +2021/04/30 23:31:22 [2008] [Azure CNS] saveState +2021/04/30 23:31:22 [2008] [Azure CNS] store not initialized. + internalapi_test.go:406: NC version in container status is -1, HostVersion is -1 +--- PASS: TestIPAMFailToGetIPWhenAllIPsAreAllocated (0.00s) +=== RUN TestIPAMRequestThenReleaseThenRequestAgain +setOrchestratorTypeInternal +NC Request {Version:-1 NetworkContainerType:Docker NetworkContainerid:06867cf3-332d-409d-8819-ed70d2c116b0 PrimaryInterfaceIdentifier: AuthorizationToken: LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} OrchestratorContext:[] IPConfiguration:{IPSubnet:{IPAddress:10.0.0.5 PrefixLength:24} DNSServers:[8.8.8.8 8.8.4.4] GatewayIPAddress:10.0.0.1} SecondaryIPConfigs:map[898fb8f1-f93e-4c96-9c31-6b89098949a3:{IPAddress:10.0.0.1 NCVersion:-1}] MultiTenancyInfo:{EncapType: ID:0} CnetAddressSpace:[] Routes:[] AllowHostToNCCommunication:false AllowNCToHostCommunication:false EndpointPolicies:[]}2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.1 version to -1, programmed host nc version is -1 +2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.1 as Available +2021/04/30 23:31:22 [2008] [Azure CNS] saveState +2021/04/30 23:31:22 [2008] [Azure CNS] store not initialized. + internalapi_test.go:406: NC version in container status is -1, HostVersion is -1 +2021/04/30 23:31:22 [2008] [releaseIPConfig] Releasing IP 10.0.0.1 for pod {PodName:testpod1 PodNamespace:testpod1namespace} +2021/04/30 23:31:22 [2008] [updateIPConfigState] Changing IpId [898fb8f1-f93e-4c96-9c31-6b89098949a3] state to [Available], orchestratorContext []. Current config [IPConfigurationStatus: Id: [898fb8f1-f93e-4c96-9c31-6b89098949a3], NcId: [06867cf3-332d-409d-8819-ed70d2c116b0], IpAddress: [10.0.0.1], State: [Allocated], OrchestratorContext: [{"PodName":"testpod1","PodNamespace":"testpod1namespace"}]] +2021/04/30 23:31:22 [2008] [setIPConfigAsAvailable] Deleted outdated pod info testpod1:testpod1namespace from PodIPIDByOrchestratorContext since IP 10.0.0.1 with ID 898fb8f1-f93e-4c96-9c31-6b89098949a3 will be released and set as Available +2021/04/30 23:31:22 [2008] [releaseIPConfig] Released IP 10.0.0.1 for pod {PodName:testpod1 PodNamespace:testpod1namespace} +2021/04/30 23:31:22 [2008] [updateIPConfigState] Changing IpId [898fb8f1-f93e-4c96-9c31-6b89098949a3] state to [Allocated], orchestratorContext [{"PodName":"testpod2","PodNamespace":"testpod2namespace"}]. Current config [IPConfigurationStatus: Id: [898fb8f1-f93e-4c96-9c31-6b89098949a3], NcId: [06867cf3-332d-409d-8819-ed70d2c116b0], IpAddress: [10.0.0.1], State: [Available], OrchestratorContext: []] +2021/04/30 23:31:22 [2008] [Azure CNS] GetPrimaryInterfaceInfoFromMemory +2021/04/30 23:31:22 [2008] [Azure CNS] GetPrimaryInterfaceInfoFromHost +--- PASS: TestIPAMRequestThenReleaseThenRequestAgain (0.00s) +=== RUN TestIPAMReleaseIPIdempotency +setOrchestratorTypeInternal +NC Request {Version:-1 NetworkContainerType:Docker NetworkContainerid:06867cf3-332d-409d-8819-ed70d2c116b0 PrimaryInterfaceIdentifier: AuthorizationToken: LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} OrchestratorContext:[] IPConfiguration:{IPSubnet:{IPAddress:10.0.0.5 PrefixLength:24} DNSServers:[8.8.8.8 8.8.4.4] GatewayIPAddress:10.0.0.1} SecondaryIPConfigs:map[898fb8f1-f93e-4c96-9c31-6b89098949a3:{IPAddress:10.0.0.1 NCVersion:-1}] MultiTenancyInfo:{EncapType: ID:0} CnetAddressSpace:[] Routes:[] AllowHostToNCCommunication:false AllowNCToHostCommunication:false EndpointPolicies:[]}2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.1 version to -1, programmed host nc version is -1 +2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.1 as Available +2021/04/30 23:31:22 [2008] [Azure CNS] saveState +2021/04/30 23:31:22 [2008] [Azure CNS] store not initialized. + internalapi_test.go:406: NC version in container status is -1, HostVersion is -1 +2021/04/30 23:31:22 [2008] [releaseIPConfig] Releasing IP 10.0.0.1 for pod {PodName:testpod1 PodNamespace:testpod1namespace} +2021/04/30 23:31:22 [2008] [updateIPConfigState] Changing IpId [898fb8f1-f93e-4c96-9c31-6b89098949a3] state to [Available], orchestratorContext []. Current config [IPConfigurationStatus: Id: [898fb8f1-f93e-4c96-9c31-6b89098949a3], NcId: [06867cf3-332d-409d-8819-ed70d2c116b0], IpAddress: [10.0.0.1], State: [Allocated], OrchestratorContext: [{"PodName":"testpod1","PodNamespace":"testpod1namespace"}]] +2021/04/30 23:31:22 [2008] [setIPConfigAsAvailable] Deleted outdated pod info testpod1:testpod1namespace from PodIPIDByOrchestratorContext since IP 10.0.0.1 with ID 898fb8f1-f93e-4c96-9c31-6b89098949a3 will be released and set as Available +2021/04/30 23:31:22 [2008] [releaseIPConfig] Released IP 10.0.0.1 for pod {PodName:testpod1 PodNamespace:testpod1namespace} +2021/04/30 23:31:22 [2008] [releaseIPConfig] SetIPConfigAsAvailable failed to release, no allocation found for pod [{PodName:testpod1 PodNamespace:testpod1namespace}] +--- PASS: TestIPAMReleaseIPIdempotency (0.00s) +=== RUN TestIPAMAllocateIPIdempotency +setOrchestratorTypeInternal +NC Request {Version:-1 NetworkContainerType:Docker NetworkContainerid:06867cf3-332d-409d-8819-ed70d2c116b0 PrimaryInterfaceIdentifier: AuthorizationToken: LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} OrchestratorContext:[] IPConfiguration:{IPSubnet:{IPAddress:10.0.0.5 PrefixLength:24} DNSServers:[8.8.8.8 8.8.4.4] GatewayIPAddress:10.0.0.1} SecondaryIPConfigs:map[898fb8f1-f93e-4c96-9c31-6b89098949a3:{IPAddress:10.0.0.1 NCVersion:-1}] MultiTenancyInfo:{EncapType: ID:0} CnetAddressSpace:[] Routes:[] AllowHostToNCCommunication:false AllowNCToHostCommunication:false EndpointPolicies:[]}2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.1 version to -1, programmed host nc version is -1 +2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.1 as Available +2021/04/30 23:31:22 [2008] [Azure CNS] saveState +2021/04/30 23:31:22 [2008] [Azure CNS] store not initialized. + internalapi_test.go:406: NC version in container status is -1, HostVersion is -1 +NC Request {Version:-1 NetworkContainerType:Docker NetworkContainerid:06867cf3-332d-409d-8819-ed70d2c116b0 PrimaryInterfaceIdentifier: AuthorizationToken: LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} OrchestratorContext:[] IPConfiguration:{IPSubnet:{IPAddress:10.0.0.5 PrefixLength:24} DNSServers:[8.8.8.8 8.8.4.4] GatewayIPAddress:10.0.0.1} SecondaryIPConfigs:map[898fb8f1-f93e-4c96-9c31-6b89098949a3:{IPAddress:10.0.0.1 NCVersion:-1}] MultiTenancyInfo:{EncapType: ID:0} CnetAddressSpace:[] Routes:[] AllowHostToNCCommunication:false AllowNCToHostCommunication:false EndpointPolicies:[]}2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.1 version to -1, programmed host nc version is -1 +2021/04/30 23:31:22 [2008] [Azure CNS] saveState +2021/04/30 23:31:22 [2008] [Azure CNS] store not initialized. + internalapi_test.go:406: NC version in container status is -1, HostVersion is -1 +--- PASS: TestIPAMAllocateIPIdempotency (0.00s) +=== RUN TestAvailableIPConfigs +setOrchestratorTypeInternal +NC Request {Version:-1 NetworkContainerType:Docker NetworkContainerid:06867cf3-332d-409d-8819-ed70d2c116b0 PrimaryInterfaceIdentifier: AuthorizationToken: LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} OrchestratorContext:[] IPConfiguration:{IPSubnet:{IPAddress:10.0.0.5 PrefixLength:24} DNSServers:[8.8.8.8 8.8.4.4] GatewayIPAddress:10.0.0.1} SecondaryIPConfigs:map[718e04ac-5a13-4dce-84b3-040accaa9b41:{IPAddress:10.0.0.3 NCVersion:-1} 898fb8f1-f93e-4c96-9c31-6b89098949a3:{IPAddress:10.0.0.1 NCVersion:-1} b21e1ee1-fb7e-4e6d-8c68-22ee5049944e:{IPAddress:10.0.0.2 NCVersion:-1}] MultiTenancyInfo:{EncapType: ID:0} CnetAddressSpace:[] Routes:[] AllowHostToNCCommunication:false AllowNCToHostCommunication:false EndpointPolicies:[]}2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.3 version to -1, programmed host nc version is -1 +2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.3 as Available +2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.1 version to -1, programmed host nc version is -1 +2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.1 as Available +2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.2 version to -1, programmed host nc version is -1 +2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.2 as Available +2021/04/30 23:31:22 [2008] [Azure CNS] saveState +2021/04/30 23:31:22 [2008] [Azure CNS] store not initialized. + internalapi_test.go:406: NC version in container status is -1, HostVersion is -1 +2021/04/30 23:31:22 [2008] [updateIPConfigState] Changing IpId [898fb8f1-f93e-4c96-9c31-6b89098949a3] state to [Allocated], orchestratorContext [{"PodName":"testpod1","PodNamespace":"testpod1namespace"}]. Current config [IPConfigurationStatus: Id: [898fb8f1-f93e-4c96-9c31-6b89098949a3], NcId: [06867cf3-332d-409d-8819-ed70d2c116b0], IpAddress: [10.0.0.1], State: [Available], OrchestratorContext: []] +2021/04/30 23:31:22 [2008] [Azure CNS] GetPrimaryInterfaceInfoFromMemory +2021/04/30 23:31:22 [2008] [Azure CNS] GetPrimaryInterfaceInfoFromHost +--- PASS: TestAvailableIPConfigs (0.00s) +=== RUN TestIPAMMarkIPCountAsPending +setOrchestratorTypeInternal +NC Request {Version:-1 NetworkContainerType:Docker NetworkContainerid:06867cf3-332d-409d-8819-ed70d2c116b0 PrimaryInterfaceIdentifier: AuthorizationToken: LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} OrchestratorContext:[] IPConfiguration:{IPSubnet:{IPAddress:10.0.0.5 PrefixLength:24} DNSServers:[8.8.8.8 8.8.4.4] GatewayIPAddress:10.0.0.1} SecondaryIPConfigs:map[898fb8f1-f93e-4c96-9c31-6b89098949a3:{IPAddress:10.0.0.1 NCVersion:-1}] MultiTenancyInfo:{EncapType: ID:0} CnetAddressSpace:[] Routes:[] AllowHostToNCCommunication:false AllowNCToHostCommunication:false EndpointPolicies:[]}2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.1 version to -1, programmed host nc version is -1 +2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.1 as Available +2021/04/30 23:31:22 [2008] [Azure CNS] saveState +2021/04/30 23:31:22 [2008] [Azure CNS] store not initialized. + internalapi_test.go:406: NC version in container status is -1, HostVersion is -1 +2021/04/30 23:31:22 [2008] [updateIPConfigState] Changing IpId [898fb8f1-f93e-4c96-9c31-6b89098949a3] state to [PendingRelease], orchestratorContext []. Current config [IPConfigurationStatus: Id: [898fb8f1-f93e-4c96-9c31-6b89098949a3], NcId: [06867cf3-332d-409d-8819-ed70d2c116b0], IpAddress: [10.0.0.1], State: [Available], OrchestratorContext: []] +2021/04/30 23:31:22 [2008] [releaseIPConfig] SetIPConfigAsAvailable failed to release, no allocation found for pod [{PodName:testpod1 PodNamespace:testpod1namespace}] +2021/04/30 23:31:22 [2008] [MarkIPAsPendingRelease] Set total ips to PendingRelease 0, expected 1 +--- PASS: TestIPAMMarkIPCountAsPending (0.00s) +=== RUN TestIPAMMarkIPAsPendingWithPendingProgrammingIPs +setOrchestratorTypeInternal +NC Request {Version:0 NetworkContainerType:Docker NetworkContainerid:06867cf3-332d-409d-8819-ed70d2c116b0 PrimaryInterfaceIdentifier: AuthorizationToken: LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} OrchestratorContext:[] IPConfiguration:{IPSubnet:{IPAddress:10.0.0.5 PrefixLength:24} DNSServers:[8.8.8.8 8.8.4.4] GatewayIPAddress:10.0.0.1} SecondaryIPConfigs:map[718e04ac-5a13-4dce-84b3-040accaa9b41:{IPAddress:10.0.0.3 NCVersion:0} 718e04ac-5a13-4dce-84b3-040accaa9b42:{IPAddress:10.0.0.4 NCVersion:-1} 898fb8f1-f93e-4c96-9c31-6b89098949a3:{IPAddress:10.0.0.1 NCVersion:0} b21e1ee1-fb7e-4e6d-8c68-22ee5049944e:{IPAddress:10.0.0.2 NCVersion:-1}] MultiTenancyInfo:{EncapType: ID:0} CnetAddressSpace:[] Routes:[] AllowHostToNCCommunication:false AllowNCToHostCommunication:false EndpointPolicies:[]}2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.3 version to 0, programmed host nc version is -1 +2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.3 as PendingProgramming +2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.2 version to -1, programmed host nc version is -1 +2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.2 as Available +2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.4 version to -1, programmed host nc version is -1 +2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.4 as Available +2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.1 version to 0, programmed host nc version is -1 +2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.1 as PendingProgramming +2021/04/30 23:31:22 [2008] [Azure CNS] saveState +2021/04/30 23:31:22 [2008] [Azure CNS] store not initialized. +2021/04/30 23:31:22 [2008] [updateIPConfigState] Changing IpId [718e04ac-5a13-4dce-84b3-040accaa9b41] state to [PendingRelease], orchestratorContext []. Current config [IPConfigurationStatus: Id: [718e04ac-5a13-4dce-84b3-040accaa9b41], NcId: [06867cf3-332d-409d-8819-ed70d2c116b0], IpAddress: [10.0.0.3], State: [PendingProgramming], OrchestratorContext: []] +2021/04/30 23:31:22 [2008] [updateIPConfigState] Changing IpId [898fb8f1-f93e-4c96-9c31-6b89098949a3] state to [PendingRelease], orchestratorContext []. Current config [IPConfigurationStatus: Id: [898fb8f1-f93e-4c96-9c31-6b89098949a3], NcId: [06867cf3-332d-409d-8819-ed70d2c116b0], IpAddress: [10.0.0.1], State: [PendingProgramming], OrchestratorContext: []] +2021/04/30 23:31:22 [2008] [releaseIPConfig] SetIPConfigAsAvailable failed to release, no allocation found for pod [{PodName:testpod1 PodNamespace:testpod1namespace}] +2021/04/30 23:31:22 [2008] [updateIPConfigState] Changing IpId [b21e1ee1-fb7e-4e6d-8c68-22ee5049944e] state to [PendingRelease], orchestratorContext []. Current config [IPConfigurationStatus: Id: [b21e1ee1-fb7e-4e6d-8c68-22ee5049944e], NcId: [06867cf3-332d-409d-8819-ed70d2c116b0], IpAddress: [10.0.0.2], State: [Available], OrchestratorContext: []] +2021/04/30 23:31:22 [2008] [updateIPConfigState] Changing IpId [718e04ac-5a13-4dce-84b3-040accaa9b42] state to [PendingRelease], orchestratorContext []. Current config [IPConfigurationStatus: Id: [718e04ac-5a13-4dce-84b3-040accaa9b42], NcId: [06867cf3-332d-409d-8819-ed70d2c116b0], IpAddress: [10.0.0.4], State: [Available], OrchestratorContext: []] +--- PASS: TestIPAMMarkIPAsPendingWithPendingProgrammingIPs (0.00s) +=== RUN TestIPAMMarkExistingIPConfigAsPending +setOrchestratorTypeInternal +NC Request {Version:-1 NetworkContainerType:Docker NetworkContainerid:06867cf3-332d-409d-8819-ed70d2c116b0 PrimaryInterfaceIdentifier: AuthorizationToken: LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} OrchestratorContext:[] IPConfiguration:{IPSubnet:{IPAddress:10.0.0.5 PrefixLength:24} DNSServers:[8.8.8.8 8.8.4.4] GatewayIPAddress:10.0.0.1} SecondaryIPConfigs:map[898fb8f1-f93e-4c96-9c31-6b89098949a3:{IPAddress:10.0.0.1 NCVersion:-1} b21e1ee1-fb7e-4e6d-8c68-22ee5049944e:{IPAddress:10.0.0.2 NCVersion:-1}] MultiTenancyInfo:{EncapType: ID:0} CnetAddressSpace:[] Routes:[] AllowHostToNCCommunication:false AllowNCToHostCommunication:false EndpointPolicies:[]}2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.2 version to -1, programmed host nc version is -1 +2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.2 as Available +2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.1 version to -1, programmed host nc version is -1 +2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.1 as Available +2021/04/30 23:31:22 [2008] [Azure CNS] saveState +2021/04/30 23:31:22 [2008] [Azure CNS] store not initialized. + internalapi_test.go:406: NC version in container status is -1, HostVersion is -1 +2021/04/30 23:31:22 [2008] [MarkExistingIPsAsPending]: Marking IP [IPConfigurationStatus: Id: [b21e1ee1-fb7e-4e6d-8c68-22ee5049944e], NcId: [06867cf3-332d-409d-8819-ed70d2c116b0], IpAddress: [10.0.0.2], State: [Available], OrchestratorContext: []] to PendingRelease +--- PASS: TestIPAMMarkExistingIPConfigAsPending (0.00s) +PASS +coverage: 8.4% of statements in ./... +2021/04/30 23:31:22 [2008] [Listener] Stopped listening on localhost:10090 +2021/04/30 23:31:22 [2008] [Azure CNS] Service stopped. +2021/04/30 23:31:22 [2008] [Listener] Stopped listening on localhost:9000 +ok github.com/Azure/azure-container-networking/cns/restserver 0.494s coverage: 8.4% of statements in ./... +? github.com/Azure/azure-container-networking/cns/routes [no test files] +? github.com/Azure/azure-container-networking/cns/service [no test files] +? github.com/Azure/azure-container-networking/common [no test files] +? github.com/Azure/azure-container-networking/ebtables [no test files] +=== RUN TestAzure +Running Suite: Azure source Suite +================================= +Random Seed: 1619825482 +Will run 106 of 106 specs + +2021/04/30 23:31:23 [2026] [Listener] Started listening on localhost:42424. +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil +2021/04/30 23:31:23 [2026] [ipam] Starting source ipv6NodeIpam. +•2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. +2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server +•2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. +2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. +2021/04/30 23:31:23 [2026] [ipam] merging address space +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server +2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:true. +2021/04/30 23:31:23 [2026] [ipam] Checking pool ace:cab:deca:deed::/126. +2021/04/30 23:31:23 [2026] [ipam] Pool ace:cab:deca:deed::/126 matches requirements. +2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as:0xc00020a7b0 Id:ace:cab:deca:deed::/126 IfName: Subnet:{IP:ace:cab:deca:deed:: Mask:fffffffffffffffffffffffffffffffc} Gateway:ace:cab:deca:deed::1 Addresses:map[ace:cab:deca:deed::2:0xc000208100 ace:cab:deca:deed::3:0xc000208140] addrsByID:map[] IsIPv6:true Priority:0 RefCount:1 epoch:1} err:. +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +•2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. +2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. +2021/04/30 23:31:23 [2026] [ipam] merging address space +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server +2021/04/30 23:31:23 [2026] [ipam] Requesting address with address:ace:cab:deca:deed::2 options:map[]. +2021/04/30 23:31:23 [2026] [ipam] Address request completed with address:ace:cab:deca:deed::2/126 +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +•2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. +2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. +2021/04/30 23:31:23 [2026] [ipam] merging address space +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server +2021/04/30 23:31:23 [2026] [ipam] Requesting address with address: options:map[]. +2021/04/30 23:31:23 [2026] [ipam] Address request completed with address:ace:cab:deca:deed::3/126 +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +•2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. +2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. +2021/04/30 23:31:23 [2026] [ipam] merging address space +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server +2021/04/30 23:31:23 [2026] [ipam] Releasing address with address: options:map[]. +2021/04/30 23:31:23 [2026] Address not found. Not Returning error +2021/04/30 23:31:23 [2026] [ipam] Address release completed with address: err:. +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +•2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. +2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. +2021/04/30 23:31:23 [2026] [ipam] merging address space +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server +2021/04/30 23:31:23 [2026] [ipam] Releasing address with address: options:map[]. +2021/04/30 23:31:23 [2026] Address not found. Not Returning error +2021/04/30 23:31:23 [2026] [ipam] Address release completed with address: err:. +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. +2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. +2021/04/30 23:31:23 [2026] [ipam] merging address space +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server +2021/04/30 23:31:23 [2026] [ipam] Skip releasing pool with poolId:ace:cab:deca:deed::/126. due to address being in use +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +•2021/04/30 23:31:23 [2026] [ipam] ipam store is nil +•2021/04/30 23:31:23 [2026] [ipam] reboot time 2021-04-30 21:51:59 +0000 UTC store mod time 0001-01-01 00:00:00 +0000 UTC +2021/04/30 23:31:23 [2026] [ipam] Detected Reboot +2021/04/30 23:31:23 [2026] [ipam] store key not found +•2021/04/30 23:31:23 [2026] [ipam] reboot time 2021-04-30 21:51:59 +0000 UTC store mod time 0001-01-01 00:00:00 +0000 UTC +2021/04/30 23:31:23 [2026] [ipam] Detected Reboot +2021/04/30 23:31:23 [2026] [ipam] Failed to restore state, err:Error +•2021/04/30 23:31:23 [2026] [ipam] ipam store is nil +•2021/04/30 23:31:23 [2026] [ipam] ipam store is nil +•2021/04/30 23:31:23 [2026] [ipam] reboot time 2021-04-30 21:51:59 +0000 UTC store mod time 2021-04-30 22:51:59 +0000 UTC +2021/04/30 23:31:23 [2026] [ipam] Restored state, &{Version: TimeStamp:0001-01-01 00:00:00 +0000 UTC AddrSpaces:map[as-test:0xc0000203f0] store:0xc0002cea80 source: netApi: Mutex:{state:0 sema:0}} +•2021/04/30 23:31:23 [2026] [ipam] Restored state, &{Version: TimeStamp:0001-01-01 00:00:00 +0000 UTC AddrSpaces:map[as-test:0xc000020690] store:0xc0002ceb00 source: netApi: Mutex:{state:0 sema:0}} +•2021/04/30 23:31:23 [2026] [ipam] reboot time 2021-04-30 21:51:59 +0000 UTC store mod time 0001-01-01 00:00:00 +0000 UTC +2021/04/30 23:31:23 [2026] [ipam] Detected Reboot +2021/04/30 23:31:23 [2026] [ipam] Rehydrating ipam state from persistent store +2021/04/30 23:31:23 [2026] [ipam] Restored state, &{Version: TimeStamp:0001-01-01 00:00:00 +0000 UTC AddrSpaces:map[as-test:0xc000020810] store:0xc0002ceb80 source: netApi: Mutex:{state:0 sema:0}} +•2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +•2021/04/30 23:31:23 [2026] [ipam] Starting source azure. +•2021/04/30 23:31:23 [2026] [ipam] Starting source mas. +•2021/04/30 23:31:23 [2026] [ipam] Starting source null. +••••••••••2021/04/30 23:31:23 [2026] [ipam] Failed to find interface with MAC address:000D3A6E1825 +•2021/04/30 23:31:23 [2026] [ipam] Failed to find interface with MAC address:000D3A6E1825 +2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from config file +••••2021/04/30 23:31:23 [2026] [ipam] Failed to create address:1.1.1.6 err:Address already exists. +2021/04/30 23:31:23 [2026] [ipam] Failed to create address: err:Invalid address. +•2021/04/30 23:31:23 [2026] [ipam] Failed to create pool:{0.0.0.0/24 []} ifName:eth0 err:Address pool already exists. +2021/04/30 23:31:23 [2026] [ipam] Failed to parse subnet:invalid err:invalid CIDR address: invalid. +2021/04/30 23:31:23 [2026] [ipam] Failed to find interface with MAC address:222222222222 +•••••••••••••2021/04/30 23:31:23 [2026] [Utils] Initializing HTTP client with connection timeout: 10, response header timeout: 10 +2021/04/30 23:31:23 [2026] [ipam] Wireserver call http://localhost:42424 to retrieve IP List +2021/04/30 23:31:23 [2026] [ipam] got 1 addresses from interface lo, subnet 10.0.0.0/16 +2021/04/30 23:31:23 [2026] [ipam] got 1 addresses from interface lo, subnet 10.1.0.0/16 +•2021/04/30 23:31:23 [2026] [ipam] ipam store is nil +2021/04/30 23:31:23 [2026] [ipam] Starting source azure. +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +2021/04/30 23:31:23 [2026] [Utils] Initializing HTTP client with connection timeout: 10, response header timeout: 10 +2021/04/30 23:31:23 [2026] [ipam] Wireserver call http://localhost:42424 to retrieve IP List +2021/04/30 23:31:23 [2026] [ipam] got 1 addresses from interface lo, subnet 10.0.0.0/16 +2021/04/30 23:31:23 [2026] [ipam] got 1 addresses from interface lo, subnet 10.1.0.0/16 +2021/04/30 23:31:23 [2026] [ipam] merging address space +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +•••••••••••••2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +•2021/04/30 23:31:23 [2026] [ipam] merging address space +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +•••••••••••••2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId:10.0.0.0/16 options:map[] v6:false. +2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool: err:Address pool not found. +•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId:10.0.0.0/16 options:map[] v6:false. +2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as: Id:10.0.0.0/16 IfName: Subnet:{IP: Mask:} Gateway: Addresses:map[] addrsByID:map[] IsIPv6:false Priority:0 RefCount:1 epoch:0} err:. +•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:false. +2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. +2021/04/30 23:31:23 [2026] [ipam] Pool 10.0.0.0/16 is in use. +2021/04/30 23:31:23 [2026] [ipam] Releasing pool 10.0.0.0/16 as there are no allocations +2021/04/30 23:31:23 [2026] [ipam] Pool 10.0.0.0/16 matches requirements. +2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as: Id:10.0.0.0/16 IfName: Subnet:{IP: Mask:} Gateway: Addresses:map[10.0.0.2:0xc00060dfc0] addrsByID:map[] IsIPv6:false Priority:0 RefCount:1 epoch:0} err:. +•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:false. +2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. +2021/04/30 23:31:23 [2026] [ipam] Pool 10.0.0.0/16 is in use. +2021/04/30 23:31:23 [2026] [ipam] Skip releasing pool with poolId:10.0.0.0/16. due to address being in use +2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool: err:No available address pools. +•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId:10.0.0.0/16 options:map[] v6:false. +2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as: Id:10.0.0.0/16 IfName: Subnet:{IP: Mask:} Gateway: Addresses:map[10.0.0.1:0xc000648080 10.0.0.2:0xc0006480c0] addrsByID:map[] IsIPv6:false Priority:0 RefCount:1 epoch:0} err:. +•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:true. +2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. +2021/04/30 23:31:23 [2026] [ipam] Pool is of a different address family. +2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool: err:No available address pools. +•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[azure.interface.name:en0] v6:false. +2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. +2021/04/30 23:31:23 [2026] [ipam] Pool is not on the requested interface. +2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool: err:No available address pools. +•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:false. +2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. +2021/04/30 23:31:23 [2026] [ipam] Pool 10.0.0.0/16 matches requirements. +2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as: Id:10.0.0.0/16 IfName: Subnet:{IP: Mask:} Gateway: Addresses:map[] addrsByID:map[] IsIPv6:false Priority:0 RefCount:1 epoch:0} err:. +•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:false. +2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. +2021/04/30 23:31:23 [2026] [ipam] Pool 10.0.0.0/16 matches requirements. +2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.1.0.0/16. +2021/04/30 23:31:23 [2026] [ipam] Pool 10.1.0.0/16 matches requirements. +2021/04/30 23:31:23 [2026] [ipam] Pool is preferred because of priority. +2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as: Id:10.1.0.0/16 IfName: Subnet:{IP: Mask:} Gateway: Addresses:map[] addrsByID:map[] IsIPv6:false Priority:2 RefCount:1 epoch:0} err:. +•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:false. +2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. +2021/04/30 23:31:23 [2026] [ipam] Pool 10.0.0.0/16 matches requirements. +2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.1.0.0/16. +2021/04/30 23:31:23 [2026] [ipam] Pool 10.1.0.0/16 matches requirements. +2021/04/30 23:31:23 [2026] [ipam] Pool is preferred because of capacity. +2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as: Id:10.1.0.0/16 IfName: Subnet:{IP: Mask:} Gateway: Addresses:map[10.1.0.1/16:0xc000648100] addrsByID:map[] IsIPv6:false Priority:0 RefCount:1 epoch:0} err:. +••2021/04/30 23:31:23 [2026] [ipam] Releasing pool 10.0.0.0/16 as there are no allocations +•2021/04/30 23:31:23 [2026] [ipam] Skip releasing pool with poolId:10.0.0.0/16. due to address being in use +•2021/04/30 23:31:23 [2026] [ipam] Releasing pool 10.0.0.0/16 as there are no allocations +••••2021/04/30 23:31:23 [2026] [ipam] Requesting address with address:10.0.0.1/16 options:map[]. +2021/04/30 23:31:23 [2026] [ipam] Address request failed with Address not found +•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address:10.0.0.1/16 options:map[azure.address.id:10.0.0.1/16]. +2021/04/30 23:31:23 [2026] [ipam] Address request completed with address: +•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address: options:map[azure.address.id:f6082149-cc2f-4a9e-8d5e-e85c3b16396e]. +2021/04/30 23:31:23 [2026] [ipam] Address request completed with address:10.0.1.1/24 +•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address:10.0.0.1/16 options:map[]. +2021/04/30 23:31:23 [2026] [ipam] Address request failed with Address already in use +•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address:10.0.0.1/16 options:map[azure.address.id:10.0.0.2/16]. +2021/04/30 23:31:23 [2026] [ipam] Address request failed with Address already in use +•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address: options:map[azure.address.type:gateway]. +2021/04/30 23:31:23 [2026] [ipam] Address request completed with address: +•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address: options:map[azure.address.id:10.0.0.1/16]. +2021/04/30 23:31:23 [2026] [ipam] Address request completed with address: +•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address: options:map[]. +2021/04/30 23:31:23 [2026] [ipam] Address request failed with No available addresses +•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address: options:map[]. +2021/04/30 23:31:23 [2026] [ipam] Address request completed with address: +•2021/04/30 23:31:23 [2026] [ipam] Releasing address with address:0.0.0.0 options:map[]. +2021/04/30 23:31:23 [2026] [ipam] Address release completed with address:0.0.0.0 err:. +•2021/04/30 23:31:23 [2026] [ipam] Releasing address with address:0.0.0.0 options:map[]. +2021/04/30 23:31:23 [2026] [ipam] Address release completed with address:0.0.0.0 err:. +•2021/04/30 23:31:23 [2026] [ipam] Releasing address with address:10.0.0.1/16 options:map[]. +2021/04/30 23:31:23 [2026] Address not in use. Not Returning error +2021/04/30 23:31:23 [2026] [ipam] Address release completed with address:10.0.0.1/16 err:. +•2021/04/30 23:31:23 [2026] [ipam] Releasing address with address: options:map[azure.address.id:10.0.0.1/16]. +2021/04/30 23:31:23 [2026] [ipam] Address release completed with address:0.0.0.0 err:. +•2021/04/30 23:31:23 [2026] [ipam] Releasing address with address:10.0.0.1/16 options:map[]. +2021/04/30 23:31:23 [2026] Deleting Address record from address pool as metadata doesn't have this address +2021/04/30 23:31:23 [2026] [ipam] Address release completed with address:10.0.0.1/16 err:. +•2021/04/30 23:31:23 [2026] [Listener] Stopped listening on localhost:42424 + +Ran 106 of 106 Specs in 0.085 seconds +SUCCESS! -- 106 Passed | 0 Failed | 0 Pending | 0 Skipped +--- PASS: TestAzure (0.09s) +=== RUN TestFileIpam +Running Suite: MAS Suite +======================== +Random Seed: 1619825482 +Will run 106 of 106 specs + +2021/04/30 23:31:23 [2026] [Listener] Started listening on localhost:42424. +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil +2021/04/30 23:31:23 [2026] [ipam] Starting source ipv6NodeIpam. +•2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. +2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server +•2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. +2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. +2021/04/30 23:31:23 [2026] [ipam] merging address space +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server +2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:true. +2021/04/30 23:31:23 [2026] [ipam] Checking pool ace:cab:deca:deed::/126. +2021/04/30 23:31:23 [2026] [ipam] Pool ace:cab:deca:deed::/126 matches requirements. +2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as:0xc00020a990 Id:ace:cab:deca:deed::/126 IfName: Subnet:{IP:ace:cab:deca:deed:: Mask:fffffffffffffffffffffffffffffffc} Gateway:ace:cab:deca:deed::1 Addresses:map[ace:cab:deca:deed::2:0xc000648980 ace:cab:deca:deed::3:0xc0006489c0] addrsByID:map[] IsIPv6:true Priority:0 RefCount:1 epoch:1} err:. +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +•2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. +2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. +2021/04/30 23:31:23 [2026] [ipam] merging address space +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server +2021/04/30 23:31:23 [2026] [ipam] Requesting address with address:ace:cab:deca:deed::2 options:map[]. +2021/04/30 23:31:23 [2026] [ipam] Address request completed with address:ace:cab:deca:deed::2/126 +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +•2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. +2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. +2021/04/30 23:31:23 [2026] [ipam] merging address space +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server +2021/04/30 23:31:23 [2026] [ipam] Requesting address with address: options:map[]. +2021/04/30 23:31:23 [2026] [ipam] Address request completed with address:ace:cab:deca:deed::3/126 +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +•2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. +2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. +2021/04/30 23:31:23 [2026] [ipam] merging address space +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server +2021/04/30 23:31:23 [2026] [ipam] Releasing address with address: options:map[]. +2021/04/30 23:31:23 [2026] Address not found. Not Returning error +2021/04/30 23:31:23 [2026] [ipam] Address release completed with address: err:. +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +•2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. +2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. +2021/04/30 23:31:23 [2026] [ipam] merging address space +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server +2021/04/30 23:31:23 [2026] [ipam] Releasing address with address: options:map[]. +2021/04/30 23:31:23 [2026] Address not found. Not Returning error +2021/04/30 23:31:23 [2026] [ipam] Address release completed with address: err:. +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. +2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. +2021/04/30 23:31:23 [2026] [ipam] merging address space +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server +2021/04/30 23:31:23 [2026] [ipam] Skip releasing pool with poolId:ace:cab:deca:deed::/126. due to address being in use +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +•2021/04/30 23:31:23 [2026] [ipam] ipam store is nil +•2021/04/30 23:31:23 [2026] [ipam] reboot time 2021-04-30 21:51:59 +0000 UTC store mod time 0001-01-01 00:00:00 +0000 UTC +2021/04/30 23:31:23 [2026] [ipam] Detected Reboot +2021/04/30 23:31:23 [2026] [ipam] store key not found +•2021/04/30 23:31:23 [2026] [ipam] reboot time 2021-04-30 21:51:59 +0000 UTC store mod time 0001-01-01 00:00:00 +0000 UTC +2021/04/30 23:31:23 [2026] [ipam] Detected Reboot +2021/04/30 23:31:23 [2026] [ipam] Failed to restore state, err:Error +•2021/04/30 23:31:23 [2026] [ipam] ipam store is nil +•2021/04/30 23:31:23 [2026] [ipam] ipam store is nil +•2021/04/30 23:31:23 [2026] [ipam] reboot time 2021-04-30 21:51:59 +0000 UTC store mod time 2021-04-30 22:51:59 +0000 UTC +2021/04/30 23:31:23 [2026] [ipam] Restored state, &{Version: TimeStamp:0001-01-01 00:00:00 +0000 UTC AddrSpaces:map[as-test:0xc000439e30] store:0xc0005b7d80 source: netApi: Mutex:{state:0 sema:0}} +•2021/04/30 23:31:23 [2026] [ipam] Restored state, &{Version: TimeStamp:0001-01-01 00:00:00 +0000 UTC AddrSpaces:map[as-test:0xc000255410] store:0xc0005b7e00 source: netApi: Mutex:{state:0 sema:0}} +•2021/04/30 23:31:23 [2026] [ipam] reboot time 2021-04-30 21:51:59 +0000 UTC store mod time 0001-01-01 00:00:00 +0000 UTC +2021/04/30 23:31:23 [2026] [ipam] Detected Reboot +2021/04/30 23:31:23 [2026] [ipam] Rehydrating ipam state from persistent store +2021/04/30 23:31:23 [2026] [ipam] Restored state, &{Version: TimeStamp:0001-01-01 00:00:00 +0000 UTC AddrSpaces:map[as-test:0xc0003720c0] store:0xc0005b7e80 source: netApi: Mutex:{state:0 sema:0}} +•2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +•2021/04/30 23:31:23 [2026] [ipam] Starting source azure. +•2021/04/30 23:31:23 [2026] [ipam] Starting source mas. +•2021/04/30 23:31:23 [2026] [ipam] Starting source null. +••••••••••2021/04/30 23:31:23 [2026] [ipam] Failed to find interface with MAC address:000D3A6E1825 +•2021/04/30 23:31:23 [2026] [ipam] Failed to find interface with MAC address:000D3A6E1825 +2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from config file +••••2021/04/30 23:31:23 [2026] [ipam] Failed to create address:1.1.1.6 err:Address already exists. +2021/04/30 23:31:23 [2026] [ipam] Failed to create address: err:Invalid address. +•2021/04/30 23:31:23 [2026] [ipam] Failed to create pool:{0.0.0.0/24 []} ifName:eth0 err:Address pool already exists. +2021/04/30 23:31:23 [2026] [ipam] Failed to parse subnet:invalid err:invalid CIDR address: invalid. +2021/04/30 23:31:23 [2026] [ipam] Failed to find interface with MAC address:222222222222 +•••••••••••••2021/04/30 23:31:23 [2026] [Utils] Initializing HTTP client with connection timeout: 10, response header timeout: 10 +2021/04/30 23:31:23 [2026] [ipam] Wireserver call http://localhost:42424 to retrieve IP List +2021/04/30 23:31:23 [2026] [ipam] got 1 addresses from interface lo, subnet 10.0.0.0/16 +2021/04/30 23:31:23 [2026] [ipam] got 1 addresses from interface lo, subnet 10.1.0.0/16 +•2021/04/30 23:31:23 [2026] [ipam] ipam store is nil +2021/04/30 23:31:23 [2026] [ipam] Starting source azure. +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +2021/04/30 23:31:23 [2026] [Utils] Initializing HTTP client with connection timeout: 10, response header timeout: 10 +2021/04/30 23:31:23 [2026] [ipam] Wireserver call http://localhost:42424 to retrieve IP List +2021/04/30 23:31:23 [2026] [ipam] got 1 addresses from interface lo, subnet 10.0.0.0/16 +2021/04/30 23:31:23 [2026] [ipam] got 1 addresses from interface lo, subnet 10.1.0.0/16 +2021/04/30 23:31:23 [2026] [ipam] merging address space +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +•••••••••••••2021/04/30 23:31:23 [2026] [ipam] merging address space +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +•2021/04/30 23:31:23 [2026] [ipam] merging address space +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +•••••••••••••2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId:10.0.0.0/16 options:map[] v6:false. +2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool: err:Address pool not found. +•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId:10.0.0.0/16 options:map[] v6:false. +2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as: Id:10.0.0.0/16 IfName: Subnet:{IP: Mask:} Gateway: Addresses:map[] addrsByID:map[] IsIPv6:false Priority:0 RefCount:1 epoch:0} err:. +•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:false. +2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. +2021/04/30 23:31:23 [2026] [ipam] Pool 10.0.0.0/16 is in use. +2021/04/30 23:31:23 [2026] [ipam] Releasing pool 10.0.0.0/16 as there are no allocations +2021/04/30 23:31:23 [2026] [ipam] Pool 10.0.0.0/16 matches requirements. +2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as: Id:10.0.0.0/16 IfName: Subnet:{IP: Mask:} Gateway: Addresses:map[10.0.0.2:0xc00008b680] addrsByID:map[] IsIPv6:false Priority:0 RefCount:1 epoch:0} err:. +•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:false. +2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. +2021/04/30 23:31:23 [2026] [ipam] Pool 10.0.0.0/16 is in use. +2021/04/30 23:31:23 [2026] [ipam] Skip releasing pool with poolId:10.0.0.0/16. due to address being in use +2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool: err:No available address pools. +•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId:10.0.0.0/16 options:map[] v6:false. +2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as: Id:10.0.0.0/16 IfName: Subnet:{IP: Mask:} Gateway: Addresses:map[10.0.0.1:0xc00008b740 10.0.0.2:0xc00008b780] addrsByID:map[] IsIPv6:false Priority:0 RefCount:1 epoch:0} err:. +•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:true. +2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. +2021/04/30 23:31:23 [2026] [ipam] Pool is of a different address family. +2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool: err:No available address pools. +•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[azure.interface.name:en0] v6:false. +2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. +2021/04/30 23:31:23 [2026] [ipam] Pool is not on the requested interface. +2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool: err:No available address pools. +•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:false. +2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. +2021/04/30 23:31:23 [2026] [ipam] Pool 10.0.0.0/16 matches requirements. +2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as: Id:10.0.0.0/16 IfName: Subnet:{IP: Mask:} Gateway: Addresses:map[] addrsByID:map[] IsIPv6:false Priority:0 RefCount:1 epoch:0} err:. +•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:false. +2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. +2021/04/30 23:31:23 [2026] [ipam] Pool 10.0.0.0/16 matches requirements. +2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.1.0.0/16. +2021/04/30 23:31:23 [2026] [ipam] Pool 10.1.0.0/16 matches requirements. +2021/04/30 23:31:23 [2026] [ipam] Pool is preferred because of priority. +2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as: Id:10.1.0.0/16 IfName: Subnet:{IP: Mask:} Gateway: Addresses:map[] addrsByID:map[] IsIPv6:false Priority:2 RefCount:1 epoch:0} err:. +•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:false. +2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. +2021/04/30 23:31:23 [2026] [ipam] Pool 10.0.0.0/16 matches requirements. +2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.1.0.0/16. +2021/04/30 23:31:23 [2026] [ipam] Pool 10.1.0.0/16 matches requirements. +2021/04/30 23:31:23 [2026] [ipam] Pool is preferred because of capacity. +2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as: Id:10.1.0.0/16 IfName: Subnet:{IP: Mask:} Gateway: Addresses:map[10.1.0.1/16:0xc00008b7c0] addrsByID:map[] IsIPv6:false Priority:0 RefCount:1 epoch:0} err:. +••2021/04/30 23:31:23 [2026] [ipam] Releasing pool 10.0.0.0/16 as there are no allocations +•2021/04/30 23:31:23 [2026] [ipam] Skip releasing pool with poolId:10.0.0.0/16. due to address being in use +•2021/04/30 23:31:23 [2026] [ipam] Releasing pool 10.0.0.0/16 as there are no allocations +••••2021/04/30 23:31:23 [2026] [ipam] Requesting address with address:10.0.0.1/16 options:map[]. +2021/04/30 23:31:23 [2026] [ipam] Address request failed with Address not found +•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address:10.0.0.1/16 options:map[azure.address.id:10.0.0.1/16]. +2021/04/30 23:31:23 [2026] [ipam] Address request completed with address: +•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address: options:map[azure.address.id:b587f505-4225-44ec-8f01-d74982ed6cd5]. +2021/04/30 23:31:23 [2026] [ipam] Address request completed with address:10.0.1.3/24 +•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address:10.0.0.1/16 options:map[]. +2021/04/30 23:31:23 [2026] [ipam] Address request failed with Address already in use +•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address:10.0.0.1/16 options:map[azure.address.id:10.0.0.2/16]. +2021/04/30 23:31:23 [2026] [ipam] Address request failed with Address already in use +•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address: options:map[azure.address.type:gateway]. +2021/04/30 23:31:23 [2026] [ipam] Address request completed with address: +•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address: options:map[azure.address.id:10.0.0.1/16]. +2021/04/30 23:31:23 [2026] [ipam] Address request completed with address: +•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address: options:map[]. +2021/04/30 23:31:23 [2026] [ipam] Address request failed with No available addresses +•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address: options:map[]. +2021/04/30 23:31:23 [2026] [ipam] Address request completed with address: +•2021/04/30 23:31:23 [2026] [ipam] Releasing address with address:0.0.0.0 options:map[]. +2021/04/30 23:31:23 [2026] [ipam] Address release completed with address:0.0.0.0 err:. +•2021/04/30 23:31:23 [2026] [ipam] Releasing address with address:0.0.0.0 options:map[]. +2021/04/30 23:31:23 [2026] [ipam] Address release completed with address:0.0.0.0 err:. +•2021/04/30 23:31:23 [2026] [ipam] Releasing address with address:10.0.0.1/16 options:map[]. +2021/04/30 23:31:23 [2026] Address not in use. Not Returning error +2021/04/30 23:31:23 [2026] [ipam] Address release completed with address:10.0.0.1/16 err:. +•2021/04/30 23:31:23 [2026] [ipam] Releasing address with address: options:map[azure.address.id:10.0.0.1/16]. +2021/04/30 23:31:23 [2026] [ipam] Address release completed with address:0.0.0.0 err:. +•2021/04/30 23:31:23 [2026] [ipam] Releasing address with address:10.0.0.1/16 options:map[]. +2021/04/30 23:31:23 [2026] Deleting Address record from address pool as metadata doesn't have this address +2021/04/30 23:31:23 [2026] [ipam] Address release completed with address:10.0.0.1/16 err:. +•2021/04/30 23:31:23 [2026] [Listener] Stopped listening on localhost:42424 + +Ran 106 of 106 Specs in 0.042 seconds +SUCCESS! -- 106 Passed | 0 Failed | 0 Pending | 0 Skipped +--- PASS: TestFileIpam (0.04s) +=== RUN TestIpv6Ipam +Running Suite: Ipv6Ipam Suite +============================= +Random Seed: 1619825482 +Will run 106 of 106 specs + +2021/04/30 23:31:23 [2026] [Listener] Started listening on localhost:42424. +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil +2021/04/30 23:31:23 [2026] [ipam] Starting source ipv6NodeIpam. +•2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. +2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server +•2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. +2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. +2021/04/30 23:31:23 [2026] [ipam] merging address space +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server +2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:true. +2021/04/30 23:31:23 [2026] [ipam] Checking pool ace:cab:deca:deed::/126. +2021/04/30 23:31:23 [2026] [ipam] Pool ace:cab:deca:deed::/126 matches requirements. +2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as:0xc00037d980 Id:ace:cab:deca:deed::/126 IfName: Subnet:{IP:ace:cab:deca:deed:: Mask:fffffffffffffffffffffffffffffffc} Gateway:ace:cab:deca:deed::1 Addresses:map[ace:cab:deca:deed::2:0xc0002098c0 ace:cab:deca:deed::3:0xc000209900] addrsByID:map[] IsIPv6:true Priority:0 RefCount:1 epoch:1} err:. +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +•2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. +2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. +2021/04/30 23:31:23 [2026] [ipam] merging address space +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server +2021/04/30 23:31:23 [2026] [ipam] Requesting address with address:ace:cab:deca:deed::2 options:map[]. +2021/04/30 23:31:23 [2026] [ipam] Address request completed with address:ace:cab:deca:deed::2/126 +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +•2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. +2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. +2021/04/30 23:31:23 [2026] [ipam] merging address space +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server +2021/04/30 23:31:23 [2026] [ipam] Requesting address with address: options:map[]. +2021/04/30 23:31:23 [2026] [ipam] Address request completed with address:ace:cab:deca:deed::3/126 +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +•2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. +2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. +2021/04/30 23:31:23 [2026] [ipam] merging address space +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server +2021/04/30 23:31:23 [2026] [ipam] Releasing address with address: options:map[]. +2021/04/30 23:31:23 [2026] Address not found. Not Returning error +2021/04/30 23:31:23 [2026] [ipam] Address release completed with address: err:. +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +•2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. +2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. +2021/04/30 23:31:23 [2026] [ipam] merging address space +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server +2021/04/30 23:31:23 [2026] [ipam] Releasing address with address: options:map[]. +2021/04/30 23:31:23 [2026] Address not found. Not Returning error +2021/04/30 23:31:23 [2026] [ipam] Address release completed with address: err:. +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. +2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. +2021/04/30 23:31:23 [2026] [ipam] merging address space +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server +2021/04/30 23:31:23 [2026] [ipam] Skip releasing pool with poolId:ace:cab:deca:deed::/126. due to address being in use +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +•2021/04/30 23:31:23 [2026] [ipam] ipam store is nil +•2021/04/30 23:31:23 [2026] [ipam] reboot time 2021-04-30 21:51:59 +0000 UTC store mod time 0001-01-01 00:00:00 +0000 UTC +2021/04/30 23:31:23 [2026] [ipam] Detected Reboot +2021/04/30 23:31:23 [2026] [ipam] store key not found +•2021/04/30 23:31:23 [2026] [ipam] reboot time 2021-04-30 21:51:59 +0000 UTC store mod time 0001-01-01 00:00:00 +0000 UTC +2021/04/30 23:31:23 [2026] [ipam] Detected Reboot +2021/04/30 23:31:23 [2026] [ipam] Failed to restore state, err:Error +•2021/04/30 23:31:23 [2026] [ipam] ipam store is nil +•2021/04/30 23:31:23 [2026] [ipam] ipam store is nil +•2021/04/30 23:31:23 [2026] [ipam] reboot time 2021-04-30 21:51:59 +0000 UTC store mod time 2021-04-30 22:51:59 +0000 UTC +2021/04/30 23:31:23 [2026] [ipam] Restored state, &{Version: TimeStamp:0001-01-01 00:00:00 +0000 UTC AddrSpaces:map[as-test:0xc000519350] store:0xc000512400 source: netApi: Mutex:{state:0 sema:0}} +•2021/04/30 23:31:23 [2026] [ipam] Restored state, &{Version: TimeStamp:0001-01-01 00:00:00 +0000 UTC AddrSpaces:map[as-test:0xc0005195f0] store:0xc000512480 source: netApi: Mutex:{state:0 sema:0}} +•2021/04/30 23:31:23 [2026] [ipam] reboot time 2021-04-30 21:51:59 +0000 UTC store mod time 0001-01-01 00:00:00 +0000 UTC +2021/04/30 23:31:23 [2026] [ipam] Detected Reboot +2021/04/30 23:31:23 [2026] [ipam] Rehydrating ipam state from persistent store +2021/04/30 23:31:23 [2026] [ipam] Restored state, &{Version: TimeStamp:0001-01-01 00:00:00 +0000 UTC AddrSpaces:map[as-test:0xc000519770] store:0xc000512500 source: netApi: Mutex:{state:0 sema:0}} +•2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +•2021/04/30 23:31:23 [2026] [ipam] Starting source azure. +•2021/04/30 23:31:23 [2026] [ipam] Starting source mas. +•2021/04/30 23:31:23 [2026] [ipam] Starting source null. +••••••••••2021/04/30 23:31:23 [2026] [ipam] Failed to find interface with MAC address:000D3A6E1825 +•2021/04/30 23:31:23 [2026] [ipam] Failed to find interface with MAC address:000D3A6E1825 +2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from config file +••••2021/04/30 23:31:23 [2026] [ipam] Failed to create address:1.1.1.6 err:Address already exists. +2021/04/30 23:31:23 [2026] [ipam] Failed to create address: err:Invalid address. +•2021/04/30 23:31:23 [2026] [ipam] Failed to create pool:{0.0.0.0/24 []} ifName:eth0 err:Address pool already exists. +2021/04/30 23:31:23 [2026] [ipam] Failed to parse subnet:invalid err:invalid CIDR address: invalid. +2021/04/30 23:31:23 [2026] [ipam] Failed to find interface with MAC address:222222222222 +•••••••••••••2021/04/30 23:31:23 [2026] [Utils] Initializing HTTP client with connection timeout: 10, response header timeout: 10 +2021/04/30 23:31:23 [2026] [ipam] Wireserver call http://localhost:42424 to retrieve IP List +2021/04/30 23:31:23 [2026] [ipam] got 1 addresses from interface lo, subnet 10.0.0.0/16 +2021/04/30 23:31:23 [2026] [ipam] got 1 addresses from interface lo, subnet 10.1.0.0/16 +•2021/04/30 23:31:23 [2026] [ipam] ipam store is nil +2021/04/30 23:31:23 [2026] [ipam] Starting source azure. +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +2021/04/30 23:31:23 [2026] [Utils] Initializing HTTP client with connection timeout: 10, response header timeout: 10 +2021/04/30 23:31:23 [2026] [ipam] Wireserver call http://localhost:42424 to retrieve IP List +2021/04/30 23:31:23 [2026] [ipam] got 1 addresses from interface lo, subnet 10.0.0.0/16 +2021/04/30 23:31:23 [2026] [ipam] got 1 addresses from interface lo, subnet 10.1.0.0/16 +2021/04/30 23:31:23 [2026] [ipam] merging address space +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +•••••••••••••2021/04/30 23:31:23 [2026] [ipam] merging address space +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +•2021/04/30 23:31:23 [2026] [ipam] merging address space +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +•••••••••••••2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId:10.0.0.0/16 options:map[] v6:false. +2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool: err:Address pool not found. +•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId:10.0.0.0/16 options:map[] v6:false. +2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as: Id:10.0.0.0/16 IfName: Subnet:{IP: Mask:} Gateway: Addresses:map[] addrsByID:map[] IsIPv6:false Priority:0 RefCount:1 epoch:0} err:. +•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:false. +2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. +2021/04/30 23:31:23 [2026] [ipam] Pool 10.0.0.0/16 is in use. +2021/04/30 23:31:23 [2026] [ipam] Releasing pool 10.0.0.0/16 as there are no allocations +2021/04/30 23:31:23 [2026] [ipam] Pool 10.0.0.0/16 matches requirements. +2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as: Id:10.0.0.0/16 IfName: Subnet:{IP: Mask:} Gateway: Addresses:map[10.0.0.2:0xc000779b80] addrsByID:map[] IsIPv6:false Priority:0 RefCount:1 epoch:0} err:. +•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:false. +2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. +2021/04/30 23:31:23 [2026] [ipam] Pool 10.0.0.0/16 is in use. +2021/04/30 23:31:23 [2026] [ipam] Skip releasing pool with poolId:10.0.0.0/16. due to address being in use +2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool: err:No available address pools. +•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId:10.0.0.0/16 options:map[] v6:false. +2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as: Id:10.0.0.0/16 IfName: Subnet:{IP: Mask:} Gateway: Addresses:map[10.0.0.1:0xc000779c40 10.0.0.2:0xc000779c80] addrsByID:map[] IsIPv6:false Priority:0 RefCount:1 epoch:0} err:. +•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:true. +2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. +2021/04/30 23:31:23 [2026] [ipam] Pool is of a different address family. +2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool: err:No available address pools. +•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[azure.interface.name:en0] v6:false. +2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. +2021/04/30 23:31:23 [2026] [ipam] Pool is not on the requested interface. +2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool: err:No available address pools. +•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:false. +2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. +2021/04/30 23:31:23 [2026] [ipam] Pool 10.0.0.0/16 matches requirements. +2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as: Id:10.0.0.0/16 IfName: Subnet:{IP: Mask:} Gateway: Addresses:map[] addrsByID:map[] IsIPv6:false Priority:0 RefCount:1 epoch:0} err:. +•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:false. +2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. +2021/04/30 23:31:23 [2026] [ipam] Pool 10.0.0.0/16 matches requirements. +2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.1.0.0/16. +2021/04/30 23:31:23 [2026] [ipam] Pool 10.1.0.0/16 matches requirements. +2021/04/30 23:31:23 [2026] [ipam] Pool is preferred because of priority. +2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as: Id:10.1.0.0/16 IfName: Subnet:{IP: Mask:} Gateway: Addresses:map[] addrsByID:map[] IsIPv6:false Priority:2 RefCount:1 epoch:0} err:. +•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:false. +2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. +2021/04/30 23:31:23 [2026] [ipam] Pool 10.0.0.0/16 matches requirements. +2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.1.0.0/16. +2021/04/30 23:31:23 [2026] [ipam] Pool 10.1.0.0/16 matches requirements. +2021/04/30 23:31:23 [2026] [ipam] Pool is preferred because of capacity. +2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as: Id:10.1.0.0/16 IfName: Subnet:{IP: Mask:} Gateway: Addresses:map[10.1.0.1/16:0xc000779cc0] addrsByID:map[] IsIPv6:false Priority:0 RefCount:1 epoch:0} err:. +••2021/04/30 23:31:23 [2026] [ipam] Releasing pool 10.0.0.0/16 as there are no allocations +•2021/04/30 23:31:23 [2026] [ipam] Skip releasing pool with poolId:10.0.0.0/16. due to address being in use +•2021/04/30 23:31:23 [2026] [ipam] Releasing pool 10.0.0.0/16 as there are no allocations +••••2021/04/30 23:31:23 [2026] [ipam] Requesting address with address:10.0.0.1/16 options:map[]. +2021/04/30 23:31:23 [2026] [ipam] Address request failed with Address not found +•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address:10.0.0.1/16 options:map[azure.address.id:10.0.0.1/16]. +2021/04/30 23:31:23 [2026] [ipam] Address request completed with address: +•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address: options:map[azure.address.id:fc3e33ba-e50a-4750-aa9d-13bb2be9bc5c]. +2021/04/30 23:31:23 [2026] [ipam] Address request completed with address:10.0.1.1/24 +•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address:10.0.0.1/16 options:map[]. +2021/04/30 23:31:23 [2026] [ipam] Address request failed with Address already in use +•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address:10.0.0.1/16 options:map[azure.address.id:10.0.0.2/16]. +2021/04/30 23:31:23 [2026] [ipam] Address request failed with Address already in use +•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address: options:map[azure.address.type:gateway]. +2021/04/30 23:31:23 [2026] [ipam] Address request completed with address: +•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address: options:map[azure.address.id:10.0.0.1/16]. +2021/04/30 23:31:23 [2026] [ipam] Address request completed with address: +•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address: options:map[]. +2021/04/30 23:31:23 [2026] [ipam] Address request failed with No available addresses +•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address: options:map[]. +2021/04/30 23:31:23 [2026] [ipam] Address request completed with address: +•2021/04/30 23:31:23 [2026] [ipam] Releasing address with address:0.0.0.0 options:map[]. +2021/04/30 23:31:23 [2026] [ipam] Address release completed with address:0.0.0.0 err:. +•2021/04/30 23:31:23 [2026] [ipam] Releasing address with address:0.0.0.0 options:map[]. +2021/04/30 23:31:23 [2026] [ipam] Address release completed with address:0.0.0.0 err:. +•2021/04/30 23:31:23 [2026] [ipam] Releasing address with address:10.0.0.1/16 options:map[]. +2021/04/30 23:31:23 [2026] Address not in use. Not Returning error +2021/04/30 23:31:23 [2026] [ipam] Address release completed with address:10.0.0.1/16 err:. +•2021/04/30 23:31:23 [2026] [ipam] Releasing address with address: options:map[azure.address.id:10.0.0.1/16]. +2021/04/30 23:31:23 [2026] [ipam] Address release completed with address:0.0.0.0 err:. +•2021/04/30 23:31:23 [2026] [ipam] Releasing address with address:10.0.0.1/16 options:map[]. +2021/04/30 23:31:23 [2026] Deleting Address record from address pool as metadata doesn't have this address +2021/04/30 23:31:23 [2026] [ipam] Address release completed with address:10.0.0.1/16 err:. +•2021/04/30 23:31:23 [2026] [Listener] Stopped listening on localhost:42424 + +Ran 106 of 106 Specs in 0.079 seconds +SUCCESS! -- 106 Passed | 0 Failed | 0 Pending | 0 Skipped +--- PASS: TestIpv6Ipam (0.08s) +=== RUN TestManagerIpv6Ipam +Running Suite: Manager ipv6ipam Suite +===================================== +Random Seed: 1619825482 +Will run 106 of 106 specs + +2021/04/30 23:31:23 [2026] [Listener] Started listening on localhost:42424. +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil +2021/04/30 23:31:23 [2026] [ipam] Starting source ipv6NodeIpam. +•2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. +2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server +•2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. +2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. +2021/04/30 23:31:23 [2026] [ipam] merging address space +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server +2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:true. +2021/04/30 23:31:23 [2026] [ipam] Checking pool ace:cab:deca:deed::/126. +2021/04/30 23:31:23 [2026] [ipam] Pool ace:cab:deca:deed::/126 matches requirements. +2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as:0xc0002875c0 Id:ace:cab:deca:deed::/126 IfName: Subnet:{IP:ace:cab:deca:deed:: Mask:fffffffffffffffffffffffffffffffc} Gateway:ace:cab:deca:deed::1 Addresses:map[ace:cab:deca:deed::2:0xc00039e340 ace:cab:deca:deed::3:0xc00039e380] addrsByID:map[] IsIPv6:true Priority:0 RefCount:1 epoch:1} err:. +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +•2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. +2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. +2021/04/30 23:31:23 [2026] [ipam] merging address space +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server +2021/04/30 23:31:23 [2026] [ipam] Requesting address with address:ace:cab:deca:deed::2 options:map[]. +2021/04/30 23:31:23 [2026] [ipam] Address request completed with address:ace:cab:deca:deed::2/126 +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +•2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. +2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. +2021/04/30 23:31:23 [2026] [ipam] merging address space +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server +2021/04/30 23:31:23 [2026] [ipam] Requesting address with address: options:map[]. +2021/04/30 23:31:23 [2026] [ipam] Address request completed with address:ace:cab:deca:deed::3/126 +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +•2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. +2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. +2021/04/30 23:31:23 [2026] [ipam] merging address space +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server +2021/04/30 23:31:23 [2026] [ipam] Releasing address with address: options:map[]. +2021/04/30 23:31:23 [2026] Address not found. Not Returning error +2021/04/30 23:31:23 [2026] [ipam] Address release completed with address: err:. +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +•2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. +2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. +2021/04/30 23:31:23 [2026] [ipam] merging address space +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server +2021/04/30 23:31:23 [2026] [ipam] Releasing address with address: options:map[]. +2021/04/30 23:31:23 [2026] Address not found. Not Returning error +2021/04/30 23:31:23 [2026] [ipam] Address release completed with address: err:. +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. +2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. +2021/04/30 23:31:23 [2026] [ipam] merging address space +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server +2021/04/30 23:31:23 [2026] [ipam] Skip releasing pool with poolId:ace:cab:deca:deed::/126. due to address being in use +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +•2021/04/30 23:31:23 [2026] [ipam] ipam store is nil +•2021/04/30 23:31:23 [2026] [ipam] reboot time 2021-04-30 21:51:59 +0000 UTC store mod time 0001-01-01 00:00:00 +0000 UTC +2021/04/30 23:31:23 [2026] [ipam] Detected Reboot +2021/04/30 23:31:23 [2026] [ipam] store key not found +•2021/04/30 23:31:23 [2026] [ipam] reboot time 2021-04-30 21:51:59 +0000 UTC store mod time 0001-01-01 00:00:00 +0000 UTC +2021/04/30 23:31:23 [2026] [ipam] Detected Reboot +2021/04/30 23:31:23 [2026] [ipam] Failed to restore state, err:Error +•2021/04/30 23:31:23 [2026] [ipam] ipam store is nil +•2021/04/30 23:31:23 [2026] [ipam] ipam store is nil +•2021/04/30 23:31:23 [2026] [ipam] reboot time 2021-04-30 21:51:59 +0000 UTC store mod time 2021-04-30 22:51:59 +0000 UTC +2021/04/30 23:31:23 [2026] [ipam] Restored state, &{Version: TimeStamp:0001-01-01 00:00:00 +0000 UTC AddrSpaces:map[as-test:0xc00063b500] store:0xc000767680 source: netApi: Mutex:{state:0 sema:0}} +•2021/04/30 23:31:23 [2026] [ipam] Restored state, &{Version: TimeStamp:0001-01-01 00:00:00 +0000 UTC AddrSpaces:map[as-test:0xc00063b800] store:0xc000767700 source: netApi: Mutex:{state:0 sema:0}} +•2021/04/30 23:31:23 [2026] [ipam] reboot time 2021-04-30 21:51:59 +0000 UTC store mod time 0001-01-01 00:00:00 +0000 UTC +2021/04/30 23:31:23 [2026] [ipam] Detected Reboot +2021/04/30 23:31:23 [2026] [ipam] Rehydrating ipam state from persistent store +2021/04/30 23:31:23 [2026] [ipam] Restored state, &{Version: TimeStamp:0001-01-01 00:00:00 +0000 UTC AddrSpaces:map[as-test:0xc00063b9b0] store:0xc000767780 source: netApi: Mutex:{state:0 sema:0}} +•2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +•2021/04/30 23:31:23 [2026] [ipam] Starting source azure. +•2021/04/30 23:31:23 [2026] [ipam] Starting source mas. +•2021/04/30 23:31:23 [2026] [ipam] Starting source null. +••••••••••2021/04/30 23:31:23 [2026] [ipam] Failed to find interface with MAC address:000D3A6E1825 +•2021/04/30 23:31:23 [2026] [ipam] Failed to find interface with MAC address:000D3A6E1825 +2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from config file +••••2021/04/30 23:31:23 [2026] [ipam] Failed to create address:1.1.1.6 err:Address already exists. +2021/04/30 23:31:23 [2026] [ipam] Failed to create address: err:Invalid address. +•2021/04/30 23:31:23 [2026] [ipam] Failed to create pool:{0.0.0.0/24 []} ifName:eth0 err:Address pool already exists. +2021/04/30 23:31:23 [2026] [ipam] Failed to parse subnet:invalid err:invalid CIDR address: invalid. +2021/04/30 23:31:23 [2026] [ipam] Failed to find interface with MAC address:222222222222 +•••••••••••••2021/04/30 23:31:23 [2026] [Utils] Initializing HTTP client with connection timeout: 10, response header timeout: 10 +2021/04/30 23:31:23 [2026] [ipam] Wireserver call http://localhost:42424 to retrieve IP List +2021/04/30 23:31:23 [2026] [ipam] got 1 addresses from interface lo, subnet 10.0.0.0/16 +2021/04/30 23:31:23 [2026] [ipam] got 1 addresses from interface lo, subnet 10.1.0.0/16 +•2021/04/30 23:31:23 [2026] [ipam] ipam store is nil +2021/04/30 23:31:23 [2026] [ipam] Starting source azure. +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +2021/04/30 23:31:23 [2026] [Utils] Initializing HTTP client with connection timeout: 10, response header timeout: 10 +2021/04/30 23:31:23 [2026] [ipam] Wireserver call http://localhost:42424 to retrieve IP List +2021/04/30 23:31:23 [2026] [ipam] got 1 addresses from interface lo, subnet 10.0.0.0/16 +2021/04/30 23:31:23 [2026] [ipam] got 1 addresses from interface lo, subnet 10.1.0.0/16 +2021/04/30 23:31:23 [2026] [ipam] merging address space +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +•••••••••••••2021/04/30 23:31:23 [2026] [ipam] merging address space +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +•2021/04/30 23:31:23 [2026] [ipam] merging address space +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +•••••••••••••2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId:10.0.0.0/16 options:map[] v6:false. +2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool: err:Address pool not found. +•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId:10.0.0.0/16 options:map[] v6:false. +2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as: Id:10.0.0.0/16 IfName: Subnet:{IP: Mask:} Gateway: Addresses:map[] addrsByID:map[] IsIPv6:false Priority:0 RefCount:1 epoch:0} err:. +•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:false. +2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. +2021/04/30 23:31:23 [2026] [ipam] Pool 10.0.0.0/16 is in use. +2021/04/30 23:31:23 [2026] [ipam] Releasing pool 10.0.0.0/16 as there are no allocations +2021/04/30 23:31:23 [2026] [ipam] Pool 10.0.0.0/16 matches requirements. +2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as: Id:10.0.0.0/16 IfName: Subnet:{IP: Mask:} Gateway: Addresses:map[10.0.0.2:0xc000649180] addrsByID:map[] IsIPv6:false Priority:0 RefCount:1 epoch:0} err:. +•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:false. +2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. +2021/04/30 23:31:23 [2026] [ipam] Pool 10.0.0.0/16 is in use. +2021/04/30 23:31:23 [2026] [ipam] Skip releasing pool with poolId:10.0.0.0/16. due to address being in use +2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool: err:No available address pools. +•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId:10.0.0.0/16 options:map[] v6:false. +2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as: Id:10.0.0.0/16 IfName: Subnet:{IP: Mask:} Gateway: Addresses:map[10.0.0.1:0xc000649240 10.0.0.2:0xc000649280] addrsByID:map[] IsIPv6:false Priority:0 RefCount:1 epoch:0} err:. +•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:true. +2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. +2021/04/30 23:31:23 [2026] [ipam] Pool is of a different address family. +2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool: err:No available address pools. +•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[azure.interface.name:en0] v6:false. +2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. +2021/04/30 23:31:23 [2026] [ipam] Pool is not on the requested interface. +2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool: err:No available address pools. +•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:false. +2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. +2021/04/30 23:31:23 [2026] [ipam] Pool 10.0.0.0/16 matches requirements. +2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as: Id:10.0.0.0/16 IfName: Subnet:{IP: Mask:} Gateway: Addresses:map[] addrsByID:map[] IsIPv6:false Priority:0 RefCount:1 epoch:0} err:. +•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:false. +2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.1.0.0/16. +2021/04/30 23:31:23 [2026] [ipam] Pool 10.1.0.0/16 matches requirements. +2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. +2021/04/30 23:31:23 [2026] [ipam] Pool 10.0.0.0/16 matches requirements. +2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as: Id:10.1.0.0/16 IfName: Subnet:{IP: Mask:} Gateway: Addresses:map[] addrsByID:map[] IsIPv6:false Priority:2 RefCount:1 epoch:0} err:. +•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:false. +2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.1.0.0/16. +2021/04/30 23:31:23 [2026] [ipam] Pool 10.1.0.0/16 matches requirements. +2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. +2021/04/30 23:31:23 [2026] [ipam] Pool 10.0.0.0/16 matches requirements. +2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as: Id:10.1.0.0/16 IfName: Subnet:{IP: Mask:} Gateway: Addresses:map[10.1.0.1/16:0xc0006492c0] addrsByID:map[] IsIPv6:false Priority:0 RefCount:1 epoch:0} err:. +••2021/04/30 23:31:23 [2026] [ipam] Releasing pool 10.0.0.0/16 as there are no allocations +•2021/04/30 23:31:23 [2026] [ipam] Skip releasing pool with poolId:10.0.0.0/16. due to address being in use +•2021/04/30 23:31:23 [2026] [ipam] Releasing pool 10.0.0.0/16 as there are no allocations +••••2021/04/30 23:31:23 [2026] [ipam] Requesting address with address:10.0.0.1/16 options:map[]. +2021/04/30 23:31:23 [2026] [ipam] Address request failed with Address not found +•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address:10.0.0.1/16 options:map[azure.address.id:10.0.0.1/16]. +2021/04/30 23:31:23 [2026] [ipam] Address request completed with address: +•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address: options:map[azure.address.id:4320211b-113f-4985-bcaa-b6969121b606]. +2021/04/30 23:31:23 [2026] [ipam] Address request completed with address:10.0.1.1/24 +•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address:10.0.0.1/16 options:map[]. +2021/04/30 23:31:23 [2026] [ipam] Address request failed with Address already in use +•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address:10.0.0.1/16 options:map[azure.address.id:10.0.0.2/16]. +2021/04/30 23:31:23 [2026] [ipam] Address request failed with Address already in use +•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address: options:map[azure.address.type:gateway]. +2021/04/30 23:31:23 [2026] [ipam] Address request completed with address: +•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address: options:map[azure.address.id:10.0.0.1/16]. +2021/04/30 23:31:23 [2026] [ipam] Address request completed with address: +•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address: options:map[]. +2021/04/30 23:31:23 [2026] [ipam] Address request failed with No available addresses +•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address: options:map[]. +2021/04/30 23:31:23 [2026] [ipam] Address request completed with address: +•2021/04/30 23:31:23 [2026] [ipam] Releasing address with address:0.0.0.0 options:map[]. +2021/04/30 23:31:23 [2026] [ipam] Address release completed with address:0.0.0.0 err:. +•2021/04/30 23:31:23 [2026] [ipam] Releasing address with address:0.0.0.0 options:map[]. +2021/04/30 23:31:23 [2026] [ipam] Address release completed with address:0.0.0.0 err:. +•2021/04/30 23:31:23 [2026] [ipam] Releasing address with address:10.0.0.1/16 options:map[]. +2021/04/30 23:31:23 [2026] Address not in use. Not Returning error +2021/04/30 23:31:23 [2026] [ipam] Address release completed with address:10.0.0.1/16 err:. +•2021/04/30 23:31:23 [2026] [ipam] Releasing address with address: options:map[azure.address.id:10.0.0.1/16]. +2021/04/30 23:31:23 [2026] [ipam] Address release completed with address:0.0.0.0 err:. +•2021/04/30 23:31:23 [2026] [ipam] Releasing address with address:10.0.0.1/16 options:map[]. +2021/04/30 23:31:23 [2026] Deleting Address record from address pool as metadata doesn't have this address +2021/04/30 23:31:23 [2026] [ipam] Address release completed with address:10.0.0.1/16 err:. +•2021/04/30 23:31:23 [2026] [Listener] Stopped listening on localhost:42424 + +Ran 106 of 106 Specs in 0.088 seconds +SUCCESS! -- 106 Passed | 0 Failed | 0 Pending | 0 Skipped +--- PASS: TestManagerIpv6Ipam (0.09s) +=== RUN TestManager +Running Suite: Manager Suite +============================ +Random Seed: 1619825482 +Will run 106 of 106 specs + +2021/04/30 23:31:23 [2026] [Listener] Started listening on localhost:42424. +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil +2021/04/30 23:31:23 [2026] [ipam] Starting source ipv6NodeIpam. +•2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. +2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server +•2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. +2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. +2021/04/30 23:31:23 [2026] [ipam] merging address space +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server +2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:true. +2021/04/30 23:31:23 [2026] [ipam] Checking pool ace:cab:deca:deed::/126. +2021/04/30 23:31:23 [2026] [ipam] Pool ace:cab:deca:deed::/126 matches requirements. +2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as:0xc0003338f0 Id:ace:cab:deca:deed::/126 IfName: Subnet:{IP:ace:cab:deca:deed:: Mask:fffffffffffffffffffffffffffffffc} Gateway:ace:cab:deca:deed::1 Addresses:map[ace:cab:deca:deed::2:0xc000649b40 ace:cab:deca:deed::3:0xc000649b80] addrsByID:map[] IsIPv6:true Priority:0 RefCount:1 epoch:1} err:. +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +•2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. +2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. +2021/04/30 23:31:23 [2026] [ipam] merging address space +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server +2021/04/30 23:31:23 [2026] [ipam] Requesting address with address:ace:cab:deca:deed::2 options:map[]. +2021/04/30 23:31:23 [2026] [ipam] Address request completed with address:ace:cab:deca:deed::2/126 +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +•2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. +2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. +2021/04/30 23:31:23 [2026] [ipam] merging address space +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server +2021/04/30 23:31:23 [2026] [ipam] Requesting address with address: options:map[]. +2021/04/30 23:31:23 [2026] [ipam] Address request completed with address:ace:cab:deca:deed::3/126 +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +•2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. +2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. +2021/04/30 23:31:23 [2026] [ipam] merging address space +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server +2021/04/30 23:31:23 [2026] [ipam] Releasing address with address: options:map[]. +2021/04/30 23:31:23 [2026] Address not found. Not Returning error +2021/04/30 23:31:23 [2026] [ipam] Address release completed with address: err:. +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +•2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. +2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. +2021/04/30 23:31:23 [2026] [ipam] merging address space +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server +2021/04/30 23:31:23 [2026] [ipam] Releasing address with address: options:map[]. +2021/04/30 23:31:23 [2026] Address not found. Not Returning error +2021/04/30 23:31:23 [2026] [ipam] Address release completed with address: err:. +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. +2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. +2021/04/30 23:31:23 [2026] [ipam] merging address space +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server +2021/04/30 23:31:23 [2026] [ipam] Skip releasing pool with poolId:ace:cab:deca:deed::/126. due to address being in use +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +•2021/04/30 23:31:23 [2026] [ipam] ipam store is nil +•2021/04/30 23:31:23 [2026] [ipam] reboot time 2021-04-30 21:51:59 +0000 UTC store mod time 0001-01-01 00:00:00 +0000 UTC +2021/04/30 23:31:23 [2026] [ipam] Detected Reboot +2021/04/30 23:31:23 [2026] [ipam] store key not found +•2021/04/30 23:31:23 [2026] [ipam] reboot time 2021-04-30 21:51:59 +0000 UTC store mod time 0001-01-01 00:00:00 +0000 UTC +2021/04/30 23:31:23 [2026] [ipam] Detected Reboot +2021/04/30 23:31:23 [2026] [ipam] Failed to restore state, err:Error +•2021/04/30 23:31:23 [2026] [ipam] ipam store is nil +•2021/04/30 23:31:23 [2026] [ipam] ipam store is nil +•2021/04/30 23:31:23 [2026] [ipam] reboot time 2021-04-30 21:51:59 +0000 UTC store mod time 2021-04-30 22:51:59 +0000 UTC +2021/04/30 23:31:23 [2026] [ipam] Restored state, &{Version: TimeStamp:0001-01-01 00:00:00 +0000 UTC AddrSpaces:map[as-test:0xc000518210] store:0xc0002cee80 source: netApi: Mutex:{state:0 sema:0}} +•2021/04/30 23:31:23 [2026] [ipam] Restored state, &{Version: TimeStamp:0001-01-01 00:00:00 +0000 UTC AddrSpaces:map[as-test:0xc0005184e0] store:0xc0002cf080 source: netApi: Mutex:{state:0 sema:0}} +•2021/04/30 23:31:23 [2026] [ipam] reboot time 2021-04-30 21:51:59 +0000 UTC store mod time 0001-01-01 00:00:00 +0000 UTC +2021/04/30 23:31:23 [2026] [ipam] Detected Reboot +2021/04/30 23:31:23 [2026] [ipam] Rehydrating ipam state from persistent store +2021/04/30 23:31:23 [2026] [ipam] Restored state, &{Version: TimeStamp:0001-01-01 00:00:00 +0000 UTC AddrSpaces:map[as-test:0xc000518660] store:0xc0002cf100 source: netApi: Mutex:{state:0 sema:0}} +•2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +•2021/04/30 23:31:23 [2026] [ipam] Starting source azure. +•2021/04/30 23:31:23 [2026] [ipam] Starting source mas. +•2021/04/30 23:31:23 [2026] [ipam] Starting source null. +••••••••••2021/04/30 23:31:23 [2026] [ipam] Failed to find interface with MAC address:000D3A6E1825 +•2021/04/30 23:31:23 [2026] [ipam] Failed to find interface with MAC address:000D3A6E1825 +2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from config file +••••2021/04/30 23:31:23 [2026] [ipam] Failed to create address:1.1.1.6 err:Address already exists. +2021/04/30 23:31:23 [2026] [ipam] Failed to create address: err:Invalid address. +•2021/04/30 23:31:23 [2026] [ipam] Failed to create pool:{0.0.0.0/24 []} ifName:eth0 err:Address pool already exists. +2021/04/30 23:31:23 [2026] [ipam] Failed to parse subnet:invalid err:invalid CIDR address: invalid. +2021/04/30 23:31:23 [2026] [ipam] Failed to find interface with MAC address:222222222222 +•••••••••••••2021/04/30 23:31:23 [2026] [Utils] Initializing HTTP client with connection timeout: 10, response header timeout: 10 +2021/04/30 23:31:23 [2026] [ipam] Wireserver call http://localhost:42424 to retrieve IP List +2021/04/30 23:31:23 [2026] [ipam] got 1 addresses from interface lo, subnet 10.0.0.0/16 +2021/04/30 23:31:23 [2026] [ipam] got 1 addresses from interface lo, subnet 10.1.0.0/16 +•2021/04/30 23:31:23 [2026] [ipam] ipam store is nil +2021/04/30 23:31:23 [2026] [ipam] Starting source azure. +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +2021/04/30 23:31:23 [2026] [Utils] Initializing HTTP client with connection timeout: 10, response header timeout: 10 +2021/04/30 23:31:23 [2026] [ipam] Wireserver call http://localhost:42424 to retrieve IP List +2021/04/30 23:31:23 [2026] [ipam] got 1 addresses from interface lo, subnet 10.0.0.0/16 +2021/04/30 23:31:23 [2026] [ipam] got 1 addresses from interface lo, subnet 10.1.0.0/16 +2021/04/30 23:31:23 [2026] [ipam] merging address space +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +•••••••••••••2021/04/30 23:31:23 [2026] [ipam] merging address space +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +•2021/04/30 23:31:23 [2026] [ipam] merging address space +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +•••••••••••••2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId:10.0.0.0/16 options:map[] v6:false. +2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool: err:Address pool not found. +•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId:10.0.0.0/16 options:map[] v6:false. +2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as: Id:10.0.0.0/16 IfName: Subnet:{IP: Mask:} Gateway: Addresses:map[] addrsByID:map[] IsIPv6:false Priority:0 RefCount:1 epoch:0} err:. +•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:false. +2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. +2021/04/30 23:31:23 [2026] [ipam] Pool 10.0.0.0/16 is in use. +2021/04/30 23:31:23 [2026] [ipam] Releasing pool 10.0.0.0/16 as there are no allocations +2021/04/30 23:31:23 [2026] [ipam] Pool 10.0.0.0/16 matches requirements. +2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as: Id:10.0.0.0/16 IfName: Subnet:{IP: Mask:} Gateway: Addresses:map[10.0.0.2:0xc00060b580] addrsByID:map[] IsIPv6:false Priority:0 RefCount:1 epoch:0} err:. +•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:false. +2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. +2021/04/30 23:31:23 [2026] [ipam] Pool 10.0.0.0/16 is in use. +2021/04/30 23:31:23 [2026] [ipam] Skip releasing pool with poolId:10.0.0.0/16. due to address being in use +2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool: err:No available address pools. +•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId:10.0.0.0/16 options:map[] v6:false. +2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as: Id:10.0.0.0/16 IfName: Subnet:{IP: Mask:} Gateway: Addresses:map[10.0.0.1:0xc00052a0c0 10.0.0.2:0xc00052a100] addrsByID:map[] IsIPv6:false Priority:0 RefCount:1 epoch:0} err:. +•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:true. +2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. +2021/04/30 23:31:23 [2026] [ipam] Pool is of a different address family. +2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool: err:No available address pools. +•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[azure.interface.name:en0] v6:false. +2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. +2021/04/30 23:31:23 [2026] [ipam] Pool is not on the requested interface. +2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool: err:No available address pools. +•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:false. +2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. +2021/04/30 23:31:23 [2026] [ipam] Pool 10.0.0.0/16 matches requirements. +2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as: Id:10.0.0.0/16 IfName: Subnet:{IP: Mask:} Gateway: Addresses:map[] addrsByID:map[] IsIPv6:false Priority:0 RefCount:1 epoch:0} err:. +•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:false. +2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. +2021/04/30 23:31:23 [2026] [ipam] Pool 10.0.0.0/16 matches requirements. +2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.1.0.0/16. +2021/04/30 23:31:23 [2026] [ipam] Pool 10.1.0.0/16 matches requirements. +2021/04/30 23:31:23 [2026] [ipam] Pool is preferred because of priority. +2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as: Id:10.1.0.0/16 IfName: Subnet:{IP: Mask:} Gateway: Addresses:map[] addrsByID:map[] IsIPv6:false Priority:2 RefCount:1 epoch:0} err:. +•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:false. +2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. +2021/04/30 23:31:23 [2026] [ipam] Pool 10.0.0.0/16 matches requirements. +2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.1.0.0/16. +2021/04/30 23:31:23 [2026] [ipam] Pool 10.1.0.0/16 matches requirements. +2021/04/30 23:31:23 [2026] [ipam] Pool is preferred because of capacity. +2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as: Id:10.1.0.0/16 IfName: Subnet:{IP: Mask:} Gateway: Addresses:map[10.1.0.1/16:0xc00052a140] addrsByID:map[] IsIPv6:false Priority:0 RefCount:1 epoch:0} err:. +••2021/04/30 23:31:23 [2026] [ipam] Releasing pool 10.0.0.0/16 as there are no allocations +•2021/04/30 23:31:23 [2026] [ipam] Skip releasing pool with poolId:10.0.0.0/16. due to address being in use +•2021/04/30 23:31:23 [2026] [ipam] Releasing pool 10.0.0.0/16 as there are no allocations +••••2021/04/30 23:31:23 [2026] [ipam] Requesting address with address:10.0.0.1/16 options:map[]. +2021/04/30 23:31:23 [2026] [ipam] Address request failed with Address not found +•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address:10.0.0.1/16 options:map[azure.address.id:10.0.0.1/16]. +2021/04/30 23:31:23 [2026] [ipam] Address request completed with address: +•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address: options:map[azure.address.id:ae781e4e-a2a0-41b8-9c64-69378c4a903a]. +2021/04/30 23:31:23 [2026] [ipam] Address request completed with address:10.0.1.1/24 +•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address:10.0.0.1/16 options:map[]. +2021/04/30 23:31:23 [2026] [ipam] Address request failed with Address already in use +•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address:10.0.0.1/16 options:map[azure.address.id:10.0.0.2/16]. +2021/04/30 23:31:23 [2026] [ipam] Address request failed with Address already in use +•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address: options:map[azure.address.type:gateway]. +2021/04/30 23:31:23 [2026] [ipam] Address request completed with address: +•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address: options:map[azure.address.id:10.0.0.1/16]. +2021/04/30 23:31:23 [2026] [ipam] Address request completed with address: +•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address: options:map[]. +2021/04/30 23:31:23 [2026] [ipam] Address request failed with No available addresses +•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address: options:map[]. +2021/04/30 23:31:23 [2026] [ipam] Address request completed with address: +•2021/04/30 23:31:23 [2026] [ipam] Releasing address with address:0.0.0.0 options:map[]. +2021/04/30 23:31:23 [2026] [ipam] Address release completed with address:0.0.0.0 err:. +•2021/04/30 23:31:23 [2026] [ipam] Releasing address with address:0.0.0.0 options:map[]. +2021/04/30 23:31:23 [2026] [ipam] Address release completed with address:0.0.0.0 err:. +•2021/04/30 23:31:23 [2026] [ipam] Releasing address with address:10.0.0.1/16 options:map[]. +2021/04/30 23:31:23 [2026] Address not in use. Not Returning error +2021/04/30 23:31:23 [2026] [ipam] Address release completed with address:10.0.0.1/16 err:. +•2021/04/30 23:31:23 [2026] [ipam] Releasing address with address: options:map[azure.address.id:10.0.0.1/16]. +2021/04/30 23:31:23 [2026] [ipam] Address release completed with address:0.0.0.0 err:. +•2021/04/30 23:31:23 [2026] [ipam] Releasing address with address:10.0.0.1/16 options:map[]. +2021/04/30 23:31:23 [2026] Deleting Address record from address pool as metadata doesn't have this address +2021/04/30 23:31:23 [2026] [ipam] Address release completed with address:10.0.0.1/16 err:. +•2021/04/30 23:31:23 [2026] [Listener] Stopped listening on localhost:42424 + +Ran 106 of 106 Specs in 0.073 seconds +SUCCESS! -- 106 Passed | 0 Failed | 0 Pending | 0 Skipped +--- PASS: TestManager (0.07s) +=== RUN TestPool +Running Suite: Pool Suite +========================= +Random Seed: 1619825482 +Will run 106 of 106 specs + +2021/04/30 23:31:23 [2026] [Listener] Started listening on localhost:42424. +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil +2021/04/30 23:31:23 [2026] [ipam] Starting source ipv6NodeIpam. +•2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. +2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server +•2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. +2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. +2021/04/30 23:31:23 [2026] [ipam] merging address space +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server +2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:true. +2021/04/30 23:31:23 [2026] [ipam] Checking pool ace:cab:deca:deed::/126. +2021/04/30 23:31:23 [2026] [ipam] Pool ace:cab:deca:deed::/126 matches requirements. +2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as:0xc00073b9e0 Id:ace:cab:deca:deed::/126 IfName: Subnet:{IP:ace:cab:deca:deed:: Mask:fffffffffffffffffffffffffffffffc} Gateway:ace:cab:deca:deed::1 Addresses:map[ace:cab:deca:deed::2:0xc00052abc0 ace:cab:deca:deed::3:0xc00052ac00] addrsByID:map[] IsIPv6:true Priority:0 RefCount:1 epoch:1} err:. +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +•2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. +2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. +2021/04/30 23:31:23 [2026] [ipam] merging address space +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server +2021/04/30 23:31:23 [2026] [ipam] Requesting address with address:ace:cab:deca:deed::2 options:map[]. +2021/04/30 23:31:23 [2026] [ipam] Address request completed with address:ace:cab:deca:deed::2/126 +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +•2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. +2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. +2021/04/30 23:31:23 [2026] [ipam] merging address space +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server +2021/04/30 23:31:23 [2026] [ipam] Requesting address with address: options:map[]. +2021/04/30 23:31:23 [2026] [ipam] Address request completed with address:ace:cab:deca:deed::3/126 +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +•2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. +2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. +2021/04/30 23:31:23 [2026] [ipam] merging address space +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server +2021/04/30 23:31:23 [2026] [ipam] Releasing address with address: options:map[]. +2021/04/30 23:31:23 [2026] Address not found. Not Returning error +2021/04/30 23:31:23 [2026] [ipam] Address release completed with address: err:. +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +•2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. +2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. +2021/04/30 23:31:23 [2026] [ipam] merging address space +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server +2021/04/30 23:31:23 [2026] [ipam] Releasing address with address: options:map[]. +2021/04/30 23:31:23 [2026] Address not found. Not Returning error +2021/04/30 23:31:23 [2026] [ipam] Address release completed with address: err:. +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. +2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. +2021/04/30 23:31:23 [2026] [ipam] merging address space +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server +2021/04/30 23:31:23 [2026] [ipam] Skip releasing pool with poolId:ace:cab:deca:deed::/126. due to address being in use +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +•2021/04/30 23:31:23 [2026] [ipam] ipam store is nil +•2021/04/30 23:31:23 [2026] [ipam] reboot time 2021-04-30 21:51:59 +0000 UTC store mod time 0001-01-01 00:00:00 +0000 UTC +2021/04/30 23:31:23 [2026] [ipam] Detected Reboot +2021/04/30 23:31:23 [2026] [ipam] store key not found +•2021/04/30 23:31:23 [2026] [ipam] reboot time 2021-04-30 21:51:59 +0000 UTC store mod time 0001-01-01 00:00:00 +0000 UTC +2021/04/30 23:31:23 [2026] [ipam] Detected Reboot +2021/04/30 23:31:23 [2026] [ipam] Failed to restore state, err:Error +•2021/04/30 23:31:23 [2026] [ipam] ipam store is nil +•2021/04/30 23:31:23 [2026] [ipam] ipam store is nil +•2021/04/30 23:31:23 [2026] [ipam] reboot time 2021-04-30 21:51:59 +0000 UTC store mod time 2021-04-30 22:51:59 +0000 UTC +2021/04/30 23:31:23 [2026] [ipam] Restored state, &{Version: TimeStamp:0001-01-01 00:00:00 +0000 UTC AddrSpaces:map[as-test:0xc000519b00] store:0xc000513800 source: netApi: Mutex:{state:0 sema:0}} +•2021/04/30 23:31:23 [2026] [ipam] Restored state, &{Version: TimeStamp:0001-01-01 00:00:00 +0000 UTC AddrSpaces:map[as-test:0xc000519ef0] store:0xc000513880 source: netApi: Mutex:{state:0 sema:0}} +•2021/04/30 23:31:23 [2026] [ipam] reboot time 2021-04-30 21:51:59 +0000 UTC store mod time 0001-01-01 00:00:00 +0000 UTC +2021/04/30 23:31:23 [2026] [ipam] Detected Reboot +2021/04/30 23:31:23 [2026] [ipam] Rehydrating ipam state from persistent store +2021/04/30 23:31:23 [2026] [ipam] Restored state, &{Version: TimeStamp:0001-01-01 00:00:00 +0000 UTC AddrSpaces:map[as-test:0xc000678210] store:0xc000513900 source: netApi: Mutex:{state:0 sema:0}} +•2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +•2021/04/30 23:31:23 [2026] [ipam] Starting source azure. +•2021/04/30 23:31:23 [2026] [ipam] Starting source mas. +•2021/04/30 23:31:23 [2026] [ipam] Starting source null. +••••••••••2021/04/30 23:31:23 [2026] [ipam] Failed to find interface with MAC address:000D3A6E1825 +•2021/04/30 23:31:23 [2026] [ipam] Failed to find interface with MAC address:000D3A6E1825 +2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from config file +••••2021/04/30 23:31:23 [2026] [ipam] Failed to create address:1.1.1.6 err:Address already exists. +2021/04/30 23:31:23 [2026] [ipam] Failed to create address: err:Invalid address. +•2021/04/30 23:31:23 [2026] [ipam] Failed to create pool:{0.0.0.0/24 []} ifName:eth0 err:Address pool already exists. +2021/04/30 23:31:23 [2026] [ipam] Failed to parse subnet:invalid err:invalid CIDR address: invalid. +2021/04/30 23:31:23 [2026] [ipam] Failed to find interface with MAC address:222222222222 +•••••••••••••2021/04/30 23:31:23 [2026] [Utils] Initializing HTTP client with connection timeout: 10, response header timeout: 10 +2021/04/30 23:31:23 [2026] [ipam] Wireserver call http://localhost:42424 to retrieve IP List +2021/04/30 23:31:23 [2026] [ipam] got 1 addresses from interface lo, subnet 10.0.0.0/16 +2021/04/30 23:31:23 [2026] [ipam] got 1 addresses from interface lo, subnet 10.1.0.0/16 +•2021/04/30 23:31:23 [2026] [ipam] ipam store is nil +2021/04/30 23:31:23 [2026] [ipam] Starting source azure. +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +2021/04/30 23:31:23 [2026] [Utils] Initializing HTTP client with connection timeout: 10, response header timeout: 10 +2021/04/30 23:31:23 [2026] [ipam] Wireserver call http://localhost:42424 to retrieve IP List +2021/04/30 23:31:23 [2026] [ipam] got 1 addresses from interface lo, subnet 10.0.0.0/16 +2021/04/30 23:31:23 [2026] [ipam] got 1 addresses from interface lo, subnet 10.1.0.0/16 +2021/04/30 23:31:23 [2026] [ipam] merging address space +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +•••••••••••••2021/04/30 23:31:23 [2026] [ipam] merging address space +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +•2021/04/30 23:31:23 [2026] [ipam] merging address space +2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. +•••••••••••••2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId:10.0.0.0/16 options:map[] v6:false. +2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool: err:Address pool not found. +•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId:10.0.0.0/16 options:map[] v6:false. +2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as: Id:10.0.0.0/16 IfName: Subnet:{IP: Mask:} Gateway: Addresses:map[] addrsByID:map[] IsIPv6:false Priority:0 RefCount:1 epoch:0} err:. +•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:false. +2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. +2021/04/30 23:31:23 [2026] [ipam] Pool 10.0.0.0/16 is in use. +2021/04/30 23:31:23 [2026] [ipam] Releasing pool 10.0.0.0/16 as there are no allocations +2021/04/30 23:31:23 [2026] [ipam] Pool 10.0.0.0/16 matches requirements. +2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as: Id:10.0.0.0/16 IfName: Subnet:{IP: Mask:} Gateway: Addresses:map[10.0.0.2:0xc000779ac0] addrsByID:map[] IsIPv6:false Priority:0 RefCount:1 epoch:0} err:. +•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:false. +2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. +2021/04/30 23:31:23 [2026] [ipam] Pool 10.0.0.0/16 is in use. +2021/04/30 23:31:23 [2026] [ipam] Skip releasing pool with poolId:10.0.0.0/16. due to address being in use +2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool: err:No available address pools. +•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId:10.0.0.0/16 options:map[] v6:false. +2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as: Id:10.0.0.0/16 IfName: Subnet:{IP: Mask:} Gateway: Addresses:map[10.0.0.1:0xc000779b80 10.0.0.2:0xc000779bc0] addrsByID:map[] IsIPv6:false Priority:0 RefCount:1 epoch:0} err:. +•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:true. +2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. +2021/04/30 23:31:23 [2026] [ipam] Pool is of a different address family. +2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool: err:No available address pools. +•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[azure.interface.name:en0] v6:false. +2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. +2021/04/30 23:31:23 [2026] [ipam] Pool is not on the requested interface. +2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool: err:No available address pools. +•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:false. +2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. +2021/04/30 23:31:23 [2026] [ipam] Pool 10.0.0.0/16 matches requirements. +2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as: Id:10.0.0.0/16 IfName: Subnet:{IP: Mask:} Gateway: Addresses:map[] addrsByID:map[] IsIPv6:false Priority:0 RefCount:1 epoch:0} err:. +•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:false. +2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. +2021/04/30 23:31:23 [2026] [ipam] Pool 10.0.0.0/16 matches requirements. +2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.1.0.0/16. +2021/04/30 23:31:23 [2026] [ipam] Pool 10.1.0.0/16 matches requirements. +2021/04/30 23:31:23 [2026] [ipam] Pool is preferred because of priority. +2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as: Id:10.1.0.0/16 IfName: Subnet:{IP: Mask:} Gateway: Addresses:map[] addrsByID:map[] IsIPv6:false Priority:2 RefCount:1 epoch:0} err:. +•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:false. +2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.1.0.0/16. +2021/04/30 23:31:23 [2026] [ipam] Pool 10.1.0.0/16 matches requirements. +2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. +2021/04/30 23:31:23 [2026] [ipam] Pool 10.0.0.0/16 matches requirements. +2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as: Id:10.1.0.0/16 IfName: Subnet:{IP: Mask:} Gateway: Addresses:map[10.1.0.1/16:0xc000779c00] addrsByID:map[] IsIPv6:false Priority:0 RefCount:1 epoch:0} err:. +••2021/04/30 23:31:23 [2026] [ipam] Releasing pool 10.0.0.0/16 as there are no allocations +•2021/04/30 23:31:23 [2026] [ipam] Skip releasing pool with poolId:10.0.0.0/16. due to address being in use +•2021/04/30 23:31:23 [2026] [ipam] Releasing pool 10.0.0.0/16 as there are no allocations +••••2021/04/30 23:31:23 [2026] [ipam] Requesting address with address:10.0.0.1/16 options:map[]. +2021/04/30 23:31:23 [2026] [ipam] Address request failed with Address not found +•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address:10.0.0.1/16 options:map[azure.address.id:10.0.0.1/16]. +2021/04/30 23:31:23 [2026] [ipam] Address request completed with address: +•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address: options:map[azure.address.id:651d7fb2-afca-4430-86a9-1184855d79bc]. +2021/04/30 23:31:23 [2026] [ipam] Address request completed with address:10.0.1.1/24 +•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address:10.0.0.1/16 options:map[]. +2021/04/30 23:31:23 [2026] [ipam] Address request failed with Address already in use +•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address:10.0.0.1/16 options:map[azure.address.id:10.0.0.2/16]. +2021/04/30 23:31:23 [2026] [ipam] Address request failed with Address already in use +•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address: options:map[azure.address.type:gateway]. +2021/04/30 23:31:23 [2026] [ipam] Address request completed with address: +•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address: options:map[azure.address.id:10.0.0.1/16]. +2021/04/30 23:31:23 [2026] [ipam] Address request completed with address: +•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address: options:map[]. +2021/04/30 23:31:23 [2026] [ipam] Address request failed with No available addresses +•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address: options:map[]. +2021/04/30 23:31:23 [2026] [ipam] Address request completed with address: +•2021/04/30 23:31:23 [2026] [ipam] Releasing address with address:0.0.0.0 options:map[]. +2021/04/30 23:31:23 [2026] [ipam] Address release completed with address:0.0.0.0 err:. +•2021/04/30 23:31:23 [2026] [ipam] Releasing address with address:0.0.0.0 options:map[]. +2021/04/30 23:31:23 [2026] [ipam] Address release completed with address:0.0.0.0 err:. +•2021/04/30 23:31:23 [2026] [ipam] Releasing address with address:10.0.0.1/16 options:map[]. +2021/04/30 23:31:23 [2026] Address not in use. Not Returning error +2021/04/30 23:31:23 [2026] [ipam] Address release completed with address:10.0.0.1/16 err:. +•2021/04/30 23:31:23 [2026] [ipam] Releasing address with address: options:map[azure.address.id:10.0.0.1/16]. +2021/04/30 23:31:23 [2026] [ipam] Address release completed with address:0.0.0.0 err:. +•2021/04/30 23:31:23 [2026] [ipam] Releasing address with address:10.0.0.1/16 options:map[]. +2021/04/30 23:31:23 [2026] Deleting Address record from address pool as metadata doesn't have this address +2021/04/30 23:31:23 [2026] [ipam] Address release completed with address:10.0.0.1/16 err:. +•2021/04/30 23:31:23 [2026] [Listener] Stopped listening on localhost:42424 + +Ran 106 of 106 Specs in 0.072 seconds +SUCCESS! -- 106 Passed | 0 Failed | 0 Pending | 0 Skipped +--- PASS: TestPool (0.07s) +PASS +coverage: 5.3% of statements in ./... +ok github.com/Azure/azure-container-networking/ipam 0.718s coverage: 5.3% of statements in ./... +? github.com/Azure/azure-container-networking/iptables [no test files] +=== RUN TestLogFileRotatesWhenSizeLimitIsReached +--- PASS: TestLogFileRotatesWhenSizeLimitIsReached (0.00s) +=== RUN TestPid +--- PASS: TestPid (0.00s) +PASS +coverage: 1.1% of statements in ./... +ok github.com/Azure/azure-container-networking/log 0.196s coverage: 1.1% of statements in ./... +=== RUN TestEcho +--- PASS: TestEcho (0.00s) +=== RUN TestAddDeleteBridge +--- PASS: TestAddDeleteBridge (0.05s) +=== RUN TestAddDeleteVEth +--- PASS: TestAddDeleteVEth (0.02s) +=== RUN TestAddDeleteIPVlan +--- PASS: TestAddDeleteIPVlan (0.04s) +=== RUN TestSetLinkState +--- PASS: TestSetLinkState (0.02s) +=== RUN TestSetLinkPromisc +--- PASS: TestSetLinkPromisc (0.02s) +=== RUN TestSetLinkHairpin +--- PASS: TestSetLinkHairpin (0.11s) +=== RUN TestAddRemoveStaticArp +--- PASS: TestAddRemoveStaticArp (0.03s) +PASS +coverage: 2.8% of statements in ./... +ok github.com/Azure/azure-container-networking/netlink 0.467s coverage: 2.8% of statements in ./... +=== RUN TestEndpoint +Running Suite: Endpoint Suite +============================= +Random Seed: 1619825484 +Will run 38 of 38 specs + +2021/04/30 23:31:24 [2254] [net] Deleted ExternalInterface eth0. +•2021/04/30 23:31:24 [2254] [net] Deleted ExternalInterface eth0. +•2021/04/30 23:31:24 [2254] [net] network store is nil +•2021/04/30 23:31:24 [2254] [net] network store key not found +•2021/04/30 23:31:24 [2254] [net] Failed to restore state, err:error for test +•2021/04/30 23:31:24 [2254] [net] Restored state, &{Version: TimeStamp:0001-01-01 00:00:00 +0000 UTC ExternalInterfaces:map[eth0:0xc000591900] store:0xc000244e80 Mutex:{state:0 sema:0}} +2021/04/30 23:31:24 [2254] External Interface &{Name:eth0 Networks:map[nwId:0xc0002af2b0] Subnets:[] BridgeName: DNSInfo:{Suffix: Servers:[] Options:[]} MacAddress: IPAddresses:[] Routes:[] IPv4Gateway: IPv6Gateway:} +2021/04/30 23:31:24 [2254] Number of endpoints: 0 +••2021/04/30 23:31:24 [2254] [net] Save failed, err:error for test +•2021/04/30 23:31:24 [2254] Get number of endpoints for ifname network +•2021/04/30 23:31:24 [2254] Get number of endpoints for ifname eth0 network +•2021/04/30 23:31:24 [2254] Get number of endpoints for ifname eth0 network +•2021/04/30 23:31:24 [2254] Get number of endpoints for ifname eth0 network nwId +•2021/04/30 23:31:24 [2254] Get number of endpoints for ifname eth0 network nwId +•2021/04/30 23:31:24 [2254] Get number of endpoints for ifname eth0 network nwId +•2021/04/30 23:31:24 [2254] Get number of endpoints for ifname eth0 network nwId +••2021/04/30 23:31:24 [2254] [net] Deleted ExternalInterface eth0. +•••2021/04/30 23:31:24 [2254] [net] Creating network &{MasterIfName:eth0 AdapterName: Id: Mode: Subnets:[] PodSubnet:{Family:0 Prefix:{IP: Mask:} Gateway: PrimaryIP:} DNS:{Suffix: Servers:[] Options:[]} Policies:[] BridgeName: EnableSnatOnHost:false NetNs: Options:map[] DisableHairpinOnHostInterface:false IPV6Mode: IPAMType: ServiceCidrs:}. +2021/04/30 23:31:24 [2254] [net] Failed to create network , err:Subnet not found. +•2021/04/30 23:31:24 [2254] [net] Creating network &{MasterIfName:eth0 AdapterName: Id: Mode: Subnets:[] PodSubnet:{Family:0 Prefix:{IP: Mask:} Gateway: PrimaryIP:} DNS:{Suffix: Servers:[] Options:[]} Policies:[] BridgeName: EnableSnatOnHost:false NetNs: Options:map[] DisableHairpinOnHostInterface:false IPV6Mode: IPAMType: ServiceCidrs:}. +2021/04/30 23:31:24 [2254] [net] Failed to create network , err:Subnet not found. +•2021/04/30 23:31:24 [2254] [net] Creating network &{MasterIfName: AdapterName: Id: Mode: Subnets:[{Family:0 Prefix:{IP:10.0.0.1 Mask:ffff0000} Gateway: PrimaryIP:}] PodSubnet:{Family:0 Prefix:{IP: Mask:} Gateway: PrimaryIP:} DNS:{Suffix: Servers:[] Options:[]} Policies:[] BridgeName: EnableSnatOnHost:false NetNs: Options:map[] DisableHairpinOnHostInterface:false IPV6Mode: IPAMType: ServiceCidrs:}. +2021/04/30 23:31:24 [2254] [net] Failed to create network , err:Subnet not found. +•2021/04/30 23:31:24 [2254] [net] Creating network &{MasterIfName:eth0 AdapterName: Id:nw Mode: Subnets:[] PodSubnet:{Family:0 Prefix:{IP: Mask:} Gateway: PrimaryIP:} DNS:{Suffix: Servers:[] Options:[]} Policies:[] BridgeName: EnableSnatOnHost:false NetNs: Options:map[] DisableHairpinOnHostInterface:false IPV6Mode: IPAMType: ServiceCidrs:}. +2021/04/30 23:31:24 [2254] [net] Failed to create network nw, err:Network already exists. +•2021/04/30 23:31:24 [2254] [net] Deleting network invalid. +2021/04/30 23:31:24 [2254] [net] Failed to delete network invalid, err:Network not found. +••2021/04/30 23:31:24 [2254] Trying to retrieve endpoint id invalid +•2021/04/30 23:31:24 [2254] Trying to retrieve endpoint id epId +•2021/04/30 23:31:24 [2254] Trying to retrieve endpoint for pod name: test in namespace: ns +•2021/04/30 23:31:24 [2254] Trying to retrieve endpoint for pod name: invalid in namespace: +•2021/04/30 23:31:24 [2254] Trying to retrieve endpoint for pod name: test in namespace: ns +••2021/04/30 23:31:24 [2254] namesplit [nginx] +2021/04/30 23:31:24 [2254] namesplit [nginx deployment 5c689d88bb] +2021/04/30 23:31:24 [2254] Pod name after splitting based on - : [nginx] +2021/04/30 23:31:24 [2254] namesplit [nginx deployment 5c689d88bb qwq47] +2021/04/30 23:31:24 [2254] Pod name after splitting based on - : [nginx deployment] +••2021/04/30 23:31:24 [2254] [net] Attached endpoint to sandbox key. +••2021/04/30 23:31:24 [2254] [net] Detached endpoint from sandbox key. +•2021/04/30 23:31:24 [2254] [net] Updating existing endpoint [&{Id:test ContainerID: NetNsPath: IfName: SandboxKey: IfIndex:0 MacAddress: DNS:{Suffix: Servers:[] Options:[]} IPAddresses:[] IPsToRouteViaHost:[] InfraVnetIP:{IP: Mask:} Routes:[] Policies:[] Gateways:[] EnableSnatOnHost:false EnableInfraVnet:false EnableMultiTenancy:false EnableSnatForDns:false AllowInboundFromHostToNC:false AllowInboundFromNCToHost:false NetworkContainerID: PODName: PODNameSpace: Data:map[] InfraVnetAddressSpace: SkipHotAttachEp:false IPV6Mode: VnetCidrs: ServiceCidrs:}] in network to target [&{Id: ContainerID: NetNsPath: IfName: SandboxKey: IfIndex:0 MacAddress: DNS:{Suffix: Servers:[] Options:[]} IPAddresses:[] IPsToRouteViaHost:[] InfraVnetIP:{IP: Mask:} Routes:[] Policies:[] Gateways:[] EnableSnatOnHost:false EnableInfraVnet:false EnableMultiTenancy:false EnableSnatForDns:false AllowInboundFromHostToNC:false AllowInboundFromNCToHost:false NetworkContainerID: PODName: PODNameSpace: Data:map[] InfraVnetAddressSpace: SkipHotAttachEp:false IPV6Mode: VnetCidrs: ServiceCidrs:}]. +2021/04/30 23:31:24 [2254] Trying to retrieve endpoint id test +•2021/04/30 23:31:24 [2254] namesplit [nginx deployment 5c689d88bb] +2021/04/30 23:31:24 [2254] Pod name after splitting based on - : [nginx] +2021/04/30 23:31:24 [2254] namesplit [nginx deployment 5c689d88bb qwq47] +2021/04/30 23:31:24 [2254] Pod name after splitting based on - : [nginx deployment] +2021/04/30 23:31:24 [2254] namesplit [nginx] +• +Ran 38 of 38 Specs in 0.017 seconds +SUCCESS! -- 38 Passed | 0 Failed | 0 Pending | 0 Skipped +--- PASS: TestEndpoint (0.02s) +=== RUN TestManager +Running Suite: Manager Suite +============================ +Random Seed: 1619825484 +Will run 38 of 38 specs + +2021/04/30 23:31:24 [2254] [net] Deleted ExternalInterface eth0. +•2021/04/30 23:31:24 [2254] [net] Deleted ExternalInterface eth0. +•2021/04/30 23:31:24 [2254] [net] network store is nil +•2021/04/30 23:31:24 [2254] [net] network store key not found +•2021/04/30 23:31:24 [2254] [net] Failed to restore state, err:error for test +•2021/04/30 23:31:24 [2254] [net] Restored state, &{Version: TimeStamp:0001-01-01 00:00:00 +0000 UTC ExternalInterfaces:map[eth0:0xc0003af700] store:0xc000245200 Mutex:{state:0 sema:0}} +2021/04/30 23:31:24 [2254] External Interface &{Name:eth0 Networks:map[nwId:0xc0003d0dd0] Subnets:[] BridgeName: DNSInfo:{Suffix: Servers:[] Options:[]} MacAddress: IPAddresses:[] Routes:[] IPv4Gateway: IPv6Gateway:} +2021/04/30 23:31:24 [2254] Number of endpoints: 0 +••2021/04/30 23:31:24 [2254] [net] Save failed, err:error for test +•2021/04/30 23:31:24 [2254] Get number of endpoints for ifname network +•2021/04/30 23:31:24 [2254] Get number of endpoints for ifname eth0 network +•2021/04/30 23:31:24 [2254] Get number of endpoints for ifname eth0 network +•2021/04/30 23:31:24 [2254] Get number of endpoints for ifname eth0 network nwId +•2021/04/30 23:31:24 [2254] Get number of endpoints for ifname eth0 network nwId +•2021/04/30 23:31:24 [2254] Get number of endpoints for ifname eth0 network nwId +•2021/04/30 23:31:24 [2254] Get number of endpoints for ifname eth0 network nwId +••2021/04/30 23:31:24 [2254] [net] Deleted ExternalInterface eth0. +•••2021/04/30 23:31:24 [2254] [net] Creating network &{MasterIfName:eth0 AdapterName: Id: Mode: Subnets:[] PodSubnet:{Family:0 Prefix:{IP: Mask:} Gateway: PrimaryIP:} DNS:{Suffix: Servers:[] Options:[]} Policies:[] BridgeName: EnableSnatOnHost:false NetNs: Options:map[] DisableHairpinOnHostInterface:false IPV6Mode: IPAMType: ServiceCidrs:}. +2021/04/30 23:31:24 [2254] [net] Failed to create network , err:Subnet not found. +•2021/04/30 23:31:24 [2254] [net] Creating network &{MasterIfName:eth0 AdapterName: Id: Mode: Subnets:[] PodSubnet:{Family:0 Prefix:{IP: Mask:} Gateway: PrimaryIP:} DNS:{Suffix: Servers:[] Options:[]} Policies:[] BridgeName: EnableSnatOnHost:false NetNs: Options:map[] DisableHairpinOnHostInterface:false IPV6Mode: IPAMType: ServiceCidrs:}. +2021/04/30 23:31:24 [2254] [net] Failed to create network , err:Subnet not found. +•2021/04/30 23:31:24 [2254] [net] Creating network &{MasterIfName: AdapterName: Id: Mode: Subnets:[{Family:0 Prefix:{IP:10.0.0.1 Mask:ffff0000} Gateway: PrimaryIP:}] PodSubnet:{Family:0 Prefix:{IP: Mask:} Gateway: PrimaryIP:} DNS:{Suffix: Servers:[] Options:[]} Policies:[] BridgeName: EnableSnatOnHost:false NetNs: Options:map[] DisableHairpinOnHostInterface:false IPV6Mode: IPAMType: ServiceCidrs:}. +2021/04/30 23:31:24 [2254] [net] Failed to create network , err:Subnet not found. +•2021/04/30 23:31:24 [2254] [net] Creating network &{MasterIfName:eth0 AdapterName: Id:nw Mode: Subnets:[] PodSubnet:{Family:0 Prefix:{IP: Mask:} Gateway: PrimaryIP:} DNS:{Suffix: Servers:[] Options:[]} Policies:[] BridgeName: EnableSnatOnHost:false NetNs: Options:map[] DisableHairpinOnHostInterface:false IPV6Mode: IPAMType: ServiceCidrs:}. +2021/04/30 23:31:24 [2254] [net] Failed to create network nw, err:Network already exists. +•2021/04/30 23:31:24 [2254] [net] Deleting network invalid. +2021/04/30 23:31:24 [2254] [net] Failed to delete network invalid, err:Network not found. +••2021/04/30 23:31:24 [2254] Trying to retrieve endpoint id invalid +•2021/04/30 23:31:24 [2254] Trying to retrieve endpoint id epId +•2021/04/30 23:31:24 [2254] Trying to retrieve endpoint for pod name: test in namespace: ns +•2021/04/30 23:31:24 [2254] Trying to retrieve endpoint for pod name: invalid in namespace: +•2021/04/30 23:31:24 [2254] Trying to retrieve endpoint for pod name: test in namespace: ns +••2021/04/30 23:31:24 [2254] namesplit [nginx] +2021/04/30 23:31:24 [2254] namesplit [nginx deployment 5c689d88bb] +2021/04/30 23:31:24 [2254] Pod name after splitting based on - : [nginx] +2021/04/30 23:31:24 [2254] namesplit [nginx deployment 5c689d88bb qwq47] +2021/04/30 23:31:24 [2254] Pod name after splitting based on - : [nginx deployment] +••2021/04/30 23:31:24 [2254] [net] Attached endpoint to sandbox key. +••2021/04/30 23:31:24 [2254] [net] Detached endpoint from sandbox key. +•2021/04/30 23:31:24 [2254] [net] Updating existing endpoint [&{Id:test ContainerID: NetNsPath: IfName: SandboxKey: IfIndex:0 MacAddress: DNS:{Suffix: Servers:[] Options:[]} IPAddresses:[] IPsToRouteViaHost:[] InfraVnetIP:{IP: Mask:} Routes:[] Policies:[] Gateways:[] EnableSnatOnHost:false EnableInfraVnet:false EnableMultiTenancy:false EnableSnatForDns:false AllowInboundFromHostToNC:false AllowInboundFromNCToHost:false NetworkContainerID: PODName: PODNameSpace: Data:map[] InfraVnetAddressSpace: SkipHotAttachEp:false IPV6Mode: VnetCidrs: ServiceCidrs:}] in network to target [&{Id: ContainerID: NetNsPath: IfName: SandboxKey: IfIndex:0 MacAddress: DNS:{Suffix: Servers:[] Options:[]} IPAddresses:[] IPsToRouteViaHost:[] InfraVnetIP:{IP: Mask:} Routes:[] Policies:[] Gateways:[] EnableSnatOnHost:false EnableInfraVnet:false EnableMultiTenancy:false EnableSnatForDns:false AllowInboundFromHostToNC:false AllowInboundFromNCToHost:false NetworkContainerID: PODName: PODNameSpace: Data:map[] InfraVnetAddressSpace: SkipHotAttachEp:false IPV6Mode: VnetCidrs: ServiceCidrs:}]. +2021/04/30 23:31:24 [2254] Trying to retrieve endpoint id test +•2021/04/30 23:31:24 [2254] namesplit [nginx deployment 5c689d88bb] +2021/04/30 23:31:24 [2254] Pod name after splitting based on - : [nginx] +2021/04/30 23:31:24 [2254] namesplit [nginx deployment 5c689d88bb qwq47] +2021/04/30 23:31:24 [2254] Pod name after splitting based on - : [nginx deployment] +2021/04/30 23:31:24 [2254] namesplit [nginx] +• +Ran 38 of 38 Specs in 0.007 seconds +SUCCESS! -- 38 Passed | 0 Failed | 0 Pending | 0 Skipped +--- PASS: TestManager (0.01s) +=== RUN TestNetwork +Running Suite: Network Suite +============================ +Random Seed: 1619825484 +Will run 38 of 38 specs + +2021/04/30 23:31:24 [2254] [net] Deleted ExternalInterface eth0. +•2021/04/30 23:31:24 [2254] [net] Deleted ExternalInterface eth0. +•2021/04/30 23:31:24 [2254] [net] network store is nil +•2021/04/30 23:31:24 [2254] [net] network store key not found +•2021/04/30 23:31:24 [2254] [net] Failed to restore state, err:error for test +•2021/04/30 23:31:24 [2254] [net] Restored state, &{Version: TimeStamp:0001-01-01 00:00:00 +0000 UTC ExternalInterfaces:map[eth0:0xc000028e00] store:0xc0004b1100 Mutex:{state:0 sema:0}} +2021/04/30 23:31:24 [2254] External Interface &{Name:eth0 Networks:map[nwId:0xc000361380] Subnets:[] BridgeName: DNSInfo:{Suffix: Servers:[] Options:[]} MacAddress: IPAddresses:[] Routes:[] IPv4Gateway: IPv6Gateway:} +2021/04/30 23:31:24 [2254] Number of endpoints: 0 +••2021/04/30 23:31:24 [2254] [net] Save failed, err:error for test +•2021/04/30 23:31:24 [2254] Get number of endpoints for ifname network +•2021/04/30 23:31:24 [2254] Get number of endpoints for ifname eth0 network +•2021/04/30 23:31:24 [2254] Get number of endpoints for ifname eth0 network +•2021/04/30 23:31:24 [2254] Get number of endpoints for ifname eth0 network nwId +•2021/04/30 23:31:24 [2254] Get number of endpoints for ifname eth0 network nwId +•2021/04/30 23:31:24 [2254] Get number of endpoints for ifname eth0 network nwId +•2021/04/30 23:31:24 [2254] Get number of endpoints for ifname eth0 network nwId +••2021/04/30 23:31:24 [2254] [net] Deleted ExternalInterface eth0. +•••2021/04/30 23:31:24 [2254] [net] Creating network &{MasterIfName:eth0 AdapterName: Id: Mode: Subnets:[] PodSubnet:{Family:0 Prefix:{IP: Mask:} Gateway: PrimaryIP:} DNS:{Suffix: Servers:[] Options:[]} Policies:[] BridgeName: EnableSnatOnHost:false NetNs: Options:map[] DisableHairpinOnHostInterface:false IPV6Mode: IPAMType: ServiceCidrs:}. +2021/04/30 23:31:24 [2254] [net] Failed to create network , err:Subnet not found. +•2021/04/30 23:31:24 [2254] [net] Creating network &{MasterIfName:eth0 AdapterName: Id: Mode: Subnets:[] PodSubnet:{Family:0 Prefix:{IP: Mask:} Gateway: PrimaryIP:} DNS:{Suffix: Servers:[] Options:[]} Policies:[] BridgeName: EnableSnatOnHost:false NetNs: Options:map[] DisableHairpinOnHostInterface:false IPV6Mode: IPAMType: ServiceCidrs:}. +2021/04/30 23:31:24 [2254] [net] Failed to create network , err:Subnet not found. +•2021/04/30 23:31:24 [2254] [net] Creating network &{MasterIfName: AdapterName: Id: Mode: Subnets:[{Family:0 Prefix:{IP:10.0.0.1 Mask:ffff0000} Gateway: PrimaryIP:}] PodSubnet:{Family:0 Prefix:{IP: Mask:} Gateway: PrimaryIP:} DNS:{Suffix: Servers:[] Options:[]} Policies:[] BridgeName: EnableSnatOnHost:false NetNs: Options:map[] DisableHairpinOnHostInterface:false IPV6Mode: IPAMType: ServiceCidrs:}. +2021/04/30 23:31:24 [2254] [net] Failed to create network , err:Subnet not found. +•2021/04/30 23:31:24 [2254] [net] Creating network &{MasterIfName:eth0 AdapterName: Id:nw Mode: Subnets:[] PodSubnet:{Family:0 Prefix:{IP: Mask:} Gateway: PrimaryIP:} DNS:{Suffix: Servers:[] Options:[]} Policies:[] BridgeName: EnableSnatOnHost:false NetNs: Options:map[] DisableHairpinOnHostInterface:false IPV6Mode: IPAMType: ServiceCidrs:}. +2021/04/30 23:31:24 [2254] [net] Failed to create network nw, err:Network already exists. +•2021/04/30 23:31:24 [2254] [net] Deleting network invalid. +2021/04/30 23:31:24 [2254] [net] Failed to delete network invalid, err:Network not found. +••2021/04/30 23:31:24 [2254] Trying to retrieve endpoint id invalid +•2021/04/30 23:31:24 [2254] Trying to retrieve endpoint id epId +•2021/04/30 23:31:24 [2254] Trying to retrieve endpoint for pod name: test in namespace: ns +•2021/04/30 23:31:24 [2254] Trying to retrieve endpoint for pod name: invalid in namespace: +•2021/04/30 23:31:24 [2254] Trying to retrieve endpoint for pod name: test in namespace: ns +••2021/04/30 23:31:24 [2254] namesplit [nginx] +2021/04/30 23:31:24 [2254] namesplit [nginx deployment 5c689d88bb] +2021/04/30 23:31:24 [2254] Pod name after splitting based on - : [nginx] +2021/04/30 23:31:24 [2254] namesplit [nginx deployment 5c689d88bb qwq47] +2021/04/30 23:31:24 [2254] Pod name after splitting based on - : [nginx deployment] +••2021/04/30 23:31:24 [2254] [net] Attached endpoint to sandbox key. +••2021/04/30 23:31:24 [2254] [net] Detached endpoint from sandbox key. +•2021/04/30 23:31:24 [2254] [net] Updating existing endpoint [&{Id:test ContainerID: NetNsPath: IfName: SandboxKey: IfIndex:0 MacAddress: DNS:{Suffix: Servers:[] Options:[]} IPAddresses:[] IPsToRouteViaHost:[] InfraVnetIP:{IP: Mask:} Routes:[] Policies:[] Gateways:[] EnableSnatOnHost:false EnableInfraVnet:false EnableMultiTenancy:false EnableSnatForDns:false AllowInboundFromHostToNC:false AllowInboundFromNCToHost:false NetworkContainerID: PODName: PODNameSpace: Data:map[] InfraVnetAddressSpace: SkipHotAttachEp:false IPV6Mode: VnetCidrs: ServiceCidrs:}] in network to target [&{Id: ContainerID: NetNsPath: IfName: SandboxKey: IfIndex:0 MacAddress: DNS:{Suffix: Servers:[] Options:[]} IPAddresses:[] IPsToRouteViaHost:[] InfraVnetIP:{IP: Mask:} Routes:[] Policies:[] Gateways:[] EnableSnatOnHost:false EnableInfraVnet:false EnableMultiTenancy:false EnableSnatForDns:false AllowInboundFromHostToNC:false AllowInboundFromNCToHost:false NetworkContainerID: PODName: PODNameSpace: Data:map[] InfraVnetAddressSpace: SkipHotAttachEp:false IPV6Mode: VnetCidrs: ServiceCidrs:}]. +2021/04/30 23:31:24 [2254] Trying to retrieve endpoint id test +•2021/04/30 23:31:24 [2254] namesplit [nginx deployment 5c689d88bb] +2021/04/30 23:31:24 [2254] Pod name after splitting based on - : [nginx] +2021/04/30 23:31:24 [2254] namesplit [nginx deployment 5c689d88bb qwq47] +2021/04/30 23:31:24 [2254] Pod name after splitting based on - : [nginx deployment] +2021/04/30 23:31:24 [2254] namesplit [nginx] +• +Ran 38 of 38 Specs in 0.006 seconds +SUCCESS! -- 38 Passed | 0 Failed | 0 Pending | 0 Skipped +--- PASS: TestNetwork (0.01s) +PASS +coverage: 1.9% of statements in ./... +ok github.com/Azure/azure-container-networking/network 0.213s coverage: 1.9% of statements in ./... +? github.com/Azure/azure-container-networking/network/epcommon [no test files] +? github.com/Azure/azure-container-networking/network/ovsinfravnet [no test files] +=== RUN TestAllowInboundFromHostToNC +2021/04/30 23:31:24 [2290] [Azure-Utils] iptables -w 60 -t filter -L AZURECNIOUTPUT +2021/04/30 23:31:24 [2290] AZURECNIOUTPUT Chain exists in table filter +2021/04/30 23:31:24 [2290] [Azure-Utils] iptables -w 60 -t filter -C OUTPUT -j AZURECNIOUTPUT +2021/04/30 23:31:24 [2290] Rule already exists +2021/04/30 23:31:24 [2290] [Azure-Utils] iptables -w 60 -t filter -C AZURECNIOUTPUT -s 169.254.0.1 -d 169.254.0.4 -j ACCEPT +2021/04/30 23:31:24 [2290] [Azure-Utils] iptables -w 60 -t filter -I AZURECNIOUTPUT 1 -s 169.254.0.1 -d 169.254.0.4 -j ACCEPT +2021/04/30 23:31:24 [2290] [Azure-Utils] iptables -w 60 -t filter -L AZURECNIINPUT +2021/04/30 23:31:24 [2290] AZURECNIINPUT Chain exists in table filter +2021/04/30 23:31:24 [2290] [Azure-Utils] iptables -w 60 -t filter -C INPUT -j AZURECNIINPUT +2021/04/30 23:31:24 [2290] Rule already exists +2021/04/30 23:31:24 [2290] [Azure-Utils] iptables -w 60 -t filter -C AZURECNIINPUT -i azSnatbr -m state --state ESTABLISHED,RELATED -j ACCEPT +2021/04/30 23:31:24 [2290] Rule already exists +2021/04/30 23:31:24 [2290] Adding static arp entry for ip 169.254.0.4 mac f2:5f:c9:41:9f:a5 +2021/04/30 23:31:24 [2290] [Azure-Utils] iptables -w 60 -t filter -L AZURECNIOUTPUT +2021/04/30 23:31:24 [2290] AZURECNIOUTPUT Chain exists in table filter +2021/04/30 23:31:24 [2290] [Azure-Utils] iptables -w 60 -t filter -C OUTPUT -j AZURECNIOUTPUT +2021/04/30 23:31:24 [2290] Rule already exists +2021/04/30 23:31:24 [2290] [Azure-Utils] iptables -w 60 -t filter -C AZURECNIOUTPUT -s 169.254.0.1 -d 169.254.0.4 -j ACCEPT +2021/04/30 23:31:24 [2290] Rule already exists +2021/04/30 23:31:24 [2290] [Azure-Utils] iptables -w 60 -t filter -L AZURECNIINPUT +2021/04/30 23:31:24 [2290] AZURECNIINPUT Chain exists in table filter +2021/04/30 23:31:24 [2290] [Azure-Utils] iptables -w 60 -t filter -C INPUT -j AZURECNIINPUT +2021/04/30 23:31:24 [2290] Rule already exists +2021/04/30 23:31:24 [2290] [Azure-Utils] iptables -w 60 -t filter -C AZURECNIINPUT -i azSnatbr -m state --state ESTABLISHED,RELATED -j ACCEPT +2021/04/30 23:31:24 [2290] Rule already exists +2021/04/30 23:31:24 [2290] Adding static arp entry for ip 169.254.0.4 mac f2:5f:c9:41:9f:a5 +2021/04/30 23:31:24 [2290] [Azure-Utils] iptables -w 60 -t filter -D AZURECNIOUTPUT -s 169.254.0.1 -d 169.254.0.4 -j ACCEPT +2021/04/30 23:31:24 [2290] Removing static arp entry for ip 169.254.0.4 +--- PASS: TestAllowInboundFromHostToNC (0.16s) +=== RUN TestAllowInboundFromNCToHost +2021/04/30 23:31:24 [2290] [Azure-Utils] iptables -w 60 -t filter -L AZURECNIINPUT +2021/04/30 23:31:24 [2290] AZURECNIINPUT Chain exists in table filter +2021/04/30 23:31:24 [2290] [Azure-Utils] iptables -w 60 -t filter -C INPUT -j AZURECNIINPUT +2021/04/30 23:31:24 [2290] Rule already exists +2021/04/30 23:31:24 [2290] [Azure-Utils] iptables -w 60 -t filter -C AZURECNIINPUT -s 169.254.0.4 -d 169.254.0.1 -j ACCEPT +2021/04/30 23:31:24 [2290] [Azure-Utils] iptables -w 60 -t filter -I AZURECNIINPUT 1 -s 169.254.0.4 -d 169.254.0.1 -j ACCEPT +2021/04/30 23:31:24 [2290] [Azure-Utils] iptables -w 60 -t filter -L AZURECNIOUTPUT +2021/04/30 23:31:24 [2290] AZURECNIOUTPUT Chain exists in table filter +2021/04/30 23:31:24 [2290] [Azure-Utils] iptables -w 60 -t filter -C OUTPUT -j AZURECNIOUTPUT +2021/04/30 23:31:24 [2290] Rule already exists +2021/04/30 23:31:24 [2290] [Azure-Utils] iptables -w 60 -t filter -C AZURECNIOUTPUT -o azSnatbr -m state --state ESTABLISHED,RELATED -j ACCEPT +2021/04/30 23:31:24 [2290] Rule already exists +2021/04/30 23:31:24 [2290] Adding static arp entry for ip 169.254.0.4 mac be:da:fd:b5:15:80 +2021/04/30 23:31:24 [2290] [Azure-Utils] iptables -w 60 -t filter -L AZURECNIINPUT +2021/04/30 23:31:24 [2290] AZURECNIINPUT Chain exists in table filter +2021/04/30 23:31:24 [2290] [Azure-Utils] iptables -w 60 -t filter -C INPUT -j AZURECNIINPUT +2021/04/30 23:31:24 [2290] Rule already exists +2021/04/30 23:31:24 [2290] [Azure-Utils] iptables -w 60 -t filter -C AZURECNIINPUT -s 169.254.0.4 -d 169.254.0.1 -j ACCEPT +2021/04/30 23:31:24 [2290] Rule already exists +2021/04/30 23:31:24 [2290] [Azure-Utils] iptables -w 60 -t filter -L AZURECNIOUTPUT +2021/04/30 23:31:25 [2290] AZURECNIOUTPUT Chain exists in table filter +2021/04/30 23:31:25 [2290] [Azure-Utils] iptables -w 60 -t filter -C OUTPUT -j AZURECNIOUTPUT +2021/04/30 23:31:25 [2290] Rule already exists +2021/04/30 23:31:25 [2290] [Azure-Utils] iptables -w 60 -t filter -C AZURECNIOUTPUT -o azSnatbr -m state --state ESTABLISHED,RELATED -j ACCEPT +2021/04/30 23:31:25 [2290] Rule already exists +2021/04/30 23:31:25 [2290] Adding static arp entry for ip 169.254.0.4 mac be:da:fd:b5:15:80 +2021/04/30 23:31:25 [2290] [Azure-Utils] iptables -w 60 -t filter -D AZURECNIINPUT -s 169.254.0.4 -d 169.254.0.1 -j ACCEPT +2021/04/30 23:31:25 [2290] Removing static arp entry for ip 169.254.0.4 +--- PASS: TestAllowInboundFromNCToHost (0.14s) +PASS +coverage: 2.9% of statements in ./... +ok github.com/Azure/azure-container-networking/network/ovssnat 0.447s coverage: 2.9% of statements in ./... +? github.com/Azure/azure-container-networking/network/policy [no test files] +mock nns server started +=== RUN TestAddContainerNetworking +2021/04/30 23:31:24 [2367] [baremetal] Creating grpc connection to nns at endpoint ::6668 +Received request of type :Setup +2021/04/30 23:31:24 [2367] [baremetal] ConfigureContainerNetworking for container sf_8e9961f4-5b4f-4b3c-a9ae-c3294b0d9681 for nw namespace testnwspace succeeded with result: interfaces:{name:"azurevnet_45830dd4-1778-4735-9173-bba59b74cc8b_4ab80fb9-147e-4461-a213-56f4d44e806f" mac_address:"0036578BB0F1" network_namespace_id:"testnwspace" ipaddresses:{version:"4" ip:"10.91.149.1" prefix_length:"24" default_gateway:"10.91.148.1"}} +--- PASS: TestAddContainerNetworking (0.01s) +=== RUN TestDeleteContainerNetworking +2021/04/30 23:31:24 [2367] [baremetal] Creating grpc connection to nns at endpoint ::6668 +Received request of type :Teardown +2021/04/30 23:31:24 [2367] [baremetal] ConfigureContainerNetworking for container sf_8e9961f4-5b4f-4b3c-a9ae-c3294b0d9681 for nw namespace testnwspace succeeded with result: interfaces:{name:"azurevnet_45830dd4-1778-4735-9173-bba59b74cc8b_4ab80fb9-147e-4461-a213-56f4d44e806f" mac_address:"0036578BB0F1" network_namespace_id:"testnwspace" ipaddresses:{version:"4" ip:"10.91.149.1" prefix_length:"24" default_gateway:"10.91.148.1"}} +--- PASS: TestDeleteContainerNetworking (0.00s) +=== RUN TestAddContainerNetworkingFailure +2021/04/30 23:31:24 [2367] [baremetal] Creating grpc connection to nns at endpoint ::6668 +Received request of type :Setup +2021/04/30 23:31:24 [2367] [baremetal] ConfigureContainerNetworking for container testpod for nw namespace testnwspace failed with error: rpc error: code = Unknown desc = NnsMockServer: RequestType:Setup failed with error: Invalid PodName format. Should be in format podname_logicalContainerId. containerId should be uuid +--- PASS: TestAddContainerNetworkingFailure (0.00s) +=== RUN TestDeleteContainerNetworkingFailure +2021/04/30 23:31:24 [2367] [baremetal] Creating grpc connection to nns at endpoint ::6668 +Received request of type :Teardown +2021/04/30 23:31:24 [2367] [baremetal] ConfigureContainerNetworking for container testpod for nw namespace testnwspace failed with error: rpc error: code = Unknown desc = NnsMockServer: RequestType:Teardown failed with error: Invalid PodName format. Should be in format podname_logicalContainerId. containerId should be uuid +--- PASS: TestDeleteContainerNetworkingFailure (0.00s) +=== RUN TestAddContainerNetworkingGrpcServerDown +mock nns server stopped +2021/04/30 23:31:24 [2367] [baremetal] Creating grpc connection to nns at endpoint ::6668 +mock nns server started +Received request of type :Setup +2021/04/30 23:32:07 [2367] [baremetal] ConfigureContainerNetworking for container sf_8e9961f4-5b4f-4b3c-a9ae-c3294b0d9681 for nw namespace testnwspace succeeded with result: interfaces:{name:"azurevnet_45830dd4-1778-4735-9173-bba59b74cc8b_4ab80fb9-147e-4461-a213-56f4d44e806f" mac_address:"0036578BB0F1" network_namespace_id:"testnwspace" ipaddresses:{version:"4" ip:"10.91.149.1" prefix_length:"24" default_gateway:"10.91.148.1"}} +--- PASS: TestAddContainerNetworkingGrpcServerDown (42.81s) +PASS +coverage: 1.6% of statements in ./... +mock nns server stopped +ok github.com/Azure/azure-container-networking/nns 42.937s coverage: 1.6% of statements in ./... +? github.com/Azure/azure-container-networking/nodenetworkconfig/api/v1alpha [no test files] +2021/04/30 23:31:27 [2658] Finished initializing all Prometheus metrics +2021/04/30 23:31:27 [2658] Executing iptables command iptables [-w 60 -D FORWARD -j AZURE-NPM] +2021/04/30 23:31:27 [2658] AppInsights didn't initialized. +2021/04/30 23:31:27 [2658] Error: There was an error running command: [iptables -w 60 -D FORWARD -j AZURE-NPM] Stderr: [exit status 2, iptables v1.6.1: Couldn't load target `AZURE-NPM':No such file or directory + +Try `iptables -h' or 'iptables --help' for more information.] +2021/04/30 23:31:27 [2658] AppInsights didn't initialized. +2021/04/30 23:31:27 [2658] AppInsights didn't initialized. +2021/04/30 23:31:27 [2658] Error: failed to add default allow CONNECTED/RELATED rule to AZURE-NPM chain. +2021/04/30 23:31:27 [2658] AppInsights didn't initialized. +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-F -exist] +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-X -exist] +=== RUN TestNewNs +--- PASS: TestNewNs (0.00s) +=== RUN TestAddNamespace + nameSpaceController_test.go:79: Start storing ipset to /var/log/ipset-test.conf + nameSpaceController_test.go:104: Calling add namespace event +I0430 23:31:27.366758 2658 nameSpaceController.go:129] [NAMESPACE ADD EVENT] for namespace [test-namespace] +I0430 23:31:27.366835 2658 nameSpaceController.go:370] NAMESPACE UPDATING: + namespace: [ns-test-namespace/map[app:test-namespace]] +I0430 23:31:27.366878 2658 nameSpaceController.go:326] NAMESPACE CREATING: [ns-test-namespace/map[app:test-namespace]] +2021/04/30 23:31:27 [2658] Creating Set: &{operationFlag:-N name:ns-test-namespace set:azure-npm-2293040867 spec:[nethash]} +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-2293040867 nethash] +I0430 23:31:27.368223 2658 nameSpaceController.go:129] [NAMESPACE UPDATE EVENT] for namespace [test-namespace] +I0430 23:31:27.368278 2658 nameSpaceController.go:155] [NAMESPACE UPDATE EVENT] Resourceversion is same for this namespace [test-namespace] +2021/04/30 23:31:27 [2658] Creating List: &{operationFlag:-N name:all-namespaces set:azure-npm-530439631 spec:[setlist]} +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-530439631 setlist] +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-A -exist azure-npm-530439631 azure-npm-2293040867] +I0430 23:31:27.374013 2658 nameSpaceController.go:346] Adding namespace ns-test-namespace to ipset list ns-app +2021/04/30 23:31:27 [2658] Creating List: &{operationFlag:-N name:ns-app set:azure-npm-38964400 spec:[setlist]} +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-38964400 setlist] +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-A -exist azure-npm-38964400 azure-npm-2293040867] +I0430 23:31:27.378178 2658 nameSpaceController.go:353] Adding namespace ns-test-namespace to ipset list ns-app:test-namespace +2021/04/30 23:31:27 [2658] Creating List: &{operationFlag:-N name:ns-app:test-namespace set:azure-npm-3308517892 spec:[setlist]} +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-3308517892 setlist] +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-A -exist azure-npm-3308517892 azure-npm-2293040867] +I0430 23:31:27.394061 2658 nameSpaceController.go:269] Successfully synced 'test-namespace' + nameSpaceController_test.go:87: Start re-storing ipset to /var/log/ipset-test.conf +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-F -exist] +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-X -exist] +--- PASS: TestAddNamespace (0.06s) +=== RUN TestUpdateNamespace + nameSpaceController_test.go:79: Start storing ipset to /var/log/ipset-test.conf + nameSpaceController_test.go:104: Calling add namespace event +I0430 23:31:27.419814 2658 nameSpaceController.go:129] [NAMESPACE ADD EVENT] for namespace [test-namespace] +I0430 23:31:27.419896 2658 nameSpaceController.go:370] NAMESPACE UPDATING: + namespace: [ns-test-namespace/map[app:test-namespace]] +I0430 23:31:27.419931 2658 nameSpaceController.go:326] NAMESPACE CREATING: [ns-test-namespace/map[app:test-namespace]] +2021/04/30 23:31:27 [2658] Creating Set: &{operationFlag:-N name:ns-test-namespace set:azure-npm-2293040867 spec:[nethash]} +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-2293040867 nethash] +I0430 23:31:27.420832 2658 nameSpaceController.go:129] [NAMESPACE UPDATE EVENT] for namespace [test-namespace] +I0430 23:31:27.420872 2658 nameSpaceController.go:155] [NAMESPACE UPDATE EVENT] Resourceversion is same for this namespace [test-namespace] +2021/04/30 23:31:27 [2658] Creating List: &{operationFlag:-N name:all-namespaces set:azure-npm-530439631 spec:[setlist]} +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-530439631 setlist] +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-A -exist azure-npm-530439631 azure-npm-2293040867] +I0430 23:31:27.424887 2658 nameSpaceController.go:346] Adding namespace ns-test-namespace to ipset list ns-app +2021/04/30 23:31:27 [2658] Creating List: &{operationFlag:-N name:ns-app set:azure-npm-38964400 spec:[setlist]} +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-38964400 setlist] +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-A -exist azure-npm-38964400 azure-npm-2293040867] +I0430 23:31:27.434395 2658 nameSpaceController.go:353] Adding namespace ns-test-namespace to ipset list ns-app:test-namespace +2021/04/30 23:31:27 [2658] Creating List: &{operationFlag:-N name:ns-app:test-namespace set:azure-npm-3308517892 spec:[setlist]} +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-3308517892 setlist] +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-A -exist azure-npm-3308517892 azure-npm-2293040867] +I0430 23:31:27.438788 2658 nameSpaceController.go:269] Successfully synced 'test-namespace' + nameSpaceController_test.go:115: Complete add namespace event + nameSpaceController_test.go:117: Updating kubeinformer namespace object + nameSpaceController_test.go:120: Calling update namespace event +I0430 23:31:27.438916 2658 nameSpaceController.go:129] [NAMESPACE UPDATE EVENT] for namespace [test-namespace] +I0430 23:31:27.438963 2658 nameSpaceController.go:370] NAMESPACE UPDATING: + namespace: [ns-test-namespace/map[app:new-test-namespace]] +I0430 23:31:27.438990 2658 nameSpaceController.go:394] Deleting namespace ns-test-namespace from ipset list ns-app:test-namespace +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-D -exist azure-npm-3308517892 azure-npm-2293040867] +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-X -exist azure-npm-3308517892] +I0430 23:31:27.461516 2658 nameSpaceController.go:411] Adding namespace ns-test-namespace to ipset list ns-app:new-test-namespace +2021/04/30 23:31:27 [2658] Creating List: &{operationFlag:-N name:ns-app:new-test-namespace set:azure-npm-4070642153 spec:[setlist]} +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-4070642153 setlist] +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-A -exist azure-npm-4070642153 azure-npm-2293040867] +I0430 23:31:27.463265 2658 nameSpaceController.go:269] Successfully synced 'test-namespace' + nameSpaceController_test.go:87: Start re-storing ipset to /var/log/ipset-test.conf +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-F -exist] +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-X -exist] +--- PASS: TestUpdateNamespace (0.08s) +=== RUN TestAddNamespaceLabel + nameSpaceController_test.go:79: Start storing ipset to /var/log/ipset-test.conf + nameSpaceController_test.go:104: Calling add namespace event +I0430 23:31:27.495620 2658 nameSpaceController.go:129] [NAMESPACE ADD EVENT] for namespace [test-namespace] +I0430 23:31:27.495679 2658 nameSpaceController.go:370] NAMESPACE UPDATING: + namespace: [ns-test-namespace/map[app:test-namespace]] +I0430 23:31:27.495730 2658 nameSpaceController.go:326] NAMESPACE CREATING: [ns-test-namespace/map[app:test-namespace]] +2021/04/30 23:31:27 [2658] Creating Set: &{operationFlag:-N name:ns-test-namespace set:azure-npm-2293040867 spec:[nethash]} +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-2293040867 nethash] +I0430 23:31:27.496279 2658 nameSpaceController.go:129] [NAMESPACE UPDATE EVENT] for namespace [test-namespace] +I0430 23:31:27.496311 2658 nameSpaceController.go:155] [NAMESPACE UPDATE EVENT] Resourceversion is same for this namespace [test-namespace] +2021/04/30 23:31:27 [2658] Creating List: &{operationFlag:-N name:all-namespaces set:azure-npm-530439631 spec:[setlist]} +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-530439631 setlist] +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-A -exist azure-npm-530439631 azure-npm-2293040867] +I0430 23:31:27.499644 2658 nameSpaceController.go:346] Adding namespace ns-test-namespace to ipset list ns-app +2021/04/30 23:31:27 [2658] Creating List: &{operationFlag:-N name:ns-app set:azure-npm-38964400 spec:[setlist]} +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-38964400 setlist] +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-A -exist azure-npm-38964400 azure-npm-2293040867] +I0430 23:31:27.501309 2658 nameSpaceController.go:353] Adding namespace ns-test-namespace to ipset list ns-app:test-namespace +2021/04/30 23:31:27 [2658] Creating List: &{operationFlag:-N name:ns-app:test-namespace set:azure-npm-3308517892 spec:[setlist]} +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-3308517892 setlist] +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-A -exist azure-npm-3308517892 azure-npm-2293040867] +I0430 23:31:27.521212 2658 nameSpaceController.go:269] Successfully synced 'test-namespace' + nameSpaceController_test.go:115: Complete add namespace event + nameSpaceController_test.go:117: Updating kubeinformer namespace object + nameSpaceController_test.go:120: Calling update namespace event +I0430 23:31:27.521534 2658 nameSpaceController.go:129] [NAMESPACE UPDATE EVENT] for namespace [test-namespace] +I0430 23:31:27.521588 2658 nameSpaceController.go:370] NAMESPACE UPDATING: + namespace: [ns-test-namespace/map[app:new-test-namespace update:true]] +I0430 23:31:27.521646 2658 nameSpaceController.go:394] Deleting namespace ns-test-namespace from ipset list ns-app:test-namespace +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-D -exist azure-npm-3308517892 azure-npm-2293040867] +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-X -exist azure-npm-3308517892] +I0430 23:31:27.549611 2658 nameSpaceController.go:411] Adding namespace ns-test-namespace to ipset list ns-app:new-test-namespace +2021/04/30 23:31:27 [2658] Creating List: &{operationFlag:-N name:ns-app:new-test-namespace set:azure-npm-4070642153 spec:[setlist]} +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-4070642153 setlist] +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-A -exist azure-npm-4070642153 azure-npm-2293040867] +I0430 23:31:27.551833 2658 nameSpaceController.go:411] Adding namespace ns-test-namespace to ipset list ns-update +2021/04/30 23:31:27 [2658] Creating List: &{operationFlag:-N name:ns-update set:azure-npm-1460180784 spec:[setlist]} +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-1460180784 setlist] +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-A -exist azure-npm-1460180784 azure-npm-2293040867] +I0430 23:31:27.554128 2658 nameSpaceController.go:411] Adding namespace ns-test-namespace to ipset list ns-update:true +2021/04/30 23:31:27 [2658] Creating List: &{operationFlag:-N name:ns-update:true set:azure-npm-1082004050 spec:[setlist]} +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-1082004050 setlist] +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-A -exist azure-npm-1082004050 azure-npm-2293040867] +I0430 23:31:27.556817 2658 nameSpaceController.go:269] Successfully synced 'test-namespace' + nameSpaceController_test.go:87: Start re-storing ipset to /var/log/ipset-test.conf +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-F -exist] +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-X -exist] +--- PASS: TestAddNamespaceLabel (0.10s) +=== RUN TestAddNamespaceLabelSameRv + nameSpaceController_test.go:79: Start storing ipset to /var/log/ipset-test.conf + nameSpaceController_test.go:104: Calling add namespace event +I0430 23:31:27.592625 2658 nameSpaceController.go:129] [NAMESPACE ADD EVENT] for namespace [test-namespace] +I0430 23:31:27.592709 2658 nameSpaceController.go:370] NAMESPACE UPDATING: + namespace: [ns-test-namespace/map[app:test-namespace]] +I0430 23:31:27.592751 2658 nameSpaceController.go:326] NAMESPACE CREATING: [ns-test-namespace/map[app:test-namespace]] +2021/04/30 23:31:27 [2658] Creating Set: &{operationFlag:-N name:ns-test-namespace set:azure-npm-2293040867 spec:[nethash]} +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-2293040867 nethash] +2021/04/30 23:31:27 [2658] Creating List: &{operationFlag:-N name:all-namespaces set:azure-npm-530439631 spec:[setlist]} +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-530439631 setlist] +I0430 23:31:27.594400 2658 nameSpaceController.go:129] [NAMESPACE UPDATE EVENT] for namespace [test-namespace] +I0430 23:31:27.594442 2658 nameSpaceController.go:155] [NAMESPACE UPDATE EVENT] Resourceversion is same for this namespace [test-namespace] +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-A -exist azure-npm-530439631 azure-npm-2293040867] +I0430 23:31:27.603817 2658 nameSpaceController.go:346] Adding namespace ns-test-namespace to ipset list ns-app +2021/04/30 23:31:27 [2658] Creating List: &{operationFlag:-N name:ns-app set:azure-npm-38964400 spec:[setlist]} +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-38964400 setlist] +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-A -exist azure-npm-38964400 azure-npm-2293040867] +I0430 23:31:27.606698 2658 nameSpaceController.go:353] Adding namespace ns-test-namespace to ipset list ns-app:test-namespace +2021/04/30 23:31:27 [2658] Creating List: &{operationFlag:-N name:ns-app:test-namespace set:azure-npm-3308517892 spec:[setlist]} +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-3308517892 setlist] +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-A -exist azure-npm-3308517892 azure-npm-2293040867] +I0430 23:31:27.609433 2658 nameSpaceController.go:269] Successfully synced 'test-namespace' + nameSpaceController_test.go:115: Complete add namespace event + nameSpaceController_test.go:117: Updating kubeinformer namespace object + nameSpaceController_test.go:120: Calling update namespace event +I0430 23:31:27.609569 2658 nameSpaceController.go:129] [NAMESPACE UPDATE EVENT] for namespace [test-namespace] +I0430 23:31:27.609588 2658 nameSpaceController.go:155] [NAMESPACE UPDATE EVENT] Resourceversion is same for this namespace [test-namespace] + nameSpaceController_test.go:123: Update Namespace: worker queue length is 0 + nameSpaceController_test.go:87: Start re-storing ipset to /var/log/ipset-test.conf +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-F -exist] +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-X -exist] +--- PASS: TestAddNamespaceLabelSameRv (0.04s) +=== RUN TestDeleteandUpdateNamespaceLabel + nameSpaceController_test.go:79: Start storing ipset to /var/log/ipset-test.conf + nameSpaceController_test.go:104: Calling add namespace event +I0430 23:31:27.636088 2658 nameSpaceController.go:129] [NAMESPACE ADD EVENT] for namespace [test-namespace] +I0430 23:31:27.636188 2658 nameSpaceController.go:370] NAMESPACE UPDATING: + namespace: [ns-test-namespace/map[app:old-test-namespace group:test update:true]] +I0430 23:31:27.636276 2658 nameSpaceController.go:326] NAMESPACE CREATING: [ns-test-namespace/map[app:old-test-namespace group:test update:true]] +2021/04/30 23:31:27 [2658] Creating Set: &{operationFlag:-N name:ns-test-namespace set:azure-npm-2293040867 spec:[nethash]} +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-2293040867 nethash] +I0430 23:31:27.636552 2658 nameSpaceController.go:129] [NAMESPACE UPDATE EVENT] for namespace [test-namespace] +I0430 23:31:27.636601 2658 nameSpaceController.go:155] [NAMESPACE UPDATE EVENT] Resourceversion is same for this namespace [test-namespace] +2021/04/30 23:31:27 [2658] Creating List: &{operationFlag:-N name:all-namespaces set:azure-npm-530439631 spec:[setlist]} +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-530439631 setlist] +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-A -exist azure-npm-530439631 azure-npm-2293040867] +I0430 23:31:27.639893 2658 nameSpaceController.go:346] Adding namespace ns-test-namespace to ipset list ns-update +2021/04/30 23:31:27 [2658] Creating List: &{operationFlag:-N name:ns-update set:azure-npm-1460180784 spec:[setlist]} +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-1460180784 setlist] +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-A -exist azure-npm-1460180784 azure-npm-2293040867] +I0430 23:31:27.642381 2658 nameSpaceController.go:353] Adding namespace ns-test-namespace to ipset list ns-update:true +2021/04/30 23:31:27 [2658] Creating List: &{operationFlag:-N name:ns-update:true set:azure-npm-1082004050 spec:[setlist]} +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-1082004050 setlist] +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-A -exist azure-npm-1082004050 azure-npm-2293040867] +I0430 23:31:27.644487 2658 nameSpaceController.go:346] Adding namespace ns-test-namespace to ipset list ns-group +2021/04/30 23:31:27 [2658] Creating List: &{operationFlag:-N name:ns-group set:azure-npm-3501174184 spec:[setlist]} +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-3501174184 setlist] +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-A -exist azure-npm-3501174184 azure-npm-2293040867] +I0430 23:31:27.655049 2658 nameSpaceController.go:353] Adding namespace ns-test-namespace to ipset list ns-group:test +2021/04/30 23:31:27 [2658] Creating List: &{operationFlag:-N name:ns-group:test set:azure-npm-3079734622 spec:[setlist]} +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-3079734622 setlist] +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-A -exist azure-npm-3079734622 azure-npm-2293040867] +I0430 23:31:27.657064 2658 nameSpaceController.go:346] Adding namespace ns-test-namespace to ipset list ns-app +2021/04/30 23:31:27 [2658] Creating List: &{operationFlag:-N name:ns-app set:azure-npm-38964400 spec:[setlist]} +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-38964400 setlist] +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-A -exist azure-npm-38964400 azure-npm-2293040867] +I0430 23:31:27.659011 2658 nameSpaceController.go:353] Adding namespace ns-test-namespace to ipset list ns-app:old-test-namespace +2021/04/30 23:31:27 [2658] Creating List: &{operationFlag:-N name:ns-app:old-test-namespace set:azure-npm-442393800 spec:[setlist]} +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-442393800 setlist] +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-A -exist azure-npm-442393800 azure-npm-2293040867] +I0430 23:31:27.661658 2658 nameSpaceController.go:269] Successfully synced 'test-namespace' + nameSpaceController_test.go:115: Complete add namespace event + nameSpaceController_test.go:117: Updating kubeinformer namespace object + nameSpaceController_test.go:120: Calling update namespace event +I0430 23:31:27.661769 2658 nameSpaceController.go:129] [NAMESPACE UPDATE EVENT] for namespace [test-namespace] +I0430 23:31:27.661809 2658 nameSpaceController.go:370] NAMESPACE UPDATING: + namespace: [ns-test-namespace/map[app:old-test-namespace update:false]] +I0430 23:31:27.661844 2658 nameSpaceController.go:394] Deleting namespace ns-test-namespace from ipset list ns-group +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-D -exist azure-npm-3501174184 azure-npm-2293040867] +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-X -exist azure-npm-3501174184] +I0430 23:31:27.681613 2658 nameSpaceController.go:394] Deleting namespace ns-test-namespace from ipset list ns-group:test +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-D -exist azure-npm-3079734622 azure-npm-2293040867] +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-X -exist azure-npm-3079734622] +I0430 23:31:27.709567 2658 nameSpaceController.go:394] Deleting namespace ns-test-namespace from ipset list ns-update:true +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-D -exist azure-npm-1082004050 azure-npm-2293040867] +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-X -exist azure-npm-1082004050] +I0430 23:31:27.733563 2658 nameSpaceController.go:411] Adding namespace ns-test-namespace to ipset list ns-update:false +2021/04/30 23:31:27 [2658] Creating List: &{operationFlag:-N name:ns-update:false set:azure-npm-250870597 spec:[setlist]} +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-250870597 setlist] +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-A -exist azure-npm-250870597 azure-npm-2293040867] +I0430 23:31:27.735260 2658 nameSpaceController.go:269] Successfully synced 'test-namespace' + nameSpaceController_test.go:87: Start re-storing ipset to /var/log/ipset-test.conf +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-F -exist] +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-X -exist] +--- PASS: TestDeleteandUpdateNamespaceLabel (0.12s) +=== RUN TestNewNameSpaceUpdate + nameSpaceController_test.go:79: Start storing ipset to /var/log/ipset-test.conf + nameSpaceController_test.go:104: Calling add namespace event +I0430 23:31:27.759580 2658 nameSpaceController.go:129] [NAMESPACE ADD EVENT] for namespace [test-namespace] +I0430 23:31:27.759631 2658 nameSpaceController.go:370] NAMESPACE UPDATING: + namespace: [ns-test-namespace/map[app:old-test-namespace group:test update:true]] +I0430 23:31:27.759689 2658 nameSpaceController.go:326] NAMESPACE CREATING: [ns-test-namespace/map[app:old-test-namespace group:test update:true]] +2021/04/30 23:31:27 [2658] Creating Set: &{operationFlag:-N name:ns-test-namespace set:azure-npm-2293040867 spec:[nethash]} +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-2293040867 nethash] +I0430 23:31:27.760110 2658 nameSpaceController.go:129] [NAMESPACE UPDATE EVENT] for namespace [test-namespace] +I0430 23:31:27.760139 2658 nameSpaceController.go:155] [NAMESPACE UPDATE EVENT] Resourceversion is same for this namespace [test-namespace] +2021/04/30 23:31:27 [2658] Creating List: &{operationFlag:-N name:all-namespaces set:azure-npm-530439631 spec:[setlist]} +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-530439631 setlist] +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-A -exist azure-npm-530439631 azure-npm-2293040867] +I0430 23:31:27.762505 2658 nameSpaceController.go:346] Adding namespace ns-test-namespace to ipset list ns-app +2021/04/30 23:31:27 [2658] Creating List: &{operationFlag:-N name:ns-app set:azure-npm-38964400 spec:[setlist]} +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-38964400 setlist] +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-A -exist azure-npm-38964400 azure-npm-2293040867] +I0430 23:31:27.764073 2658 nameSpaceController.go:353] Adding namespace ns-test-namespace to ipset list ns-app:old-test-namespace +2021/04/30 23:31:27 [2658] Creating List: &{operationFlag:-N name:ns-app:old-test-namespace set:azure-npm-442393800 spec:[setlist]} +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-442393800 setlist] +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-A -exist azure-npm-442393800 azure-npm-2293040867] +I0430 23:31:27.765752 2658 nameSpaceController.go:346] Adding namespace ns-test-namespace to ipset list ns-update +2021/04/30 23:31:27 [2658] Creating List: &{operationFlag:-N name:ns-update set:azure-npm-1460180784 spec:[setlist]} +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-1460180784 setlist] +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-A -exist azure-npm-1460180784 azure-npm-2293040867] +I0430 23:31:27.767964 2658 nameSpaceController.go:353] Adding namespace ns-test-namespace to ipset list ns-update:true +2021/04/30 23:31:27 [2658] Creating List: &{operationFlag:-N name:ns-update:true set:azure-npm-1082004050 spec:[setlist]} +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-1082004050 setlist] +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-A -exist azure-npm-1082004050 azure-npm-2293040867] +I0430 23:31:27.769836 2658 nameSpaceController.go:346] Adding namespace ns-test-namespace to ipset list ns-group +2021/04/30 23:31:27 [2658] Creating List: &{operationFlag:-N name:ns-group set:azure-npm-3501174184 spec:[setlist]} +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-3501174184 setlist] +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-A -exist azure-npm-3501174184 azure-npm-2293040867] +I0430 23:31:27.771694 2658 nameSpaceController.go:353] Adding namespace ns-test-namespace to ipset list ns-group:test +2021/04/30 23:31:27 [2658] Creating List: &{operationFlag:-N name:ns-group:test set:azure-npm-3079734622 spec:[setlist]} +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-3079734622 setlist] +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-A -exist azure-npm-3079734622 azure-npm-2293040867] +I0430 23:31:27.773425 2658 nameSpaceController.go:269] Successfully synced 'test-namespace' + nameSpaceController_test.go:115: Complete add namespace event + nameSpaceController_test.go:117: Updating kubeinformer namespace object + nameSpaceController_test.go:120: Calling update namespace event +I0430 23:31:27.773644 2658 nameSpaceController.go:129] [NAMESPACE UPDATE EVENT] for namespace [test-namespace] +I0430 23:31:27.773691 2658 nameSpaceController.go:370] NAMESPACE UPDATING: + namespace: [ns-test-namespace/map[app:old-test-namespace update:false]] +I0430 23:31:27.773756 2658 nameSpaceController.go:394] Deleting namespace ns-test-namespace from ipset list ns-update:true +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-D -exist azure-npm-1082004050 azure-npm-2293040867] +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-X -exist azure-npm-1082004050] +I0430 23:31:27.805570 2658 nameSpaceController.go:394] Deleting namespace ns-test-namespace from ipset list ns-group +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-D -exist azure-npm-3501174184 azure-npm-2293040867] +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-X -exist azure-npm-3501174184] +I0430 23:31:27.825686 2658 nameSpaceController.go:394] Deleting namespace ns-test-namespace from ipset list ns-group:test +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-D -exist azure-npm-3079734622 azure-npm-2293040867] +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-X -exist azure-npm-3079734622] +I0430 23:31:27.845537 2658 nameSpaceController.go:411] Adding namespace ns-test-namespace to ipset list ns-update:false +2021/04/30 23:31:27 [2658] Creating List: &{operationFlag:-N name:ns-update:false set:azure-npm-250870597 spec:[setlist]} +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-250870597 setlist] +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-A -exist azure-npm-250870597 azure-npm-2293040867] +I0430 23:31:27.847505 2658 nameSpaceController.go:269] Successfully synced 'test-namespace' + nameSpaceController_test.go:87: Start re-storing ipset to /var/log/ipset-test.conf +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-F -exist] +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-X -exist] +--- PASS: TestNewNameSpaceUpdate (0.11s) +=== RUN TestDeleteNamespace + nameSpaceController_test.go:79: Start storing ipset to /var/log/ipset-test.conf + nameSpaceController_test.go:104: Calling add namespace event +I0430 23:31:27.867872 2658 nameSpaceController.go:129] [NAMESPACE ADD EVENT] for namespace [test-namespace] +I0430 23:31:27.867933 2658 nameSpaceController.go:370] NAMESPACE UPDATING: + namespace: [ns-test-namespace/map[app:test-namespace]] +I0430 23:31:27.867964 2658 nameSpaceController.go:326] NAMESPACE CREATING: [ns-test-namespace/map[app:test-namespace]] +2021/04/30 23:31:27 [2658] Creating Set: &{operationFlag:-N name:ns-test-namespace set:azure-npm-2293040867 spec:[nethash]} +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-2293040867 nethash] +I0430 23:31:27.868447 2658 nameSpaceController.go:129] [NAMESPACE UPDATE EVENT] for namespace [test-namespace] +I0430 23:31:27.868502 2658 nameSpaceController.go:155] [NAMESPACE UPDATE EVENT] Resourceversion is same for this namespace [test-namespace] +2021/04/30 23:31:27 [2658] Creating List: &{operationFlag:-N name:all-namespaces set:azure-npm-530439631 spec:[setlist]} +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-530439631 setlist] +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-A -exist azure-npm-530439631 azure-npm-2293040867] +I0430 23:31:27.870813 2658 nameSpaceController.go:346] Adding namespace ns-test-namespace to ipset list ns-app +2021/04/30 23:31:27 [2658] Creating List: &{operationFlag:-N name:ns-app set:azure-npm-38964400 spec:[setlist]} +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-38964400 setlist] +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-A -exist azure-npm-38964400 azure-npm-2293040867] +I0430 23:31:27.872659 2658 nameSpaceController.go:353] Adding namespace ns-test-namespace to ipset list ns-app:test-namespace +2021/04/30 23:31:27 [2658] Creating List: &{operationFlag:-N name:ns-app:test-namespace set:azure-npm-3308517892 spec:[setlist]} +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-3308517892 setlist] +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-A -exist azure-npm-3308517892 azure-npm-2293040867] +I0430 23:31:27.874437 2658 nameSpaceController.go:269] Successfully synced 'test-namespace' + nameSpaceController_test.go:131: Complete add namespace event + nameSpaceController_test.go:133: Updating kubeinformer namespace object + nameSpaceController_test.go:136: Calling delete namespace event +I0430 23:31:27.874679 2658 nameSpaceController.go:291] NameSpace test-namespace not found, may be it is deleted +I0430 23:31:27.874715 2658 nameSpaceController.go:435] NAMESPACE DELETING: [ns-test-namespace] +I0430 23:31:27.874749 2658 nameSpaceController.go:442] NAMESPACE DELETING cached labels: [ns-test-namespace/map[app:test-namespace]] +I0430 23:31:27.874805 2658 nameSpaceController.go:449] Deleting namespace ns-test-namespace from ipset list ns-app +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-D -exist azure-npm-38964400 azure-npm-2293040867] +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-X -exist azure-npm-38964400] +I0430 23:31:27.901547 2658 nameSpaceController.go:456] Deleting namespace ns-test-namespace from ipset list ns-app:test-namespace +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-D -exist azure-npm-3308517892 azure-npm-2293040867] +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-X -exist azure-npm-3308517892] +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-D -exist azure-npm-530439631 azure-npm-2293040867] +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-X -exist azure-npm-530439631] +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-X -exist azure-npm-2293040867] +I0430 23:31:27.981625 2658 nameSpaceController.go:269] Successfully synced 'test-namespace' + nameSpaceController_test.go:87: Start re-storing ipset to /var/log/ipset-test.conf +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-F -exist] +2021/04/30 23:31:27 [2658] Executing ipset command ipset [-X -exist] +--- PASS: TestDeleteNamespace (0.16s) +=== RUN TestDeleteNamespaceWithTombstone + nameSpaceController_test.go:79: Start storing ipset to /var/log/ipset-test.conf +I0430 23:31:28.023614 2658 nameSpaceController.go:208] [NAMESPACE DELETE EVENT] Namespace [test-namespace] does not exist in case, so returning + nameSpaceController_test.go:87: Start re-storing ipset to /var/log/ipset-test.conf +2021/04/30 23:31:28 [2658] Executing ipset command ipset [-F -exist] +2021/04/30 23:31:28 [2658] Executing ipset command ipset [-X -exist] +--- PASS: TestDeleteNamespaceWithTombstone (0.03s) +=== RUN TestDeleteNamespaceWithTombstoneAfterAddingNameSpace + nameSpaceController_test.go:104: Calling add namespace event +I0430 23:31:28.050863 2658 nameSpaceController.go:129] [NAMESPACE ADD EVENT] for namespace [test-namespace] +I0430 23:31:28.050938 2658 nameSpaceController.go:370] NAMESPACE UPDATING: + namespace: [ns-test-namespace/map[app:test-namespace]] +I0430 23:31:28.050971 2658 nameSpaceController.go:326] NAMESPACE CREATING: [ns-test-namespace/map[app:test-namespace]] +2021/04/30 23:31:28 [2658] Creating Set: &{operationFlag:-N name:ns-test-namespace set:azure-npm-2293040867 spec:[nethash]} +2021/04/30 23:31:28 [2658] Executing ipset command ipset [-N -exist azure-npm-2293040867 nethash] +I0430 23:31:28.052055 2658 nameSpaceController.go:129] [NAMESPACE UPDATE EVENT] for namespace [test-namespace] +I0430 23:31:28.052090 2658 nameSpaceController.go:155] [NAMESPACE UPDATE EVENT] Resourceversion is same for this namespace [test-namespace] +2021/04/30 23:31:28 [2658] Creating List: &{operationFlag:-N name:all-namespaces set:azure-npm-530439631 spec:[setlist]} +2021/04/30 23:31:28 [2658] Executing ipset command ipset [-N -exist azure-npm-530439631 setlist] +2021/04/30 23:31:28 [2658] Executing ipset command ipset [-A -exist azure-npm-530439631 azure-npm-2293040867] +I0430 23:31:28.081487 2658 nameSpaceController.go:346] Adding namespace ns-test-namespace to ipset list ns-app +2021/04/30 23:31:28 [2658] Creating List: &{operationFlag:-N name:ns-app set:azure-npm-38964400 spec:[setlist]} +2021/04/30 23:31:28 [2658] Executing ipset command ipset [-N -exist azure-npm-38964400 setlist] +2021/04/30 23:31:28 [2658] Executing ipset command ipset [-A -exist azure-npm-38964400 azure-npm-2293040867] +I0430 23:31:28.092469 2658 nameSpaceController.go:353] Adding namespace ns-test-namespace to ipset list ns-app:test-namespace +2021/04/30 23:31:28 [2658] Creating List: &{operationFlag:-N name:ns-app:test-namespace set:azure-npm-3308517892 spec:[setlist]} +2021/04/30 23:31:28 [2658] Executing ipset command ipset [-N -exist azure-npm-3308517892 setlist] +2021/04/30 23:31:28 [2658] Executing ipset command ipset [-A -exist azure-npm-3308517892 azure-npm-2293040867] +I0430 23:31:28.101060 2658 nameSpaceController.go:269] Successfully synced 'test-namespace' + nameSpaceController_test.go:131: Complete add namespace event + nameSpaceController_test.go:133: Updating kubeinformer namespace object + nameSpaceController_test.go:136: Calling delete namespace event +I0430 23:31:28.101336 2658 nameSpaceController.go:291] NameSpace test-namespace not found, may be it is deleted +I0430 23:31:28.101376 2658 nameSpaceController.go:435] NAMESPACE DELETING: [ns-test-namespace] +I0430 23:31:28.101411 2658 nameSpaceController.go:442] NAMESPACE DELETING cached labels: [ns-test-namespace/map[app:test-namespace]] +I0430 23:31:28.101458 2658 nameSpaceController.go:449] Deleting namespace ns-test-namespace from ipset list ns-app +2021/04/30 23:31:28 [2658] Executing ipset command ipset [-D -exist azure-npm-38964400 azure-npm-2293040867] +2021/04/30 23:31:28 [2658] Executing ipset command ipset [-X -exist azure-npm-38964400] +I0430 23:31:28.141600 2658 nameSpaceController.go:456] Deleting namespace ns-test-namespace from ipset list ns-app:test-namespace +2021/04/30 23:31:28 [2658] Executing ipset command ipset [-D -exist azure-npm-3308517892 azure-npm-2293040867] +2021/04/30 23:31:28 [2658] Executing ipset command ipset [-X -exist azure-npm-3308517892] +2021/04/30 23:31:28 [2658] Executing ipset command ipset [-D -exist azure-npm-530439631 azure-npm-2293040867] +2021/04/30 23:31:28 [2658] Executing ipset command ipset [-X -exist azure-npm-530439631] +2021/04/30 23:31:28 [2658] Executing ipset command ipset [-X -exist azure-npm-2293040867] +I0430 23:31:28.241754 2658 nameSpaceController.go:269] Successfully synced 'test-namespace' +--- PASS: TestDeleteNamespaceWithTombstoneAfterAddingNameSpace (0.19s) +=== RUN TestGetNamespaceObjFromNsObj +--- PASS: TestGetNamespaceObjFromNsObj (0.00s) +=== RUN TestIsSystemNs +--- PASS: TestIsSystemNs (0.00s) +=== RUN TestAddMultipleNetworkPolicies +2021/04/30 23:31:28 [2658] Error creating metric num_policies +2021/04/30 23:31:28 [2658] Error creating metric add_policy_exec_time +2021/04/30 23:31:28 [2658] Error creating metric num_iptables_rules +2021/04/30 23:31:28 [2658] Error creating metric add_iptables_rule_exec_time +2021/04/30 23:31:28 [2658] Error creating metric num_ipsets +2021/04/30 23:31:28 [2658] Error creating metric add_ipset_exec_time +2021/04/30 23:31:28 [2658] Error creating metric num_ipset_entries +2021/04/30 23:31:28 [2658] Error creating metric ipset_counts +2021/04/30 23:31:28 [2658] Finished initializing all Prometheus metrics +2021/04/30 23:31:28 [2658] Creating Set: &{operationFlag:-N name:kube-system set:azure-npm-2725615454 spec:[nethash]} +2021/04/30 23:31:28 [2658] Executing ipset command ipset [-N -exist azure-npm-2725615454 nethash] +2021/04/30 23:31:28 [2658] Initializing AZURE-NPM chains. +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-ACCEPT] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-INGRESS] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-EGRESS] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-INGRESS-PORT] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-INGRESS-FROM] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-EGRESS-PORT] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-EGRESS-TO] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-INGRESS-DROPS] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-EGRESS-DROPS] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -I FORWARD 1 -j AZURE-NPM] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM -j AZURE-NPM-INGRESS] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM -j AZURE-NPM-EGRESS] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM -j AZURE-NPM-ACCEPT -m mark --mark 0x3000 -m comment --comment ACCEPT-on-INGRESS-and-EGRESS-mark-0x3000] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM -j AZURE-NPM-ACCEPT -m mark --mark 0x2000 -m comment --comment ACCEPT-on-INGRESS-mark-0x2000] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM -j AZURE-NPM-ACCEPT -m mark --mark 0x1000 -m comment --comment ACCEPT-on-EGRESS-mark-0x1000] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM -m state --state RELATED,ESTABLISHED -j ACCEPT -m comment --comment ACCEPT-on-connection-state] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-ACCEPT -j MARK --set-mark 0x0 -m comment --comment Clear-AZURE-NPM-MARKS] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-ACCEPT -j ACCEPT -m comment --comment ACCEPT-All-packets] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS -j AZURE-NPM-INGRESS-PORT] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS -j RETURN -m mark --mark 0x2000 -m comment --comment RETURN-on-INGRESS-mark-0x2000] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS -j AZURE-NPM-INGRESS-DROPS] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS-PORT -j RETURN -m mark --mark 0x2000 -m comment --comment RETURN-on-INGRESS-mark-0x2000] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS-FROM -j RETURN -m mark --mark 0x2000 -m comment --comment RETURN-on-INGRESS-mark-0x2000] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS -j AZURE-NPM-EGRESS-PORT] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS -j RETURN -m mark --mark 0x3000 -m comment --comment RETURN-on-EGRESS-and-INGRESS-mark-0x3000] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS -j RETURN -m mark --mark 0x1000 -m comment --comment RETURN-on-EGRESS-mark-0x1000] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS -j AZURE-NPM-EGRESS-DROPS] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS-PORT -j RETURN -m mark --mark 0x3000 -m comment --comment RETURN-on-EGRESS-and-INGRESS-mark-0x3000] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS-PORT -j RETURN -m mark --mark 0x1000 -m comment --comment RETURN-on-EGRESS-mark-0x1000] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS-TO -j RETURN -m mark --mark 0x3000 -m comment --comment RETURN-on-EGRESS-and-INGRESS-mark-0x3000] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS-TO -j RETURN -m mark --mark 0x1000 -m comment --comment RETURN-on-EGRESS-mark-0x1000] +2021/04/30 23:31:28 [2658] started parsing ingress rule +2021/04/30 23:31:28 [2658] finished parsing ingress rule +2021/04/30 23:31:28 [2658] started parsing egress rule +2021/04/30 23:31:28 [2658] finished parsing egress rule +2021/04/30 23:31:28 [2658] Finished translatePolicy +2021/04/30 23:31:28 [2658] sets: [ns-test-nwpolicy app:test ns-test-nwpolicy app:test] +2021/04/30 23:31:28 [2658] lists: [] +2021/04/30 23:31:28 [2658] entries: +2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-3260345197 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-allow-ingress-in-ns-test-nwpolicy-0in-AND-TCP-PORT-8000-TO-ns-test-nwpolicy]} +2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-8000-TO-ns-test-nwpolicy]} +2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS]} +2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-0-FROM-ns-test-nwpolicy]} +2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS]} +2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -j DROP -m comment --comment DROP-ALL-TO-ns-test-nwpolicy]} +2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 src -j DROP -m comment --comment DROP-ALL-FROM-ns-test-nwpolicy]} +I0430 23:31:28.353059 2658 networkPolicyController.go:343] Creating set: ns-test-nwpolicy, hashedSet: azure-npm-806075013 +2021/04/30 23:31:28 [2658] Creating Set: &{operationFlag:-N name:ns-test-nwpolicy set:azure-npm-806075013 spec:[nethash]} +2021/04/30 23:31:28 [2658] Executing ipset command ipset [-N -exist azure-npm-806075013 nethash] +I0430 23:31:28.354150 2658 networkPolicyController.go:343] Creating set: app:test, hashedSet: azure-npm-2817129730 +2021/04/30 23:31:28 [2658] Creating Set: &{operationFlag:-N name:app:test set:azure-npm-2817129730 spec:[nethash]} +2021/04/30 23:31:28 [2658] Executing ipset command ipset [-N -exist azure-npm-2817129730 nethash] +I0430 23:31:28.354993 2658 networkPolicyController.go:349] Creating set: namedport:0, hashedSet: azure-npm-1468440115 +2021/04/30 23:31:28 [2658] Creating Set: &{operationFlag:-N name:namedport:0 set:azure-npm-1468440115 spec:[hash:ip,port]} +2021/04/30 23:31:28 [2658] Executing ipset command ipset [-N -exist azure-npm-1468440115 hash:ip,port] +I0430 23:31:28.358490 2658 networkPolicyController.go:436] Creating set: allow-ingress-in-ns-test-nwpolicy-0in, hashedSet: azure-npm-3260345197 +2021/04/30 23:31:28 [2658] Creating Set: &{operationFlag:-N name:allow-ingress-in-ns-test-nwpolicy-0in set:azure-npm-3260345197 spec:[nethash maxelem 4294967295]} +2021/04/30 23:31:28 [2658] Executing ipset command ipset [-N -exist azure-npm-3260345197 nethash maxelem 4294967295] +2021/04/30 23:31:28 [2658] Executing ipset command ipset [-A -exist azure-npm-3260345197 1.0.0.0/1] +2021/04/30 23:31:28 [2658] Executing ipset command ipset [-A -exist azure-npm-3260345197 128.0.0.0/1] +I0430 23:31:28.363706 2658 networkPolicyController.go:436] Creating set: allow-ingress-in-ns-test-nwpolicy-0out, hashedSet: azure-npm-3481675862 +2021/04/30 23:31:28 [2658] Creating Set: &{operationFlag:-N name:allow-ingress-in-ns-test-nwpolicy-0out set:azure-npm-3481675862 spec:[nethash maxelem 4294967295]} +2021/04/30 23:31:28 [2658] Executing ipset command ipset [-N -exist azure-npm-3481675862 nethash maxelem 4294967295] +2021/04/30 23:31:28 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-3260345197 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-allow-ingress-in-ns-test-nwpolicy-0in-AND-TCP-PORT-8000-TO-ns-test-nwpolicy]}. +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-INGRESS-PORT -m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-3260345197 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-allow-ingress-in-ns-test-nwpolicy-0in-AND-TCP-PORT-8000-TO-ns-test-nwpolicy] +2021/04/30 23:31:28 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-8000-TO-ns-test-nwpolicy]}. +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-INGRESS-PORT -m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-8000-TO-ns-test-nwpolicy] +2021/04/30 23:31:28 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS]}. +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS-PORT -m set --match-set azure-npm-806075013 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS] +2021/04/30 23:31:28 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-0-FROM-ns-test-nwpolicy]}. +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-EGRESS-PORT -m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-0-FROM-ns-test-nwpolicy] +2021/04/30 23:31:28 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS]}. +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS-PORT -m set --match-set azure-npm-806075013 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS] +2021/04/30 23:31:28 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -j DROP -m comment --comment DROP-ALL-TO-ns-test-nwpolicy]}. +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-INGRESS-DROPS -m set --match-set azure-npm-806075013 dst -j DROP -m comment --comment DROP-ALL-TO-ns-test-nwpolicy] +2021/04/30 23:31:28 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 src -j DROP -m comment --comment DROP-ALL-FROM-ns-test-nwpolicy]}. +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-EGRESS-DROPS -m set --match-set azure-npm-806075013 src -j DROP -m comment --comment DROP-ALL-FROM-ns-test-nwpolicy] +I0430 23:31:28.374417 2658 networkPolicyController.go:216] Successfully synced 'test-nwpolicy/allow-ingress' +2021/04/30 23:31:28 [2658] started parsing ingress rule +2021/04/30 23:31:28 [2658] finished parsing ingress rule +2021/04/30 23:31:28 [2658] started parsing egress rule +2021/04/30 23:31:28 [2658] finished parsing egress rule +2021/04/30 23:31:28 [2658] Finished translatePolicy +2021/04/30 23:31:28 [2658] sets: [ns-test-nwpolicy-new app:test ns-test-nwpolicy-new app:test] +2021/04/30 23:31:28 [2658] lists: [] +2021/04/30 23:31:28 [2658] entries: +2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-4288785846 dst -m set --match-set azure-npm-1835913541 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x2000 -m comment --comment ALLOW-allow-ingress-new-in-ns-test-nwpolicy-new-0in-AND-TCP-PORT-0-TO-ns-test-nwpolicy-new]} +2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-4288785846 dst -m set --match-set azure-npm-4288785846 src -m set --match-set azure-npm-2817129730 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-new-AND-TCP-PORT-0-TO-ns-test-nwpolicy-new]} +2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-4288785846 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-ns-test-nwpolicy-new-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS]} +2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-4288785846 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-4288785846 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-new-AND-TCP-PORT-0-FROM-ns-test-nwpolicy-new]} +2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-4288785846 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-ns-test-nwpolicy-new-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS]} +2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-4288785846 dst -j DROP -m comment --comment DROP-ALL-TO-ns-test-nwpolicy-new]} +2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-4288785846 src -j DROP -m comment --comment DROP-ALL-FROM-ns-test-nwpolicy-new]} +I0430 23:31:28.375898 2658 networkPolicyController.go:343] Creating set: ns-test-nwpolicy-new, hashedSet: azure-npm-4288785846 +2021/04/30 23:31:28 [2658] Creating Set: &{operationFlag:-N name:ns-test-nwpolicy-new set:azure-npm-4288785846 spec:[nethash]} +2021/04/30 23:31:28 [2658] Executing ipset command ipset [-N -exist azure-npm-4288785846 nethash] +I0430 23:31:28.376890 2658 networkPolicyController.go:343] Creating set: app:test, hashedSet: azure-npm-2817129730 +I0430 23:31:28.376949 2658 networkPolicyController.go:349] Creating set: namedport:0, hashedSet: azure-npm-1468440115 +I0430 23:31:28.376973 2658 networkPolicyController.go:436] Creating set: allow-ingress-new-in-ns-test-nwpolicy-new-0in, hashedSet: azure-npm-1835913541 +2021/04/30 23:31:28 [2658] Creating Set: &{operationFlag:-N name:allow-ingress-new-in-ns-test-nwpolicy-new-0in set:azure-npm-1835913541 spec:[nethash maxelem 4294967295]} +2021/04/30 23:31:28 [2658] Executing ipset command ipset [-N -exist azure-npm-1835913541 nethash maxelem 4294967295] +2021/04/30 23:31:28 [2658] Executing ipset command ipset [-A -exist azure-npm-1835913541 1.0.0.0/1] +2021/04/30 23:31:28 [2658] Executing ipset command ipset [-A -exist azure-npm-1835913541 128.0.0.0/1] +I0430 23:31:28.379772 2658 networkPolicyController.go:436] Creating set: allow-ingress-new-in-ns-test-nwpolicy-new-0out, hashedSet: azure-npm-1613714382 +2021/04/30 23:31:28 [2658] Creating Set: &{operationFlag:-N name:allow-ingress-new-in-ns-test-nwpolicy-new-0out set:azure-npm-1613714382 spec:[nethash maxelem 4294967295]} +2021/04/30 23:31:28 [2658] Executing ipset command ipset [-N -exist azure-npm-1613714382 nethash maxelem 4294967295] +2021/04/30 23:31:28 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-4288785846 dst -m set --match-set azure-npm-1835913541 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x2000 -m comment --comment ALLOW-allow-ingress-new-in-ns-test-nwpolicy-new-0in-AND-TCP-PORT-0-TO-ns-test-nwpolicy-new]}. +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-INGRESS-PORT -m set --match-set azure-npm-4288785846 dst -m set --match-set azure-npm-1835913541 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x2000 -m comment --comment ALLOW-allow-ingress-new-in-ns-test-nwpolicy-new-0in-AND-TCP-PORT-0-TO-ns-test-nwpolicy-new] +2021/04/30 23:31:28 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-4288785846 dst -m set --match-set azure-npm-4288785846 src -m set --match-set azure-npm-2817129730 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-new-AND-TCP-PORT-0-TO-ns-test-nwpolicy-new]}. +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-INGRESS-PORT -m set --match-set azure-npm-4288785846 dst -m set --match-set azure-npm-4288785846 src -m set --match-set azure-npm-2817129730 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-new-AND-TCP-PORT-0-TO-ns-test-nwpolicy-new] +2021/04/30 23:31:28 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-4288785846 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-ns-test-nwpolicy-new-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS]}. +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS-PORT -m set --match-set azure-npm-4288785846 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-ns-test-nwpolicy-new-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS] +2021/04/30 23:31:28 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-4288785846 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-4288785846 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-new-AND-TCP-PORT-0-FROM-ns-test-nwpolicy-new]}. +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-EGRESS-PORT -m set --match-set azure-npm-4288785846 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-4288785846 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-new-AND-TCP-PORT-0-FROM-ns-test-nwpolicy-new] +2021/04/30 23:31:28 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-4288785846 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-ns-test-nwpolicy-new-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS]}. +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS-PORT -m set --match-set azure-npm-4288785846 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-ns-test-nwpolicy-new-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS] +2021/04/30 23:31:28 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-4288785846 dst -j DROP -m comment --comment DROP-ALL-TO-ns-test-nwpolicy-new]}. +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-INGRESS-DROPS -m set --match-set azure-npm-4288785846 dst -j DROP -m comment --comment DROP-ALL-TO-ns-test-nwpolicy-new] +2021/04/30 23:31:28 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-4288785846 src -j DROP -m comment --comment DROP-ALL-FROM-ns-test-nwpolicy-new]}. +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-EGRESS-DROPS -m set --match-set azure-npm-4288785846 src -j DROP -m comment --comment DROP-ALL-FROM-ns-test-nwpolicy-new] +I0430 23:31:28.389385 2658 networkPolicyController.go:216] Successfully synced 'test-nwpolicy-new/allow-ingress-new' +--- PASS: TestAddMultipleNetworkPolicies (0.15s) +=== RUN TestAddNetworkPolicy +2021/04/30 23:31:28 [2658] Error creating metric num_policies +2021/04/30 23:31:28 [2658] Error creating metric add_policy_exec_time +2021/04/30 23:31:28 [2658] Error creating metric num_iptables_rules +2021/04/30 23:31:28 [2658] Error creating metric add_iptables_rule_exec_time +2021/04/30 23:31:28 [2658] Error creating metric num_ipsets +2021/04/30 23:31:28 [2658] Error creating metric add_ipset_exec_time +2021/04/30 23:31:28 [2658] Error creating metric num_ipset_entries +2021/04/30 23:31:28 [2658] Error creating metric ipset_counts +2021/04/30 23:31:28 [2658] Finished initializing all Prometheus metrics +2021/04/30 23:31:28 [2658] Creating Set: &{operationFlag:-N name:kube-system set:azure-npm-2725615454 spec:[nethash]} +2021/04/30 23:31:28 [2658] Executing ipset command ipset [-N -exist azure-npm-2725615454 nethash] +2021/04/30 23:31:28 [2658] Initializing AZURE-NPM chains. +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-ACCEPT] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-INGRESS] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-EGRESS] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-INGRESS-PORT] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-INGRESS-FROM] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-EGRESS-PORT] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-EGRESS-TO] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-INGRESS-DROPS] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-EGRESS-DROPS] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM] +2021/04/30 23:31:28 [2658] started parsing ingress rule +2021/04/30 23:31:28 [2658] finished parsing ingress rule +2021/04/30 23:31:28 [2658] started parsing egress rule +2021/04/30 23:31:28 [2658] finished parsing egress rule +2021/04/30 23:31:28 [2658] Finished translatePolicy +2021/04/30 23:31:28 [2658] sets: [ns-test-nwpolicy app:test ns-test-nwpolicy app:test] +2021/04/30 23:31:28 [2658] lists: [] +2021/04/30 23:31:28 [2658] entries: +2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-3260345197 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-allow-ingress-in-ns-test-nwpolicy-0in-AND-TCP-PORT-8000-TO-ns-test-nwpolicy]} +2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-8000-TO-ns-test-nwpolicy]} +2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS]} +2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-0-FROM-ns-test-nwpolicy]} +2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS]} +2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -j DROP -m comment --comment DROP-ALL-TO-ns-test-nwpolicy]} +2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 src -j DROP -m comment --comment DROP-ALL-FROM-ns-test-nwpolicy]} +I0430 23:31:28.448248 2658 networkPolicyController.go:343] Creating set: ns-test-nwpolicy, hashedSet: azure-npm-806075013 +2021/04/30 23:31:28 [2658] Creating Set: &{operationFlag:-N name:ns-test-nwpolicy set:azure-npm-806075013 spec:[nethash]} +2021/04/30 23:31:28 [2658] Executing ipset command ipset [-N -exist azure-npm-806075013 nethash] +I0430 23:31:28.449171 2658 networkPolicyController.go:343] Creating set: app:test, hashedSet: azure-npm-2817129730 +2021/04/30 23:31:28 [2658] Creating Set: &{operationFlag:-N name:app:test set:azure-npm-2817129730 spec:[nethash]} +2021/04/30 23:31:28 [2658] Executing ipset command ipset [-N -exist azure-npm-2817129730 nethash] +I0430 23:31:28.450103 2658 networkPolicyController.go:349] Creating set: namedport:0, hashedSet: azure-npm-1468440115 +2021/04/30 23:31:28 [2658] Creating Set: &{operationFlag:-N name:namedport:0 set:azure-npm-1468440115 spec:[hash:ip,port]} +2021/04/30 23:31:28 [2658] Executing ipset command ipset [-N -exist azure-npm-1468440115 hash:ip,port] +I0430 23:31:28.450967 2658 networkPolicyController.go:436] Creating set: allow-ingress-in-ns-test-nwpolicy-0in, hashedSet: azure-npm-3260345197 +2021/04/30 23:31:28 [2658] Creating Set: &{operationFlag:-N name:allow-ingress-in-ns-test-nwpolicy-0in set:azure-npm-3260345197 spec:[nethash maxelem 4294967295]} +2021/04/30 23:31:28 [2658] Executing ipset command ipset [-N -exist azure-npm-3260345197 nethash maxelem 4294967295] +2021/04/30 23:31:28 [2658] Executing ipset command ipset [-A -exist azure-npm-3260345197 1.0.0.0/1] +2021/04/30 23:31:28 [2658] Executing ipset command ipset [-A -exist azure-npm-3260345197 128.0.0.0/1] +I0430 23:31:28.453717 2658 networkPolicyController.go:436] Creating set: allow-ingress-in-ns-test-nwpolicy-0out, hashedSet: azure-npm-3481675862 +2021/04/30 23:31:28 [2658] Creating Set: &{operationFlag:-N name:allow-ingress-in-ns-test-nwpolicy-0out set:azure-npm-3481675862 spec:[nethash maxelem 4294967295]} +2021/04/30 23:31:28 [2658] Executing ipset command ipset [-N -exist azure-npm-3481675862 nethash maxelem 4294967295] +2021/04/30 23:31:28 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-3260345197 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-allow-ingress-in-ns-test-nwpolicy-0in-AND-TCP-PORT-8000-TO-ns-test-nwpolicy]}. +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-INGRESS-PORT -m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-3260345197 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-allow-ingress-in-ns-test-nwpolicy-0in-AND-TCP-PORT-8000-TO-ns-test-nwpolicy] +2021/04/30 23:31:28 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-8000-TO-ns-test-nwpolicy]}. +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-INGRESS-PORT -m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-8000-TO-ns-test-nwpolicy] +2021/04/30 23:31:28 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS]}. +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS-PORT -m set --match-set azure-npm-806075013 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS] +2021/04/30 23:31:28 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-0-FROM-ns-test-nwpolicy]}. +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-EGRESS-PORT -m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-0-FROM-ns-test-nwpolicy] +2021/04/30 23:31:28 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS]}. +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS-PORT -m set --match-set azure-npm-806075013 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS] +2021/04/30 23:31:28 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -j DROP -m comment --comment DROP-ALL-TO-ns-test-nwpolicy]}. +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-INGRESS-DROPS -m set --match-set azure-npm-806075013 dst -j DROP -m comment --comment DROP-ALL-TO-ns-test-nwpolicy] +2021/04/30 23:31:28 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 src -j DROP -m comment --comment DROP-ALL-FROM-ns-test-nwpolicy]}. +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-EGRESS-DROPS -m set --match-set azure-npm-806075013 src -j DROP -m comment --comment DROP-ALL-FROM-ns-test-nwpolicy] +I0430 23:31:28.471876 2658 networkPolicyController.go:216] Successfully synced 'test-nwpolicy/allow-ingress' +--- PASS: TestAddNetworkPolicy (0.08s) +=== RUN TestDeleteNetworkPolicy +2021/04/30 23:31:28 [2658] Error creating metric num_policies +2021/04/30 23:31:28 [2658] Error creating metric add_policy_exec_time +2021/04/30 23:31:28 [2658] Error creating metric num_iptables_rules +2021/04/30 23:31:28 [2658] Error creating metric add_iptables_rule_exec_time +2021/04/30 23:31:28 [2658] Error creating metric num_ipsets +2021/04/30 23:31:28 [2658] Error creating metric add_ipset_exec_time +2021/04/30 23:31:28 [2658] Error creating metric num_ipset_entries +2021/04/30 23:31:28 [2658] Error creating metric ipset_counts +2021/04/30 23:31:28 [2658] Finished initializing all Prometheus metrics +2021/04/30 23:31:28 [2658] Creating Set: &{operationFlag:-N name:kube-system set:azure-npm-2725615454 spec:[nethash]} +2021/04/30 23:31:28 [2658] Executing ipset command ipset [-N -exist azure-npm-2725615454 nethash] +2021/04/30 23:31:28 [2658] Initializing AZURE-NPM chains. +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-ACCEPT] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-INGRESS] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-EGRESS] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-INGRESS-PORT] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-INGRESS-FROM] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-EGRESS-PORT] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-EGRESS-TO] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-INGRESS-DROPS] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-EGRESS-DROPS] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM] +2021/04/30 23:31:28 [2658] started parsing ingress rule +2021/04/30 23:31:28 [2658] finished parsing ingress rule +2021/04/30 23:31:28 [2658] started parsing egress rule +2021/04/30 23:31:28 [2658] finished parsing egress rule +2021/04/30 23:31:28 [2658] Finished translatePolicy +2021/04/30 23:31:28 [2658] sets: [ns-test-nwpolicy app:test ns-test-nwpolicy app:test] +2021/04/30 23:31:28 [2658] lists: [] +2021/04/30 23:31:28 [2658] entries: +2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-3260345197 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-allow-ingress-in-ns-test-nwpolicy-0in-AND-TCP-PORT-8000-TO-ns-test-nwpolicy]} +2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-8000-TO-ns-test-nwpolicy]} +2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS]} +2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-0-FROM-ns-test-nwpolicy]} +2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS]} +2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -j DROP -m comment --comment DROP-ALL-TO-ns-test-nwpolicy]} +2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 src -j DROP -m comment --comment DROP-ALL-FROM-ns-test-nwpolicy]} +I0430 23:31:28.556005 2658 networkPolicyController.go:343] Creating set: ns-test-nwpolicy, hashedSet: azure-npm-806075013 +2021/04/30 23:31:28 [2658] Creating Set: &{operationFlag:-N name:ns-test-nwpolicy set:azure-npm-806075013 spec:[nethash]} +2021/04/30 23:31:28 [2658] Executing ipset command ipset [-N -exist azure-npm-806075013 nethash] +I0430 23:31:28.557974 2658 networkPolicyController.go:343] Creating set: app:test, hashedSet: azure-npm-2817129730 +2021/04/30 23:31:28 [2658] Creating Set: &{operationFlag:-N name:app:test set:azure-npm-2817129730 spec:[nethash]} +2021/04/30 23:31:28 [2658] Executing ipset command ipset [-N -exist azure-npm-2817129730 nethash] +I0430 23:31:28.562259 2658 networkPolicyController.go:349] Creating set: namedport:0, hashedSet: azure-npm-1468440115 +2021/04/30 23:31:28 [2658] Creating Set: &{operationFlag:-N name:namedport:0 set:azure-npm-1468440115 spec:[hash:ip,port]} +2021/04/30 23:31:28 [2658] Executing ipset command ipset [-N -exist azure-npm-1468440115 hash:ip,port] +I0430 23:31:28.563727 2658 networkPolicyController.go:436] Creating set: allow-ingress-in-ns-test-nwpolicy-0in, hashedSet: azure-npm-3260345197 +2021/04/30 23:31:28 [2658] Creating Set: &{operationFlag:-N name:allow-ingress-in-ns-test-nwpolicy-0in set:azure-npm-3260345197 spec:[nethash maxelem 4294967295]} +2021/04/30 23:31:28 [2658] Executing ipset command ipset [-N -exist azure-npm-3260345197 nethash maxelem 4294967295] +2021/04/30 23:31:28 [2658] Executing ipset command ipset [-A -exist azure-npm-3260345197 1.0.0.0/1] +2021/04/30 23:31:28 [2658] Executing ipset command ipset [-A -exist azure-npm-3260345197 128.0.0.0/1] +I0430 23:31:28.568675 2658 networkPolicyController.go:436] Creating set: allow-ingress-in-ns-test-nwpolicy-0out, hashedSet: azure-npm-3481675862 +2021/04/30 23:31:28 [2658] Creating Set: &{operationFlag:-N name:allow-ingress-in-ns-test-nwpolicy-0out set:azure-npm-3481675862 spec:[nethash maxelem 4294967295]} +2021/04/30 23:31:28 [2658] Executing ipset command ipset [-N -exist azure-npm-3481675862 nethash maxelem 4294967295] +2021/04/30 23:31:28 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-3260345197 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-allow-ingress-in-ns-test-nwpolicy-0in-AND-TCP-PORT-8000-TO-ns-test-nwpolicy]}. +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-INGRESS-PORT -m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-3260345197 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-allow-ingress-in-ns-test-nwpolicy-0in-AND-TCP-PORT-8000-TO-ns-test-nwpolicy] +2021/04/30 23:31:28 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-8000-TO-ns-test-nwpolicy]}. +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-INGRESS-PORT -m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-8000-TO-ns-test-nwpolicy] +2021/04/30 23:31:28 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS]}. +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS-PORT -m set --match-set azure-npm-806075013 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS] +2021/04/30 23:31:28 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-0-FROM-ns-test-nwpolicy]}. +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-EGRESS-PORT -m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-0-FROM-ns-test-nwpolicy] +2021/04/30 23:31:28 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS]}. +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS-PORT -m set --match-set azure-npm-806075013 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS] +2021/04/30 23:31:28 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -j DROP -m comment --comment DROP-ALL-TO-ns-test-nwpolicy]}. +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-INGRESS-DROPS -m set --match-set azure-npm-806075013 dst -j DROP -m comment --comment DROP-ALL-TO-ns-test-nwpolicy] +2021/04/30 23:31:28 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 src -j DROP -m comment --comment DROP-ALL-FROM-ns-test-nwpolicy]}. +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-EGRESS-DROPS -m set --match-set azure-npm-806075013 src -j DROP -m comment --comment DROP-ALL-FROM-ns-test-nwpolicy] +I0430 23:31:28.585795 2658 networkPolicyController.go:216] Successfully synced 'test-nwpolicy/allow-ingress' + networkPolicyController_test.go:172: Complete adding network policy event +I0430 23:31:28.586015 2658 networkPolicyController.go:247] Network Policy test-nwpolicy/allow-ingress is not found, may be it is deleted +2021/04/30 23:31:28 [2658] started parsing ingress rule +2021/04/30 23:31:28 [2658] finished parsing ingress rule +2021/04/30 23:31:28 [2658] started parsing egress rule +2021/04/30 23:31:28 [2658] finished parsing egress rule +2021/04/30 23:31:28 [2658] Finished translatePolicy +2021/04/30 23:31:28 [2658] sets: [ns-test-nwpolicy app:test ns-test-nwpolicy app:test] +2021/04/30 23:31:28 [2658] lists: [] +2021/04/30 23:31:28 [2658] entries: +2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-3260345197 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-allow-ingress-in-ns-test-nwpolicy-0in-AND-TCP-PORT-8000-TO-ns-test-nwpolicy]} +2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-8000-TO-ns-test-nwpolicy]} +2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS]} +2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-0-FROM-ns-test-nwpolicy]} +2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS]} +2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -j DROP -m comment --comment DROP-ALL-TO-ns-test-nwpolicy]} +2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 src -j DROP -m comment --comment DROP-ALL-FROM-ns-test-nwpolicy]} +2021/04/30 23:31:28 [2658] Deleting iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-3260345197 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-allow-ingress-in-ns-test-nwpolicy-0in-AND-TCP-PORT-8000-TO-ns-test-nwpolicy]} +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -D AZURE-NPM-INGRESS-PORT -m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-3260345197 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-allow-ingress-in-ns-test-nwpolicy-0in-AND-TCP-PORT-8000-TO-ns-test-nwpolicy] +2021/04/30 23:31:28 [2658] Deleting iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-8000-TO-ns-test-nwpolicy]} +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -D AZURE-NPM-INGRESS-PORT -m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-8000-TO-ns-test-nwpolicy] +2021/04/30 23:31:28 [2658] Deleting iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS]} +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -D AZURE-NPM-INGRESS-PORT -m set --match-set azure-npm-806075013 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS] +2021/04/30 23:31:28 [2658] Deleting iptables entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-0-FROM-ns-test-nwpolicy]} +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -D AZURE-NPM-EGRESS-PORT -m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-0-FROM-ns-test-nwpolicy] +2021/04/30 23:31:28 [2658] Deleting iptables entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS]} +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -D AZURE-NPM-EGRESS-PORT -m set --match-set azure-npm-806075013 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS] +2021/04/30 23:31:28 [2658] Deleting iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -j DROP -m comment --comment DROP-ALL-TO-ns-test-nwpolicy]} +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -D AZURE-NPM-INGRESS-DROPS -m set --match-set azure-npm-806075013 dst -j DROP -m comment --comment DROP-ALL-TO-ns-test-nwpolicy] +2021/04/30 23:31:28 [2658] Deleting iptables entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 src -j DROP -m comment --comment DROP-ALL-FROM-ns-test-nwpolicy]} +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -D AZURE-NPM-EGRESS-DROPS -m set --match-set azure-npm-806075013 src -j DROP -m comment --comment DROP-ALL-FROM-ns-test-nwpolicy] +I0430 23:31:28.611192 2658 networkPolicyController.go:467] Delete set: allow-ingress-in-ns-test-nwpolicy-0in, hashedSet: azure-npm-3260345197 +2021/04/30 23:31:28 [2658] Executing ipset command ipset [-X -exist azure-npm-3260345197] +2021/04/30 23:31:28 [2658] AppInsights didn't initialized. +2021/04/30 23:31:28 [2658] Error: There was an error running command: [ipset -X -exist azure-npm-3260345197] Stderr: [exit status 1, ipset v6.34: Set cannot be destroyed: it is in use by a kernel component] +2021/04/30 23:31:28 [2658] AppInsights didn't initialized. +I0430 23:31:28.633912 2658 networkPolicyController.go:467] Delete set: allow-ingress-in-ns-test-nwpolicy-0out, hashedSet: azure-npm-3481675862 +2021/04/30 23:31:28 [2658] Executing ipset command ipset [-X -exist azure-npm-3481675862] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -D FORWARD -j AZURE-NPM] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -F AZURE-NPM] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -F AZURE-NPM-ACCEPT] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -F AZURE-NPM-INGRESS] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -F AZURE-NPM-EGRESS] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -F AZURE-NPM-INGRESS-PORT] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -F AZURE-NPM-INGRESS-FROM] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -F AZURE-NPM-EGRESS-PORT] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -F AZURE-NPM-EGRESS-TO] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -F AZURE-NPM-INGRESS-DROPS] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -F AZURE-NPM-EGRESS-DROPS] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -F AZURE-NPM-TARGET-SETS] +2021/04/30 23:31:28 [2658] AppInsights didn't initialized. +2021/04/30 23:31:28 [2658] Error: There was an error running command: [iptables -w 60 -F AZURE-NPM-TARGET-SETS] Stderr: [exit status 1, iptables: No chain/target/match by that name.] +2021/04/30 23:31:28 [2658] AppInsights didn't initialized. +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -F AZURE-NPM-INRGESS-DROPS] +2021/04/30 23:31:28 [2658] AppInsights didn't initialized. +2021/04/30 23:31:28 [2658] Error: There was an error running command: [iptables -w 60 -F AZURE-NPM-INRGESS-DROPS] Stderr: [exit status 1, iptables: No chain/target/match by that name.] +2021/04/30 23:31:28 [2658] AppInsights didn't initialized. +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -X AZURE-NPM] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -X AZURE-NPM-ACCEPT] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -X AZURE-NPM-INGRESS] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -X AZURE-NPM-EGRESS] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -X AZURE-NPM-INGRESS-PORT] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -X AZURE-NPM-INGRESS-FROM] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -X AZURE-NPM-EGRESS-PORT] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -X AZURE-NPM-EGRESS-TO] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -X AZURE-NPM-INGRESS-DROPS] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -X AZURE-NPM-EGRESS-DROPS] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -X AZURE-NPM-TARGET-SETS] +2021/04/30 23:31:28 [2658] AppInsights didn't initialized. +2021/04/30 23:31:28 [2658] Error: There was an error running command: [iptables -w 60 -X AZURE-NPM-TARGET-SETS] Stderr: [exit status 1, iptables: No chain/target/match by that name.] +2021/04/30 23:31:28 [2658] AppInsights didn't initialized. +2021/04/30 23:31:28 [2658] Chain doesn't exist AZURE-NPM-TARGET-SETS. +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -X AZURE-NPM-INRGESS-DROPS] +2021/04/30 23:31:28 [2658] AppInsights didn't initialized. +2021/04/30 23:31:28 [2658] Error: There was an error running command: [iptables -w 60 -X AZURE-NPM-INRGESS-DROPS] Stderr: [exit status 1, iptables: No chain/target/match by that name.] +2021/04/30 23:31:28 [2658] AppInsights didn't initialized. +2021/04/30 23:31:28 [2658] Chain doesn't exist AZURE-NPM-INRGESS-DROPS. +I0430 23:31:28.692943 2658 networkPolicyController.go:216] Successfully synced 'test-nwpolicy/allow-ingress' +--- PASS: TestDeleteNetworkPolicy (0.22s) +=== RUN TestDeleteNetworkPolicyWithTombstone +2021/04/30 23:31:28 [2658] Error creating metric num_policies +2021/04/30 23:31:28 [2658] Error creating metric add_policy_exec_time +2021/04/30 23:31:28 [2658] Error creating metric num_iptables_rules +2021/04/30 23:31:28 [2658] Error creating metric add_iptables_rule_exec_time +2021/04/30 23:31:28 [2658] Error creating metric num_ipsets +2021/04/30 23:31:28 [2658] Error creating metric add_ipset_exec_time +2021/04/30 23:31:28 [2658] Error creating metric num_ipset_entries +2021/04/30 23:31:28 [2658] Error creating metric ipset_counts +2021/04/30 23:31:28 [2658] Finished initializing all Prometheus metrics +--- PASS: TestDeleteNetworkPolicyWithTombstone (0.00s) +=== RUN TestDeleteNetworkPolicyWithTombstoneAfterAddingNetworkPolicy +2021/04/30 23:31:28 [2658] Error creating metric num_policies +2021/04/30 23:31:28 [2658] Error creating metric add_policy_exec_time +2021/04/30 23:31:28 [2658] Error creating metric num_iptables_rules +2021/04/30 23:31:28 [2658] Error creating metric add_iptables_rule_exec_time +2021/04/30 23:31:28 [2658] Error creating metric num_ipsets +2021/04/30 23:31:28 [2658] Error creating metric add_ipset_exec_time +2021/04/30 23:31:28 [2658] Error creating metric num_ipset_entries +2021/04/30 23:31:28 [2658] Error creating metric ipset_counts +2021/04/30 23:31:28 [2658] Finished initializing all Prometheus metrics +2021/04/30 23:31:28 [2658] Creating Set: &{operationFlag:-N name:kube-system set:azure-npm-2725615454 spec:[nethash]} +2021/04/30 23:31:28 [2658] Executing ipset command ipset [-N -exist azure-npm-2725615454 nethash] +2021/04/30 23:31:28 [2658] Initializing AZURE-NPM chains. +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-ACCEPT] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-INGRESS] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-EGRESS] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-INGRESS-PORT] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-INGRESS-FROM] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-EGRESS-PORT] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-EGRESS-TO] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-INGRESS-DROPS] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-EGRESS-DROPS] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -I FORWARD 1 -j AZURE-NPM] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM -j AZURE-NPM-INGRESS] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM -j AZURE-NPM-EGRESS] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM -j AZURE-NPM-ACCEPT -m mark --mark 0x3000 -m comment --comment ACCEPT-on-INGRESS-and-EGRESS-mark-0x3000] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM -j AZURE-NPM-ACCEPT -m mark --mark 0x2000 -m comment --comment ACCEPT-on-INGRESS-mark-0x2000] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM -j AZURE-NPM-ACCEPT -m mark --mark 0x1000 -m comment --comment ACCEPT-on-EGRESS-mark-0x1000] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM -m state --state RELATED,ESTABLISHED -j ACCEPT -m comment --comment ACCEPT-on-connection-state] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-ACCEPT -j MARK --set-mark 0x0 -m comment --comment Clear-AZURE-NPM-MARKS] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-ACCEPT -j ACCEPT -m comment --comment ACCEPT-All-packets] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS -j AZURE-NPM-INGRESS-PORT] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS -j RETURN -m mark --mark 0x2000 -m comment --comment RETURN-on-INGRESS-mark-0x2000] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS -j AZURE-NPM-INGRESS-DROPS] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS-PORT -j RETURN -m mark --mark 0x2000 -m comment --comment RETURN-on-INGRESS-mark-0x2000] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS-FROM -j RETURN -m mark --mark 0x2000 -m comment --comment RETURN-on-INGRESS-mark-0x2000] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS -j AZURE-NPM-EGRESS-PORT] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS -j RETURN -m mark --mark 0x3000 -m comment --comment RETURN-on-EGRESS-and-INGRESS-mark-0x3000] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS -j RETURN -m mark --mark 0x1000 -m comment --comment RETURN-on-EGRESS-mark-0x1000] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS -j AZURE-NPM-EGRESS-DROPS] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS-PORT -j RETURN -m mark --mark 0x3000 -m comment --comment RETURN-on-EGRESS-and-INGRESS-mark-0x3000] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS-PORT -j RETURN -m mark --mark 0x1000 -m comment --comment RETURN-on-EGRESS-mark-0x1000] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS-TO -j RETURN -m mark --mark 0x3000 -m comment --comment RETURN-on-EGRESS-and-INGRESS-mark-0x3000] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS-TO -j RETURN -m mark --mark 0x1000 -m comment --comment RETURN-on-EGRESS-mark-0x1000] +2021/04/30 23:31:28 [2658] started parsing ingress rule +2021/04/30 23:31:28 [2658] finished parsing ingress rule +2021/04/30 23:31:28 [2658] started parsing egress rule +2021/04/30 23:31:28 [2658] finished parsing egress rule +2021/04/30 23:31:28 [2658] Finished translatePolicy +2021/04/30 23:31:28 [2658] sets: [ns-test-nwpolicy app:test ns-test-nwpolicy app:test] +2021/04/30 23:31:28 [2658] lists: [] +2021/04/30 23:31:28 [2658] entries: +2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-3260345197 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-allow-ingress-in-ns-test-nwpolicy-0in-AND-TCP-PORT-8000-TO-ns-test-nwpolicy]} +2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-8000-TO-ns-test-nwpolicy]} +2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS]} +2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-0-FROM-ns-test-nwpolicy]} +2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS]} +2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -j DROP -m comment --comment DROP-ALL-TO-ns-test-nwpolicy]} +2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 src -j DROP -m comment --comment DROP-ALL-FROM-ns-test-nwpolicy]} +I0430 23:31:28.774738 2658 networkPolicyController.go:343] Creating set: ns-test-nwpolicy, hashedSet: azure-npm-806075013 +2021/04/30 23:31:28 [2658] Creating Set: &{operationFlag:-N name:ns-test-nwpolicy set:azure-npm-806075013 spec:[nethash]} +2021/04/30 23:31:28 [2658] Executing ipset command ipset [-N -exist azure-npm-806075013 nethash] +I0430 23:31:28.776626 2658 networkPolicyController.go:343] Creating set: app:test, hashedSet: azure-npm-2817129730 +2021/04/30 23:31:28 [2658] Creating Set: &{operationFlag:-N name:app:test set:azure-npm-2817129730 spec:[nethash]} +2021/04/30 23:31:28 [2658] Executing ipset command ipset [-N -exist azure-npm-2817129730 nethash] +I0430 23:31:28.778064 2658 networkPolicyController.go:349] Creating set: namedport:0, hashedSet: azure-npm-1468440115 +2021/04/30 23:31:28 [2658] Creating Set: &{operationFlag:-N name:namedport:0 set:azure-npm-1468440115 spec:[hash:ip,port]} +2021/04/30 23:31:28 [2658] Executing ipset command ipset [-N -exist azure-npm-1468440115 hash:ip,port] +I0430 23:31:28.779267 2658 networkPolicyController.go:436] Creating set: allow-ingress-in-ns-test-nwpolicy-0in, hashedSet: azure-npm-3260345197 +2021/04/30 23:31:28 [2658] Creating Set: &{operationFlag:-N name:allow-ingress-in-ns-test-nwpolicy-0in set:azure-npm-3260345197 spec:[nethash maxelem 4294967295]} +2021/04/30 23:31:28 [2658] Executing ipset command ipset [-N -exist azure-npm-3260345197 nethash maxelem 4294967295] +2021/04/30 23:31:28 [2658] Executing ipset command ipset [-A -exist azure-npm-3260345197 1.0.0.0/1] +2021/04/30 23:31:28 [2658] Executing ipset command ipset [-A -exist azure-npm-3260345197 128.0.0.0/1] +I0430 23:31:28.782383 2658 networkPolicyController.go:436] Creating set: allow-ingress-in-ns-test-nwpolicy-0out, hashedSet: azure-npm-3481675862 +2021/04/30 23:31:28 [2658] Creating Set: &{operationFlag:-N name:allow-ingress-in-ns-test-nwpolicy-0out set:azure-npm-3481675862 spec:[nethash maxelem 4294967295]} +2021/04/30 23:31:28 [2658] Executing ipset command ipset [-N -exist azure-npm-3481675862 nethash maxelem 4294967295] +2021/04/30 23:31:28 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-3260345197 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-allow-ingress-in-ns-test-nwpolicy-0in-AND-TCP-PORT-8000-TO-ns-test-nwpolicy]}. +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-INGRESS-PORT -m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-3260345197 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-allow-ingress-in-ns-test-nwpolicy-0in-AND-TCP-PORT-8000-TO-ns-test-nwpolicy] +2021/04/30 23:31:28 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-8000-TO-ns-test-nwpolicy]}. +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-INGRESS-PORT -m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-8000-TO-ns-test-nwpolicy] +2021/04/30 23:31:28 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS]}. +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS-PORT -m set --match-set azure-npm-806075013 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS] +2021/04/30 23:31:28 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-0-FROM-ns-test-nwpolicy]}. +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-EGRESS-PORT -m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-0-FROM-ns-test-nwpolicy] +2021/04/30 23:31:28 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS]}. +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS-PORT -m set --match-set azure-npm-806075013 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS] +2021/04/30 23:31:28 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -j DROP -m comment --comment DROP-ALL-TO-ns-test-nwpolicy]}. +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-INGRESS-DROPS -m set --match-set azure-npm-806075013 dst -j DROP -m comment --comment DROP-ALL-TO-ns-test-nwpolicy] +2021/04/30 23:31:28 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 src -j DROP -m comment --comment DROP-ALL-FROM-ns-test-nwpolicy]}. +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-EGRESS-DROPS -m set --match-set azure-npm-806075013 src -j DROP -m comment --comment DROP-ALL-FROM-ns-test-nwpolicy] +I0430 23:31:28.802974 2658 networkPolicyController.go:216] Successfully synced 'test-nwpolicy/allow-ingress' + networkPolicyController_test.go:172: Complete adding network policy event +I0430 23:31:28.803333 2658 networkPolicyController.go:247] Network Policy test-nwpolicy/allow-ingress is not found, may be it is deleted +2021/04/30 23:31:28 [2658] started parsing ingress rule +2021/04/30 23:31:28 [2658] finished parsing ingress rule +2021/04/30 23:31:28 [2658] started parsing egress rule +2021/04/30 23:31:28 [2658] finished parsing egress rule +2021/04/30 23:31:28 [2658] Finished translatePolicy +2021/04/30 23:31:28 [2658] sets: [ns-test-nwpolicy app:test ns-test-nwpolicy app:test] +2021/04/30 23:31:28 [2658] lists: [] +2021/04/30 23:31:28 [2658] entries: +2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-3260345197 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-allow-ingress-in-ns-test-nwpolicy-0in-AND-TCP-PORT-8000-TO-ns-test-nwpolicy]} +2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-8000-TO-ns-test-nwpolicy]} +2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS]} +2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-0-FROM-ns-test-nwpolicy]} +2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS]} +2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -j DROP -m comment --comment DROP-ALL-TO-ns-test-nwpolicy]} +2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 src -j DROP -m comment --comment DROP-ALL-FROM-ns-test-nwpolicy]} +2021/04/30 23:31:28 [2658] Deleting iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-3260345197 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-allow-ingress-in-ns-test-nwpolicy-0in-AND-TCP-PORT-8000-TO-ns-test-nwpolicy]} +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -D AZURE-NPM-INGRESS-PORT -m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-3260345197 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-allow-ingress-in-ns-test-nwpolicy-0in-AND-TCP-PORT-8000-TO-ns-test-nwpolicy] +2021/04/30 23:31:28 [2658] Deleting iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-8000-TO-ns-test-nwpolicy]} +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -D AZURE-NPM-INGRESS-PORT -m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-8000-TO-ns-test-nwpolicy] +2021/04/30 23:31:28 [2658] Deleting iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS]} +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -D AZURE-NPM-INGRESS-PORT -m set --match-set azure-npm-806075013 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS] +2021/04/30 23:31:28 [2658] Deleting iptables entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-0-FROM-ns-test-nwpolicy]} +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -D AZURE-NPM-EGRESS-PORT -m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-0-FROM-ns-test-nwpolicy] +2021/04/30 23:31:28 [2658] Deleting iptables entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS]} +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -D AZURE-NPM-EGRESS-PORT -m set --match-set azure-npm-806075013 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS] +2021/04/30 23:31:28 [2658] Deleting iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -j DROP -m comment --comment DROP-ALL-TO-ns-test-nwpolicy]} +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -D AZURE-NPM-INGRESS-DROPS -m set --match-set azure-npm-806075013 dst -j DROP -m comment --comment DROP-ALL-TO-ns-test-nwpolicy] +2021/04/30 23:31:28 [2658] Deleting iptables entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 src -j DROP -m comment --comment DROP-ALL-FROM-ns-test-nwpolicy]} +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -D AZURE-NPM-EGRESS-DROPS -m set --match-set azure-npm-806075013 src -j DROP -m comment --comment DROP-ALL-FROM-ns-test-nwpolicy] +I0430 23:31:28.834608 2658 networkPolicyController.go:467] Delete set: allow-ingress-in-ns-test-nwpolicy-0in, hashedSet: azure-npm-3260345197 +2021/04/30 23:31:28 [2658] Executing ipset command ipset [-X -exist azure-npm-3260345197] +I0430 23:31:28.873629 2658 networkPolicyController.go:467] Delete set: allow-ingress-in-ns-test-nwpolicy-0out, hashedSet: azure-npm-3481675862 +2021/04/30 23:31:28 [2658] Executing ipset command ipset [-X -exist azure-npm-3481675862] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -D FORWARD -j AZURE-NPM] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -F AZURE-NPM] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -F AZURE-NPM-ACCEPT] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -F AZURE-NPM-INGRESS] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -F AZURE-NPM-EGRESS] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -F AZURE-NPM-INGRESS-PORT] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -F AZURE-NPM-INGRESS-FROM] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -F AZURE-NPM-EGRESS-PORT] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -F AZURE-NPM-EGRESS-TO] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -F AZURE-NPM-INGRESS-DROPS] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -F AZURE-NPM-EGRESS-DROPS] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -F AZURE-NPM-TARGET-SETS] +2021/04/30 23:31:28 [2658] AppInsights didn't initialized. +2021/04/30 23:31:28 [2658] Error: There was an error running command: [iptables -w 60 -F AZURE-NPM-TARGET-SETS] Stderr: [exit status 1, iptables: No chain/target/match by that name.] +2021/04/30 23:31:28 [2658] AppInsights didn't initialized. +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -F AZURE-NPM-INRGESS-DROPS] +2021/04/30 23:31:28 [2658] AppInsights didn't initialized. +2021/04/30 23:31:28 [2658] Error: There was an error running command: [iptables -w 60 -F AZURE-NPM-INRGESS-DROPS] Stderr: [exit status 1, iptables: No chain/target/match by that name.] +2021/04/30 23:31:28 [2658] AppInsights didn't initialized. +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -X AZURE-NPM] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -X AZURE-NPM-ACCEPT] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -X AZURE-NPM-INGRESS] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -X AZURE-NPM-EGRESS] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -X AZURE-NPM-INGRESS-PORT] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -X AZURE-NPM-INGRESS-FROM] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -X AZURE-NPM-EGRESS-PORT] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -X AZURE-NPM-EGRESS-TO] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -X AZURE-NPM-INGRESS-DROPS] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -X AZURE-NPM-EGRESS-DROPS] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -X AZURE-NPM-TARGET-SETS] +2021/04/30 23:31:28 [2658] AppInsights didn't initialized. +2021/04/30 23:31:28 [2658] Error: There was an error running command: [iptables -w 60 -X AZURE-NPM-TARGET-SETS] Stderr: [exit status 1, iptables: No chain/target/match by that name.] +2021/04/30 23:31:28 [2658] AppInsights didn't initialized. +2021/04/30 23:31:28 [2658] Chain doesn't exist AZURE-NPM-TARGET-SETS. +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -X AZURE-NPM-INRGESS-DROPS] +2021/04/30 23:31:28 [2658] AppInsights didn't initialized. +2021/04/30 23:31:28 [2658] Error: There was an error running command: [iptables -w 60 -X AZURE-NPM-INRGESS-DROPS] Stderr: [exit status 1, iptables: No chain/target/match by that name.] +2021/04/30 23:31:28 [2658] AppInsights didn't initialized. +2021/04/30 23:31:28 [2658] Chain doesn't exist AZURE-NPM-INRGESS-DROPS. +I0430 23:31:28.987320 2658 networkPolicyController.go:216] Successfully synced 'test-nwpolicy/allow-ingress' +--- PASS: TestDeleteNetworkPolicyWithTombstoneAfterAddingNetworkPolicy (0.29s) +=== RUN TestUpdateNetworkPolicy +2021/04/30 23:31:28 [2658] Error creating metric num_policies +2021/04/30 23:31:28 [2658] Error creating metric add_policy_exec_time +2021/04/30 23:31:28 [2658] Error creating metric num_iptables_rules +2021/04/30 23:31:28 [2658] Error creating metric add_iptables_rule_exec_time +2021/04/30 23:31:28 [2658] Error creating metric num_ipsets +2021/04/30 23:31:28 [2658] Error creating metric add_ipset_exec_time +2021/04/30 23:31:28 [2658] Error creating metric num_ipset_entries +2021/04/30 23:31:28 [2658] Error creating metric ipset_counts +2021/04/30 23:31:28 [2658] Finished initializing all Prometheus metrics +2021/04/30 23:31:28 [2658] Creating Set: &{operationFlag:-N name:kube-system set:azure-npm-2725615454 spec:[nethash]} +2021/04/30 23:31:28 [2658] Executing ipset command ipset [-N -exist azure-npm-2725615454 nethash] +2021/04/30 23:31:28 [2658] Initializing AZURE-NPM chains. +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-ACCEPT] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-INGRESS] +2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-EGRESS] +2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-INGRESS-PORT] +2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-INGRESS-FROM] +2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-EGRESS-PORT] +2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-EGRESS-TO] +2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-INGRESS-DROPS] +2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-EGRESS-DROPS] +2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM] +2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -I FORWARD 1 -j AZURE-NPM] +2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM -j AZURE-NPM-INGRESS] +2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM -j AZURE-NPM-EGRESS] +2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM -j AZURE-NPM-ACCEPT -m mark --mark 0x3000 -m comment --comment ACCEPT-on-INGRESS-and-EGRESS-mark-0x3000] +2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM -j AZURE-NPM-ACCEPT -m mark --mark 0x2000 -m comment --comment ACCEPT-on-INGRESS-mark-0x2000] +2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM -j AZURE-NPM-ACCEPT -m mark --mark 0x1000 -m comment --comment ACCEPT-on-EGRESS-mark-0x1000] +2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM -m state --state RELATED,ESTABLISHED -j ACCEPT -m comment --comment ACCEPT-on-connection-state] +2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-ACCEPT -j MARK --set-mark 0x0 -m comment --comment Clear-AZURE-NPM-MARKS] +2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-ACCEPT -j ACCEPT -m comment --comment ACCEPT-All-packets] +2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS -j AZURE-NPM-INGRESS-PORT] +2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS -j RETURN -m mark --mark 0x2000 -m comment --comment RETURN-on-INGRESS-mark-0x2000] +2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS -j AZURE-NPM-INGRESS-DROPS] +2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS-PORT -j RETURN -m mark --mark 0x2000 -m comment --comment RETURN-on-INGRESS-mark-0x2000] +2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS-FROM -j RETURN -m mark --mark 0x2000 -m comment --comment RETURN-on-INGRESS-mark-0x2000] +2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS -j AZURE-NPM-EGRESS-PORT] +2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS -j RETURN -m mark --mark 0x3000 -m comment --comment RETURN-on-EGRESS-and-INGRESS-mark-0x3000] +2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS -j RETURN -m mark --mark 0x1000 -m comment --comment RETURN-on-EGRESS-mark-0x1000] +2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS -j AZURE-NPM-EGRESS-DROPS] +2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS-PORT -j RETURN -m mark --mark 0x3000 -m comment --comment RETURN-on-EGRESS-and-INGRESS-mark-0x3000] +2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS-PORT -j RETURN -m mark --mark 0x1000 -m comment --comment RETURN-on-EGRESS-mark-0x1000] +2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS-TO -j RETURN -m mark --mark 0x3000 -m comment --comment RETURN-on-EGRESS-and-INGRESS-mark-0x3000] +2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS-TO -j RETURN -m mark --mark 0x1000 -m comment --comment RETURN-on-EGRESS-mark-0x1000] +2021/04/30 23:31:29 [2658] started parsing ingress rule +2021/04/30 23:31:29 [2658] finished parsing ingress rule +2021/04/30 23:31:29 [2658] started parsing egress rule +2021/04/30 23:31:29 [2658] finished parsing egress rule +2021/04/30 23:31:29 [2658] Finished translatePolicy +2021/04/30 23:31:29 [2658] sets: [ns-test-nwpolicy app:test ns-test-nwpolicy app:test] +2021/04/30 23:31:29 [2658] lists: [] +2021/04/30 23:31:29 [2658] entries: +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-3260345197 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-allow-ingress-in-ns-test-nwpolicy-0in-AND-TCP-PORT-8000-TO-ns-test-nwpolicy]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-8000-TO-ns-test-nwpolicy]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-0-FROM-ns-test-nwpolicy]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -j DROP -m comment --comment DROP-ALL-TO-ns-test-nwpolicy]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 src -j DROP -m comment --comment DROP-ALL-FROM-ns-test-nwpolicy]} +I0430 23:31:29.077857 2658 networkPolicyController.go:343] Creating set: ns-test-nwpolicy, hashedSet: azure-npm-806075013 +2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:ns-test-nwpolicy set:azure-npm-806075013 spec:[nethash]} +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-806075013 nethash] +I0430 23:31:29.079058 2658 networkPolicyController.go:343] Creating set: app:test, hashedSet: azure-npm-2817129730 +2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:app:test set:azure-npm-2817129730 spec:[nethash]} +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-2817129730 nethash] +I0430 23:31:29.080432 2658 networkPolicyController.go:349] Creating set: namedport:0, hashedSet: azure-npm-1468440115 +2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:namedport:0 set:azure-npm-1468440115 spec:[hash:ip,port]} +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-1468440115 hash:ip,port] +I0430 23:31:29.081668 2658 networkPolicyController.go:436] Creating set: allow-ingress-in-ns-test-nwpolicy-0in, hashedSet: azure-npm-3260345197 +2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:allow-ingress-in-ns-test-nwpolicy-0in set:azure-npm-3260345197 spec:[nethash maxelem 4294967295]} +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-3260345197 nethash maxelem 4294967295] +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-3260345197 1.0.0.0/1] +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-3260345197 128.0.0.0/1] +I0430 23:31:29.088034 2658 networkPolicyController.go:436] Creating set: allow-ingress-in-ns-test-nwpolicy-0out, hashedSet: azure-npm-3481675862 +2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:allow-ingress-in-ns-test-nwpolicy-0out set:azure-npm-3481675862 spec:[nethash maxelem 4294967295]} +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-3481675862 nethash maxelem 4294967295] +2021/04/30 23:31:29 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-3260345197 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-allow-ingress-in-ns-test-nwpolicy-0in-AND-TCP-PORT-8000-TO-ns-test-nwpolicy]}. +2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-INGRESS-PORT -m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-3260345197 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-allow-ingress-in-ns-test-nwpolicy-0in-AND-TCP-PORT-8000-TO-ns-test-nwpolicy] +2021/04/30 23:31:29 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-8000-TO-ns-test-nwpolicy]}. +2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-INGRESS-PORT -m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-8000-TO-ns-test-nwpolicy] +2021/04/30 23:31:29 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS]}. +2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS-PORT -m set --match-set azure-npm-806075013 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS] +2021/04/30 23:31:29 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-0-FROM-ns-test-nwpolicy]}. +2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-EGRESS-PORT -m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-0-FROM-ns-test-nwpolicy] +2021/04/30 23:31:29 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS]}. +2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS-PORT -m set --match-set azure-npm-806075013 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS] +2021/04/30 23:31:29 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -j DROP -m comment --comment DROP-ALL-TO-ns-test-nwpolicy]}. +2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-INGRESS-DROPS -m set --match-set azure-npm-806075013 dst -j DROP -m comment --comment DROP-ALL-TO-ns-test-nwpolicy] +2021/04/30 23:31:29 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 src -j DROP -m comment --comment DROP-ALL-FROM-ns-test-nwpolicy]}. +2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-EGRESS-DROPS -m set --match-set azure-npm-806075013 src -j DROP -m comment --comment DROP-ALL-FROM-ns-test-nwpolicy] +I0430 23:31:29.100307 2658 networkPolicyController.go:216] Successfully synced 'test-nwpolicy/allow-ingress' + networkPolicyController_test.go:197: Complete adding network policy event +--- PASS: TestUpdateNetworkPolicy (0.11s) +=== RUN TestLabelUpdateNetworkPolicy +2021/04/30 23:31:29 [2658] Error creating metric num_policies +2021/04/30 23:31:29 [2658] Error creating metric add_policy_exec_time +2021/04/30 23:31:29 [2658] Error creating metric num_iptables_rules +2021/04/30 23:31:29 [2658] Error creating metric add_iptables_rule_exec_time +2021/04/30 23:31:29 [2658] Error creating metric num_ipsets +2021/04/30 23:31:29 [2658] Error creating metric add_ipset_exec_time +2021/04/30 23:31:29 [2658] Error creating metric num_ipset_entries +2021/04/30 23:31:29 [2658] Error creating metric ipset_counts +2021/04/30 23:31:29 [2658] Finished initializing all Prometheus metrics +2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:kube-system set:azure-npm-2725615454 spec:[nethash]} +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-2725615454 nethash] +2021/04/30 23:31:29 [2658] Initializing AZURE-NPM chains. +2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM] +2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-ACCEPT] +2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-INGRESS] +2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-EGRESS] +2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-INGRESS-PORT] +2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-INGRESS-FROM] +2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-EGRESS-PORT] +2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-EGRESS-TO] +2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-INGRESS-DROPS] +2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-EGRESS-DROPS] +2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM] +2021/04/30 23:31:29 [2658] started parsing ingress rule +2021/04/30 23:31:29 [2658] finished parsing ingress rule +2021/04/30 23:31:29 [2658] started parsing egress rule +2021/04/30 23:31:29 [2658] finished parsing egress rule +2021/04/30 23:31:29 [2658] Finished translatePolicy +2021/04/30 23:31:29 [2658] sets: [ns-test-nwpolicy app:test ns-test-nwpolicy app:test] +2021/04/30 23:31:29 [2658] lists: [] +2021/04/30 23:31:29 [2658] entries: +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-3260345197 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-allow-ingress-in-ns-test-nwpolicy-0in-AND-TCP-PORT-8000-TO-ns-test-nwpolicy]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-8000-TO-ns-test-nwpolicy]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-0-FROM-ns-test-nwpolicy]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -j DROP -m comment --comment DROP-ALL-TO-ns-test-nwpolicy]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 src -j DROP -m comment --comment DROP-ALL-FROM-ns-test-nwpolicy]} +I0430 23:31:29.159798 2658 networkPolicyController.go:343] Creating set: ns-test-nwpolicy, hashedSet: azure-npm-806075013 +2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:ns-test-nwpolicy set:azure-npm-806075013 spec:[nethash]} +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-806075013 nethash] +I0430 23:31:29.160752 2658 networkPolicyController.go:343] Creating set: app:test, hashedSet: azure-npm-2817129730 +2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:app:test set:azure-npm-2817129730 spec:[nethash]} +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-2817129730 nethash] +I0430 23:31:29.161722 2658 networkPolicyController.go:349] Creating set: namedport:0, hashedSet: azure-npm-1468440115 +2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:namedport:0 set:azure-npm-1468440115 spec:[hash:ip,port]} +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-1468440115 hash:ip,port] +I0430 23:31:29.162756 2658 networkPolicyController.go:436] Creating set: allow-ingress-in-ns-test-nwpolicy-0in, hashedSet: azure-npm-3260345197 +2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:allow-ingress-in-ns-test-nwpolicy-0in set:azure-npm-3260345197 spec:[nethash maxelem 4294967295]} +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-3260345197 nethash maxelem 4294967295] +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-3260345197 1.0.0.0/1] +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-3260345197 128.0.0.0/1] +I0430 23:31:29.165768 2658 networkPolicyController.go:436] Creating set: allow-ingress-in-ns-test-nwpolicy-0out, hashedSet: azure-npm-3481675862 +2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:allow-ingress-in-ns-test-nwpolicy-0out set:azure-npm-3481675862 spec:[nethash maxelem 4294967295]} +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-3481675862 nethash maxelem 4294967295] +2021/04/30 23:31:29 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-3260345197 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-allow-ingress-in-ns-test-nwpolicy-0in-AND-TCP-PORT-8000-TO-ns-test-nwpolicy]}. +2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-INGRESS-PORT -m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-3260345197 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-allow-ingress-in-ns-test-nwpolicy-0in-AND-TCP-PORT-8000-TO-ns-test-nwpolicy] +2021/04/30 23:31:29 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-8000-TO-ns-test-nwpolicy]}. +2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-INGRESS-PORT -m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-8000-TO-ns-test-nwpolicy] +2021/04/30 23:31:29 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS]}. +2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS-PORT -m set --match-set azure-npm-806075013 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS] +2021/04/30 23:31:29 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-0-FROM-ns-test-nwpolicy]}. +2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-EGRESS-PORT -m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-0-FROM-ns-test-nwpolicy] +2021/04/30 23:31:29 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS]}. +2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS-PORT -m set --match-set azure-npm-806075013 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS] +2021/04/30 23:31:29 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -j DROP -m comment --comment DROP-ALL-TO-ns-test-nwpolicy]}. +2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-INGRESS-DROPS -m set --match-set azure-npm-806075013 dst -j DROP -m comment --comment DROP-ALL-TO-ns-test-nwpolicy] +2021/04/30 23:31:29 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 src -j DROP -m comment --comment DROP-ALL-FROM-ns-test-nwpolicy]}. +2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-EGRESS-DROPS -m set --match-set azure-npm-806075013 src -j DROP -m comment --comment DROP-ALL-FROM-ns-test-nwpolicy] +I0430 23:31:29.181288 2658 networkPolicyController.go:216] Successfully synced 'test-nwpolicy/allow-ingress' + networkPolicyController_test.go:197: Complete adding network policy event +2021/04/30 23:31:29 [2658] started parsing ingress rule +2021/04/30 23:31:29 [2658] finished parsing ingress rule +2021/04/30 23:31:29 [2658] started parsing egress rule +2021/04/30 23:31:29 [2658] finished parsing egress rule +2021/04/30 23:31:29 [2658] Finished translatePolicy +2021/04/30 23:31:29 [2658] sets: [ns-test-nwpolicy app:test ns-test-nwpolicy app:test] +2021/04/30 23:31:29 [2658] lists: [] +2021/04/30 23:31:29 [2658] entries: +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-3260345197 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-allow-ingress-in-ns-test-nwpolicy-0in-AND-TCP-PORT-8000-TO-ns-test-nwpolicy]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-8000-TO-ns-test-nwpolicy]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-0-FROM-ns-test-nwpolicy]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -j DROP -m comment --comment DROP-ALL-TO-ns-test-nwpolicy]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 src -j DROP -m comment --comment DROP-ALL-FROM-ns-test-nwpolicy]} +2021/04/30 23:31:29 [2658] Deleting iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-3260345197 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-allow-ingress-in-ns-test-nwpolicy-0in-AND-TCP-PORT-8000-TO-ns-test-nwpolicy]} +2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -D AZURE-NPM-INGRESS-PORT -m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-3260345197 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-allow-ingress-in-ns-test-nwpolicy-0in-AND-TCP-PORT-8000-TO-ns-test-nwpolicy] +2021/04/30 23:31:29 [2658] Deleting iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-8000-TO-ns-test-nwpolicy]} +2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -D AZURE-NPM-INGRESS-PORT -m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-8000-TO-ns-test-nwpolicy] +2021/04/30 23:31:29 [2658] Deleting iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS]} +2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -D AZURE-NPM-INGRESS-PORT -m set --match-set azure-npm-806075013 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS] +2021/04/30 23:31:29 [2658] Deleting iptables entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-0-FROM-ns-test-nwpolicy]} +2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -D AZURE-NPM-EGRESS-PORT -m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-0-FROM-ns-test-nwpolicy] +2021/04/30 23:31:29 [2658] Deleting iptables entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS]} +2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -D AZURE-NPM-EGRESS-PORT -m set --match-set azure-npm-806075013 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS] +2021/04/30 23:31:29 [2658] Deleting iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -j DROP -m comment --comment DROP-ALL-TO-ns-test-nwpolicy]} +2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -D AZURE-NPM-INGRESS-DROPS -m set --match-set azure-npm-806075013 dst -j DROP -m comment --comment DROP-ALL-TO-ns-test-nwpolicy] +2021/04/30 23:31:29 [2658] Deleting iptables entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 src -j DROP -m comment --comment DROP-ALL-FROM-ns-test-nwpolicy]} +2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -D AZURE-NPM-EGRESS-DROPS -m set --match-set azure-npm-806075013 src -j DROP -m comment --comment DROP-ALL-FROM-ns-test-nwpolicy] +I0430 23:31:29.207273 2658 networkPolicyController.go:467] Delete set: allow-ingress-in-ns-test-nwpolicy-0in, hashedSet: azure-npm-3260345197 +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-X -exist azure-npm-3260345197] +2021/04/30 23:31:29 [2658] AppInsights didn't initialized. +2021/04/30 23:31:29 [2658] Error: There was an error running command: [ipset -X -exist azure-npm-3260345197] Stderr: [exit status 1, ipset v6.34: Set cannot be destroyed: it is in use by a kernel component] +2021/04/30 23:31:29 [2658] AppInsights didn't initialized. +I0430 23:31:29.229820 2658 networkPolicyController.go:467] Delete set: allow-ingress-in-ns-test-nwpolicy-0out, hashedSet: azure-npm-3481675862 +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-X -exist azure-npm-3481675862] +2021/04/30 23:31:29 [2658] started parsing ingress rule +2021/04/30 23:31:29 [2658] finished parsing ingress rule +2021/04/30 23:31:29 [2658] started parsing egress rule +2021/04/30 23:31:29 [2658] finished parsing egress rule +2021/04/30 23:31:29 [2658] Finished translatePolicy +2021/04/30 23:31:29 [2658] sets: [app:test new:test ns-test-nwpolicy app:test app:test new:test ns-test-nwpolicy app:test] +2021/04/30 23:31:29 [2658] lists: [] +2021/04/30 23:31:29 [2658] entries: +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-1144646857 dst -m set --match-set azure-npm-3260345197 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-allow-ingress-in-ns-test-nwpolicy-0in-AND-TCP-PORT-8000-TO-app:test-AND-new:test-IN-ns-test-nwpolicy]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-1144646857 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-8000-TO-app:test-AND-new:test-IN-ns-test-nwpolicy]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-1144646857 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-app:test-AND-new:test-IN-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -m set --match-set azure-npm-1144646857 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-0-FROM-app:test-AND-new:test-IN-ns-test-nwpolicy]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -m set --match-set azure-npm-1144646857 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-app:test-AND-new:test-IN-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-1144646857 dst -j DROP -m comment --comment DROP-ALL-TO-app:test-AND-new:test-IN-ns-test-nwpolicy]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -m set --match-set azure-npm-1144646857 src -j DROP -m comment --comment DROP-ALL-FROM-app:test-AND-new:test-IN-ns-test-nwpolicy]} +I0430 23:31:29.262601 2658 networkPolicyController.go:343] Creating set: app:test, hashedSet: azure-npm-2817129730 +I0430 23:31:29.262641 2658 networkPolicyController.go:343] Creating set: new:test, hashedSet: azure-npm-1144646857 +2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:new:test set:azure-npm-1144646857 spec:[nethash]} +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-1144646857 nethash] +I0430 23:31:29.264318 2658 networkPolicyController.go:343] Creating set: ns-test-nwpolicy, hashedSet: azure-npm-806075013 +I0430 23:31:29.264379 2658 networkPolicyController.go:349] Creating set: namedport:0, hashedSet: azure-npm-1468440115 +I0430 23:31:29.264420 2658 networkPolicyController.go:436] Creating set: allow-ingress-in-ns-test-nwpolicy-0in, hashedSet: azure-npm-3260345197 +I0430 23:31:29.264483 2658 networkPolicyController.go:436] Creating set: allow-ingress-in-ns-test-nwpolicy-0out, hashedSet: azure-npm-3481675862 +2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:allow-ingress-in-ns-test-nwpolicy-0out set:azure-npm-3481675862 spec:[nethash maxelem 4294967295]} +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-3481675862 nethash maxelem 4294967295] +2021/04/30 23:31:29 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-1144646857 dst -m set --match-set azure-npm-3260345197 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-allow-ingress-in-ns-test-nwpolicy-0in-AND-TCP-PORT-8000-TO-app:test-AND-new:test-IN-ns-test-nwpolicy]}. +2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-INGRESS-PORT -m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-1144646857 dst -m set --match-set azure-npm-3260345197 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-allow-ingress-in-ns-test-nwpolicy-0in-AND-TCP-PORT-8000-TO-app:test-AND-new:test-IN-ns-test-nwpolicy] +2021/04/30 23:31:29 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-1144646857 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-8000-TO-app:test-AND-new:test-IN-ns-test-nwpolicy]}. +2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-INGRESS-PORT -m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-1144646857 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-8000-TO-app:test-AND-new:test-IN-ns-test-nwpolicy] +2021/04/30 23:31:29 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-1144646857 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-app:test-AND-new:test-IN-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS]}. +2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS-PORT -m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-1144646857 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-app:test-AND-new:test-IN-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS] +2021/04/30 23:31:29 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -m set --match-set azure-npm-1144646857 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-0-FROM-app:test-AND-new:test-IN-ns-test-nwpolicy]}. +2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-EGRESS-PORT -m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -m set --match-set azure-npm-1144646857 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-0-FROM-app:test-AND-new:test-IN-ns-test-nwpolicy] +2021/04/30 23:31:29 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -m set --match-set azure-npm-1144646857 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-app:test-AND-new:test-IN-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS]}. +2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS-PORT -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -m set --match-set azure-npm-1144646857 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-app:test-AND-new:test-IN-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS] +2021/04/30 23:31:29 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-1144646857 dst -j DROP -m comment --comment DROP-ALL-TO-app:test-AND-new:test-IN-ns-test-nwpolicy]}. +2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-INGRESS-DROPS -m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-1144646857 dst -j DROP -m comment --comment DROP-ALL-TO-app:test-AND-new:test-IN-ns-test-nwpolicy] +2021/04/30 23:31:29 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -m set --match-set azure-npm-1144646857 src -j DROP -m comment --comment DROP-ALL-FROM-app:test-AND-new:test-IN-ns-test-nwpolicy]}. +2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-EGRESS-DROPS -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -m set --match-set azure-npm-1144646857 src -j DROP -m comment --comment DROP-ALL-FROM-app:test-AND-new:test-IN-ns-test-nwpolicy] +I0430 23:31:29.294909 2658 networkPolicyController.go:216] Successfully synced 'test-nwpolicy/allow-ingress' +--- PASS: TestLabelUpdateNetworkPolicy (0.19s) +=== RUN TestAddPolicy +--- PASS: TestAddPolicy (0.00s) +=== RUN TestDeductPolicy +--- PASS: TestDeductPolicy (0.00s) +=== RUN TestParseLabel +--- PASS: TestParseLabel (0.00s) +=== RUN TestGetOperatorAndLabel +--- PASS: TestGetOperatorAndLabel (0.00s) +=== RUN TestGetOperatorsAndLabels +--- PASS: TestGetOperatorsAndLabels (0.00s) +=== RUN TestReqHeap +--- PASS: TestReqHeap (0.00s) +=== RUN TestSortSelector +--- PASS: TestSortSelector (0.00s) +=== RUN TestHashSelector +--- PASS: TestHashSelector (0.00s) +=== RUN TestParseSelector +--- PASS: TestParseSelector (0.00s) +=== RUN TestAddMultiplePods +I0430 23:31:29.297423 2658 podController.go:148] [POD ADD EVENT] for test-pod-1 in test-namespace +I0430 23:31:29.297512 2658 podController.go:438] [syncAddAndUpdatePod] updating Pod with key test-namespace/test-pod-1 +I0430 23:31:29.297569 2658 podController.go:447] Creating set: ns-test-namespace, hashedSet: azure-npm-2293040867 +2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:ns-test-namespace set:azure-npm-2293040867 spec:[nethash]} +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-2293040867 nethash] +I0430 23:31:29.297776 2658 podController.go:385] POD CREATING: [ns-test-namespace/test-pod-1/map[app:test-pod]1.2.3.4] +I0430 23:31:29.297823 2658 podController.go:400] Adding pod 1.2.3.4 to ipset ns-test-namespace +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-2293040867 1.2.3.4] +I0430 23:31:29.297999 2658 podController.go:410] Adding pod 1.2.3.4 to ipset app +2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:app set:azure-npm-527074092 spec:[nethash]} +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-527074092 nethash] +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-527074092 1.2.3.4] +I0430 23:31:29.298243 2658 podController.go:416] Adding pod 1.2.3.4 to ipset app:test-pod +2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:app:test-pod set:azure-npm-873617220 spec:[nethash]} +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-873617220 nethash] +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-873617220 1.2.3.4] +I0430 23:31:29.298471 2658 podController.go:424] Adding named port ipsets +I0430 23:31:29.298513 2658 podController.go:633] port is {Name:app:test-pod-1 HostPort:0 ContainerPort:8080 Protocol: HostIP:} +I0430 23:31:29.298576 2658 podController.go:654] in Adding named port ipsets +2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:namedport:app:test-pod-1 set:azure-npm-36138882 spec:[hash:ip,port]} +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-36138882 hash:ip,port] +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-36138882 1.2.3.4,8080] +I0430 23:31:29.298797 2658 podController.go:321] Successfully synced 'test-namespace/test-pod-1' +I0430 23:31:29.298858 2658 podController.go:148] [POD ADD EVENT] for test-pod-2 in test-namespace +I0430 23:31:29.298929 2658 podController.go:438] [syncAddAndUpdatePod] updating Pod with key test-namespace/test-pod-2 +I0430 23:31:29.298976 2658 podController.go:385] POD CREATING: [ns-test-namespace/test-pod-2/map[app:test-pod]1.2.3.5] +I0430 23:31:29.299045 2658 podController.go:400] Adding pod 1.2.3.5 to ipset ns-test-namespace +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-2293040867 1.2.3.5] +I0430 23:31:29.299158 2658 podController.go:410] Adding pod 1.2.3.5 to ipset app +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-527074092 1.2.3.5] +I0430 23:31:29.299288 2658 podController.go:416] Adding pod 1.2.3.5 to ipset app:test-pod +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-873617220 1.2.3.5] +I0430 23:31:29.299416 2658 podController.go:424] Adding named port ipsets +I0430 23:31:29.299466 2658 podController.go:633] port is {Name:app:test-pod-2 HostPort:0 ContainerPort:8080 Protocol: HostIP:} +I0430 23:31:29.299525 2658 podController.go:654] in Adding named port ipsets +2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:namedport:app:test-pod-2 set:azure-npm-19361263 spec:[hash:ip,port]} +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-19361263 hash:ip,port] +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-19361263 1.2.3.5,8080] +I0430 23:31:29.299777 2658 podController.go:321] Successfully synced 'test-namespace/test-pod-2' +--- PASS: TestAddMultiplePods (0.00s) +=== RUN TestAddPod +I0430 23:31:29.301140 2658 podController.go:148] [POD ADD EVENT] for test-pod in test-namespace +I0430 23:31:29.301254 2658 podController.go:438] [syncAddAndUpdatePod] updating Pod with key test-namespace/test-pod +I0430 23:31:29.301471 2658 podController.go:447] Creating set: ns-test-namespace, hashedSet: azure-npm-2293040867 +I0430 23:31:29.302103 2658 podController.go:148] [POD UPDATE EVENT] for test-pod in test-namespace +I0430 23:31:29.302149 2658 podController.go:201] [POD UPDATE EVENT] Two pods have the same RVs +2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:ns-test-namespace set:azure-npm-2293040867 spec:[nethash]} +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-2293040867 nethash] +I0430 23:31:29.302751 2658 podController.go:385] POD CREATING: [ns-test-namespace/test-pod/map[app:test-pod]1.2.3.4] +I0430 23:31:29.302824 2658 podController.go:400] Adding pod 1.2.3.4 to ipset ns-test-namespace +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-2293040867 1.2.3.4] +I0430 23:31:29.303019 2658 podController.go:410] Adding pod 1.2.3.4 to ipset app +2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:app set:azure-npm-527074092 spec:[nethash]} +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-527074092 nethash] +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-527074092 1.2.3.4] +I0430 23:31:29.303304 2658 podController.go:416] Adding pod 1.2.3.4 to ipset app:test-pod +2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:app:test-pod set:azure-npm-873617220 spec:[nethash]} +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-873617220 nethash] +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-873617220 1.2.3.4] +I0430 23:31:29.303537 2658 podController.go:424] Adding named port ipsets +I0430 23:31:29.303588 2658 podController.go:633] port is {Name:app:test-pod HostPort:0 ContainerPort:8080 Protocol: HostIP:} +I0430 23:31:29.303655 2658 podController.go:654] in Adding named port ipsets +2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:namedport:app:test-pod set:azure-npm-1395119760 spec:[hash:ip,port]} +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-1395119760 hash:ip,port] +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-1395119760 1.2.3.4,8080] +I0430 23:31:29.303948 2658 podController.go:321] Successfully synced 'test-namespace/test-pod' +[[ipset -N -exist azure-npm-2293040867 nethash] [ipset -A -exist azure-npm-2293040867 1.2.3.4] [ipset -N -exist azure-npm-527074092 nethash] [ipset -A -exist azure-npm-527074092 1.2.3.4] [ipset -N -exist azure-npm-873617220 nethash] [ipset -A -exist azure-npm-873617220 1.2.3.4] [ipset -N -exist azure-npm-1395119760 hash:ip,port] [ipset -A -exist azure-npm-1395119760 1.2.3.4,8080]] +--- PASS: TestAddPod (0.00s) +=== RUN TestAddHostNetworkPod +I0430 23:31:29.304825 2658 podController.go:148] [POD ADD EVENT] for test-pod in test-namespace +I0430 23:31:29.304857 2658 podController.go:155] [POD ADD EVENT] HostNetwork POD IGNORED: [/test-namespace/test-pod/map[app:test-pod]1.2.3.4] + podController_test.go:123: Add Pod: worker queue length is 0 +--- PASS: TestAddHostNetworkPod (0.00s) +=== RUN TestDeletePod +I0430 23:31:29.305290 2658 podController.go:148] [POD ADD EVENT] for test-pod in test-namespace +I0430 23:31:29.305364 2658 podController.go:438] [syncAddAndUpdatePod] updating Pod with key test-namespace/test-pod +I0430 23:31:29.305392 2658 podController.go:447] Creating set: ns-test-namespace, hashedSet: azure-npm-2293040867 +2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:ns-test-namespace set:azure-npm-2293040867 spec:[nethash]} +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-2293040867 nethash] +I0430 23:31:29.305533 2658 podController.go:385] POD CREATING: [ns-test-namespace/test-pod/map[app:test-pod]1.2.3.4] +I0430 23:31:29.305557 2658 podController.go:400] Adding pod 1.2.3.4 to ipset ns-test-namespace +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-2293040867 1.2.3.4] +I0430 23:31:29.305631 2658 podController.go:410] Adding pod 1.2.3.4 to ipset app +2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:app set:azure-npm-527074092 spec:[nethash]} +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-527074092 nethash] +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-527074092 1.2.3.4] +I0430 23:31:29.305749 2658 podController.go:416] Adding pod 1.2.3.4 to ipset app:test-pod +2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:app:test-pod set:azure-npm-873617220 spec:[nethash]} +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-873617220 nethash] +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-873617220 1.2.3.4] +I0430 23:31:29.305872 2658 podController.go:424] Adding named port ipsets +I0430 23:31:29.305890 2658 podController.go:633] port is {Name:app:test-pod HostPort:0 ContainerPort:8080 Protocol: HostIP:} +I0430 23:31:29.305918 2658 podController.go:654] in Adding named port ipsets +2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:namedport:app:test-pod set:azure-npm-1395119760 spec:[hash:ip,port]} +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-1395119760 hash:ip,port] +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-1395119760 1.2.3.4,8080] +I0430 23:31:29.306063 2658 podController.go:321] Successfully synced 'test-namespace/test-pod' + podController_test.go:132: Complete add pod event +I0430 23:31:29.306118 2658 podController.go:240] [POD DELETE EVENT] for test-pod in test-namespace +I0430 23:31:29.306151 2658 podController.go:350] pod test-namespace/test-pod not found, may be it is deleted +I0430 23:31:29.306164 2658 podController.go:550] [cleanUpDeletedPod] deleting Pod with key test-namespace/test-pod +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-D -exist azure-npm-2293040867 1.2.3.4] +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-X -exist azure-npm-2293040867] +I0430 23:31:29.306249 2658 podController.go:567] Deleting pod 1.2.3.4 from ipset app +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-D -exist azure-npm-527074092 1.2.3.4] +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-X -exist azure-npm-527074092] +I0430 23:31:29.306323 2658 podController.go:573] Deleting pod 1.2.3.4 from ipset app:test-pod +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-D -exist azure-npm-873617220 1.2.3.4] +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-X -exist azure-npm-873617220] +I0430 23:31:29.306392 2658 podController.go:633] port is {Name:app:test-pod HostPort:0 ContainerPort:8080 Protocol: HostIP:} +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-D -exist azure-npm-1395119760 1.2.3.4,8080] +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-X -exist azure-npm-1395119760] +I0430 23:31:29.306482 2658 podController.go:321] Successfully synced 'test-namespace/test-pod' +--- PASS: TestDeletePod (0.00s) +=== RUN TestDeleteHostNetworkPod +I0430 23:31:29.307711 2658 podController.go:148] [POD ADD EVENT] for test-pod in test-namespace +I0430 23:31:29.307752 2658 podController.go:155] [POD ADD EVENT] HostNetwork POD IGNORED: [/test-namespace/test-pod/map[app:test-pod]1.2.3.4] + podController_test.go:123: Add Pod: worker queue length is 0 + podController_test.go:132: Complete add pod event +I0430 23:31:29.307834 2658 podController.go:240] [POD DELETE EVENT] for test-pod in test-namespace +I0430 23:31:29.307849 2658 podController.go:242] [POD DELETE EVENT] HostNetwork POD IGNORED: [/test-namespace/test-pod/map[app:test-pod]1.2.3.4] + podController_test.go:149: Delete Pod: worker queue length is 0 +--- PASS: TestDeleteHostNetworkPod (0.00s) +=== RUN TestDeletePodWithTombstone +I0430 23:31:29.308510 2658 podController.go:240] [POD DELETE EVENT] for test-pod in test-namespace +--- PASS: TestDeletePodWithTombstone (0.00s) +=== RUN TestDeletePodWithTombstoneAfterAddingPod +I0430 23:31:29.309711 2658 podController.go:148] [POD ADD EVENT] for test-pod in test-namespace +I0430 23:31:29.310544 2658 podController.go:438] [syncAddAndUpdatePod] updating Pod with key test-namespace/test-pod +I0430 23:31:29.311034 2658 podController.go:148] [POD UPDATE EVENT] for test-pod in test-namespace +I0430 23:31:29.310632 2658 podController.go:447] Creating set: ns-test-namespace, hashedSet: azure-npm-2293040867 +I0430 23:31:29.311094 2658 podController.go:201] [POD UPDATE EVENT] Two pods have the same RVs +2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:ns-test-namespace set:azure-npm-2293040867 spec:[nethash]} +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-2293040867 nethash] +I0430 23:31:29.311341 2658 podController.go:385] POD CREATING: [ns-test-namespace/test-pod/map[app:test-pod]1.2.3.4] +I0430 23:31:29.311395 2658 podController.go:400] Adding pod 1.2.3.4 to ipset ns-test-namespace +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-2293040867 1.2.3.4] +I0430 23:31:29.311539 2658 podController.go:410] Adding pod 1.2.3.4 to ipset app +2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:app set:azure-npm-527074092 spec:[nethash]} +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-527074092 nethash] +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-527074092 1.2.3.4] +I0430 23:31:29.311771 2658 podController.go:416] Adding pod 1.2.3.4 to ipset app:test-pod +2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:app:test-pod set:azure-npm-873617220 spec:[nethash]} +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-873617220 nethash] +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-873617220 1.2.3.4] +I0430 23:31:29.312061 2658 podController.go:424] Adding named port ipsets +I0430 23:31:29.312211 2658 podController.go:633] port is {Name:app:test-pod HostPort:0 ContainerPort:8080 Protocol: HostIP:} +I0430 23:31:29.312250 2658 podController.go:654] in Adding named port ipsets +2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:namedport:app:test-pod set:azure-npm-1395119760 spec:[hash:ip,port]} +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-1395119760 hash:ip,port] +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-1395119760 1.2.3.4,8080] +I0430 23:31:29.312406 2658 podController.go:321] Successfully synced 'test-namespace/test-pod' + podController_test.go:132: Complete add pod event +I0430 23:31:29.312490 2658 podController.go:240] [POD DELETE EVENT] for test-pod in test-namespace +I0430 23:31:29.312557 2658 podController.go:350] pod test-namespace/test-pod not found, may be it is deleted +I0430 23:31:29.312610 2658 podController.go:550] [cleanUpDeletedPod] deleting Pod with key test-namespace/test-pod +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-D -exist azure-npm-2293040867 1.2.3.4] +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-X -exist azure-npm-2293040867] +I0430 23:31:29.312730 2658 podController.go:567] Deleting pod 1.2.3.4 from ipset app +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-D -exist azure-npm-527074092 1.2.3.4] +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-X -exist azure-npm-527074092] +I0430 23:31:29.312900 2658 podController.go:573] Deleting pod 1.2.3.4 from ipset app:test-pod +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-D -exist azure-npm-873617220 1.2.3.4] +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-X -exist azure-npm-873617220] +I0430 23:31:29.313055 2658 podController.go:633] port is {Name:app:test-pod HostPort:0 ContainerPort:8080 Protocol: HostIP:} +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-D -exist azure-npm-1395119760 1.2.3.4,8080] +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-X -exist azure-npm-1395119760] +I0430 23:31:29.313293 2658 podController.go:321] Successfully synced 'test-namespace/test-pod' +--- PASS: TestDeletePodWithTombstoneAfterAddingPod (0.00s) +=== RUN TestLabelUpdatePod +I0430 23:31:29.314460 2658 podController.go:148] [POD ADD EVENT] for test-pod in test-namespace +I0430 23:31:29.314568 2658 podController.go:438] [syncAddAndUpdatePod] updating Pod with key test-namespace/test-pod +I0430 23:31:29.314616 2658 podController.go:447] Creating set: ns-test-namespace, hashedSet: azure-npm-2293040867 +2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:ns-test-namespace set:azure-npm-2293040867 spec:[nethash]} +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-2293040867 nethash] +I0430 23:31:29.314809 2658 podController.go:385] POD CREATING: [ns-test-namespace/test-pod/map[app:test-pod]1.2.3.4] +I0430 23:31:29.314846 2658 podController.go:400] Adding pod 1.2.3.4 to ipset ns-test-namespace +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-2293040867 1.2.3.4] +I0430 23:31:29.315041 2658 podController.go:410] Adding pod 1.2.3.4 to ipset app +2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:app set:azure-npm-527074092 spec:[nethash]} +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-527074092 nethash] +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-527074092 1.2.3.4] +I0430 23:31:29.315310 2658 podController.go:416] Adding pod 1.2.3.4 to ipset app:test-pod +2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:app:test-pod set:azure-npm-873617220 spec:[nethash]} +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-873617220 nethash] +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-873617220 1.2.3.4] +I0430 23:31:29.315619 2658 podController.go:424] Adding named port ipsets +I0430 23:31:29.315668 2658 podController.go:633] port is {Name:app:test-pod HostPort:0 ContainerPort:8080 Protocol: HostIP:} +I0430 23:31:29.315737 2658 podController.go:654] in Adding named port ipsets +I0430 23:31:29.315712 2658 podController.go:148] [POD UPDATE EVENT] for test-pod in test-namespace +I0430 23:31:29.315819 2658 podController.go:201] [POD UPDATE EVENT] Two pods have the same RVs +2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:namedport:app:test-pod set:azure-npm-1395119760 spec:[hash:ip,port]} +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-1395119760 hash:ip,port] +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-1395119760 1.2.3.4,8080] +I0430 23:31:29.316312 2658 podController.go:321] Successfully synced 'test-namespace/test-pod' + podController_test.go:159: Complete add pod event +I0430 23:31:29.316418 2658 podController.go:148] [POD UPDATE EVENT] for test-pod in test-namespace +I0430 23:31:29.316496 2658 podController.go:438] [syncAddAndUpdatePod] updating Pod with key test-namespace/test-pod +I0430 23:31:29.316562 2658 podController.go:494] Deleting pod 1.2.3.4 from ipset app:test-pod +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-D -exist azure-npm-873617220 1.2.3.4] +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-X -exist azure-npm-873617220] +I0430 23:31:29.316798 2658 podController.go:508] Adding pod 1.2.3.4 to ipset app:new-test-pod +2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:app:new-test-pod set:azure-npm-2579824545 spec:[nethash]} +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-2579824545 nethash] +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-2579824545 1.2.3.4] +I0430 23:31:29.317120 2658 podController.go:321] Successfully synced 'test-namespace/test-pod' +--- PASS: TestLabelUpdatePod (0.00s) +=== RUN TestIPAddressUpdatePod +I0430 23:31:29.318234 2658 podController.go:148] [POD ADD EVENT] for test-pod in test-namespace +I0430 23:31:29.318511 2658 podController.go:438] [syncAddAndUpdatePod] updating Pod with key test-namespace/test-pod +I0430 23:31:29.318560 2658 podController.go:447] Creating set: ns-test-namespace, hashedSet: azure-npm-2293040867 +2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:ns-test-namespace set:azure-npm-2293040867 spec:[nethash]} +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-2293040867 nethash] +I0430 23:31:29.318775 2658 podController.go:148] [POD UPDATE EVENT] for test-pod in test-namespace +I0430 23:31:29.318832 2658 podController.go:201] [POD UPDATE EVENT] Two pods have the same RVs +I0430 23:31:29.318840 2658 podController.go:385] POD CREATING: [ns-test-namespace/test-pod/map[app:test-pod]1.2.3.4] +I0430 23:31:29.318910 2658 podController.go:400] Adding pod 1.2.3.4 to ipset ns-test-namespace +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-2293040867 1.2.3.4] +I0430 23:31:29.319075 2658 podController.go:410] Adding pod 1.2.3.4 to ipset app +2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:app set:azure-npm-527074092 spec:[nethash]} +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-527074092 nethash] +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-527074092 1.2.3.4] +I0430 23:31:29.319311 2658 podController.go:416] Adding pod 1.2.3.4 to ipset app:test-pod +2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:app:test-pod set:azure-npm-873617220 spec:[nethash]} +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-873617220 nethash] +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-873617220 1.2.3.4] +I0430 23:31:29.319627 2658 podController.go:424] Adding named port ipsets +I0430 23:31:29.319685 2658 podController.go:633] port is {Name:app:test-pod HostPort:0 ContainerPort:8080 Protocol: HostIP:} +I0430 23:31:29.319753 2658 podController.go:654] in Adding named port ipsets +2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:namedport:app:test-pod set:azure-npm-1395119760 spec:[hash:ip,port]} +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-1395119760 hash:ip,port] +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-1395119760 1.2.3.4,8080] +I0430 23:31:29.320058 2658 podController.go:321] Successfully synced 'test-namespace/test-pod' + podController_test.go:159: Complete add pod event +I0430 23:31:29.320213 2658 podController.go:148] [POD UPDATE EVENT] for test-pod in test-namespace +I0430 23:31:29.320298 2658 podController.go:438] [syncAddAndUpdatePod] updating Pod with key test-namespace/test-pod +2021/04/30 23:31:29 [2658] AppInsights didn't initialized. +2021/04/30 23:31:29 [2658] [syncAddAndUpdatePod] Info: Unexpected state. Pod (Namespace:ns-test-namespace, Name:test-pod, newUid:) , has cachedPodIp:1.2.3.4 which is different from PodIp:4.3.2.1 +2021/04/30 23:31:29 [2658] AppInsights didn't initialized. +I0430 23:31:29.320468 2658 podController.go:474] Deleting cached Pod with key:test-namespace/test-pod first due to IP Mistmatch +I0430 23:31:29.320485 2658 podController.go:550] [cleanUpDeletedPod] deleting Pod with key test-namespace/test-pod +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-D -exist azure-npm-2293040867 1.2.3.4] +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-X -exist azure-npm-2293040867] +I0430 23:31:29.320650 2658 podController.go:567] Deleting pod 1.2.3.4 from ipset app +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-D -exist azure-npm-527074092 1.2.3.4] +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-X -exist azure-npm-527074092] +I0430 23:31:29.320782 2658 podController.go:573] Deleting pod 1.2.3.4 from ipset app:test-pod +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-D -exist azure-npm-873617220 1.2.3.4] +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-X -exist azure-npm-873617220] +I0430 23:31:29.320902 2658 podController.go:633] port is {Name:app:test-pod HostPort:0 ContainerPort:8080 Protocol: HostIP:} +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-D -exist azure-npm-1395119760 1.2.3.4,8080] +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-X -exist azure-npm-1395119760] +I0430 23:31:29.321074 2658 podController.go:479] Adding back Pod with key:test-namespace/test-pod after IP Mistmatch +I0430 23:31:29.321113 2658 podController.go:385] POD CREATING: [ns-test-namespace/test-pod/map[app:test-pod]4.3.2.1] +I0430 23:31:29.321159 2658 podController.go:400] Adding pod 4.3.2.1 to ipset ns-test-namespace +2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:ns-test-namespace set:azure-npm-2293040867 spec:[nethash]} +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-2293040867 nethash] +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-2293040867 4.3.2.1] +I0430 23:31:29.321377 2658 podController.go:410] Adding pod 4.3.2.1 to ipset app +2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:app set:azure-npm-527074092 spec:[nethash]} +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-527074092 nethash] +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-527074092 4.3.2.1] +I0430 23:31:29.321505 2658 podController.go:416] Adding pod 4.3.2.1 to ipset app:test-pod +2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:app:test-pod set:azure-npm-873617220 spec:[nethash]} +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-873617220 nethash] +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-873617220 4.3.2.1] +I0430 23:31:29.321614 2658 podController.go:424] Adding named port ipsets +I0430 23:31:29.321628 2658 podController.go:633] port is {Name:app:test-pod HostPort:0 ContainerPort:8080 Protocol: HostIP:} +I0430 23:31:29.321650 2658 podController.go:654] in Adding named port ipsets +2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:namedport:app:test-pod set:azure-npm-1395119760 spec:[hash:ip,port]} +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-1395119760 hash:ip,port] +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-1395119760 4.3.2.1,8080] +I0430 23:31:29.321759 2658 podController.go:321] Successfully synced 'test-namespace/test-pod' +--- PASS: TestIPAddressUpdatePod (0.00s) +=== RUN TestPodStatusUpdatePod +I0430 23:31:29.322625 2658 podController.go:148] [POD ADD EVENT] for test-pod in test-namespace +I0430 23:31:29.322693 2658 podController.go:438] [syncAddAndUpdatePod] updating Pod with key test-namespace/test-pod +I0430 23:31:29.322719 2658 podController.go:447] Creating set: ns-test-namespace, hashedSet: azure-npm-2293040867 +2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:ns-test-namespace set:azure-npm-2293040867 spec:[nethash]} +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-2293040867 nethash] +I0430 23:31:29.322871 2658 podController.go:385] POD CREATING: [ns-test-namespace/test-pod/map[app:test-pod]1.2.3.4] +I0430 23:31:29.322900 2658 podController.go:400] Adding pod 1.2.3.4 to ipset ns-test-namespace +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-2293040867 1.2.3.4] +I0430 23:31:29.322987 2658 podController.go:410] Adding pod 1.2.3.4 to ipset app +2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:app set:azure-npm-527074092 spec:[nethash]} +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-527074092 nethash] +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-527074092 1.2.3.4] +I0430 23:31:29.323238 2658 podController.go:416] Adding pod 1.2.3.4 to ipset app:test-pod +2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:app:test-pod set:azure-npm-873617220 spec:[nethash]} +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-873617220 nethash] +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-873617220 1.2.3.4] +I0430 23:31:29.323420 2658 podController.go:424] Adding named port ipsets +I0430 23:31:29.323449 2658 podController.go:633] port is {Name:app:test-pod HostPort:0 ContainerPort:8080 Protocol: HostIP:} +I0430 23:31:29.323490 2658 podController.go:654] in Adding named port ipsets +2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:namedport:app:test-pod set:azure-npm-1395119760 spec:[hash:ip,port]} +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-1395119760 hash:ip,port] +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-1395119760 1.2.3.4,8080] +I0430 23:31:29.323681 2658 podController.go:321] Successfully synced 'test-namespace/test-pod' + podController_test.go:159: Complete add pod event +I0430 23:31:29.323778 2658 podController.go:148] [POD UPDATE EVENT] for test-pod in test-namespace +I0430 23:31:29.323839 2658 podController.go:550] [cleanUpDeletedPod] deleting Pod with key test-namespace/test-pod +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-D -exist azure-npm-2293040867 1.2.3.4] +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-X -exist azure-npm-2293040867] +I0430 23:31:29.323983 2658 podController.go:567] Deleting pod 1.2.3.4 from ipset app +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-D -exist azure-npm-527074092 1.2.3.4] +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-X -exist azure-npm-527074092] +I0430 23:31:29.324134 2658 podController.go:573] Deleting pod 1.2.3.4 from ipset app:test-pod +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-D -exist azure-npm-873617220 1.2.3.4] +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-X -exist azure-npm-873617220] +I0430 23:31:29.324279 2658 podController.go:633] port is {Name:app:test-pod HostPort:0 ContainerPort:8080 Protocol: HostIP:} +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-D -exist azure-npm-1395119760 1.2.3.4,8080] +2021/04/30 23:31:29 [2658] Executing ipset command ipset [-X -exist azure-npm-1395119760] +I0430 23:31:29.324459 2658 podController.go:321] Successfully synced 'test-namespace/test-pod' +--- PASS: TestPodStatusUpdatePod (0.00s) +=== RUN TestHasValidPodIP +--- PASS: TestHasValidPodIP (0.00s) +=== RUN TestCraftPartialIptEntrySpecFromPort +I0430 23:31:29.324875 2658 podController.go:148] [POD UPDATE EVENT] for test-pod in test-namespace +--- PASS: TestCraftPartialIptEntrySpecFromPort (0.00s) +=== RUN TestCraftPartialIptablesCommentFromPort +--- PASS: TestCraftPartialIptablesCommentFromPort (0.00s) +=== RUN TestCraftPartialIptEntrySpecFromOpAndLabel +--- PASS: TestCraftPartialIptEntrySpecFromOpAndLabel (0.00s) +=== RUN TestCraftPartialIptEntrySpecFromOpsAndLabels +--- PASS: TestCraftPartialIptEntrySpecFromOpsAndLabels (0.00s) +=== RUN TestCraftPartialIptEntryFromSelector +--- PASS: TestCraftPartialIptEntryFromSelector (0.00s) +=== RUN TestCraftPartialIptablesCommentFromSelector +--- PASS: TestCraftPartialIptablesCommentFromSelector (0.00s) +=== RUN TestGetDefaultDropEntries +--- PASS: TestGetDefaultDropEntries (0.00s) +=== RUN TestTranslateIngress +2021/04/30 23:31:29 [2658] started parsing ingress rule +2021/04/30 23:31:29 [2658] finished parsing ingress rule +--- PASS: TestTranslateIngress (0.00s) +=== RUN TestTranslateEgress +2021/04/30 23:31:29 [2658] started parsing egress rule +2021/04/30 23:31:29 [2658] finished parsing egress rule +--- PASS: TestTranslateEgress (0.00s) +=== RUN TestDenyAllPolicy +2021/04/30 23:31:29 [2658] started parsing ingress rule +2021/04/30 23:31:29 [2658] finished parsing ingress rule +2021/04/30 23:31:29 [2658] Finished translatePolicy +2021/04/30 23:31:29 [2658] sets: [ns-testnamespace] +2021/04/30 23:31:29 [2658] lists: [] +2021/04/30 23:31:29 [2658] entries: +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-2173871756 dst -j DROP -m comment --comment DROP-ALL-TO-ns-testnamespace]} +--- PASS: TestDenyAllPolicy (0.00s) +=== RUN TestAllowBackendToFrontend +2021/04/30 23:31:29 [2658] started parsing ingress rule +2021/04/30 23:31:29 [2658] finished parsing ingress rule +2021/04/30 23:31:29 [2658] Finished translatePolicy +2021/04/30 23:31:29 [2658] sets: [app:backend ns-testnamespace app:frontend] +2021/04/30 23:31:29 [2658] lists: [] +2021/04/30 23:31:29 [2658] entries: +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-FROM Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-2173871756 src -m set --match-set azure-npm-837532042 src -m set --match-set azure-npm-2173871756 dst -m set --match-set azure-npm-3038731686 dst -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:frontend-IN-ns-testnamespace-TO-app:backend-IN-ns-testnamespace]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-2173871756 dst -m set --match-set azure-npm-3038731686 dst -j AZURE-NPM-INGRESS-FROM -m comment --comment ALLOW-ALL-TO-app:backend-IN-ns-testnamespace-TO-JUMP-TO-AZURE-NPM-INGRESS-FROM]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-FROM Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-2173871756 dst -m set --match-set azure-npm-3038731686 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-app:backend-IN-ns-testnamespace-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-2173871756 dst -m set --match-set azure-npm-3038731686 dst -j DROP -m comment --comment DROP-ALL-TO-app:backend-IN-ns-testnamespace]} +--- PASS: TestAllowBackendToFrontend (0.00s) +=== RUN TestAllowAllToAppFrontend +2021/04/30 23:31:29 [2658] started parsing ingress rule +2021/04/30 23:31:29 [2658] finished parsing ingress rule +2021/04/30 23:31:29 [2658] Finished translatePolicy +2021/04/30 23:31:29 [2658] sets: [app:frontend ns-testnamespace] +2021/04/30 23:31:29 [2658] lists: [] +2021/04/30 23:31:29 [2658] entries: +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-2173871756 dst -m set --match-set azure-npm-837532042 dst -j MARK --set-mark 0x2000 -m comment --comment ALLOW-ALL-TO-app:frontend-IN-ns-testnamespace]} +--- PASS: TestAllowAllToAppFrontend (0.00s) +=== RUN TestDenyAllToAppFrontend +2021/04/30 23:31:29 [2658] started parsing ingress rule +2021/04/30 23:31:29 [2658] finished parsing ingress rule +2021/04/30 23:31:29 [2658] Finished translatePolicy +2021/04/30 23:31:29 [2658] sets: [app:frontend ns-testnamespace] +2021/04/30 23:31:29 [2658] lists: [] +2021/04/30 23:31:29 [2658] entries: +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-2173871756 dst -m set --match-set azure-npm-837532042 dst -j DROP -m comment --comment DROP-ALL-TO-app:frontend-IN-ns-testnamespace]} +--- PASS: TestDenyAllToAppFrontend (0.00s) +=== RUN TestNamespaceToFrontend +2021/04/30 23:31:29 [2658] started parsing ingress rule +2021/04/30 23:31:29 [2658] finished parsing ingress rule +2021/04/30 23:31:29 [2658] Finished translatePolicy +2021/04/30 23:31:29 [2658] sets: [app:frontend ns-testnamespace] +2021/04/30 23:31:29 [2658] lists: [] +2021/04/30 23:31:29 [2658] entries: +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-FROM Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-2173871756 src -m set --match-set azure-npm-2173871756 dst -m set --match-set azure-npm-837532042 dst -j MARK --set-mark 0x2000 -m comment --comment ALLOW-ns-testnamespace-TO-app:frontend-IN-ns-testnamespace]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-2173871756 dst -m set --match-set azure-npm-837532042 dst -j AZURE-NPM-INGRESS-FROM -m comment --comment ALLOW-ALL-TO-app:frontend-IN-ns-testnamespace-TO-JUMP-TO-AZURE-NPM-INGRESS-FROM]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-FROM Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-2173871756 dst -m set --match-set azure-npm-837532042 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-app:frontend-IN-ns-testnamespace-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-2173871756 dst -m set --match-set azure-npm-837532042 dst -j DROP -m comment --comment DROP-ALL-TO-app:frontend-IN-ns-testnamespace]} +--- PASS: TestNamespaceToFrontend (0.00s) +=== RUN TestAllowAllNamespacesToAppFrontend +2021/04/30 23:31:29 [2658] started parsing ingress rule +2021/04/30 23:31:29 [2658] finished parsing ingress rule +2021/04/30 23:31:29 [2658] Finished translatePolicy +2021/04/30 23:31:29 [2658] sets: [app:frontend ns-testnamespace] +2021/04/30 23:31:29 [2658] lists: [all-namespaces] +2021/04/30 23:31:29 [2658] entries: +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-FROM Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-530439631 src -m set --match-set azure-npm-2173871756 dst -m set --match-set azure-npm-837532042 dst -j MARK --set-mark 0x2000 -m comment --comment ALLOW-all-namespaces-TO-app:frontend-IN-ns-testnamespace]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-2173871756 dst -m set --match-set azure-npm-837532042 dst -j AZURE-NPM-INGRESS-FROM -m comment --comment ALLOW-ALL-TO-app:frontend-IN-ns-testnamespace-TO-JUMP-TO-AZURE-NPM-INGRESS-FROM]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-FROM Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-2173871756 dst -m set --match-set azure-npm-837532042 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-app:frontend-IN-ns-testnamespace-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-2173871756 dst -m set --match-set azure-npm-837532042 dst -j DROP -m comment --comment DROP-ALL-TO-app:frontend-IN-ns-testnamespace]} +--- PASS: TestAllowAllNamespacesToAppFrontend (0.00s) +=== RUN TestAllowNamespaceDevToAppFrontend +2021/04/30 23:31:29 [2658] started parsing ingress rule +2021/04/30 23:31:29 [2658] finished parsing ingress rule +2021/04/30 23:31:29 [2658] Finished translatePolicy +2021/04/30 23:31:29 [2658] sets: [app:frontend ns-testnamespace] +2021/04/30 23:31:29 [2658] lists: [ns-namespace:dev ns-namespace:test0 ns-namespace:test1] +2021/04/30 23:31:29 [2658] entries: +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-FROM Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-2343777025 src -m set ! --match-set azure-npm-1217484542 src -m set ! --match-set azure-npm-1234262161 src -m set --match-set azure-npm-2173871756 dst -m set --match-set azure-npm-837532042 dst -j MARK --set-mark 0x2000 -m comment --comment ALLOW-ns-namespace:dev-AND-ns-!namespace:test0-AND-ns-!namespace:test1-TO-app:frontend-IN-ns-testnamespace]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-2173871756 dst -m set --match-set azure-npm-837532042 dst -j AZURE-NPM-INGRESS-FROM -m comment --comment ALLOW-ALL-TO-app:frontend-IN-ns-testnamespace-TO-JUMP-TO-AZURE-NPM-INGRESS-FROM]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-FROM Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-2173871756 dst -m set --match-set azure-npm-837532042 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-app:frontend-IN-ns-testnamespace-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-2173871756 dst -m set --match-set azure-npm-837532042 dst -j DROP -m comment --comment DROP-ALL-TO-app:frontend-IN-ns-testnamespace]} +--- PASS: TestAllowNamespaceDevToAppFrontend (0.00s) +=== RUN TestAllowAllToK0AndK1AndAppFrontend +2021/04/30 23:31:29 [2658] started parsing ingress rule +2021/04/30 23:31:29 [2658] finished parsing ingress rule +2021/04/30 23:31:29 [2658] Finished translatePolicy +2021/04/30 23:31:29 [2658] sets: [app:frontend k0 k1:v0 k1:v1 ns-testnamespace] +2021/04/30 23:31:29 [2658] lists: [all-namespaces] +2021/04/30 23:31:29 [2658] entries: +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-FROM Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-530439631 src -m set --match-set azure-npm-2173871756 dst -m set --match-set azure-npm-837532042 dst -m set ! --match-set azure-npm-2537389870 dst -m set --match-set azure-npm-456904991 dst -m set --match-set azure-npm-440127372 dst -j MARK --set-mark 0x2000 -m comment --comment ALLOW-all-namespaces-TO-app:frontend-AND-!k0-AND-k1:v0-AND-k1:v1-IN-ns-testnamespace]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-2173871756 dst -m set --match-set azure-npm-837532042 dst -m set ! --match-set azure-npm-2537389870 dst -m set --match-set azure-npm-456904991 dst -m set --match-set azure-npm-440127372 dst -j AZURE-NPM-INGRESS-FROM -m comment --comment ALLOW-ALL-TO-app:frontend-AND-!k0-AND-k1:v0-AND-k1:v1-IN-ns-testnamespace-TO-JUMP-TO-AZURE-NPM-INGRESS-FROM]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-FROM Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-2173871756 dst -m set --match-set azure-npm-837532042 dst -m set ! --match-set azure-npm-2537389870 dst -m set --match-set azure-npm-456904991 dst -m set --match-set azure-npm-440127372 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-app:frontend-AND-!k0-AND-k1:v0-AND-k1:v1-IN-ns-testnamespace-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-2173871756 dst -m set --match-set azure-npm-837532042 dst -m set ! --match-set azure-npm-2537389870 dst -m set --match-set azure-npm-456904991 dst -m set --match-set azure-npm-440127372 dst -j DROP -m comment --comment DROP-ALL-TO-app:frontend-AND-!k0-AND-k1:v0-AND-k1:v1-IN-ns-testnamespace]} +--- PASS: TestAllowAllToK0AndK1AndAppFrontend (0.00s) +=== RUN TestAllowNsDevAndAppBackendToAppFrontend +2021/04/30 23:31:29 [2658] started parsing ingress rule +2021/04/30 23:31:29 [2658] finished parsing ingress rule +2021/04/30 23:31:29 [2658] Finished translatePolicy +2021/04/30 23:31:29 [2658] sets: [app:frontend ns-testnamespace app:backend] +2021/04/30 23:31:29 [2658] lists: [ns-ns:dev] +2021/04/30 23:31:29 [2658] entries: +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-FROM Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-2173871756 dst -m set --match-set azure-npm-837532042 dst -m set --match-set azure-npm-2624359271 src -m set --match-set azure-npm-3038731686 src -j MARK --set-mark 0x2000 -m comment --comment ALLOW-ns-ns:dev-AND-app:backend-TO-app:frontend-IN-ns-testnamespace]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-2173871756 dst -m set --match-set azure-npm-837532042 dst -j AZURE-NPM-INGRESS-FROM -m comment --comment ALLOW-ALL-TO-app:frontend-IN-ns-testnamespace-TO-JUMP-TO-AZURE-NPM-INGRESS-FROM]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-FROM Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-2173871756 dst -m set --match-set azure-npm-837532042 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-app:frontend-IN-ns-testnamespace-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-2173871756 dst -m set --match-set azure-npm-837532042 dst -j DROP -m comment --comment DROP-ALL-TO-app:frontend-IN-ns-testnamespace]} +--- PASS: TestAllowNsDevAndAppBackendToAppFrontend (0.00s) +=== RUN TestAllowInternalAndExternal +2021/04/30 23:31:29 [2658] started parsing ingress rule +2021/04/30 23:31:29 [2658] finished parsing ingress rule +2021/04/30 23:31:29 [2658] Finished translatePolicy +2021/04/30 23:31:29 [2658] sets: [app:backdoor ns-dangerous] +2021/04/30 23:31:29 [2658] lists: [] +2021/04/30 23:31:29 [2658] entries: +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-256277463 dst -m set --match-set azure-npm-2688166573 dst -j MARK --set-mark 0x2000 -m comment --comment ALLOW-ALL-TO-app:backdoor-IN-ns-dangerous]} +--- PASS: TestAllowInternalAndExternal (0.00s) +=== RUN TestAllowBackendToFrontendPort8000 +2021/04/30 23:31:29 [2658] started parsing ingress rule +2021/04/30 23:31:29 [2658] finished parsing ingress rule +2021/04/30 23:31:29 [2658] Finished translatePolicy +2021/04/30 23:31:29 [2658] sets: [app:frontend ns-testnamespace app:backend] +2021/04/30 23:31:29 [2658] lists: [] +2021/04/30 23:31:29 [2658] entries: +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-2173871756 dst -m set --match-set azure-npm-837532042 dst -m set --match-set azure-npm-2173871756 src -m set --match-set azure-npm-3038731686 src --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:backend-IN-ns-testnamespace-AND-PORT-8000-TO-app:frontend-IN-ns-testnamespace]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-2173871756 dst -m set --match-set azure-npm-837532042 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-app:frontend-IN-ns-testnamespace-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-2173871756 dst -m set --match-set azure-npm-837532042 dst -j DROP -m comment --comment DROP-ALL-TO-app:frontend-IN-ns-testnamespace]} +--- PASS: TestAllowBackendToFrontendPort8000 (0.00s) +=== RUN TestAllowBackendToFrontendWithMissingPort +2021/04/30 23:31:29 [2658] started parsing ingress rule +2021/04/30 23:31:29 [2658] finished parsing ingress rule +2021/04/30 23:31:29 [2658] Finished translatePolicy +2021/04/30 23:31:29 [2658] sets: [app:frontend ns-testnamespace app:backend] +2021/04/30 23:31:29 [2658] lists: [] +2021/04/30 23:31:29 [2658] entries: +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-2173871756 dst -m set --match-set azure-npm-837532042 dst -m set --match-set azure-npm-2173871756 src -m set --match-set azure-npm-3038731686 src -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:backend-IN-ns-testnamespace-AND--TO-app:frontend-IN-ns-testnamespace]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-2173871756 dst -m set --match-set azure-npm-837532042 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-app:frontend-IN-ns-testnamespace-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-2173871756 dst -m set --match-set azure-npm-837532042 dst -j DROP -m comment --comment DROP-ALL-TO-app:frontend-IN-ns-testnamespace]} +--- PASS: TestAllowBackendToFrontendWithMissingPort (0.00s) +=== RUN TestAllowMultipleLabelsToMultipleLabels +2021/04/30 23:31:29 [2658] started parsing ingress rule +2021/04/30 23:31:29 [2658] finished parsing ingress rule +2021/04/30 23:31:29 [2658] Finished translatePolicy +2021/04/30 23:31:29 [2658] sets: [app:k8s team:aks ns-acn program:cni team:acn binary:cns group:container] +2021/04/30 23:31:29 [2658] lists: [] +2021/04/30 23:31:29 [2658] entries: +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-FROM Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-42068709 src -m set --match-set azure-npm-3345321849 src -m set --match-set azure-npm-2802478816 src -m set --match-set azure-npm-42068709 dst -m set --match-set azure-npm-3926344238 dst -m set --match-set azure-npm-3019307935 dst -j MARK --set-mark 0x2000 -m comment --comment ALLOW-program:cni-AND-team:acn-IN-ns-acn-TO-app:k8s-AND-team:aks-IN-ns-acn]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-FROM Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-42068709 src -m set --match-set azure-npm-3315585516 src -m set --match-set azure-npm-3955682017 src -m set --match-set azure-npm-42068709 dst -m set --match-set azure-npm-3926344238 dst -m set --match-set azure-npm-3019307935 dst -j MARK --set-mark 0x2000 -m comment --comment ALLOW-binary:cns-AND-group:container-IN-ns-acn-TO-app:k8s-AND-team:aks-IN-ns-acn]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-42068709 dst -m set --match-set azure-npm-3926344238 dst -m set --match-set azure-npm-3019307935 dst -j AZURE-NPM-INGRESS-FROM -m comment --comment ALLOW-ALL-TO-app:k8s-AND-team:aks-IN-ns-acn-TO-JUMP-TO-AZURE-NPM-INGRESS-FROM]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-FROM Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-42068709 dst -m set --match-set azure-npm-3926344238 dst -m set --match-set azure-npm-3019307935 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-app:k8s-AND-team:aks-IN-ns-acn-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-42068709 dst -m set --match-set azure-npm-3926344238 dst -m set --match-set azure-npm-3019307935 dst -j DROP -m comment --comment DROP-ALL-TO-app:k8s-AND-team:aks-IN-ns-acn]} +--- PASS: TestAllowMultipleLabelsToMultipleLabels (0.00s) +=== RUN TestDenyAllFromAppBackend +2021/04/30 23:31:29 [2658] started parsing egress rule +2021/04/30 23:31:29 [2658] finished parsing egress rule +2021/04/30 23:31:29 [2658] Finished translatePolicy +2021/04/30 23:31:29 [2658] sets: [app:backend ns-testnamespace] +2021/04/30 23:31:29 [2658] lists: [] +2021/04/30 23:31:29 [2658] entries: +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-2173871756 src -m set --match-set azure-npm-3038731686 src -j DROP -m comment --comment DROP-ALL-FROM-app:backend-IN-ns-testnamespace]} +--- PASS: TestDenyAllFromAppBackend (0.00s) +=== RUN TestAllowAllFromAppBackend +2021/04/30 23:31:29 [2658] started parsing egress rule +2021/04/30 23:31:29 [2658] finished parsing egress rule +2021/04/30 23:31:29 [2658] Finished translatePolicy +2021/04/30 23:31:29 [2658] sets: [app:backend ns-testnamespace] +2021/04/30 23:31:29 [2658] lists: [] +2021/04/30 23:31:29 [2658] entries: +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-2173871756 src -m set --match-set azure-npm-3038731686 src -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-ALL-FROM-app:backend-IN-ns-testnamespace]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-2173871756 src -m set --match-set azure-npm-3038731686 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-app:backend-IN-ns-testnamespace-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS]} +--- PASS: TestAllowAllFromAppBackend (0.00s) +=== RUN TestDenyAllFromNsUnsafe +2021/04/30 23:31:29 [2658] started parsing egress rule +2021/04/30 23:31:29 [2658] finished parsing egress rule +2021/04/30 23:31:29 [2658] Finished translatePolicy +2021/04/30 23:31:29 [2658] sets: [ns-unsafe] +2021/04/30 23:31:29 [2658] lists: [] +2021/04/30 23:31:29 [2658] entries: +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-3909944339 src -j DROP -m comment --comment DROP-ALL-FROM-ns-unsafe]} +--- PASS: TestDenyAllFromNsUnsafe (0.00s) +=== RUN TestAllowAppFrontendToTCPPort53UDPPort53Policy +2021/04/30 23:31:29 [2658] started parsing egress rule +2021/04/30 23:31:29 [2658] finished parsing egress rule +2021/04/30 23:31:29 [2658] Finished translatePolicy +2021/04/30 23:31:29 [2658] sets: [app:frontend ns-testnamespace] +2021/04/30 23:31:29 [2658] lists: [all-namespaces] +2021/04/30 23:31:29 [2658] entries: +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-p TCP --dport 53 -m set --match-set azure-npm-2173871756 src -m set --match-set azure-npm-837532042 src -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-ALL-TO-TCP-PORT-53-FROM-app:frontend-IN-ns-testnamespace]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-p UDP --dport 53 -m set --match-set azure-npm-2173871756 src -m set --match-set azure-npm-837532042 src -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-ALL-TO-UDP-PORT-53-FROM-app:frontend-IN-ns-testnamespace]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-TO Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-2173871756 src -m set --match-set azure-npm-837532042 src -m set --match-set azure-npm-530439631 dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-app:frontend-IN-ns-testnamespace-TO-all-namespaces]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-2173871756 src -m set --match-set azure-npm-837532042 src -j AZURE-NPM-EGRESS-TO -m comment --comment ALLOW-ALL-FROM-app:frontend-IN-ns-testnamespace-TO-JUMP-TO-AZURE-NPM-EGRESS-TO]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-TO Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-2173871756 src -m set --match-set azure-npm-837532042 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-app:frontend-IN-ns-testnamespace-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-2173871756 src -m set --match-set azure-npm-837532042 src -j DROP -m comment --comment DROP-ALL-FROM-app:frontend-IN-ns-testnamespace]} +--- PASS: TestAllowAppFrontendToTCPPort53UDPPort53Policy (0.01s) +=== RUN TestComplexPolicy +2021/04/30 23:31:29 [2658] started parsing ingress rule +2021/04/30 23:31:29 [2658] finished parsing ingress rule +2021/04/30 23:31:29 [2658] started parsing egress rule +2021/04/30 23:31:29 [2658] finished parsing egress rule +2021/04/30 23:31:29 [2658] Finished translatePolicy +2021/04/30 23:31:29 [2658] sets: [role:db ns-default role:frontend] +2021/04/30 23:31:29 [2658] lists: [ns-project:myproject] +2021/04/30 23:31:29 [2658] entries: +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-784554818 dst -m set --match-set azure-npm-1547420863 dst -m set --match-set azure-npm-2329341111 src -p TCP --dport 6379 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-k8s-example-policy-in-ns-default-0in-AND-TCP-PORT-6379-TO-role:db-IN-ns-default]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-784554818 dst -m set --match-set azure-npm-1547420863 dst -m set --match-set azure-npm-1883405147 src -p TCP --dport 6379 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-ns-project:myproject-AND-TCP-PORT-6379-TO-role:db-IN-ns-default]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-784554818 dst -m set --match-set azure-npm-1547420863 dst -m set --match-set azure-npm-784554818 src -m set --match-set azure-npm-2574419033 src -p TCP --dport 6379 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-role:frontend-IN-ns-default-AND-TCP-PORT-6379-TO-role:db-IN-ns-default]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-784554818 dst -m set --match-set azure-npm-1547420863 dst -j AZURE-NPM-INGRESS-FROM -m comment --comment ALLOW-ALL-TO-role:db-IN-ns-default-TO-JUMP-TO-AZURE-NPM-INGRESS-FROM]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-FROM Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-784554818 dst -m set --match-set azure-npm-1547420863 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-role:db-IN-ns-default-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-p TCP --dport 5978 -m set --match-set azure-npm-784554818 src -m set --match-set azure-npm-1547420863 src -m set --match-set azure-npm-3675320636 dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-k8s-example-policy-in-ns-default-0out-AND-TCP-PORT-5978-FROM-role:db-IN-ns-default]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-784554818 src -m set --match-set azure-npm-1547420863 src -j AZURE-NPM-EGRESS-TO -m comment --comment ALLOW-ALL-FROM-role:db-IN-ns-default-TO-JUMP-TO-AZURE-NPM-EGRESS-TO]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-TO Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-784554818 src -m set --match-set azure-npm-1547420863 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-role:db-IN-ns-default-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-784554818 dst -m set --match-set azure-npm-1547420863 dst -j DROP -m comment --comment DROP-ALL-TO-role:db-IN-ns-default]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-784554818 src -m set --match-set azure-npm-1547420863 src -j DROP -m comment --comment DROP-ALL-FROM-role:db-IN-ns-default]} +2021/04/30 23:31:29 [2658] started parsing ingress rule +2021/04/30 23:31:29 [2658] finished parsing ingress rule +2021/04/30 23:31:29 [2658] started parsing egress rule +2021/04/30 23:31:29 [2658] finished parsing egress rule +2021/04/30 23:31:29 [2658] Finished translatePolicy +2021/04/30 23:31:29 [2658] sets: [role:db ns-default role:frontend] +2021/04/30 23:31:29 [2658] lists: [ns-project:myproject] +2021/04/30 23:31:29 [2658] entries: +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-784554818 dst -m set --match-set azure-npm-1547420863 dst -m set --match-set azure-npm-2329341111 src -p TCP --dport 6379 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-k8s-example-policy-in-ns-default-0in-AND-TCP-PORT-6379-TO-role:db-IN-ns-default]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-784554818 dst -m set --match-set azure-npm-1547420863 dst -m set --match-set azure-npm-1883405147 src -p TCP --dport 6379 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-ns-project:myproject-AND-TCP-PORT-6379-TO-role:db-IN-ns-default]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-784554818 dst -m set --match-set azure-npm-1547420863 dst -m set --match-set azure-npm-784554818 src -m set --match-set azure-npm-2574419033 src -p TCP --dport 6379 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-role:frontend-IN-ns-default-AND-TCP-PORT-6379-TO-role:db-IN-ns-default]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-784554818 dst -m set --match-set azure-npm-1547420863 dst -j AZURE-NPM-INGRESS-FROM -m comment --comment ALLOW-ALL-TO-role:db-IN-ns-default-TO-JUMP-TO-AZURE-NPM-INGRESS-FROM]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-FROM Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-784554818 dst -m set --match-set azure-npm-1547420863 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-role:db-IN-ns-default-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-p TCP --dport 5978 -m set --match-set azure-npm-784554818 src -m set --match-set azure-npm-1547420863 src -m set --match-set azure-npm-3675320636 dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-k8s-example-policy-in-ns-default-0out-AND-TCP-PORT-5978-FROM-role:db-IN-ns-default]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-784554818 src -m set --match-set azure-npm-1547420863 src -j AZURE-NPM-EGRESS-TO -m comment --comment ALLOW-ALL-FROM-role:db-IN-ns-default-TO-JUMP-TO-AZURE-NPM-EGRESS-TO]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-TO Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-784554818 src -m set --match-set azure-npm-1547420863 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-role:db-IN-ns-default-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-784554818 dst -m set --match-set azure-npm-1547420863 dst -j DROP -m comment --comment DROP-ALL-TO-role:db-IN-ns-default]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-784554818 src -m set --match-set azure-npm-1547420863 src -j DROP -m comment --comment DROP-ALL-FROM-role:db-IN-ns-default]} +--- PASS: TestComplexPolicy (0.01s) +=== RUN TestDropPrecedenceOverAllow +2021/04/30 23:31:29 [2658] started parsing ingress rule +2021/04/30 23:31:29 [2658] finished parsing ingress rule +2021/04/30 23:31:29 [2658] Finished translatePolicy +2021/04/30 23:31:29 [2658] sets: [ns-default] +2021/04/30 23:31:29 [2658] lists: [] +2021/04/30 23:31:29 [2658] entries: +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-784554818 dst -j DROP -m comment --comment DROP-ALL-TO-ns-default]} +2021/04/30 23:31:29 [2658] started parsing ingress rule +2021/04/30 23:31:29 [2658] finished parsing ingress rule +2021/04/30 23:31:29 [2658] started parsing egress rule +2021/04/30 23:31:29 [2658] finished parsing egress rule +2021/04/30 23:31:29 [2658] Finished translatePolicy +2021/04/30 23:31:29 [2658] sets: [app:test testIn:pod-A ns-default testIn:pod-B testIn:pod-C] +2021/04/30 23:31:29 [2658] lists: [all-namespaces] +2021/04/30 23:31:29 [2658] entries: +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-FROM Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-784554818 src -m set --match-set azure-npm-2817129730 src -m set --match-set azure-npm-2346935388 src -m set --match-set azure-npm-784554818 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-2397268245 dst -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:test-AND-testIn:pod-B-IN-ns-default-TO-app:test-AND-testIn:pod-A-IN-ns-default]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-FROM Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-784554818 src -m set --match-set azure-npm-2817129730 src -m set --match-set azure-npm-2363713007 src -m set --match-set azure-npm-784554818 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-2397268245 dst -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:test-AND-testIn:pod-C-IN-ns-default-TO-app:test-AND-testIn:pod-A-IN-ns-default]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-784554818 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-2397268245 dst -j AZURE-NPM-INGRESS-FROM -m comment --comment ALLOW-ALL-TO-app:test-AND-testIn:pod-A-IN-ns-default-TO-JUMP-TO-AZURE-NPM-INGRESS-FROM]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-FROM Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-784554818 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-2397268245 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-app:test-AND-testIn:pod-A-IN-ns-default-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-TO Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-784554818 src -m set --match-set azure-npm-2817129730 src -m set --match-set azure-npm-2397268245 src -m set --match-set azure-npm-530439631 dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-app:test-AND-testIn:pod-A-IN-ns-default-TO-all-namespaces]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-784554818 src -m set --match-set azure-npm-2817129730 src -m set --match-set azure-npm-2397268245 src -j AZURE-NPM-EGRESS-TO -m comment --comment ALLOW-ALL-FROM-app:test-AND-testIn:pod-A-IN-ns-default-TO-JUMP-TO-AZURE-NPM-EGRESS-TO]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-TO Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-784554818 src -m set --match-set azure-npm-2817129730 src -m set --match-set azure-npm-2397268245 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-app:test-AND-testIn:pod-A-IN-ns-default-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-784554818 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-2397268245 dst -j DROP -m comment --comment DROP-ALL-TO-app:test-AND-testIn:pod-A-IN-ns-default]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-784554818 src -m set --match-set azure-npm-2817129730 src -m set --match-set azure-npm-2397268245 src -j DROP -m comment --comment DROP-ALL-FROM-app:test-AND-testIn:pod-A-IN-ns-default]} +--- PASS: TestDropPrecedenceOverAllow (0.00s) +=== RUN TestNamedPorts +2021/04/30 23:31:29 [2658] started parsing ingress rule +2021/04/30 23:31:29 [2658] finished parsing ingress rule +2021/04/30 23:31:29 [2658] Finished translatePolicy +2021/04/30 23:31:29 [2658] sets: [app:server ns-test] +2021/04/30 23:31:29 [2658] lists: [] +2021/04/30 23:31:29 [2658] entries: +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-3863441321 dst -m set --match-set azure-npm-1519775445 dst -m set --match-set azure-npm-3050895063 dst,dst -j MARK --set-mark 0x2000 -m comment --comment ALLOW-ALL-TCP-PORT-serve-80-TO-app:server-IN-ns-test]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-3863441321 dst -m set --match-set azure-npm-1519775445 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-app:server-IN-ns-test-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS]} +2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-3863441321 dst -m set --match-set azure-npm-1519775445 dst -j DROP -m comment --comment DROP-ALL-TO-app:server-IN-ns-test]} +--- PASS: TestNamedPorts (0.00s) +PASS +coverage: 12.3% of statements in ./... +ok github.com/Azure/azure-container-networking/npm 2.252s coverage: 12.3% of statements in ./... +? github.com/Azure/azure-container-networking/npm/http/api [no test files] +? github.com/Azure/azure-container-networking/npm/http/client [no test files] +=== RUN TestGetNpmMgrHandler +--- PASS: TestGetNpmMgrHandler (0.00s) +PASS +coverage: 0.8% of statements in ./... +ok github.com/Azure/azure-container-networking/npm/http/server 0.116s coverage: 0.8% of statements in ./... +2021/04/30 23:31:26 [2544] Finished initializing all Prometheus metrics +2021/04/30 23:31:26 Uniniting iptables +2021/04/30 23:31:26 [2544] Executing iptables command iptables [-w 60 -D FORWARD -j AZURE-NPM] +2021/04/30 23:31:26 [2544] AppInsights didn't initialized. +2021/04/30 23:31:26 [2544] Error: There was an error running command: [iptables -w 60 -D FORWARD -j AZURE-NPM] Stderr: [exit status 2, iptables v1.6.1: Couldn't load target `AZURE-NPM':No such file or directory + +Try `iptables -h' or 'iptables --help' for more information.] +2021/04/30 23:31:26 [2544] AppInsights didn't initialized. +2021/04/30 23:31:26 [2544] AppInsights didn't initialized. +2021/04/30 23:31:26 [2544] Error: failed to add default allow CONNECTED/RELATED rule to AZURE-NPM chain. +2021/04/30 23:31:26 [2544] AppInsights didn't initialized. +2021/04/30 23:31:26 Uniniting ipsets +2021/04/30 23:31:26 [2544] Executing ipset command ipset [-F -exist] +2021/04/30 23:31:26 [2544] Executing ipset command ipset [-X -exist] +=== RUN TestSave +--- PASS: TestSave (0.00s) +=== RUN TestRestore +2021/04/30 23:31:26 [2544] Executing ipset command ipset [-F -exist] +2021/04/30 23:31:26 [2544] Executing ipset command ipset [-X -exist] +--- PASS: TestRestore (0.02s) +=== RUN TestCreateList +2021/04/30 23:31:26 [2544] Creating List: &{operationFlag:-N name:test-list set:azure-npm-3265379360 spec:[setlist]} +2021/04/30 23:31:26 [2544] Executing ipset command ipset [-N -exist azure-npm-3265379360 setlist] +2021/04/30 23:31:26 [2544] Executing ipset command ipset [-F -exist] +2021/04/30 23:31:26 [2544] Executing ipset command ipset [-X -exist] +--- PASS: TestCreateList (0.04s) +=== RUN TestDeleteList +2021/04/30 23:31:26 [2544] Creating List: &{operationFlag:-N name:test-list set:azure-npm-3265379360 spec:[setlist]} +2021/04/30 23:31:26 [2544] Executing ipset command ipset [-N -exist azure-npm-3265379360 setlist] +2021/04/30 23:31:26 [2544] Executing ipset command ipset [-X -exist azure-npm-3265379360] +2021/04/30 23:31:26 [2544] Executing ipset command ipset [-F -exist] +2021/04/30 23:31:26 [2544] Executing ipset command ipset [-X -exist] +--- PASS: TestDeleteList (0.04s) +=== RUN TestAddToList +2021/04/30 23:31:26 [2544] Creating Set: &{operationFlag:-N name:test-set set:azure-npm-922816856 spec:[nethash]} +2021/04/30 23:31:26 [2544] Executing ipset command ipset [-N -exist azure-npm-922816856 nethash] +2021/04/30 23:31:26 [2544] Creating List: &{operationFlag:-N name:test-list set:azure-npm-3265379360 spec:[setlist]} +2021/04/30 23:31:26 [2544] Executing ipset command ipset [-N -exist azure-npm-3265379360 setlist] +2021/04/30 23:31:26 [2544] Executing ipset command ipset [-A -exist azure-npm-3265379360 azure-npm-922816856] +2021/04/30 23:31:26 [2544] Executing ipset command ipset [-F -exist] +2021/04/30 23:31:26 [2544] Executing ipset command ipset [-X -exist] +--- PASS: TestAddToList (0.04s) +=== RUN TestDeleteFromList +2021/04/30 23:31:26 [2544] Creating Set: &{operationFlag:-N name:test-set set:azure-npm-922816856 spec:[nethash]} +2021/04/30 23:31:26 [2544] Executing ipset command ipset [-N -exist azure-npm-922816856 nethash] +2021/04/30 23:31:26 [2544] Creating List: &{operationFlag:-N name:test-list set:azure-npm-3265379360 spec:[setlist]} +2021/04/30 23:31:26 [2544] Executing ipset command ipset [-N -exist azure-npm-3265379360 setlist] +2021/04/30 23:31:26 [2544] Executing ipset command ipset [-A -exist azure-npm-3265379360 azure-npm-922816856] +2021/04/30 23:31:26 [2544] Executing ipset command ipset [-D -exist azure-npm-3265379360 azure-npm-922816856] +2021/04/30 23:31:26 [2544] Executing ipset command ipset [-X -exist azure-npm-3265379360] +2021/04/30 23:31:26 [2544] AppInsights didn't initialized. +2021/04/30 23:31:26 [2544] Set [nonexistentsetname] does not exist when attempting to delete from list [test-list] +2021/04/30 23:31:26 [2544] AppInsights didn't initialized. +2021/04/30 23:31:26 [2544] AppInsights didn't initialized. +2021/04/30 23:31:26 [2544] Set [test-set] is of the wrong type when attempting to delete list [test-set], actual type [setgeneric] +2021/04/30 23:31:26 [2544] AppInsights didn't initialized. +2021/04/30 23:31:26 [2544] AppInsights didn't initialized. +2021/04/30 23:31:26 [2544] ipset with name test-list not found +2021/04/30 23:31:26 [2544] AppInsights didn't initialized. +2021/04/30 23:31:26 [2544] Executing ipset command ipset [-X -exist azure-npm-922816856] +--- PASS: TestDeleteFromList (0.00s) +=== RUN TestCreateSet +2021/04/30 23:31:26 [2544] Creating Set: &{operationFlag:-N name:test-set set:azure-npm-922816856 spec:[nethash]} +2021/04/30 23:31:26 [2544] Executing ipset command ipset [-N -exist azure-npm-922816856 nethash] +2021/04/30 23:31:26 [2544] Creating Set: &{operationFlag:-N name:test-set-with-maxelem set:azure-npm-2955872475 spec:[nethash maxelem 4294967295]} +2021/04/30 23:31:26 [2544] Executing ipset command ipset [-N -exist azure-npm-2955872475 nethash maxelem 4294967295] +2021/04/30 23:31:26 [2544] Creating Set: &{operationFlag:-N name:test-set-with-port set:azure-npm-2238625833 spec:[hash:ip,port]} +2021/04/30 23:31:26 [2544] Executing ipset command ipset [-N -exist azure-npm-2238625833 hash:ip,port] +2021/04/30 23:31:26 [2544] Executing ipset command ipset [-A -exist azure-npm-2238625833 1.1.1.1,tcp8080] +2021/04/30 23:31:26 [2544] AppInsights didn't initialized. +2021/04/30 23:31:26 [2544] Error: There was an error running command: [ipset -A -exist azure-npm-2238625833 1.1.1.1,tcp8080] Stderr: [exit status 1, ipset v6.34: Syntax error: 'tcp8080' is invalid as number +Syntax error: cannot parse 'tcp8080' as a tcp port] +2021/04/30 23:31:26 [2544] AppInsights didn't initialized. +2021/04/30 23:31:26 [2544] Executing ipset command ipset [-F -exist] +2021/04/30 23:31:26 [2544] Executing ipset command ipset [-X -exist] +--- PASS: TestCreateSet (0.03s) +=== RUN TestDeleteSet +2021/04/30 23:31:26 [2544] Creating Set: &{operationFlag:-N name:test-delete-set set:azure-npm-2040195562 spec:[nethash]} +2021/04/30 23:31:26 [2544] Executing ipset command ipset [-N -exist azure-npm-2040195562 nethash] +2021/04/30 23:31:26 [2544] Executing ipset command ipset [-X -exist azure-npm-2040195562] +2021/04/30 23:31:26 [2544] Executing ipset command ipset [-F -exist] +2021/04/30 23:31:26 [2544] Executing ipset command ipset [-X -exist] +--- PASS: TestDeleteSet (0.04s) +=== RUN TestAddToSet +2021/04/30 23:31:26 [2544] Creating Set: &{operationFlag:-N name:test-set set:azure-npm-922816856 spec:[nethash]} +2021/04/30 23:31:26 [2544] Executing ipset command ipset [-N -exist azure-npm-922816856 nethash] +2021/04/30 23:31:26 [2544] Executing ipset command ipset [-A -exist azure-npm-922816856 1.2.3.4] +2021/04/30 23:31:26 [2544] Executing ipset command ipset [-A -exist azure-npm-922816856 1.2.3.4/ nomatch] +2021/04/30 23:31:26 [2544] AppInsights didn't initialized. +2021/04/30 23:31:26 [2544] Error: There was an error running command: [ipset -A -exist azure-npm-922816856 1.2.3.4/ nomatch] Stderr: [exit status 1, ipset v6.34: Syntax error: cannot parse 1.2.3.4/: resolving to IPv4 address failed] +2021/04/30 23:31:26 [2544] AppInsights didn't initialized. +2021/04/30 23:31:26 [2544] Executing ipset command ipset [-A -exist azure-npm-922816856 1.1.1.1,tcp:8080] +2021/04/30 23:31:26 [2544] AppInsights didn't initialized. +2021/04/30 23:31:26 [2544] Error: There was an error running command: [ipset -A -exist azure-npm-922816856 1.1.1.1,tcp:8080] Stderr: [exit status 1, ipset v6.34: Syntax error: Elem separator in 1.1.1.1,tcp:8080, but settype hash:net supports none.] +2021/04/30 23:31:26 [2544] AppInsights didn't initialized. +2021/04/30 23:31:26 [2544] Executing ipset command ipset [-A -exist azure-npm-922816856 1.1.1.1,:] +2021/04/30 23:31:26 [2544] AppInsights didn't initialized. +2021/04/30 23:31:26 [2544] Error: There was an error running command: [ipset -A -exist azure-npm-922816856 1.1.1.1,:] Stderr: [exit status 1, ipset v6.34: Syntax error: Elem separator in 1.1.1.1,:, but settype hash:net supports none.] +2021/04/30 23:31:26 [2544] AppInsights didn't initialized. +2021/04/30 23:31:26 [2544] Executing ipset command ipset [-A -exist azure-npm-922816856 1.1.1.1] +2021/04/30 23:31:26 [2544] Executing ipset command ipset [-F -exist] +2021/04/30 23:31:26 [2544] Executing ipset command ipset [-X -exist] +--- PASS: TestAddToSet (0.04s) +=== RUN TestAddToSetWithCachePodInfo +2021/04/30 23:31:26 [2544] Creating Set: &{operationFlag:-N name:test-podcache_new set:azure-npm-1317588150 spec:[nethash]} +2021/04/30 23:31:26 [2544] Executing ipset command ipset [-N -exist azure-npm-1317588150 nethash] +2021/04/30 23:31:26 [2544] Executing ipset command ipset [-A -exist azure-npm-1317588150 10.0.2.7] +2021/04/30 23:31:26 [2544] AddToSet: PodOwner has changed for Ip: 10.0.2.7, setName:test-podcache_new, Old podKey: pod1, new podKey: pod2. Replace context with new PodOwner. +2021/04/30 23:31:26 [2544] Executing ipset command ipset [-D -exist azure-npm-1317588150 10.0.2.7] +2021/04/30 23:31:26 [2544] Executing ipset command ipset [-X -exist azure-npm-1317588150] +2021/04/30 23:31:26 [2544] Executing ipset command ipset [-F -exist] +2021/04/30 23:31:26 [2544] Executing ipset command ipset [-X -exist] +--- PASS: TestAddToSetWithCachePodInfo (0.06s) +=== RUN TestDeleteFromSet +2021/04/30 23:31:26 [2544] Creating Set: &{operationFlag:-N name:test-delete-from-set set:azure-npm-3649380207 spec:[nethash]} +2021/04/30 23:31:26 [2544] Executing ipset command ipset [-N -exist azure-npm-3649380207 nethash] +2021/04/30 23:31:26 [2544] Executing ipset command ipset [-A -exist azure-npm-3649380207 1.2.3.4] +2021/04/30 23:31:26 [2544] Executing ipset command ipset [-D -exist azure-npm-3649380207 1.2.3.4] +2021/04/30 23:31:26 [2544] Executing ipset command ipset [-X -exist azure-npm-3649380207] +2021/04/30 23:31:26 [2544] Executing ipset command ipset [-F -exist] +2021/04/30 23:31:26 [2544] Executing ipset command ipset [-X -exist] +--- PASS: TestDeleteFromSet (0.04s) +=== RUN TestDeleteFromSetWithPodCache +2021/04/30 23:31:26 [2544] Creating Set: &{operationFlag:-N name:test-deleteset-withcache set:azure-npm-2616783254 spec:[nethash]} +2021/04/30 23:31:26 [2544] Executing ipset command ipset [-N -exist azure-npm-2616783254 nethash] +2021/04/30 23:31:26 [2544] Executing ipset command ipset [-A -exist azure-npm-2616783254 10.0.2.8] +2021/04/30 23:31:26 [2544] Executing ipset command ipset [-D -exist azure-npm-2616783254 10.0.2.8] +2021/04/30 23:31:26 [2544] Executing ipset command ipset [-X -exist azure-npm-2616783254] +2021/04/30 23:31:26 [2544] Creating Set: &{operationFlag:-N name:test-deleteset-withcache set:azure-npm-2616783254 spec:[nethash]} +2021/04/30 23:31:26 [2544] Executing ipset command ipset [-N -exist azure-npm-2616783254 nethash] +2021/04/30 23:31:26 [2544] Executing ipset command ipset [-A -exist azure-npm-2616783254 10.0.2.8] +2021/04/30 23:31:26 [2544] AddToSet: PodOwner has changed for Ip: 10.0.2.8, setName:test-deleteset-withcache, Old podKey: pod1, new podKey: pod2. Replace context with new PodOwner. +2021/04/30 23:31:26 [2544] DeleteFromSet: PodOwner has changed for Ip: 10.0.2.8, setName:test-deleteset-withcache, Old podKey: pod2, new podKey: pod1. Ignore the delete as this is stale update +2021/04/30 23:31:26 [2544] Executing ipset command ipset [-D -exist azure-npm-2616783254 10.0.2.8] +2021/04/30 23:31:26 [2544] Executing ipset command ipset [-X -exist azure-npm-2616783254] +2021/04/30 23:31:26 [2544] Executing ipset command ipset [-F -exist] +2021/04/30 23:31:26 [2544] Executing ipset command ipset [-X -exist] +--- PASS: TestDeleteFromSetWithPodCache (0.07s) +=== RUN TestClean +2021/04/30 23:31:26 [2544] Creating Set: &{operationFlag:-N name:test-set set:azure-npm-922816856 spec:[nethash]} +2021/04/30 23:31:26 [2544] Executing ipset command ipset [-N -exist azure-npm-922816856 nethash] +2021/04/30 23:31:26 [2544] Executing ipset command ipset [-X -exist azure-npm-922816856] +2021/04/30 23:31:26 [2544] Executing ipset command ipset [-F -exist] +2021/04/30 23:31:26 [2544] Executing ipset command ipset [-X -exist] +--- PASS: TestClean (0.09s) +=== RUN TestDestroy +2021/04/30 23:31:27 [2544] Creating Set: &{operationFlag:-N name:test-destroy set:azure-npm-1230852354 spec:[nethash]} +2021/04/30 23:31:27 [2544] Executing ipset command ipset [-N -exist azure-npm-1230852354 nethash] +2021/04/30 23:31:27 [2544] Executing ipset command ipset [-A -exist azure-npm-1230852354 1.2.3.4] +2021/04/30 23:31:27 [2544] Executing ipset command ipset [-F -exist] +2021/04/30 23:31:27 [2544] Executing ipset command ipset [-X -exist] +2021/04/30 23:31:27 [2544] Executing ipset command ipset [list -exist azure-npm-1230852354] +2021/04/30 23:31:27 [2544] AppInsights didn't initialized. +2021/04/30 23:31:27 [2544] Error: There was an error running command: [ipset list -exist azure-npm-1230852354] Stderr: [exit status 1, ipset v6.34: The set with the given name does not exist] +2021/04/30 23:31:27 [2544] AppInsights didn't initialized. +2021/04/30 23:31:27 [2544] Executing ipset command ipset [-F -exist] +2021/04/30 23:31:27 [2544] Executing ipset command ipset [-X -exist] +--- PASS: TestDestroy (0.08s) +=== RUN TestRun +2021/04/30 23:31:27 [2544] Executing ipset command ipset [-N -exist test-set nethash] +2021/04/30 23:31:27 [2544] Executing ipset command ipset [-F -exist] +2021/04/30 23:31:27 [2544] Executing ipset command ipset [-X -exist] +--- PASS: TestRun (0.05s) +=== RUN TestDestroyNpmIpsets +2021/04/30 23:31:27 [2544] Creating Set: &{operationFlag:-N name:azure-npm-123456 set:azure-npm-1280682156 spec:[nethash]} +2021/04/30 23:31:27 [2544] Executing ipset command ipset [-N -exist azure-npm-1280682156 nethash] +2021/04/30 23:31:27 [2544] Creating Set: &{operationFlag:-N name:azure-npm-56543 set:azure-npm-30682274 spec:[nethash]} +2021/04/30 23:31:27 [2544] Executing ipset command ipset [-N -exist azure-npm-30682274 nethash] +2021/04/30 23:31:27 [2544] Executing ipset command ipset [-F -exist azure-npm-1280682156] +2021/04/30 23:31:27 [2544] Executing ipset command ipset [-F -exist azure-npm-30682274] +2021/04/30 23:31:27 [2544] Executing ipset command ipset [-X -exist azure-npm-1280682156] +2021/04/30 23:31:27 [2544] Executing ipset command ipset [-X -exist azure-npm-30682274] +--- PASS: TestDestroyNpmIpsets (0.06s) +PASS +coverage: 3.3% of statements in ./... +ok github.com/Azure/azure-container-networking/npm/ipsm 0.852s coverage: 3.3% of statements in ./... +2021/04/30 23:31:27 [2701] Finished initializing all Prometheus metrics +=== RUN TestGetAllChainsAndRules +--- PASS: TestGetAllChainsAndRules (0.00s) +=== RUN TestSave +--- PASS: TestSave (0.00s) +=== RUN TestRestore +--- PASS: TestRestore (0.01s) +=== RUN TestInitNpmChains +2021/04/30 23:31:27 [2701] Initializing AZURE-NPM chains. +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N AZURE-NPM] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N AZURE-NPM-ACCEPT] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N AZURE-NPM-INGRESS] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N AZURE-NPM-EGRESS] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N AZURE-NPM-INGRESS-PORT] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N AZURE-NPM-INGRESS-FROM] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N AZURE-NPM-EGRESS-PORT] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N AZURE-NPM-EGRESS-TO] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N AZURE-NPM-INGRESS-DROPS] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N AZURE-NPM-EGRESS-DROPS] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N AZURE-NPM] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -I FORWARD 1 -j AZURE-NPM] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM -j AZURE-NPM-INGRESS] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM -j AZURE-NPM-EGRESS] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM -j AZURE-NPM-ACCEPT -m mark --mark 0x3000 -m comment --comment ACCEPT-on-INGRESS-and-EGRESS-mark-0x3000] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM -j AZURE-NPM-ACCEPT -m mark --mark 0x2000 -m comment --comment ACCEPT-on-INGRESS-mark-0x2000] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM -j AZURE-NPM-ACCEPT -m mark --mark 0x1000 -m comment --comment ACCEPT-on-EGRESS-mark-0x1000] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM -m state --state RELATED,ESTABLISHED -j ACCEPT -m comment --comment ACCEPT-on-connection-state] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-ACCEPT -j MARK --set-mark 0x0 -m comment --comment Clear-AZURE-NPM-MARKS] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-ACCEPT -j ACCEPT -m comment --comment ACCEPT-All-packets] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS -j AZURE-NPM-INGRESS-PORT] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS -j RETURN -m mark --mark 0x2000 -m comment --comment RETURN-on-INGRESS-mark-0x2000] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS -j AZURE-NPM-INGRESS-DROPS] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS-PORT -j RETURN -m mark --mark 0x2000 -m comment --comment RETURN-on-INGRESS-mark-0x2000] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS-FROM -j RETURN -m mark --mark 0x2000 -m comment --comment RETURN-on-INGRESS-mark-0x2000] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS -j AZURE-NPM-EGRESS-PORT] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS -j RETURN -m mark --mark 0x3000 -m comment --comment RETURN-on-EGRESS-and-INGRESS-mark-0x3000] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS -j RETURN -m mark --mark 0x1000 -m comment --comment RETURN-on-EGRESS-mark-0x1000] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS -j AZURE-NPM-EGRESS-DROPS] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS-PORT -j RETURN -m mark --mark 0x3000 -m comment --comment RETURN-on-EGRESS-and-INGRESS-mark-0x3000] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS-PORT -j RETURN -m mark --mark 0x1000 -m comment --comment RETURN-on-EGRESS-mark-0x1000] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS-TO -j RETURN -m mark --mark 0x3000 -m comment --comment RETURN-on-EGRESS-and-INGRESS-mark-0x3000] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS-TO -j RETURN -m mark --mark 0x1000 -m comment --comment RETURN-on-EGRESS-mark-0x1000] +--- PASS: TestInitNpmChains (0.09s) +=== RUN TestUninitNpmChains +2021/04/30 23:31:27 [2701] Initializing AZURE-NPM chains. +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N AZURE-NPM] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N AZURE-NPM-ACCEPT] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N AZURE-NPM-INGRESS] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N AZURE-NPM-EGRESS] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N AZURE-NPM-INGRESS-PORT] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N AZURE-NPM-INGRESS-FROM] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N AZURE-NPM-EGRESS-PORT] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N AZURE-NPM-EGRESS-TO] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N AZURE-NPM-INGRESS-DROPS] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N AZURE-NPM-EGRESS-DROPS] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N AZURE-NPM] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -I FORWARD 1 -j AZURE-NPM] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM -j AZURE-NPM-INGRESS] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM -j AZURE-NPM-EGRESS] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM -j AZURE-NPM-ACCEPT -m mark --mark 0x3000 -m comment --comment ACCEPT-on-INGRESS-and-EGRESS-mark-0x3000] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM -j AZURE-NPM-ACCEPT -m mark --mark 0x2000 -m comment --comment ACCEPT-on-INGRESS-mark-0x2000] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM -j AZURE-NPM-ACCEPT -m mark --mark 0x1000 -m comment --comment ACCEPT-on-EGRESS-mark-0x1000] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM -m state --state RELATED,ESTABLISHED -j ACCEPT -m comment --comment ACCEPT-on-connection-state] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-ACCEPT -j MARK --set-mark 0x0 -m comment --comment Clear-AZURE-NPM-MARKS] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-ACCEPT -j ACCEPT -m comment --comment ACCEPT-All-packets] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS -j AZURE-NPM-INGRESS-PORT] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS -j RETURN -m mark --mark 0x2000 -m comment --comment RETURN-on-INGRESS-mark-0x2000] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS -j AZURE-NPM-INGRESS-DROPS] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS-PORT -j RETURN -m mark --mark 0x2000 -m comment --comment RETURN-on-INGRESS-mark-0x2000] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS-FROM -j RETURN -m mark --mark 0x2000 -m comment --comment RETURN-on-INGRESS-mark-0x2000] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS -j AZURE-NPM-EGRESS-PORT] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS -j RETURN -m mark --mark 0x3000 -m comment --comment RETURN-on-EGRESS-and-INGRESS-mark-0x3000] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS -j RETURN -m mark --mark 0x1000 -m comment --comment RETURN-on-EGRESS-mark-0x1000] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS -j AZURE-NPM-EGRESS-DROPS] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS-PORT -j RETURN -m mark --mark 0x3000 -m comment --comment RETURN-on-EGRESS-and-INGRESS-mark-0x3000] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS-PORT -j RETURN -m mark --mark 0x1000 -m comment --comment RETURN-on-EGRESS-mark-0x1000] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS-TO -j RETURN -m mark --mark 0x3000 -m comment --comment RETURN-on-EGRESS-and-INGRESS-mark-0x3000] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS-TO -j RETURN -m mark --mark 0x1000 -m comment --comment RETURN-on-EGRESS-mark-0x1000] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -D FORWARD -j AZURE-NPM] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -F AZURE-NPM] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -F AZURE-NPM-ACCEPT] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -F AZURE-NPM-INGRESS] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -F AZURE-NPM-EGRESS] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -F AZURE-NPM-INGRESS-PORT] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -F AZURE-NPM-INGRESS-FROM] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -F AZURE-NPM-EGRESS-PORT] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -F AZURE-NPM-EGRESS-TO] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -F AZURE-NPM-INGRESS-DROPS] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -F AZURE-NPM-EGRESS-DROPS] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -F AZURE-NPM-TARGET-SETS] +2021/04/30 23:31:27 [2701] AppInsights didn't initialized. +2021/04/30 23:31:27 [2701] Error: There was an error running command: [iptables -w 60 -F AZURE-NPM-TARGET-SETS] Stderr: [exit status 1, iptables: No chain/target/match by that name.] +2021/04/30 23:31:27 [2701] AppInsights didn't initialized. +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -F AZURE-NPM-INRGESS-DROPS] +2021/04/30 23:31:27 [2701] AppInsights didn't initialized. +2021/04/30 23:31:27 [2701] Error: There was an error running command: [iptables -w 60 -F AZURE-NPM-INRGESS-DROPS] Stderr: [exit status 1, iptables: No chain/target/match by that name.] +2021/04/30 23:31:27 [2701] AppInsights didn't initialized. +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -X AZURE-NPM] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -X AZURE-NPM-ACCEPT] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -X AZURE-NPM-INGRESS] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -X AZURE-NPM-EGRESS] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -X AZURE-NPM-INGRESS-PORT] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -X AZURE-NPM-INGRESS-FROM] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -X AZURE-NPM-EGRESS-PORT] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -X AZURE-NPM-EGRESS-TO] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -X AZURE-NPM-INGRESS-DROPS] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -X AZURE-NPM-EGRESS-DROPS] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -X AZURE-NPM-TARGET-SETS] +2021/04/30 23:31:27 [2701] AppInsights didn't initialized. +2021/04/30 23:31:27 [2701] Error: There was an error running command: [iptables -w 60 -X AZURE-NPM-TARGET-SETS] Stderr: [exit status 1, iptables: No chain/target/match by that name.] +2021/04/30 23:31:27 [2701] AppInsights didn't initialized. +2021/04/30 23:31:27 [2701] Chain doesn't exist AZURE-NPM-TARGET-SETS. +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -X AZURE-NPM-INRGESS-DROPS] +2021/04/30 23:31:27 [2701] AppInsights didn't initialized. +2021/04/30 23:31:27 [2701] Error: There was an error running command: [iptables -w 60 -X AZURE-NPM-INRGESS-DROPS] Stderr: [exit status 1, iptables: No chain/target/match by that name.] +2021/04/30 23:31:27 [2701] AppInsights didn't initialized. +2021/04/30 23:31:27 [2701] Chain doesn't exist AZURE-NPM-INRGESS-DROPS. +--- PASS: TestUninitNpmChains (0.10s) +=== RUN TestExists +--- PASS: TestExists (0.00s) +=== RUN TestAddChain +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N TEST-CHAIN] +--- PASS: TestAddChain (0.00s) +=== RUN TestDeleteChain +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N TEST-CHAIN] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -X TEST-CHAIN] +--- PASS: TestDeleteChain (0.00s) +=== RUN TestAdd +2021/04/30 23:31:27 [2701] Adding iptables entry: &{Command: Name: Chain:FORWARD Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-j REJECT]}. +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -I FORWARD -j REJECT] +--- PASS: TestAdd (0.00s) +=== RUN TestDelete +2021/04/30 23:31:27 [2701] Adding iptables entry: &{Command: Name: Chain:FORWARD Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-j REJECT]}. +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -I FORWARD -j REJECT] +2021/04/30 23:31:27 [2701] Deleting iptables entry: &{Command: Name: Chain:FORWARD Flag: LockWaitTimeInSeconds:60 IsJumpEntry:false Specs:[-j REJECT]} +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -D FORWARD -j REJECT] +--- PASS: TestDelete (0.00s) +=== RUN TestRun +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N TEST-CHAIN] +--- PASS: TestRun (0.00s) +=== RUN TestGetChainLineNumber +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N KUBE-SERVICES] +2021/04/30 23:31:27 [2701] Initializing AZURE-NPM chains. +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N AZURE-NPM] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N AZURE-NPM-ACCEPT] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N AZURE-NPM-INGRESS] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N AZURE-NPM-EGRESS] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N AZURE-NPM-INGRESS-PORT] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N AZURE-NPM-INGRESS-FROM] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N AZURE-NPM-EGRESS-PORT] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N AZURE-NPM-EGRESS-TO] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N AZURE-NPM-INGRESS-DROPS] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N AZURE-NPM-EGRESS-DROPS] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N AZURE-NPM] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -I FORWARD 1 -j AZURE-NPM] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM -j AZURE-NPM-INGRESS] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM -j AZURE-NPM-EGRESS] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM -j AZURE-NPM-ACCEPT -m mark --mark 0x3000 -m comment --comment ACCEPT-on-INGRESS-and-EGRESS-mark-0x3000] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM -j AZURE-NPM-ACCEPT -m mark --mark 0x2000 -m comment --comment ACCEPT-on-INGRESS-mark-0x2000] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM -j AZURE-NPM-ACCEPT -m mark --mark 0x1000 -m comment --comment ACCEPT-on-EGRESS-mark-0x1000] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM -m state --state RELATED,ESTABLISHED -j ACCEPT -m comment --comment ACCEPT-on-connection-state] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-ACCEPT -j MARK --set-mark 0x0 -m comment --comment Clear-AZURE-NPM-MARKS] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-ACCEPT -j ACCEPT -m comment --comment ACCEPT-All-packets] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS -j AZURE-NPM-INGRESS-PORT] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS -j RETURN -m mark --mark 0x2000 -m comment --comment RETURN-on-INGRESS-mark-0x2000] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS -j AZURE-NPM-INGRESS-DROPS] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS-PORT -j RETURN -m mark --mark 0x2000 -m comment --comment RETURN-on-INGRESS-mark-0x2000] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS-FROM -j RETURN -m mark --mark 0x2000 -m comment --comment RETURN-on-INGRESS-mark-0x2000] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS -j AZURE-NPM-EGRESS-PORT] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS -j RETURN -m mark --mark 0x3000 -m comment --comment RETURN-on-EGRESS-and-INGRESS-mark-0x3000] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS -j RETURN -m mark --mark 0x1000 -m comment --comment RETURN-on-EGRESS-mark-0x1000] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS -j AZURE-NPM-EGRESS-DROPS] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS-PORT -j RETURN -m mark --mark 0x3000 -m comment --comment RETURN-on-EGRESS-and-INGRESS-mark-0x3000] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS-PORT -j RETURN -m mark --mark 0x1000 -m comment --comment RETURN-on-EGRESS-mark-0x1000] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS-TO -j RETURN -m mark --mark 0x3000 -m comment --comment RETURN-on-EGRESS-and-INGRESS-mark-0x3000] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS-TO -j RETURN -m mark --mark 0x1000 -m comment --comment RETURN-on-EGRESS-mark-0x1000] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -D FORWARD -j AZURE-NPM] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -F AZURE-NPM] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -F AZURE-NPM-ACCEPT] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -F AZURE-NPM-INGRESS] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -F AZURE-NPM-EGRESS] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -F AZURE-NPM-INGRESS-PORT] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -F AZURE-NPM-INGRESS-FROM] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -F AZURE-NPM-EGRESS-PORT] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -F AZURE-NPM-EGRESS-TO] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -F AZURE-NPM-INGRESS-DROPS] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -F AZURE-NPM-EGRESS-DROPS] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -F AZURE-NPM-TARGET-SETS] +2021/04/30 23:31:27 [2701] AppInsights didn't initialized. +2021/04/30 23:31:27 [2701] Error: There was an error running command: [iptables -w 60 -F AZURE-NPM-TARGET-SETS] Stderr: [exit status 1, iptables: No chain/target/match by that name.] +2021/04/30 23:31:27 [2701] AppInsights didn't initialized. +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -F AZURE-NPM-INRGESS-DROPS] +2021/04/30 23:31:27 [2701] AppInsights didn't initialized. +2021/04/30 23:31:27 [2701] Error: There was an error running command: [iptables -w 60 -F AZURE-NPM-INRGESS-DROPS] Stderr: [exit status 1, iptables: No chain/target/match by that name.] +2021/04/30 23:31:27 [2701] AppInsights didn't initialized. +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -X AZURE-NPM] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -X AZURE-NPM-ACCEPT] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -X AZURE-NPM-INGRESS] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -X AZURE-NPM-EGRESS] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -X AZURE-NPM-INGRESS-PORT] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -X AZURE-NPM-INGRESS-FROM] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -X AZURE-NPM-EGRESS-PORT] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -X AZURE-NPM-EGRESS-TO] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -X AZURE-NPM-INGRESS-DROPS] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -X AZURE-NPM-EGRESS-DROPS] +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -X AZURE-NPM-TARGET-SETS] +2021/04/30 23:31:27 [2701] AppInsights didn't initialized. +2021/04/30 23:31:27 [2701] Error: There was an error running command: [iptables -w 60 -X AZURE-NPM-TARGET-SETS] Stderr: [exit status 1, iptables: No chain/target/match by that name.] +2021/04/30 23:31:27 [2701] AppInsights didn't initialized. +2021/04/30 23:31:27 [2701] Chain doesn't exist AZURE-NPM-TARGET-SETS. +2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -X AZURE-NPM-INRGESS-DROPS] +2021/04/30 23:31:27 [2701] AppInsights didn't initialized. +2021/04/30 23:31:27 [2701] Error: There was an error running command: [iptables -w 60 -X AZURE-NPM-INRGESS-DROPS] Stderr: [exit status 1, iptables: No chain/target/match by that name.] +2021/04/30 23:31:27 [2701] AppInsights didn't initialized. +2021/04/30 23:31:27 [2701] Chain doesn't exist AZURE-NPM-INRGESS-DROPS. +--- PASS: TestGetChainLineNumber (0.09s) +PASS +coverage: 2.7% of statements in ./... +ok github.com/Azure/azure-container-networking/npm/iptm 0.434s coverage: 2.7% of statements in ./... +=== RUN TestPrometheusNodeHandler +2021/04/30 23:31:28 [3199] Finished initializing all Prometheus metrics +--- PASS: TestPrometheusNodeHandler (0.00s) +=== RUN TestPrometheusClusterHandler +--- PASS: TestPrometheusClusterHandler (0.00s) +PASS +coverage: 1.0% of statements in ./... +ok github.com/Azure/azure-container-networking/npm/metrics 0.122s coverage: 1.0% of statements in ./... +? github.com/Azure/azure-container-networking/npm/metrics/promutil [no test files] +? github.com/Azure/azure-container-networking/npm/plugin [no test files] +=== RUN TestSortMap +--- PASS: TestSortMap (0.00s) +=== RUN TestCompareK8sVer +--- PASS: TestCompareK8sVer (0.00s) +=== RUN TestIsNewNwPolicyVer +--- PASS: TestIsNewNwPolicyVer (0.00s) +=== RUN TestDropEmptyFields +--- PASS: TestDropEmptyFields (0.00s) +=== RUN TestCompareResourceVersions +--- PASS: TestCompareResourceVersions (0.00s) +=== RUN TestInValidOldResourceVersions +2021/04/30 23:31:29 [3597] Error: while parsing resource version to uint64 sssss +--- PASS: TestInValidOldResourceVersions (0.00s) +=== RUN TestInValidNewResourceVersions +2021/04/30 23:31:29 [3597] Error: while parsing resource version to uint64 sssss +--- PASS: TestInValidNewResourceVersions (0.00s) +=== RUN TestParseResourceVersion +2021/04/30 23:31:29 [3597] Error: while parsing resource version to uint64 string +--- PASS: TestParseResourceVersion (0.00s) +PASS +coverage: 1.2% of statements in ./... +ok github.com/Azure/azure-container-networking/npm/util 0.135s coverage: 1.2% of statements in ./... +? github.com/Azure/azure-container-networking/npm/util/errors [no test files] +? github.com/Azure/azure-container-networking/ovsctl [no test files] +=== RUN TestGetLastRebootTime +--- PASS: TestGetLastRebootTime (0.01s) +=== RUN TestGetOSDetails +--- PASS: TestGetOSDetails (0.00s) +=== RUN TestGetProcessNameByID +2021/04/30 23:31:29 [3689] [Azure-Utils] ps -p 3689 -o comm= +--- PASS: TestGetProcessNameByID (0.01s) +=== RUN TestReadFileByLines +--- PASS: TestReadFileByLines (0.00s) +=== RUN TestFileExists +--- PASS: TestFileExists (0.00s) +PASS +coverage: 1.2% of statements in ./... +ok github.com/Azure/azure-container-networking/platform 0.159s coverage: 1.2% of statements in ./... +? github.com/Azure/azure-container-networking/proto/nodenetworkservice/3.302.0.744 [no test files] +=== RUN TestPemConsumptionLinux +--- PASS: TestPemConsumptionLinux (0.65s) +PASS +coverage: 1.0% of statements in ./... +ok github.com/Azure/azure-container-networking/server/tls 0.774s coverage: 1.0% of statements in ./... +=== RUN TestKeyValuePairsAreReinstantiatedFromJSONFile +--- PASS: TestKeyValuePairsAreReinstantiatedFromJSONFile (0.00s) +=== RUN TestKeyValuePairsArePersistedToJSONFile +--- PASS: TestKeyValuePairsArePersistedToJSONFile (0.00s) +=== RUN TestKeyValuePairsAreWrittenAndReadCorrectly +--- PASS: TestKeyValuePairsAreWrittenAndReadCorrectly (0.00s) +=== RUN TestLockingStoreGivesExclusiveAccess +--- PASS: TestLockingStoreGivesExclusiveAccess (0.00s) +PASS +coverage: 1.3% of statements in ./... +ok github.com/Azure/azure-container-networking/store 0.184s coverage: 1.3% of statements in ./... +2021/04/30 23:31:31 [3741] [Listener] Started listening on localhost:3501. +2021/04/30 23:31:31 [3741] [Listener] Started listening on localhost:3500. +2021/04/30 23:31:31 [3741] [Azure-Utils] cp metadata_test.json /tmp/azuremetadata.json +2021/04/30 23:31:31 [3741] Telemetry service started +2021/04/30 23:31:31 [3741] [Telemetry] Buffer telemetry data and send it to host +=== RUN TestGetOSDetails +--- PASS: TestGetOSDetails (0.00s) +=== RUN TestGetSystemDetails +--- PASS: TestGetSystemDetails (0.00s) +=== RUN TestGetInterfaceDetails +--- PASS: TestGetInterfaceDetails (0.00s) +=== RUN TestGetReportState +[Telemetry] File not exist /var/run/AzureCNITelemetry.json--- PASS: TestGetReportState (0.00s) +=== RUN TestSendTelemetry +--- PASS: TestSendTelemetry (0.00s) +=== RUN TestCloseTelemetryConnection +2021/04/30 23:31:31 [3741] [Telemetry] server cancel event +2021/04/30 23:31:31 [3741] server close +2021/04/30 23:31:31 [3741] Telemetry Server accept error accept unix /var/run/azure-vnet-telemetry.sock: use of closed network connection +--- PASS: TestCloseTelemetryConnection (0.30s) +=== RUN TestServerCloseTelemetryConnection +2021/04/30 23:31:31 [3741] Telemetry service started +2021/04/30 23:31:31 [3741] [Telemetry] Buffer telemetry data and send it to host +2021/04/30 23:31:31 [3741] [Telemetry] server cancel event +2021/04/30 23:31:31 [3741] server close +2021/04/30 23:31:31 [3741] Telemetry Server accept error accept unix /var/run/azure-vnet-telemetry.sock: use of closed network connection +--- PASS: TestServerCloseTelemetryConnection (0.30s) +=== RUN TestClientCloseTelemetryConnection +2021/04/30 23:31:31 [3741] Telemetry service started +2021/04/30 23:31:31 [3741] [Telemetry] Buffer telemetry data and send it to host +--- PASS: TestClientCloseTelemetryConnection (0.30s) +=== RUN TestReadConfigFile +2021/04/30 23:31:32 [3741] [Telemetry] server cancel event +2021/04/30 23:31:32 [3741] server close +2021/04/30 23:31:32 [3741] Telemetry Server accept error accept unix /var/run/azure-vnet-telemetry.sock: use of closed network connection +2021/04/30 23:31:32 [3741] [Telemetry] Failed to read telemetry config: open a.config: no such file or directory +2021/04/30 23:31:32 [3741] [Telemetry] unmarshal failed with invalid character '/' looking for beginning of value +--- PASS: TestReadConfigFile (0.00s) +=== RUN TestStartTelemetryService +2021/04/30 23:31:32 [3741] [Azure-Utils] pkill -f azure-vnet-telemetry +2021/04/30 23:31:32 [3741] [Telemetry] Starting telemetry service process : args:[] +2021/04/30 23:31:32 [3741] [Telemetry] Failed to start telemetry service process :fork/exec : no such file or directory +--- PASS: TestStartTelemetryService (0.00s) +=== RUN TestWaitForTelemetrySocket +--- PASS: TestWaitForTelemetrySocket (0.01s) +=== RUN TestSetReportState +--- PASS: TestSetReportState (0.00s) +PASS +coverage: 2.7% of statements in ./... +2021/04/30 23:31:32 [3741] [Azure-Utils] rm /tmp/azuremetadata.json +2021/04/30 23:31:32 [3741] [Listener] Stopped listening on localhost:3501 +ok github.com/Azure/azure-container-networking/telemetry 1.068s coverage: 2.7% of statements in ./... +? github.com/Azure/azure-container-networking/test/nnsmockserver [no test files] +? github.com/Azure/azure-container-networking/test/nnsmockserver/nnsmock [no test files] +? github.com/Azure/azure-container-networking/testutils [no test files] +? github.com/Azure/azure-container-networking/tools/acncli [no test files] +? github.com/Azure/azure-container-networking/tools/acncli/api [no test files] +? github.com/Azure/azure-container-networking/tools/acncli/cmd [no test files] +? github.com/Azure/azure-container-networking/tools/acncli/cmd/cni [no test files] +? github.com/Azure/azure-container-networking/tools/acncli/cmd/npm [no test files] +? github.com/Azure/azure-container-networking/tools/acncli/cmd/npm/get [no test files] +? github.com/Azure/azure-container-networking/tools/acncli/installer [no test files] From af0872608a064d6cc5db77751b39b6092c879ead Mon Sep 17 00:00:00 2001 From: Mathew Merrick Date: Mon, 3 May 2021 17:20:23 +0000 Subject: [PATCH 14/19] remove logs --- npm/ipsm/ipsm.go | 42 +- npm/ipsm/ipsm_test.go | 6 +- npm/npm.go | 2 + npm/plugin/main.go | 4 +- npm/podController_test.go | 5 +- output.txt | 5362 ------------------------------------- 6 files changed, 22 insertions(+), 5399 deletions(-) delete mode 100644 output.txt diff --git a/npm/ipsm/ipsm.go b/npm/ipsm/ipsm.go index f5dbd20993..7e10a56ce9 100644 --- a/npm/ipsm/ipsm.go +++ b/npm/ipsm/ipsm.go @@ -103,7 +103,7 @@ func (ipsMgr *IpsetManager) CreateList(listName string) error { spec: []string{util.IpsetSetListFlag}, } log.Logf("Creating List: %+v", entry) - if errCode, err := ipsMgr.Run(entry); err != nil && errCode != 1 { + if err := ipsMgr.Run(entry); err != nil { metrics.SendErrorLogAndMetric(util.IpsmID, "Error: failed to create ipset list %s.", listName) return err } @@ -120,11 +120,7 @@ func (ipsMgr *IpsetManager) DeleteList(listName string) error { set: util.GetHashedName(listName), } - if errCode, err := ipsMgr.Run(entry); err != nil { - if errCode == 1 { - return nil - } - + if err := ipsMgr.Run(entry); err != nil { metrics.SendErrorLogAndMetric(util.IpsmID, "Error: failed to delete ipset %s %+v", listName, entry) return err } @@ -173,7 +169,7 @@ func (ipsMgr *IpsetManager) AddToList(listName string, setName string) error { } // add set to list - if errCode, err := ipsMgr.Run(entry); err != nil && errCode != 1 { + if err := ipsMgr.Run(entry); err != nil { return fmt.Errorf("Error: failed to create ipset rules. rule: %+v, error: %v", entry, err) } @@ -221,7 +217,7 @@ func (ipsMgr *IpsetManager) DeleteFromList(listName string, setName string) erro spec: []string{hashedSetName}, } - if _, err := ipsMgr.Run(entry); err != nil { + if err := ipsMgr.Run(entry); err != nil { metrics.SendErrorLogAndMetric(util.IpsmID, "Error: failed to delete ipset entry. %+v", entry) return err } @@ -257,7 +253,7 @@ func (ipsMgr *IpsetManager) CreateSet(setName string, spec []string) error { spec: spec, } log.Logf("Creating Set: %+v", entry) - if errCode, err := ipsMgr.Run(entry); err != nil && errCode != 1 { + if err := ipsMgr.Run(entry); err != nil { metrics.SendErrorLogAndMetric(util.IpsmID, "Error: failed to create ipset.") return err } @@ -283,11 +279,7 @@ func (ipsMgr *IpsetManager) DeleteSet(setName string) error { set: util.GetHashedName(setName), } - if errCode, err := ipsMgr.Run(entry); err != nil { - if errCode == 1 { - return nil - } - + if err := ipsMgr.Run(entry); err != nil { metrics.SendErrorLogAndMetric(util.IpsmID, "Error: failed to delete ipset %s. Entry: %+v", setName, entry) return err } @@ -351,7 +343,7 @@ func (ipsMgr *IpsetManager) AddToSet(setName, ip, spec, podKey string) error { } // todo: check err handling besides error code, corrupt state possible here - if errCode, err := ipsMgr.Run(entry); err != nil && errCode != 1 { + if err := ipsMgr.Run(entry); err != nil { metrics.SendErrorLogAndMetric(util.IpsmID, "Error: failed to create ipset rules. %+v", entry) return err } @@ -401,11 +393,7 @@ func (ipsMgr *IpsetManager) DeleteFromSet(setName, ip, podKey string) error { spec: append([]string{ip}), } - if errCode, err := ipsMgr.Run(entry); err != nil { - if errCode == 1 { - return nil - } - + if err := ipsMgr.Run(entry); err != nil { metrics.SendErrorLogAndMetric(util.IpsmID, "Error: failed to delete ipset entry. Entry: %+v", entry) return err } @@ -455,13 +443,13 @@ func (ipsMgr *IpsetManager) Destroy() error { entry := &ipsEntry{ operationFlag: util.IpsetFlushFlag, } - if _, err := ipsMgr.Run(entry); err != nil { + if err := ipsMgr.Run(entry); err != nil { metrics.SendErrorLogAndMetric(util.IpsmID, "Error: failed to flush ipset") return err } entry.operationFlag = util.IpsetDestroyFlag - if _, err := ipsMgr.Run(entry); err != nil { + if err := ipsMgr.Run(entry); err != nil { metrics.SendErrorLogAndMetric(util.IpsmID, "Error: failed to destroy ipset") return err } @@ -472,7 +460,7 @@ func (ipsMgr *IpsetManager) Destroy() error { } // Run execute an ipset command to update ipset. -func (ipsMgr *IpsetManager) Run(entry *ipsEntry) (int, error) { +func (ipsMgr *IpsetManager) Run(entry *ipsEntry) error { cmdName := util.Ipset cmdArgs := append([]string{entry.operationFlag, util.IpsetExistFlag, entry.set}, entry.spec...) cmdArgs = util.DropEmptyFields(cmdArgs) @@ -483,10 +471,10 @@ func (ipsMgr *IpsetManager) Run(entry *ipsEntry) (int, error) { output, err := cmd.CombinedOutput() if err != nil { metrics.SendErrorLogAndMetric(util.IpsmID, "Error: There was an error running command: [%s %v] Stderr: [%v, %s]", cmdName, strings.Join(cmdArgs, " "), err, strings.TrimSuffix(string(output), "\n")) - return 1, err + return err } - return 0, nil + return nil } // Save saves ipset to file. @@ -587,7 +575,7 @@ func (ipsMgr *IpsetManager) DestroyNpmIpsets() error { set: ipsetName, } - if _, err := ipsMgr.Run(entry); err != nil { + if err := ipsMgr.Run(entry); err != nil { metrics.SendErrorLogAndMetric(util.IpsmID, "{DestroyNpmIpsets} Error: failed to flush ipset %s", ipsetName) } } @@ -595,7 +583,7 @@ func (ipsMgr *IpsetManager) DestroyNpmIpsets() error { for _, ipsetName := range ipsetLists { entry.operationFlag = util.IpsetDestroyFlag entry.set = ipsetName - if _, err := ipsMgr.Run(entry); err != nil { + if err := ipsMgr.Run(entry); err != nil { metrics.SendErrorLogAndMetric(util.IpsmID, "{DestroyNpmIpsets} Error: failed to destroy ipset %s", ipsetName) } } diff --git a/npm/ipsm/ipsm_test.go b/npm/ipsm/ipsm_test.go index 7ef787a91b..38c0941a29 100644 --- a/npm/ipsm/ipsm_test.go +++ b/npm/ipsm/ipsm_test.go @@ -489,7 +489,7 @@ func TestDestroy(t *testing.T) { set: util.GetHashedName(setName), } - if _, err := ipsMgr.Run(entry); err == nil { + if err := ipsMgr.Run(entry); err == nil { t.Errorf("TestDestroy failed @ ipsMgr.Destroy since %s still exist in kernel with err %+v", setName, err) } } else { @@ -500,7 +500,7 @@ func TestDestroy(t *testing.T) { spec: append([]string{testIP}), } - if _, err := ipsMgr.Run(entry); err == nil { + if err := ipsMgr.Run(entry); err == nil { t.Errorf("TestDestroy failed @ ipsMgr.Destroy since %s still exist in ipset with err %+v", testIP, err) } } @@ -523,7 +523,7 @@ func TestRun(t *testing.T) { set: "test-set", spec: append([]string{util.IpsetNetHashFlag}), } - if _, err := ipsMgr.Run(entry); err != nil { + if err := ipsMgr.Run(entry); err != nil { t.Errorf("TestRun failed @ ipsMgr.Run with err %+v", err) } } diff --git a/npm/npm.go b/npm/npm.go index 4b804fd9ee..99ed6138c9 100644 --- a/npm/npm.go +++ b/npm/npm.go @@ -11,6 +11,7 @@ import ( "github.com/Azure/azure-container-networking/aitelemetry" "github.com/Azure/azure-container-networking/log" + "github.com/Azure/azure-container-networking/npm/ipsm" "github.com/Azure/azure-container-networking/npm/iptm" "github.com/Azure/azure-container-networking/npm/metrics" "github.com/Azure/azure-container-networking/npm/util" @@ -207,6 +208,7 @@ func NewNetworkPolicyManager(clientset *kubernetes.Clientset, informerFactory in iptMgr.UninitNpmChains() log.Logf("Azure-NPM creating, cleaning existing Azure NPM IPSets") + ipsm.NewIpsetManager(exec).DestroyNpmIpsets() var ( podInformer = informerFactory.Core().V1().Pods() diff --git a/npm/plugin/main.go b/npm/plugin/main.go index 1964f0824a..b36a7b8059 100644 --- a/npm/plugin/main.go +++ b/npm/plugin/main.go @@ -74,9 +74,7 @@ func main() { log.Logf("[INFO] Resync period for NPM pod is set to %d.", int(resyncPeriod/time.Minute)) factory := informers.NewSharedInformerFactory(clientset, resyncPeriod) - exec := exec.New() - - npMgr := npm.NewNetworkPolicyManager(clientset, factory, exec, version) + npMgr := npm.NewNetworkPolicyManager(clientset, factory, exec.New(), version) metrics.CreateTelemetryHandle(npMgr.GetAppVersion(), npm.GetAIMetadata()) restserver := restserver.NewNpmRestServer(restserver.DefaultHTTPListeningAddress) diff --git a/npm/podController_test.go b/npm/podController_test.go index 960d3565ed..bb6463c319 100644 --- a/npm/podController_test.go +++ b/npm/podController_test.go @@ -306,7 +306,6 @@ func TestAddPod(t *testing.T) { f.newPodController(stopCh) addPod(t, f, podObj) - fmt.Println(fcmd.CombinedOutputLog) testCases := []expectedValues{ {1, 2, 0}, } @@ -417,12 +416,11 @@ func TestDeletePod(t *testing.T) { testCases := []expectedValues{ {0, 2, 0}, } - + checkPodTestResult("TestDeletePod", f, testCases) if _, exists := f.npMgr.PodMap[podKey]; exists { t.Error("TestDeletePod failed @ cached pod obj exists check") } - require.Equal(len(calls), len(fcmd.CombinedOutputLog)) for i, call := range calls { require.Equalf(call.cmd, fcmd.CombinedOutputLog[i], "Call [%d] doesn't match expected", i) @@ -565,7 +563,6 @@ func TestDeletePodWithTombstoneAfterAddingPod(t *testing.T) { f.newPodController(stopCh) deletePod(t, f, podObj, DeletedFinalStateUnknownObject) - testCases := []expectedValues{ {0, 2, 0}, } diff --git a/output.txt b/output.txt deleted file mode 100644 index befb3b5a64..0000000000 --- a/output.txt +++ /dev/null @@ -1,5362 +0,0 @@ -go test -coverpkg=./... -v -race -covermode atomic -failfast -coverprofile=coverage.out ./... -TestST LogDir configuration succeeded -=== RUN TestEmptyAIKey ---- PASS: TestEmptyAIKey (0.00s) -=== RUN TestNewAITelemetry ---- PASS: TestNewAITelemetry (0.00s) -=== RUN TestTrackMetric ---- PASS: TestTrackMetric (0.00s) -=== RUN TestTrackLog ---- PASS: TestTrackLog (0.00s) -=== RUN TestTrackEvent ---- PASS: TestTrackEvent (0.00s) -=== RUN TestClose ---- PASS: TestClose (0.46s) -=== RUN TestClosewithoutSend ---- PASS: TestClosewithoutSend (0.00s) -PASS -coverage: 2.5% of statements in ./... -ok github.com/Azure/azure-container-networking/aitelemetry 0.600s coverage: 2.5% of statements in ./... -? github.com/Azure/azure-container-networking/cni [no test files] -=== RUN TestIpam -Running Suite: Ipam Suite -========================= -Random Seed: 1619825477 -Will run 14 of 14 specs - -2021/04/30 23:31:18 [1636] [Listener] Started listening on localhost:42424. -•2021/04/30 23:31:18 [1636] [cni-ipam] Plugin ipamtest version . -2021/04/30 23:31:18 [1636] [cni-ipam] Running on Linux version 4.15.0-142-generic (buildd@lgw01-amd64-036) (gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)) #146-Ubuntu SMP Tue Apr 13 01:11:19 UTC 2021 -2021/04/30 23:31:18 [1636] [ipam] ipam store is nil -2021/04/30 23:31:18 [1636] [ipam] Starting source azure. -2021/04/30 23:31:18 [1636] [cni-ipam] Plugin started. -•2021/04/30 23:31:18 [1636] [cni-ipam] Processing ADD command with args {ContainerID: Netns: IfName: Args: Path: StdinData:{ - "cniversion": "0.4.0", - "ipam": { - "type": "internal", - "subnet": "", - "ipAddress": "" - } - }}. -2021/04/30 23:31:18 [1636] [cni-ipam] Read network configuration &{CNIVersion:0.4.0 Name: Type: Mode: Master: AdapterName: Bridge: LogLevel: LogTarget: InfraVnetAddressSpace: IPV6Mode: ServiceCidrs: VnetCidrs: PodNamespaceForDualNetwork:[] IPsToRouteViaHost:[] MultiTenancy:false EnableSnatOnHost:false EnableExactMatchForPodName:false DisableHairpinOnHostInterface:false DisableIPTableLock:false CNSUrl: ExecutionMode: Ipam:{Type:internal Environment: AddrSpace: Subnet: Address: QueryInterval:} DNS:{Nameservers:[] Domain: Search:[] Options:[]} RuntimeConfig:{PortMappings:[] DNS:{Servers:[] Searches:[] Options:[]}} AdditionalArgs:[]}. -2021/04/30 23:31:18 [1636] [ipam] Starting source azure. -2021/04/30 23:31:18 [1636] [ipam] Refreshing address source. -2021/04/30 23:31:18 [1636] [Utils] Initializing HTTP client with connection timeout: 10, response header timeout: 10 -2021/04/30 23:31:18 [1636] [ipam] Wireserver call http://localhost:42424 to retrieve IP List -2021/04/30 23:31:18 [1636] [ipam] got 3 addresses from interface lo, subnet 10.0.0.0/16 -2021/04/30 23:31:18 [1636] [ipam] ipam store is nil. -2021/04/30 23:31:18 [1636] [ipam] Requesting pool with poolId: options:map[azure.address.id: azure.interface.name:] v6:false. -2021/04/30 23:31:18 [1636] [ipam] Checking pool 10.0.0.0/16. -2021/04/30 23:31:18 [1636] [ipam] Pool 10.0.0.0/16 matches requirements. -2021/04/30 23:31:18 [1636] [ipam] Pool request completed with pool:&{as:0xc00033f650 Id:10.0.0.0/16 IfName:lo Subnet:{IP:10.0.0.0 Mask:ffff0000} Gateway:10.0.0.1 Addresses:map[10.0.0.5:0xc00008b440 10.0.0.6:0xc00008b480 10.0.0.7:0xc00008b4c0] addrsByID:map[] IsIPv6:false Priority:0 RefCount:1 epoch:0} err:. -2021/04/30 23:31:18 [1636] [ipam] ipam store is nil. -2021/04/30 23:31:18 [1636] [cni-ipam] Allocated address poolID 10.0.0.0/16 with subnet 10.0.0.0/16. -2021/04/30 23:31:18 [1636] [ipam] Refreshing address source. -2021/04/30 23:31:18 [1636] [ipam] Requesting address with address: options:map[azure.address.id: azure.interface.name:]. -2021/04/30 23:31:18 [1636] [ipam] Address request completed with address:10.0.0.5/16 -2021/04/30 23:31:18 [1636] [ipam] ipam store is nil. -2021/04/30 23:31:18 [1636] [cni-ipam] Allocated address 10.0.0.5/16. -2021/04/30 23:31:18 [1636] [cni-ipam] ADD command completed with result:IP:[{Version:4 Interface: Address:{IP:10.0.0.5 Mask:ffff0000} Gateway:10.0.0.1}], Routes:[{Dst:{IP:0.0.0.0 Mask:00000000} GW:10.0.0.1}], DNS:{Nameservers:[168.63.129.16] Domain: Search:[] Options:[]} err:. -•2021/04/30 23:31:18 [1636] [cni-ipam] Processing DEL command with args {ContainerID: Netns: IfName: Args: Path: StdinData:{ - "cniversion": "0.4.0", - "ipam": { - "type": "internal", - "subnet": "10.0.0.0/16", - "ipAddress": "10.0.0.5" - } - }}. -2021/04/30 23:31:18 [1636] [cni-ipam] Read network configuration &{CNIVersion:0.4.0 Name: Type: Mode: Master: AdapterName: Bridge: LogLevel: LogTarget: InfraVnetAddressSpace: IPV6Mode: ServiceCidrs: VnetCidrs: PodNamespaceForDualNetwork:[] IPsToRouteViaHost:[] MultiTenancy:false EnableSnatOnHost:false EnableExactMatchForPodName:false DisableHairpinOnHostInterface:false DisableIPTableLock:false CNSUrl: ExecutionMode: Ipam:{Type:internal Environment: AddrSpace: Subnet:10.0.0.0/16 Address:10.0.0.5 QueryInterval:} DNS:{Nameservers:[] Domain: Search:[] Options:[]} RuntimeConfig:{PortMappings:[] DNS:{Servers:[] Searches:[] Options:[]}} AdditionalArgs:[]}. -2021/04/30 23:31:18 [1636] [ipam] Starting source azure. -2021/04/30 23:31:18 [1636] [ipam] Refreshing address source. -2021/04/30 23:31:18 [1636] [Utils] Initializing HTTP client with connection timeout: 10, response header timeout: 10 -2021/04/30 23:31:18 [1636] [ipam] Wireserver call http://localhost:42424 to retrieve IP List -2021/04/30 23:31:18 [1636] [ipam] got 3 addresses from interface lo, subnet 10.0.0.0/16 -2021/04/30 23:31:18 [1636] [ipam] merging address space -2021/04/30 23:31:18 [1636] [ipam] ipam store is nil. -2021/04/30 23:31:18 [1636] [ipam] Releasing address with address:10.0.0.5 options:map[azure.address.id:]. -2021/04/30 23:31:18 [1636] [ipam] Address release completed with address:10.0.0.5 err:. -2021/04/30 23:31:18 [1636] [ipam] ipam store is nil. -2021/04/30 23:31:18 [1636] [cni-ipam] DEL command completed with err:. -•2021/04/30 23:31:18 [1636] [cni-ipam] Processing DEL command with args {ContainerID: Netns: IfName: Args: Path: StdinData:{ - "cniversion": "0.4.0", - "ipam": { - "type": "internal", - "subnet": "10.0.0.0/16", - "ipAddress": "" - } - }}. -2021/04/30 23:31:18 [1636] [cni-ipam] Read network configuration &{CNIVersion:0.4.0 Name: Type: Mode: Master: AdapterName: Bridge: LogLevel: LogTarget: InfraVnetAddressSpace: IPV6Mode: ServiceCidrs: VnetCidrs: PodNamespaceForDualNetwork:[] IPsToRouteViaHost:[] MultiTenancy:false EnableSnatOnHost:false EnableExactMatchForPodName:false DisableHairpinOnHostInterface:false DisableIPTableLock:false CNSUrl: ExecutionMode: Ipam:{Type:internal Environment: AddrSpace: Subnet:10.0.0.0/16 Address: QueryInterval:} DNS:{Nameservers:[] Domain: Search:[] Options:[]} RuntimeConfig:{PortMappings:[] DNS:{Servers:[] Searches:[] Options:[]}} AdditionalArgs:[]}. -2021/04/30 23:31:18 [1636] [ipam] Starting source azure. -2021/04/30 23:31:18 [1636] [ipam] Refreshing address source. -2021/04/30 23:31:18 [1636] [Utils] Initializing HTTP client with connection timeout: 10, response header timeout: 10 -2021/04/30 23:31:18 [1636] [ipam] Wireserver call http://localhost:42424 to retrieve IP List -2021/04/30 23:31:18 [1636] [ipam] got 3 addresses from interface lo, subnet 10.0.0.0/16 -2021/04/30 23:31:18 [1636] [ipam] merging address space -2021/04/30 23:31:18 [1636] [ipam] ipam store is nil. -2021/04/30 23:31:18 [1636] [ipam] Releasing address with address: options:map[azure.address.id:]. -2021/04/30 23:31:18 [1636] Address not found. Not Returning error -2021/04/30 23:31:18 [1636] [ipam] Address release completed with address: err:. -2021/04/30 23:31:18 [1636] [ipam] ipam store is nil. -2021/04/30 23:31:18 [1636] [cni-ipam] DEL command completed with err:. -•2021/04/30 23:31:18 [1636] [cni-ipam] Processing ADD command with args {ContainerID: Netns: IfName: Args: Path: StdinData:{ - "cniversion": "0.4.0", - "ipam": { - "type": "internal", - "subnet": "", - "ipAddress": "10.0.0.6" - } - }}. -2021/04/30 23:31:18 [1636] [cni-ipam] Read network configuration &{CNIVersion:0.4.0 Name: Type: Mode: Master: AdapterName: Bridge: LogLevel: LogTarget: InfraVnetAddressSpace: IPV6Mode: ServiceCidrs: VnetCidrs: PodNamespaceForDualNetwork:[] IPsToRouteViaHost:[] MultiTenancy:false EnableSnatOnHost:false EnableExactMatchForPodName:false DisableHairpinOnHostInterface:false DisableIPTableLock:false CNSUrl: ExecutionMode: Ipam:{Type:internal Environment: AddrSpace: Subnet: Address:10.0.0.6 QueryInterval:} DNS:{Nameservers:[] Domain: Search:[] Options:[]} RuntimeConfig:{PortMappings:[] DNS:{Servers:[] Searches:[] Options:[]}} AdditionalArgs:[]}. -2021/04/30 23:31:18 [1636] [ipam] Starting source azure. -2021/04/30 23:31:18 [1636] [ipam] Refreshing address source. -2021/04/30 23:31:18 [1636] [Utils] Initializing HTTP client with connection timeout: 10, response header timeout: 10 -2021/04/30 23:31:18 [1636] [ipam] Wireserver call http://localhost:42424 to retrieve IP List -2021/04/30 23:31:18 [1636] [ipam] got 3 addresses from interface lo, subnet 10.0.0.0/16 -2021/04/30 23:31:18 [1636] [ipam] merging address space -2021/04/30 23:31:18 [1636] [ipam] ipam store is nil. -2021/04/30 23:31:18 [1636] [ipam] Requesting pool with poolId: options:map[azure.address.id: azure.interface.name:] v6:false. -2021/04/30 23:31:18 [1636] [ipam] Checking pool 10.0.0.0/16. -2021/04/30 23:31:18 [1636] [ipam] Pool 10.0.0.0/16 is in use. -2021/04/30 23:31:18 [1636] [ipam] Releasing pool 10.0.0.0/16 as there are no allocations -2021/04/30 23:31:18 [1636] [ipam] Pool 10.0.0.0/16 matches requirements. -2021/04/30 23:31:18 [1636] [ipam] Pool request completed with pool:&{as:0xc00033f650 Id:10.0.0.0/16 IfName:lo Subnet:{IP:10.0.0.0 Mask:ffff0000} Gateway:10.0.0.1 Addresses:map[10.0.0.5:0xc00008b440 10.0.0.6:0xc00008b480 10.0.0.7:0xc00008b4c0] addrsByID:map[] IsIPv6:false Priority:0 RefCount:1 epoch:3} err:. -2021/04/30 23:31:18 [1636] [ipam] ipam store is nil. -2021/04/30 23:31:18 [1636] [cni-ipam] Allocated address poolID 10.0.0.0/16 with subnet 10.0.0.0/16. -2021/04/30 23:31:18 [1636] [ipam] Refreshing address source. -2021/04/30 23:31:18 [1636] [ipam] Requesting address with address:10.0.0.6 options:map[azure.address.id: azure.interface.name:]. -2021/04/30 23:31:18 [1636] [ipam] Address request completed with address:10.0.0.6/16 -2021/04/30 23:31:18 [1636] [ipam] ipam store is nil. -2021/04/30 23:31:18 [1636] [cni-ipam] Allocated address 10.0.0.6/16. -2021/04/30 23:31:18 [1636] [cni-ipam] ADD command completed with result:IP:[{Version:4 Interface: Address:{IP:10.0.0.6 Mask:ffff0000} Gateway:10.0.0.1}], Routes:[{Dst:{IP:0.0.0.0 Mask:00000000} GW:10.0.0.1}], DNS:{Nameservers:[168.63.129.16] Domain: Search:[] Options:[]} err:. -•2021/04/30 23:31:18 [1636] [cni-ipam] Processing ADD command with args {ContainerID: Netns: IfName: Args: Path: StdinData:{ - "cniversion": "0.4.0", - "ipam": { - "type": "internal", - "subnet": "10.0.0.0/16", - "ipAddress": "" - } - }}. -2021/04/30 23:31:18 [1636] [cni-ipam] Read network configuration &{CNIVersion:0.4.0 Name: Type: Mode: Master: AdapterName: Bridge: LogLevel: LogTarget: InfraVnetAddressSpace: IPV6Mode: ServiceCidrs: VnetCidrs: PodNamespaceForDualNetwork:[] IPsToRouteViaHost:[] MultiTenancy:false EnableSnatOnHost:false EnableExactMatchForPodName:false DisableHairpinOnHostInterface:false DisableIPTableLock:false CNSUrl: ExecutionMode: Ipam:{Type:internal Environment: AddrSpace: Subnet:10.0.0.0/16 Address: QueryInterval:} DNS:{Nameservers:[] Domain: Search:[] Options:[]} RuntimeConfig:{PortMappings:[] DNS:{Servers:[] Searches:[] Options:[]}} AdditionalArgs:[]}. -2021/04/30 23:31:18 [1636] [ipam] Starting source azure. -2021/04/30 23:31:18 [1636] [ipam] Refreshing address source. -2021/04/30 23:31:18 [1636] [Utils] Initializing HTTP client with connection timeout: 10, response header timeout: 10 -2021/04/30 23:31:18 [1636] [ipam] Wireserver call http://localhost:42424 to retrieve IP List -2021/04/30 23:31:18 [1636] [ipam] got 3 addresses from interface lo, subnet 10.0.0.0/16 -2021/04/30 23:31:18 [1636] [ipam] merging address space -2021/04/30 23:31:18 [1636] [ipam] ipam store is nil. -2021/04/30 23:31:18 [1636] [ipam] Requesting address with address: options:map[azure.address.id:]. -2021/04/30 23:31:18 [1636] [ipam] Address request completed with address:10.0.0.7/16 -2021/04/30 23:31:18 [1636] [ipam] ipam store is nil. -2021/04/30 23:31:18 [1636] [cni-ipam] Allocated address 10.0.0.7/16. -2021/04/30 23:31:18 [1636] [cni-ipam] ADD command completed with result:IP:[{Version:4 Interface: Address:{IP:10.0.0.7 Mask:ffff0000} Gateway:10.0.0.1}], Routes:[{Dst:{IP:0.0.0.0 Mask:00000000} GW:10.0.0.1}], DNS:{Nameservers:[168.63.129.16] Domain: Search:[] Options:[]} err:. -•2021/04/30 23:31:18 [1636] [cni-ipam] Processing ADD command with args {ContainerID:25074be3-cea9-461a-aa6b-926714477f11 Netns: IfName: Args: Path: StdinData:{ - "cniversion": "0.4.0", - "ipam": { - "type": "internal", - "subnet": "10.0.0.0/16", - "ipAddress": "" - } - }}. -2021/04/30 23:31:18 [1636] [cni-ipam] Read network configuration &{CNIVersion:0.4.0 Name: Type: Mode: Master: AdapterName: Bridge: LogLevel: LogTarget: InfraVnetAddressSpace: IPV6Mode: ServiceCidrs: VnetCidrs: PodNamespaceForDualNetwork:[] IPsToRouteViaHost:[] MultiTenancy:false EnableSnatOnHost:false EnableExactMatchForPodName:false DisableHairpinOnHostInterface:false DisableIPTableLock:false CNSUrl: ExecutionMode: Ipam:{Type:internal Environment: AddrSpace: Subnet:10.0.0.0/16 Address: QueryInterval:} DNS:{Nameservers:[] Domain: Search:[] Options:[]} RuntimeConfig:{PortMappings:[] DNS:{Servers:[] Searches:[] Options:[]}} AdditionalArgs:[]}. -2021/04/30 23:31:18 [1636] [ipam] Starting source azure. -2021/04/30 23:31:18 [1636] [ipam] Refreshing address source. -2021/04/30 23:31:18 [1636] [Utils] Initializing HTTP client with connection timeout: 10, response header timeout: 10 -2021/04/30 23:31:18 [1636] [ipam] Wireserver call http://localhost:42424 to retrieve IP List -2021/04/30 23:31:18 [1636] [ipam] got 3 addresses from interface lo, subnet 10.0.0.0/16 -2021/04/30 23:31:18 [1636] [ipam] merging address space -2021/04/30 23:31:18 [1636] [ipam] ipam store is nil. -2021/04/30 23:31:18 [1636] [ipam] Requesting address with address: options:map[azure.address.id:25074be3-cea9-461a-aa6b-926714477f11]. -2021/04/30 23:31:18 [1636] [ipam] Address request completed with address:10.0.0.5/16 -2021/04/30 23:31:18 [1636] [ipam] ipam store is nil. -2021/04/30 23:31:18 [1636] [cni-ipam] Allocated address 10.0.0.5/16. -2021/04/30 23:31:18 [1636] [cni-ipam] ADD command completed with result:IP:[{Version:4 Interface: Address:{IP:10.0.0.5 Mask:ffff0000} Gateway:10.0.0.1}], Routes:[{Dst:{IP:0.0.0.0 Mask:00000000} GW:10.0.0.1}], DNS:{Nameservers:[168.63.129.16] Domain: Search:[] Options:[]} err:. -•2021/04/30 23:31:18 [1636] [cni-ipam] Processing DEL command with args {ContainerID:25074be3-cea9-461a-aa6b-926714477f11 Netns: IfName: Args: Path: StdinData:{ - "cniversion": "0.4.0", - "ipam": { - "type": "internal", - "subnet": "10.0.0.0/16", - "ipAddress": "" - } - }}. -2021/04/30 23:31:18 [1636] [cni-ipam] Read network configuration &{CNIVersion:0.4.0 Name: Type: Mode: Master: AdapterName: Bridge: LogLevel: LogTarget: InfraVnetAddressSpace: IPV6Mode: ServiceCidrs: VnetCidrs: PodNamespaceForDualNetwork:[] IPsToRouteViaHost:[] MultiTenancy:false EnableSnatOnHost:false EnableExactMatchForPodName:false DisableHairpinOnHostInterface:false DisableIPTableLock:false CNSUrl: ExecutionMode: Ipam:{Type:internal Environment: AddrSpace: Subnet:10.0.0.0/16 Address: QueryInterval:} DNS:{Nameservers:[] Domain: Search:[] Options:[]} RuntimeConfig:{PortMappings:[] DNS:{Servers:[] Searches:[] Options:[]}} AdditionalArgs:[]}. -2021/04/30 23:31:18 [1636] [ipam] Starting source azure. -2021/04/30 23:31:18 [1636] [ipam] Refreshing address source. -2021/04/30 23:31:18 [1636] [Utils] Initializing HTTP client with connection timeout: 10, response header timeout: 10 -2021/04/30 23:31:18 [1636] [ipam] Wireserver call http://localhost:42424 to retrieve IP List -2021/04/30 23:31:18 [1636] [ipam] got 3 addresses from interface lo, subnet 10.0.0.0/16 -2021/04/30 23:31:18 [1636] [ipam] merging address space -2021/04/30 23:31:18 [1636] [ipam] ipam store is nil. -2021/04/30 23:31:18 [1636] [ipam] Releasing address with address: options:map[azure.address.id:25074be3-cea9-461a-aa6b-926714477f11]. -2021/04/30 23:31:18 [1636] [ipam] Address release completed with address:10.0.0.5 err:. -2021/04/30 23:31:18 [1636] [ipam] ipam store is nil. -2021/04/30 23:31:18 [1636] [cni-ipam] DEL command completed with err:. -•2021/04/30 23:31:18 [1636] [cni-ipam] Processing DEL command with args {ContainerID: Netns: IfName: Args: Path: StdinData:{ - "cniversion": "0.4.0", - "ipam": { - "type": "internal", - "subnet": "10.0.0.0/16", - "ipAddress": "10.0.0.6" - } - }}. -2021/04/30 23:31:18 [1636] [cni-ipam] Read network configuration &{CNIVersion:0.4.0 Name: Type: Mode: Master: AdapterName: Bridge: LogLevel: LogTarget: InfraVnetAddressSpace: IPV6Mode: ServiceCidrs: VnetCidrs: PodNamespaceForDualNetwork:[] IPsToRouteViaHost:[] MultiTenancy:false EnableSnatOnHost:false EnableExactMatchForPodName:false DisableHairpinOnHostInterface:false DisableIPTableLock:false CNSUrl: ExecutionMode: Ipam:{Type:internal Environment: AddrSpace: Subnet:10.0.0.0/16 Address:10.0.0.6 QueryInterval:} DNS:{Nameservers:[] Domain: Search:[] Options:[]} RuntimeConfig:{PortMappings:[] DNS:{Servers:[] Searches:[] Options:[]}} AdditionalArgs:[]}. -2021/04/30 23:31:18 [1636] [ipam] Starting source azure. -2021/04/30 23:31:18 [1636] [ipam] Refreshing address source. -2021/04/30 23:31:18 [1636] [Utils] Initializing HTTP client with connection timeout: 10, response header timeout: 10 -2021/04/30 23:31:18 [1636] [ipam] Wireserver call http://localhost:42424 to retrieve IP List -2021/04/30 23:31:18 [1636] [ipam] got 3 addresses from interface lo, subnet 10.0.0.0/16 -2021/04/30 23:31:18 [1636] [ipam] merging address space -2021/04/30 23:31:18 [1636] [ipam] ipam store is nil. -2021/04/30 23:31:18 [1636] [ipam] Releasing address with address:10.0.0.6 options:map[azure.address.id:]. -2021/04/30 23:31:18 [1636] [ipam] Address release completed with address:10.0.0.6 err:. -2021/04/30 23:31:18 [1636] [ipam] ipam store is nil. -2021/04/30 23:31:18 [1636] [cni-ipam] DEL command completed with err:. -•2021/04/30 23:31:18 [1636] [cni-ipam] Processing ADD command with args {ContainerID: Netns: IfName: Args: Path: StdinData:{ - "cniversion": "0.4.0", - "ipam": { - "type": "internal", - "subnet": "", - "ipAddress": "" - } - }}. -2021/04/30 23:31:18 [1636] [cni-ipam] Read network configuration &{CNIVersion:0.4.0 Name: Type: Mode: Master: AdapterName: Bridge: LogLevel: LogTarget: InfraVnetAddressSpace: IPV6Mode: ServiceCidrs: VnetCidrs: PodNamespaceForDualNetwork:[] IPsToRouteViaHost:[] MultiTenancy:false EnableSnatOnHost:false EnableExactMatchForPodName:false DisableHairpinOnHostInterface:false DisableIPTableLock:false CNSUrl: ExecutionMode: Ipam:{Type:internal Environment: AddrSpace: Subnet: Address: QueryInterval:} DNS:{Nameservers:[] Domain: Search:[] Options:[]} RuntimeConfig:{PortMappings:[] DNS:{Servers:[] Searches:[] Options:[]}} AdditionalArgs:[]}. -2021/04/30 23:31:18 [1636] [ipam] Starting source azure. -2021/04/30 23:31:18 [1636] [ipam] Refreshing address source. -2021/04/30 23:31:18 [1636] [Utils] Initializing HTTP client with connection timeout: 10, response header timeout: 10 -2021/04/30 23:31:18 [1636] [ipam] Wireserver call http://localhost:42424 to retrieve IP List -2021/04/30 23:31:18 [1636] [ipam] got 3 addresses from interface lo, subnet 10.0.0.0/16 -2021/04/30 23:31:18 [1636] [ipam] merging address space -2021/04/30 23:31:18 [1636] [ipam] ipam store is nil. -2021/04/30 23:31:18 [1636] [ipam] Requesting pool with poolId: options:map[azure.address.id: azure.interface.name:] v6:false. -2021/04/30 23:31:18 [1636] [ipam] Checking pool 10.0.0.0/16. -2021/04/30 23:31:18 [1636] [ipam] Pool 10.0.0.0/16 is in use. -2021/04/30 23:31:18 [1636] [ipam] Skip releasing pool with poolId:10.0.0.0/16. due to address being in use -2021/04/30 23:31:18 [1636] [ipam] Pool request completed with pool: err:No available address pools. -2021/04/30 23:31:18 [1636] [ipamtest] Failed to allocate pool: No available address pools. -2021/04/30 23:31:18 [1636] [cni-ipam] ADD command completed with result: err:Failed to allocate pool: No available address pools. -•2021/04/30 23:31:18 [1636] [cni-ipam] Processing DEL command with args {ContainerID: Netns: IfName: Args: Path: StdinData:{ - "cniversion": "0.4.0", - "ipam": { - "type": "internal", - "subnet": "10.0.0.0/16", - "ipAddress": "10.0.0.7" - } - }}. -2021/04/30 23:31:18 [1636] [cni-ipam] Read network configuration &{CNIVersion:0.4.0 Name: Type: Mode: Master: AdapterName: Bridge: LogLevel: LogTarget: InfraVnetAddressSpace: IPV6Mode: ServiceCidrs: VnetCidrs: PodNamespaceForDualNetwork:[] IPsToRouteViaHost:[] MultiTenancy:false EnableSnatOnHost:false EnableExactMatchForPodName:false DisableHairpinOnHostInterface:false DisableIPTableLock:false CNSUrl: ExecutionMode: Ipam:{Type:internal Environment: AddrSpace: Subnet:10.0.0.0/16 Address:10.0.0.7 QueryInterval:} DNS:{Nameservers:[] Domain: Search:[] Options:[]} RuntimeConfig:{PortMappings:[] DNS:{Servers:[] Searches:[] Options:[]}} AdditionalArgs:[]}. -2021/04/30 23:31:18 [1636] [ipam] Starting source azure. -2021/04/30 23:31:18 [1636] [ipam] Refreshing address source. -2021/04/30 23:31:18 [1636] [Utils] Initializing HTTP client with connection timeout: 10, response header timeout: 10 -2021/04/30 23:31:18 [1636] [ipam] Wireserver call http://localhost:42424 to retrieve IP List -2021/04/30 23:31:18 [1636] [ipam] got 3 addresses from interface lo, subnet 10.0.0.0/16 -2021/04/30 23:31:18 [1636] [ipam] merging address space -2021/04/30 23:31:18 [1636] [ipam] ipam store is nil. -2021/04/30 23:31:18 [1636] [ipam] Releasing address with address:10.0.0.7 options:map[azure.address.id:]. -2021/04/30 23:31:18 [1636] [ipam] Address release completed with address:10.0.0.7 err:. -2021/04/30 23:31:18 [1636] [ipam] ipam store is nil. -2021/04/30 23:31:18 [1636] [cni-ipam] DEL command completed with err:. -•2021/04/30 23:31:18 [1636] [cni-ipam] Processing DEL command with args {ContainerID: Netns: IfName: Args: Path: StdinData:{ - "cniversion": "0.4.0", - "ipam": { - "type": "internal", - "subnet": "10.0.0.0/16", - "ipAddress": "" - } - }}. -2021/04/30 23:31:18 [1636] [cni-ipam] Read network configuration &{CNIVersion:0.4.0 Name: Type: Mode: Master: AdapterName: Bridge: LogLevel: LogTarget: InfraVnetAddressSpace: IPV6Mode: ServiceCidrs: VnetCidrs: PodNamespaceForDualNetwork:[] IPsToRouteViaHost:[] MultiTenancy:false EnableSnatOnHost:false EnableExactMatchForPodName:false DisableHairpinOnHostInterface:false DisableIPTableLock:false CNSUrl: ExecutionMode: Ipam:{Type:internal Environment: AddrSpace: Subnet:10.0.0.0/16 Address: QueryInterval:} DNS:{Nameservers:[] Domain: Search:[] Options:[]} RuntimeConfig:{PortMappings:[] DNS:{Servers:[] Searches:[] Options:[]}} AdditionalArgs:[]}. -2021/04/30 23:31:18 [1636] [ipam] Starting source azure. -2021/04/30 23:31:18 [1636] [ipam] Refreshing address source. -2021/04/30 23:31:18 [1636] [Utils] Initializing HTTP client with connection timeout: 10, response header timeout: 10 -2021/04/30 23:31:18 [1636] [ipam] Wireserver call http://localhost:42424 to retrieve IP List -2021/04/30 23:31:18 [1636] [ipam] got 3 addresses from interface lo, subnet 10.0.0.0/16 -2021/04/30 23:31:18 [1636] [ipam] merging address space -2021/04/30 23:31:18 [1636] [ipam] ipam store is nil. -2021/04/30 23:31:18 [1636] [ipam] Releasing address with address: options:map[azure.address.id:]. -2021/04/30 23:31:18 [1636] Address not found. Not Returning error -2021/04/30 23:31:18 [1636] [ipam] Address release completed with address: err:. -2021/04/30 23:31:18 [1636] [ipam] ipam store is nil. -2021/04/30 23:31:18 [1636] [cni-ipam] DEL command completed with err:. -•2021/04/30 23:31:18 [1636] [cni-ipam] Processing ADD command with args {ContainerID: Netns: IfName: Args: Path: StdinData:{ - "cniversion": "0.4.0", - "ipam": { - "type": "internal", - "subnet": "", - "ipAddress": "" - } - }}. -2021/04/30 23:31:18 [1636] [cni-ipam] Read network configuration &{CNIVersion:0.4.0 Name: Type: Mode: Master: AdapterName: Bridge: LogLevel: LogTarget: InfraVnetAddressSpace: IPV6Mode: ServiceCidrs: VnetCidrs: PodNamespaceForDualNetwork:[] IPsToRouteViaHost:[] MultiTenancy:false EnableSnatOnHost:false EnableExactMatchForPodName:false DisableHairpinOnHostInterface:false DisableIPTableLock:false CNSUrl: ExecutionMode: Ipam:{Type:internal Environment: AddrSpace: Subnet: Address: QueryInterval:} DNS:{Nameservers:[] Domain: Search:[] Options:[]} RuntimeConfig:{PortMappings:[] DNS:{Servers:[] Searches:[] Options:[]}} AdditionalArgs:[]}. -2021/04/30 23:31:18 [1636] [ipam] Starting source azure. -2021/04/30 23:31:18 [1636] [ipam] Refreshing address source. -2021/04/30 23:31:18 [1636] [Utils] Initializing HTTP client with connection timeout: 10, response header timeout: 10 -2021/04/30 23:31:18 [1636] [ipam] Wireserver call http://localhost:42424 to retrieve IP List -2021/04/30 23:31:18 [1636] [ipam] got 3 addresses from interface lo, subnet 10.0.0.0/16 -2021/04/30 23:31:18 [1636] [ipam] merging address space -2021/04/30 23:31:18 [1636] [ipam] ipam store is nil. -2021/04/30 23:31:18 [1636] [ipam] Requesting pool with poolId: options:map[azure.address.id: azure.interface.name:] v6:false. -2021/04/30 23:31:18 [1636] [ipam] Checking pool 10.0.0.0/16. -2021/04/30 23:31:18 [1636] [ipam] Pool 10.0.0.0/16 is in use. -2021/04/30 23:31:18 [1636] [ipam] Releasing pool 10.0.0.0/16 as there are no allocations -2021/04/30 23:31:18 [1636] [ipam] Pool 10.0.0.0/16 matches requirements. -2021/04/30 23:31:18 [1636] [ipam] Pool request completed with pool:&{as:0xc00033f650 Id:10.0.0.0/16 IfName:lo Subnet:{IP:10.0.0.0 Mask:ffff0000} Gateway:10.0.0.1 Addresses:map[10.0.0.5:0xc00008b440 10.0.0.6:0xc00008b480 10.0.0.7:0xc00008b4c0] addrsByID:map[] IsIPv6:false Priority:0 RefCount:1 epoch:11} err:. -2021/04/30 23:31:18 [1636] [ipam] ipam store is nil. -2021/04/30 23:31:18 [1636] [cni-ipam] Allocated address poolID 10.0.0.0/16 with subnet 10.0.0.0/16. -2021/04/30 23:31:18 [1636] [ipam] Refreshing address source. -2021/04/30 23:31:18 [1636] [ipam] Requesting address with address: options:map[azure.address.id: azure.interface.name:]. -2021/04/30 23:31:18 [1636] [ipam] Address request completed with address:10.0.0.7/16 -2021/04/30 23:31:18 [1636] [ipam] ipam store is nil. -2021/04/30 23:31:18 [1636] [cni-ipam] Allocated address 10.0.0.7/16. -2021/04/30 23:31:18 [1636] [cni-ipam] ADD command completed with result:IP:[{Version:4 Interface: Address:{IP:10.0.0.7 Mask:ffff0000} Gateway:10.0.0.1}], Routes:[{Dst:{IP:0.0.0.0 Mask:00000000} GW:10.0.0.1}], DNS:{Nameservers:[168.63.129.16] Domain: Search:[] Options:[]} err:. -•2021/04/30 23:31:18 [1636] [cni-ipam] Plugin stopped. -2021/04/30 23:31:18 [1636] [Listener] Stopped listening on localhost:42424 - -Ran 14 of 14 Specs in 1.061 seconds -SUCCESS! -- 14 Passed | 0 Failed | 0 Pending | 0 Skipped ---- PASS: TestIpam (1.06s) -PASS -coverage: 4.2% of statements in ./... -ok github.com/Azure/azure-container-networking/cni/ipam 1.233s coverage: 4.2% of statements in ./... -? github.com/Azure/azure-container-networking/cni/ipam/plugin [no test files] -? github.com/Azure/azure-container-networking/cni/ipam/pluginv6 [no test files] -=== RUN TestPlugin - -2021/04/30 23:31:18 [1704] [cni-net] Processing DEL command with args {ContainerID:test-container Netns:test-container IfName:azure0 Args:K8S_POD_NAME=test-pod;K8S_POD_NAMESPACE=test-pod-namespace Path:, StdinData:{"name":"test-nwcfg","type":"azure-vnet","mode":"bridge","ipsToRouteViaHost":["169.254.20.10"],"ipam":{"type":"azure-cns"},"dns":{},"runtimeConfig":{"dns":{}}}}. -2021/04/30 23:31:18 [1704] [cni-net] Read network configuration &{CNIVersion:0.2.0 Name:test-nwcfg Type:azure-vnet Mode:bridge Master: AdapterName: Bridge: LogLevel: LogTarget: InfraVnetAddressSpace: IPV6Mode: ServiceCidrs: VnetCidrs: PodNamespaceForDualNetwork:[] IPsToRouteViaHost:[169.254.20.10] MultiTenancy:false EnableSnatOnHost:false EnableExactMatchForPodName:false DisableHairpinOnHostInterface:false DisableIPTableLock:false CNSUrl: ExecutionMode: Ipam:{Type:azure-cns Environment: AddrSpace: Subnet: Address: QueryInterval:} DNS:{Nameservers:[] Domain: Search:[] Options:[]} RuntimeConfig:{PortMappings:[] DNS:{Servers:[] Searches:[] Options:[]}} AdditionalArgs:[]}. -2021/04/30 23:31:18 [1704] Execution mode : -2021/04/30 23:31:18 [1704] release ip:192.168.0.0 -2021/04/30 23:31:18 [1704] ReleaseIPAddress url http://localhost:10090/network/releaseipconfig -2021/04/30 23:31:18 [1704] [Azure CNSClient] HTTP Post returned error Post "http://localhost:10090/network/releaseipconfig": dial tcp 127.0.0.1:10090: connect: connection refused -2021/04/30 23:31:18 [1704] [testplugin] Failed to release address {192.168.0.0 ffffff00} with error: Post "http://localhost:10090/network/releaseipconfig": dial tcp 127.0.0.1:10090: connect: connection refused. -2021/04/30 23:31:18 [1704] [cni-net] DEL command completed with err:Failed to release address {192.168.0.0 ffffff00} with error: Post "http://localhost:10090/network/releaseipconfig": dial tcp 127.0.0.1:10090: connect: connection refused. ---- PASS: TestPlugin (0.00s) -PASS -coverage: 1.9% of statements in ./... -ok github.com/Azure/azure-container-networking/cni/network 0.128s coverage: 1.9% of statements in ./... -? github.com/Azure/azure-container-networking/cni/network/plugin [no test files] -? github.com/Azure/azure-container-networking/cni/telemetry/service [no test files] -? github.com/Azure/azure-container-networking/cni/utils [no test files] -? github.com/Azure/azure-container-networking/cnm [no test files] -2021/04/30 23:31:19 [1763] [Listener] Started listening on localhost:42424. -2021/04/30 23:31:19 [1763] [ipam] ipam store is nil -2021/04/30 23:31:19 [1763] [ipam] Starting source azure. -2021/04/30 23:31:19 [1763] [ipam] Plugin started. -=== RUN TestActivate -2021/04/30 23:31:19 [1763] [azure-vnet-ipam] Received *cnm.activateRequest &{}. -2021/04/30 23:31:19 [1763] [azure-vnet-ipam] Sent *cnm.ActivateResponse &{Err: Implements:[IpamDriver]}. ---- PASS: TestActivate (0.00s) -=== RUN TestGetCapabilities -2021/04/30 23:31:19 [1763] [azure-vnet-ipam] Received *ipam.GetCapabilitiesRequest &{}. -2021/04/30 23:31:19 [1763] [azure-vnet-ipam] Sent *ipam.GetCapabilitiesResponse &{Err: RequiresMACAddress:false RequiresRequestReplay:false}. ---- PASS: TestGetCapabilities (0.00s) -=== RUN TestGetDefaultAddressSpaces -2021/04/30 23:31:19 [1763] [azure-vnet-ipam] Received *ipam.GetDefaultAddressSpacesRequest &{}. -2021/04/30 23:31:19 [1763] [ipam] Refreshing address source. -2021/04/30 23:31:19 [1763] [Utils] Initializing HTTP client with connection timeout: 10, response header timeout: 10 -2021/04/30 23:31:19 [1763] [ipam] Wireserver call http://localhost:42424 to retrieve IP List -2021/04/30 23:31:19 [1763] [ipam] got 5 addresses from interface lo, subnet 10.0.0.0/16 -2021/04/30 23:31:19 [1763] [ipam] ipam store is nil. -2021/04/30 23:31:19 [1763] [azure-vnet-ipam] Sent *ipam.GetDefaultAddressSpacesResponse &{Err: LocalDefaultAddressSpace:local GlobalDefaultAddressSpace:}. ---- PASS: TestGetDefaultAddressSpaces (0.00s) -=== RUN TestRequestPool -2021/04/30 23:31:19 [1763] [azure-vnet-ipam] Received *ipam.RequestPoolRequest &{AddressSpace:local Pool: SubPool: Options:map[] V6:false}. -2021/04/30 23:31:19 [1763] [ipam] Refreshing address source. -2021/04/30 23:31:19 [1763] [ipam] Requesting pool with poolId: options:map[] v6:false. -2021/04/30 23:31:19 [1763] [ipam] Checking pool 10.0.0.0/16. -2021/04/30 23:31:19 [1763] [ipam] Pool 10.0.0.0/16 matches requirements. -2021/04/30 23:31:19 [1763] [ipam] Pool request completed with pool:&{as:0xc0005846f0 Id:10.0.0.0/16 IfName:lo Subnet:{IP:10.0.0.0 Mask:ffff0000} Gateway:10.0.0.1 Addresses:map[10.0.0.5:0xc0000d54c0 10.0.0.6:0xc0000d5500 10.0.0.7:0xc0000d5540 10.0.0.8:0xc0000d5580 10.0.0.9:0xc0000d55c0] addrsByID:map[] IsIPv6:false Priority:0 RefCount:1 epoch:0} err:. -2021/04/30 23:31:19 [1763] [ipam] ipam store is nil. -2021/04/30 23:31:19 [1763] [azure-vnet-ipam] Sent *ipam.RequestPoolResponse &{Err: PoolID:local|10.0.0.0/16 Pool:10.0.0.0/16 Data:map[]}. ---- PASS: TestRequestPool (0.00s) -=== RUN TestRequestAddress -2021/04/30 23:31:19 [1763] [azure-vnet-ipam] Received *ipam.RequestAddressRequest &{PoolID:local|10.0.0.0/16 Address: Options:map[]}. -2021/04/30 23:31:19 [1763] [ipam] Refreshing address source. -2021/04/30 23:31:19 [1763] [ipam] Requesting address with address: options:map[azure.address.id:]. -2021/04/30 23:31:19 [1763] [ipam] Address request completed with address:10.0.0.5/16 -2021/04/30 23:31:19 [1763] [ipam] ipam store is nil. -2021/04/30 23:31:19 [1763] [azure-vnet-ipam] Sent *ipam.RequestAddressResponse &{Err: Address:10.0.0.5/16 Data:map[]}. ---- PASS: TestRequestAddress (0.00s) -=== RUN TestGetPoolInfo -2021/04/30 23:31:19 [1763] [azure-vnet-ipam] Received *ipam.GetPoolInfoRequest &{PoolID:local|10.0.0.0/16}. -2021/04/30 23:31:19 [1763] [azure-vnet-ipam] Sent *ipam.GetPoolInfoResponse &{Err: Capacity:5 Available:4 UnhealthyAddresses:[]}. ---- PASS: TestGetPoolInfo (0.00s) -=== RUN TestReleaseAddress -2021/04/30 23:31:19 [1763] [azure-vnet-ipam] Received *ipam.ReleaseAddressRequest &{PoolID:local|10.0.0.0/16 Address:10.0.0.5 Options:map[]}. -2021/04/30 23:31:19 [1763] [ipam] Refreshing address source. -2021/04/30 23:31:19 [1763] [ipam] Releasing address with address:10.0.0.5 options:map[]. -2021/04/30 23:31:19 [1763] [ipam] Address release completed with address:10.0.0.5 err:. -2021/04/30 23:31:19 [1763] [ipam] ipam store is nil. -2021/04/30 23:31:19 [1763] [azure-vnet-ipam] Sent *ipam.ReleaseAddressResponse &{Err:}. ---- PASS: TestReleaseAddress (0.00s) -=== RUN TestReleasePool -2021/04/30 23:31:19 [1763] [azure-vnet-ipam] Received *ipam.ReleasePoolRequest &{PoolID:local|10.0.0.0/16}. -2021/04/30 23:31:19 [1763] [ipam] Refreshing address source. -2021/04/30 23:31:19 [1763] [ipam] Releasing pool 10.0.0.0/16 as there are no allocations -2021/04/30 23:31:19 [1763] [ipam] ipam store is nil. -2021/04/30 23:31:19 [1763] [azure-vnet-ipam] Sent *ipam.ReleasePoolResponse &{Err:}. ---- PASS: TestReleasePool (0.00s) -=== RUN TestRequestAddressWithID -2021/04/30 23:31:19 [1763] [azure-vnet-ipam] Received *ipam.RequestAddressRequest &{PoolID:local|10.0.0.0/16 Address: Options:map[azure.address.id:id0]}. -2021/04/30 23:31:19 [1763] [ipam] Refreshing address source. -2021/04/30 23:31:19 [1763] [ipam] Requesting address with address: options:map[azure.address.id:id0]. -2021/04/30 23:31:19 [1763] [ipam] Address request completed with address:10.0.0.7/16 -2021/04/30 23:31:19 [1763] [ipam] ipam store is nil. -2021/04/30 23:31:19 [1763] [azure-vnet-ipam] Sent *ipam.RequestAddressResponse &{Err: Address:10.0.0.7/16 Data:map[]}. -2021/04/30 23:31:19 [1763] [azure-vnet-ipam] Received *ipam.RequestAddressRequest &{PoolID:local|10.0.0.0/16 Address: Options:map[azure.address.id:id0]}. -2021/04/30 23:31:19 [1763] [ipam] Refreshing address source. -2021/04/30 23:31:19 [1763] [ipam] Requesting address with address: options:map[azure.address.id:id0]. -2021/04/30 23:31:19 [1763] [ipam] Address request completed with address:10.0.0.7/16 -2021/04/30 23:31:19 [1763] [ipam] ipam store is nil. -2021/04/30 23:31:19 [1763] [azure-vnet-ipam] Sent *ipam.RequestAddressResponse &{Err: Address:10.0.0.7/16 Data:map[]}. -2021/04/30 23:31:19 [1763] [azure-vnet-ipam] Received *ipam.RequestAddressRequest &{PoolID:local|10.0.0.0/16 Address: Options:map[azure.address.id:id1]}. -2021/04/30 23:31:19 [1763] [ipam] Refreshing address source. -2021/04/30 23:31:19 [1763] [ipam] Requesting address with address: options:map[azure.address.id:id1]. -2021/04/30 23:31:19 [1763] [ipam] Address request completed with address:10.0.0.8/16 -2021/04/30 23:31:19 [1763] [ipam] ipam store is nil. -2021/04/30 23:31:19 [1763] [azure-vnet-ipam] Sent *ipam.RequestAddressResponse &{Err: Address:10.0.0.8/16 Data:map[]}. -2021/04/30 23:31:19 [1763] [azure-vnet-ipam] Received *ipam.RequestAddressRequest &{PoolID:local|10.0.0.0/16 Address: Options:map[azure.address.id:id1]}. -2021/04/30 23:31:19 [1763] [ipam] Refreshing address source. -2021/04/30 23:31:19 [1763] [ipam] Requesting address with address: options:map[azure.address.id:id1]. -2021/04/30 23:31:19 [1763] [ipam] Address request completed with address:10.0.0.8/16 -2021/04/30 23:31:19 [1763] [ipam] ipam store is nil. -2021/04/30 23:31:19 [1763] [azure-vnet-ipam] Sent *ipam.RequestAddressResponse &{Err: Address:10.0.0.8/16 Data:map[]}. -2021/04/30 23:31:19 [1763] [azure-vnet-ipam] Received *ipam.ReleaseAddressRequest &{PoolID:local|10.0.0.0/16 Address:10.0.0.7 Options:map[]}. -2021/04/30 23:31:19 [1763] [ipam] Refreshing address source. -2021/04/30 23:31:19 [1763] [ipam] Releasing address with address:10.0.0.7 options:map[]. -2021/04/30 23:31:19 [1763] [ipam] Address release completed with address:10.0.0.7 err:. -2021/04/30 23:31:19 [1763] [ipam] ipam store is nil. -2021/04/30 23:31:19 [1763] [azure-vnet-ipam] Sent *ipam.ReleaseAddressResponse &{Err:}. -2021/04/30 23:31:19 [1763] [azure-vnet-ipam] Received *ipam.ReleaseAddressRequest &{PoolID:local|10.0.0.0/16 Address:10.0.0.8 Options:map[]}. -2021/04/30 23:31:19 [1763] [ipam] Refreshing address source. -2021/04/30 23:31:19 [1763] [ipam] Releasing address with address:10.0.0.8 options:map[]. -2021/04/30 23:31:19 [1763] [ipam] Address release completed with address:10.0.0.8 err:. -2021/04/30 23:31:19 [1763] [ipam] ipam store is nil. -2021/04/30 23:31:19 [1763] [azure-vnet-ipam] Sent *ipam.ReleaseAddressResponse &{Err:}. ---- PASS: TestRequestAddressWithID (0.00s) -=== RUN TestReleaseAddressWithID -2021/04/30 23:31:19 [1763] [azure-vnet-ipam] Received *ipam.RequestAddressRequest &{PoolID:local|10.0.0.0/16 Address: Options:map[azure.address.id:id1]}. -2021/04/30 23:31:19 [1763] [ipam] Refreshing address source. -2021/04/30 23:31:19 [1763] [ipam] Requesting address with address: options:map[azure.address.id:id1]. -2021/04/30 23:31:19 [1763] [ipam] Address request completed with address:10.0.0.8/16 -2021/04/30 23:31:19 [1763] [ipam] ipam store is nil. -2021/04/30 23:31:19 [1763] [azure-vnet-ipam] Sent *ipam.RequestAddressResponse &{Err: Address:10.0.0.8/16 Data:map[]}. -2021/04/30 23:31:19 [1763] [azure-vnet-ipam] Received *ipam.ReleaseAddressRequest &{PoolID:local|10.0.0.0/16 Address: Options:map[azure.address.id:id1]}. -2021/04/30 23:31:19 [1763] [ipam] Refreshing address source. -2021/04/30 23:31:19 [1763] [ipam] Releasing address with address: options:map[azure.address.id:id1]. -2021/04/30 23:31:19 [1763] [ipam] Address release completed with address:10.0.0.8 err:. -2021/04/30 23:31:19 [1763] [ipam] ipam store is nil. -2021/04/30 23:31:19 [1763] [azure-vnet-ipam] Sent *ipam.ReleaseAddressResponse &{Err:}. ---- PASS: TestReleaseAddressWithID (0.00s) -PASS -coverage: 4.4% of statements in ./... -2021/04/30 23:31:19 [1763] [ipam] Plugin stopped. -2021/04/30 23:31:19 [1763] [Listener] Stopped listening on localhost:42424 -ok github.com/Azure/azure-container-networking/cnm/ipam 0.133s coverage: 4.4% of statements in ./... -2021/04/30 23:31:19 [1777] [Listener] Started listening on /run/docker/plugins/test.sock. -2021/04/30 23:31:19 [1777] [net] network store is nil -2021/04/30 23:31:19 [1777] [net] Plugin started. -2021/04/30 23:31:19 [1777] [net] Added ExternalInterface dummy for subnet 192.168.1.0/24. -=== RUN TestActivate -2021/04/30 23:31:19 [1777] [test] Received *cnm.activateRequest &{}. -2021/04/30 23:31:19 [1777] [test] Sent *cnm.ActivateResponse &{Err: Implements:[NetworkDriver]}. ---- PASS: TestActivate (0.01s) -=== RUN TestGetCapabilities -2021/04/30 23:31:19 [1777] [test] Received *network.getCapabilitiesRequest &{}. -2021/04/30 23:31:19 [1777] [test] Sent *network.getCapabilitiesResponse &{Err: Scope:local}. ---- PASS: TestGetCapabilities (0.00s) -=== RUN TestCNM -2021/04/30 23:31:19 [1777] /sbin/ip netns add 22212 -2021/04/30 23:31:19 [1777] ###CreateNetwork##################################################################################### -2021/04/30 23:31:19 [1777] [test] Received *network.createNetworkRequest &{NetworkID:N1 Options:map[] IPv4Data:[{AddressSpace: Pool:192.168.1.0/24 Gateway: AuxAddresses:map[]}] IPv6Data:[]}. -2021/04/30 23:31:19 [1777] [net] Creating network &{MasterIfName: AdapterName: Id:N1 Mode: Subnets:[{Family:10 Prefix:{IP:192.168.1.0 Mask:ffffff00} Gateway: PrimaryIP:}] PodSubnet:{Family:0 Prefix:{IP: Mask:} Gateway: PrimaryIP:} DNS:{Suffix: Servers:[] Options:[]} Policies:[] BridgeName: EnableSnatOnHost:false NetNs: Options:map[] DisableHairpinOnHostInterface:false IPV6Mode: IPAMType: ServiceCidrs:}. -2021/04/30 23:31:19 [1777] opt map[] options map[] -2021/04/30 23:31:19 [1777] create bridge -2021/04/30 23:31:19 [1777] [net] Connecting interface dummy. -2021/04/30 23:31:19 [1777] [net] Creating bridge azure111. -2021/04/30 23:31:19 [1777] [Azure-Utils] sysctl -w net.ipv6.conf.azure111.accept_ra=0 -2021/04/30 23:31:19 [1777] [net] Deleting IP address 192.168.1.4/24 from interface dummy. -2021/04/30 23:31:19 [1777] [net] Saved interface IP configuration &{Name:dummy Networks:map[] Subnets:[192.168.1.0/24] BridgeName: DNSInfo:{Suffix: Servers:[] Options:[]} MacAddress:c6:5e:b2:ee:9d:b4 IPAddresses:[192.168.1.4/24] Routes:[] IPv4Gateway:0.0.0.0 IPv6Gateway:::}. -2021/04/30 23:31:19 [1777] [net] OSInfo: map[BUG_REPORT_URL:"https://bugs.launchpad.net/ubuntu/" HOME_URL:"https://www.ubuntu.com/" ID:ubuntu ID_LIKE:debian NAME:"Ubuntu" PRETTY_NAME:"Ubuntu 18.04.4 LTS" PRIVACY_POLICY_URL:"https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" SUPPORT_URL:"https://help.ubuntu.com/" UBUNTU_CODENAME:bionic VERSION:"18.04.4 LTS (Bionic Beaver)" VERSION_CODENAME:bionic VERSION_ID:"18.04"] -2021/04/30 23:31:19 [1777] [net] Saving dns config from dummy -2021/04/30 23:31:19 [1777] [Azure-Utils] systemd-resolve --status dummy -2021/04/30 23:31:19 [1777] [net] console output for above cmd: Link 111 (dummy) - Current Scopes: none - LLMNR setting: yes -MulticastDNS setting: no - DNSSEC setting: no - DNSSEC supported: no -2021/04/30 23:31:19 [1777] [net] Failed to read dns info {Suffix: Servers:[] Options:[]} from interface dummy: -2021/04/30 23:31:19 [1777] [net] Setting link dummy state down. -2021/04/30 23:31:19 [1777] [net] Setting link dummy master azure111. -2021/04/30 23:31:19 [1777] [net] Setting link dummy state up. -2021/04/30 23:31:19 [1777] [net] Setting link azure111 state up. -2021/04/30 23:31:19 [1777] [net] Adding SNAT rule for egress traffic on dummy. -2021/04/30 23:31:19 [1777] [Azure-Utils] ebtables -t nat -A POSTROUTING -s unicast -o dummy -j snat --to-src c6:5e:b2:ee:9d:b4 --snat-arp --snat-target ACCEPT -2021/04/30 23:31:19 [1777] [net] Adding ARP reply rule for primary IP address 192.168.1.4. -2021/04/30 23:31:19 [1777] [Azure-Utils] ebtables -t nat -A PREROUTING -p ARP --arp-op Request --arp-ip-dst 192.168.1.4 -j arpreply --arpreply-mac c6:5e:b2:ee:9d:b4 --arpreply-target DROP -2021/04/30 23:31:19 [1777] [net] Adding DNAT rule for ingress ARP traffic on interface dummy. -2021/04/30 23:31:19 [1777] [Azure-Utils] ebtables -t nat -A PREROUTING -p ARP -i dummy --arp-op Reply -j dnat --to-dst ff:ff:ff:ff:ff:ff --dnat-target ACCEPT -2021/04/30 23:31:19 [1777] [net] Enabling VEPA mode for dummy. -2021/04/30 23:31:19 [1777] [Azure-Utils] ebtables -t nat -A PREROUTING -i az+ -j dnat --to-dst 12:34:56:78:9a:bc --dnat-target ACCEPT -2021/04/30 23:31:19 [1777] [net] Setting link dummy hairpin on. -2021/04/30 23:31:19 [1777] [net] Adding IP address 192.168.1.4/24 to interface azure111. -2021/04/30 23:31:19 [1777] [net] Applying dns config on azure111 -2021/04/30 23:31:19 [1777] [net] Applied dns config { [] []} on azure111 -2021/04/30 23:31:19 [1777] [net] Connected interface dummy to bridge azure111. -2021/04/30 23:31:19 [1777] [net] Connecting interface dummy completed with err:. -2021/04/30 23:31:19 [1777] [net] Created network N1 on interface dummy. -2021/04/30 23:31:19 [1777] [test] Sent *network.createNetworkResponse &{Err:}. -2021/04/30 23:31:19 [1777] ###CreateEndpoint#################################################################################### -2021/04/30 23:31:19 [1777] [test] Received *network.createEndpointRequest &{NetworkID:N1 EndpointID:E1-xxxx Options:map[] Interface:{Address:192.168.1.0/24 AddressIPv6: MacAddress:}}. -2021/04/30 23:31:19 [1777] [net] Creating endpoint &{Id:E1-xxxx ContainerID: NetNsPath: IfName: SandboxKey: IfIndex:0 MacAddress: DNS:{Suffix: Servers:[] Options:[]} IPAddresses:[{IP:192.168.1.0 Mask:ffffff00}] IPsToRouteViaHost:[] InfraVnetIP:{IP: Mask:} Routes:[] Policies:[] Gateways:[] EnableSnatOnHost:false EnableInfraVnet:false EnableMultiTenancy:false EnableSnatForDns:false AllowInboundFromHostToNC:false AllowInboundFromNCToHost:false NetworkContainerID: PODName: PODNameSpace: Data:map[] InfraVnetAddressSpace: SkipHotAttachEp:true IPV6Mode: VnetCidrs: ServiceCidrs:} in network N1. -2021/04/30 23:31:19 [1777] Generate veth name based on endpoint id -2021/04/30 23:31:19 [1777] Bridge client -2021/04/30 23:31:19 [1777] [net] Creating veth pair azvE1-xxxx azvE1-xxxx-2. -2021/04/30 23:31:19 [1777] [net] Setting link azvE1-xxxx state up. -2021/04/30 23:31:19 [1777] [Azure-Utils] sysctl -w net.ipv6.conf.azvE1-xxxx.accept_ra=0 -2021/04/30 23:31:19 [1777] [net] Setting link azvE1-xxxx master azure111. -2021/04/30 23:31:19 [1777] [net] Adding ARP reply rule for IP address 192.168.1.0/24 -2021/04/30 23:31:19 [1777] [Azure-Utils] ebtables -t nat -A PREROUTING -p ARP --arp-op Request --arp-ip-dst 192.168.1.0 -j arpreply --arpreply-mac 12:34:56:78:9a:bc --arpreply-target DROP -2021/04/30 23:31:19 [1777] [net] Adding MAC DNAT rule for IP address 192.168.1.0/24 -2021/04/30 23:31:19 [1777] [Azure-Utils] ebtables -t nat -A PREROUTING -p IPv4 -i dummy --ip-dst 192.168.1.0 -j dnat --to-dst fe:66:52:a5:06:c0 --dnat-target ACCEPT -2021/04/30 23:31:19 [1777] [net] Setting hairpin for hostveth azvE1-xxxx -2021/04/30 23:31:19 [1777] [net] Adding IP address 192.168.1.0/24 to link azvE1-xxxx-2. -2021/04/30 23:31:19 [1777] [net] Created endpoint &{Id:E1-xxxx HnsId: SandboxKey: IfName:azvE1-xxxx-2 HostIfName:azvE1-xxxx MacAddress:fe:66:52:a5:06:c0 InfraVnetIP:{IP: Mask:} LocalIP: IPAddresses:[{IP:192.168.1.0 Mask:ffffff00}] Gateways:[0.0.0.0] DNS:{Suffix: Servers:[] Options:[]} Routes:[] VlanID:0 EnableSnatOnHost:false EnableInfraVnet:false EnableMultitenancy:false AllowInboundFromHostToNC:false AllowInboundFromNCToHost:false NetworkContainerID: NetworkNameSpace: ContainerID: PODName: PODNameSpace: InfraVnetAddressSpace: NetNs:}. -2021/04/30 23:31:19 [1777] [test] Sent *network.createEndpointResponse &{Err: Interface:{Address: AddressIPv6: MacAddress:}}. -2021/04/30 23:31:19 [1777] ###EndpointOperInfo##################################################################################### -2021/04/30 23:31:19 [1777] [test] Received *network.endpointOperInfoRequest &{NetworkID:N1 EndpointID:E1-xxxx}. -2021/04/30 23:31:19 [1777] Trying to retrieve endpoint id E1-xxxx -2021/04/30 23:31:19 [1777] [test] Sent *network.endpointOperInfoResponse &{Err: Value:map[]}. -2021/04/30 23:31:19 [1777] ###DeleteEndpoint##################################################################################### -2021/04/30 23:31:19 [1777] [test] Received *network.deleteEndpointRequest &{NetworkID:N1 EndpointID:E1-xxxx}. -2021/04/30 23:31:19 [1777] [net] Deleting endpoint E1-xxxx from network N1. -2021/04/30 23:31:19 [1777] Trying to retrieve endpoint id E1-xxxx -2021/04/30 23:31:19 [1777] [net] Deleting ARP reply rule for IP address 192.168.1.0/24 on E1-xxxx. -2021/04/30 23:31:19 [1777] [Azure-Utils] ebtables -t nat -D PREROUTING -p ARP --arp-op Request --arp-ip-dst 192.168.1.0 -j arpreply --arpreply-mac 12:34:56:78:9a:bc --arpreply-target DROP -2021/04/30 23:31:19 [1777] [net] Deleting MAC DNAT rule for IP address 192.168.1.0/24 on E1-xxxx. -2021/04/30 23:31:19 [1777] [Azure-Utils] ebtables -t nat -D PREROUTING -p IPv4 -i dummy --ip-dst 192.168.1.0 -j dnat --to-dst fe:66:52:a5:06:c0 --dnat-target ACCEPT -2021/04/30 23:31:19 [1777] [net] Deleting veth pair azvE1-xxxx azvE1-xxxx-2. -2021/04/30 23:31:19 [1777] [net] Deleted endpoint &{Id:E1-xxxx HnsId: SandboxKey: IfName:azvE1-xxxx-2 HostIfName:azvE1-xxxx MacAddress:fe:66:52:a5:06:c0 InfraVnetIP:{IP: Mask:} LocalIP: IPAddresses:[{IP:192.168.1.0 Mask:ffffff00}] Gateways:[0.0.0.0] DNS:{Suffix: Servers:[] Options:[]} Routes:[] VlanID:0 EnableSnatOnHost:false EnableInfraVnet:false EnableMultitenancy:false AllowInboundFromHostToNC:false AllowInboundFromNCToHost:false NetworkContainerID: NetworkNameSpace: ContainerID: PODName: PODNameSpace: InfraVnetAddressSpace: NetNs:}. -2021/04/30 23:31:19 [1777] [test] Sent *network.deleteEndpointResponse &{Err:}. -2021/04/30 23:31:19 [1777] ###DeleteNetwork##################################################################################### ---- PASS: TestCNM (0.37s) -PASS -coverage: 8.0% of statements in ./... -2021/04/30 23:31:19 [1777] [Listener] Stopped listening on /run/docker/plugins/test.sock -2021/04/30 23:31:19 [1777] [net] Plugin stopped. -ok github.com/Azure/azure-container-networking/cnm/network 0.569s coverage: 8.0% of statements in ./... -? github.com/Azure/azure-container-networking/cnm/plugin [no test files] -? github.com/Azure/azure-container-networking/cnms/cnmspackage [no test files] -=== RUN TestAddMissingRule -2021/04/30 23:31:19 [1839] [ADD] Found unmatched rule chain POSTROUTING rule -s Unicast -o eth0 -j snat --to-src 00:0d:12:3a:5d:32 --snat-arp --snat-target ACCEPT itr 0. Giving one more iteration. -2021/04/30 23:31:19 [1839] [Azure-Utils] ebtables -t nat -A POSTROUTING -s Unicast -o eth0 -j snat --to-src 00:0d:12:3a:5d:32 --snat-arp --snat-target ACCEPT -2021/04/30 23:31:19 [1839] [monitor] Adding Ebtable rule as it existed in state rules but not in current chain rules for 1 iterations chain POSTROUTING rule -s Unicast -o eth0 -j snat --to-src 00:0d:12:3a:5d:32 --snat-arp --snat-target ACCEPT ---- PASS: TestAddMissingRule (0.03s) -=== RUN TestDeleteInvalidRule -2021/04/30 23:31:19 [1839] [DELETE] Found unmatched rule chain PREROUTING rule -p ARP -i eth0 --arp-op Reply -j dnat --to-dst ff:ff:ff:ff:ff:ff --dnat-target ACCEPT itr 0. Giving one more iteration. -2021/04/30 23:31:19 [1839] [Azure-Utils] ebtables -t nat -D PREROUTING -p ARP -i eth0 --arp-op Reply -j dnat --to-dst ff:ff:ff:ff:ff:ff --dnat-target ACCEPT -2021/04/30 23:31:19 [1839] [monitor] Error while deleting ebtable rule exit status 255:Sorry, rule does not exist. ---- PASS: TestDeleteInvalidRule (0.02s) -PASS -coverage: 1.2% of statements in ./... -ok github.com/Azure/azure-container-networking/cnms/service 0.188s coverage: 1.2% of statements in ./... -? github.com/Azure/azure-container-networking/cns [no test files] -logdir: /tmp/cns-719870598Test logger file: /tmp/cns-719870598/azure-cns.logTest state :/tmp/cns-659312387.json2021/04/30 23:31:20 [1911] HTTP listener will be started later after CNS state has been reconciled -2021/04/30 23:31:20 [1911] [Azure CNS] restoreState -2021/04/30 23:31:20 [1911] [Azure CNS] store not initialized. -2021/04/30 23:31:20 [1911] [Azure CNS] Enter Restoring Network State -2021/04/30 23:31:20 [1911] [Azure CNS] Store is not initialized, nothing to restore for network state. -2021/04/30 23:31:20 [1911] [Utils] Initializing HTTP client with connection timeout: 0, response header timeout: 0 -2021/04/30 23:31:20 [1911] SetContext details called with: orchestrator nodeID -2021/04/30 23:31:20 [1911] [Azure CNS] Listening. -2021/04/30 23:31:20 [1911] [Listener] Started listening on localhost:10090. -2021/04/30 23:31:20 [1911] [Azure CNS] setOrchestratorType -2021/04/30 23:31:20 [1911] SetContext details called with: KubernetesCRD orchestrator nodeID -2021/04/30 23:31:20 [1911] [Azure CNS] saveState -2021/04/30 23:31:20 [1911] [Azure CNS] store not initialized. -&{200 OK 200 HTTP/1.1 1 1 map[Content-Length:[30] Content-Type:[application/json; charset=UTF-8] Date:[Fri, 30 Apr 2021 23:31:20 GMT]] 0xc00030c200 30 [] false false map[] 0xc0004cc100 } -=== RUN TestCNSClientRequestAndRelease -2021/04/30 23:31:20 [1911] [Azure-Cns] Set IP 10.0.0.5 version to -1, programmed host nc version is -1 -2021/04/30 23:31:20 [1911] [Azure-Cns] Add IP 10.0.0.5 as Available -2021/04/30 23:31:20 [1911] [Azure CNS] saveState -2021/04/30 23:31:20 [1911] [Azure CNS] store not initialized. -2021/04/30 23:31:20 [1911] ReleaseIPAddress url http://localhost:10090/network/releaseipconfig -2021/04/30 23:31:20 [1911] [releaseIPConfig] SetIPConfigAsAvailable failed to release, no allocation found for pod [{PodName:testpodname PodNamespace:testpodnamespace}] -2021/04/30 23:31:20 [1911] [updateIPConfigState] Changing IpId [aced6459-4c14-4787-9cde-bed238b2c7f4] state to [Allocated], orchestratorContext [{"PodName":"testpodname","PodNamespace":"testpodnamespace"}]. Current config [IPConfigurationStatus: Id: [aced6459-4c14-4787-9cde-bed238b2c7f4], NcId: [testNcId1], IpAddress: [10.0.0.5], State: [Available], OrchestratorContext: []] -2021/04/30 23:31:20 [1911] [Azure CNS] GetPrimaryInterfaceInfoFromMemory -2021/04/30 23:31:20 [1911] [Azure CNS] GetPrimaryInterfaceInfoFromHost -2021/04/30 23:31:20 [1911] GetIPAddressesMatchingStates url http://localhost:10090/debug/getipaddresses - cnsclient_test.go:277: [IPConfigurationStatus: Id: [aced6459-4c14-4787-9cde-bed238b2c7f4], NcId: [testNcId1], IpAddress: [10.0.0.5], State: [Allocated], OrchestratorContext: [{"PodName":"testpodname","PodNamespace":"testpodnamespace"}]] -2021/04/30 23:31:20 [1911] ReleaseIPAddress url http://localhost:10090/network/releaseipconfig -2021/04/30 23:31:20 [1911] [releaseIPConfig] Releasing IP 10.0.0.5 for pod {PodName:testpodname PodNamespace:testpodnamespace} -2021/04/30 23:31:20 [1911] [updateIPConfigState] Changing IpId [aced6459-4c14-4787-9cde-bed238b2c7f4] state to [Available], orchestratorContext []. Current config [IPConfigurationStatus: Id: [aced6459-4c14-4787-9cde-bed238b2c7f4], NcId: [testNcId1], IpAddress: [10.0.0.5], State: [Allocated], OrchestratorContext: [{"PodName":"testpodname","PodNamespace":"testpodnamespace"}]] -2021/04/30 23:31:20 [1911] [setIPConfigAsAvailable] Deleted outdated pod info testpodname:testpodnamespace from PodIPIDByOrchestratorContext since IP 10.0.0.5 with ID aced6459-4c14-4787-9cde-bed238b2c7f4 will be released and set as Available -2021/04/30 23:31:20 [1911] [releaseIPConfig] Released IP 10.0.0.5 for pod {PodName:testpodname PodNamespace:testpodnamespace} ---- PASS: TestCNSClientRequestAndRelease (0.01s) -=== RUN TestCNSClientPodContextApi -2021/04/30 23:31:20 [1911] [Azure-Cns] Delete the PodIpConfigState, IpId: aced6459-4c14-4787-9cde-bed238b2c7f4, IPConfigStatus: IPConfigurationStatus: Id: [aced6459-4c14-4787-9cde-bed238b2c7f4], NcId: [testNcId1], IpAddress: [10.0.0.5], State: [Available], OrchestratorContext: [] -2021/04/30 23:31:20 [1911] [Azure-Cns] Set IP 10.0.0.5 version to -1, programmed host nc version is -1 -2021/04/30 23:31:20 [1911] [Azure-Cns] Add IP 10.0.0.5 as Available -2021/04/30 23:31:20 [1911] [Azure CNS] saveState -2021/04/30 23:31:20 [1911] [Azure CNS] store not initialized. -2021/04/30 23:31:20 [1911] [updateIPConfigState] Changing IpId [5c27d823-a148-41a1-8191-dff3a9e403d1] state to [Allocated], orchestratorContext [{"PodName":"testpodname","PodNamespace":"testpodnamespace"}]. Current config [IPConfigurationStatus: Id: [5c27d823-a148-41a1-8191-dff3a9e403d1], NcId: [testNcId1], IpAddress: [10.0.0.5], State: [Available], OrchestratorContext: []] -2021/04/30 23:31:20 [1911] [Azure CNS] GetPrimaryInterfaceInfoFromMemory -2021/04/30 23:31:20 [1911] [Azure CNS] GetPrimaryInterfaceInfoFromHost -2021/04/30 23:31:20 [1911] GetPodIPOrchestratorContext url http://localhost:10090/debug/getpodcontext - cnsclient_test.go:317: map[testpodname:testpodnamespace:5c27d823-a148-41a1-8191-dff3a9e403d1] -2021/04/30 23:31:20 [1911] ReleaseIPAddress url http://localhost:10090/network/releaseipconfig -2021/04/30 23:31:20 [1911] [releaseIPConfig] Releasing IP 10.0.0.5 for pod {PodName:testpodname PodNamespace:testpodnamespace} -2021/04/30 23:31:20 [1911] [updateIPConfigState] Changing IpId [5c27d823-a148-41a1-8191-dff3a9e403d1] state to [Available], orchestratorContext []. Current config [IPConfigurationStatus: Id: [5c27d823-a148-41a1-8191-dff3a9e403d1], NcId: [testNcId1], IpAddress: [10.0.0.5], State: [Allocated], OrchestratorContext: [{"PodName":"testpodname","PodNamespace":"testpodnamespace"}]] -2021/04/30 23:31:20 [1911] [setIPConfigAsAvailable] Deleted outdated pod info testpodname:testpodnamespace from PodIPIDByOrchestratorContext since IP 10.0.0.5 with ID 5c27d823-a148-41a1-8191-dff3a9e403d1 will be released and set as Available -2021/04/30 23:31:20 [1911] [releaseIPConfig] Released IP 10.0.0.5 for pod {PodName:testpodname PodNamespace:testpodnamespace} ---- PASS: TestCNSClientPodContextApi (0.00s) -=== RUN TestCNSClientDebugAPI -2021/04/30 23:31:20 [1911] [Azure-Cns] Delete the PodIpConfigState, IpId: 5c27d823-a148-41a1-8191-dff3a9e403d1, IPConfigStatus: IPConfigurationStatus: Id: [5c27d823-a148-41a1-8191-dff3a9e403d1], NcId: [testNcId1], IpAddress: [10.0.0.5], State: [Available], OrchestratorContext: [] -2021/04/30 23:31:20 [1911] [Azure-Cns] Set IP 10.0.0.5 version to -1, programmed host nc version is -1 -2021/04/30 23:31:20 [1911] [Azure-Cns] Add IP 10.0.0.5 as Available -2021/04/30 23:31:20 [1911] [Azure CNS] saveState -2021/04/30 23:31:20 [1911] [Azure CNS] store not initialized. -2021/04/30 23:31:20 [1911] [updateIPConfigState] Changing IpId [8f5769a1-e970-420b-af83-bfdc92aa25d7] state to [Allocated], orchestratorContext [{"PodName":"testpodname","PodNamespace":"testpodnamespace"}]. Current config [IPConfigurationStatus: Id: [8f5769a1-e970-420b-af83-bfdc92aa25d7], NcId: [testNcId1], IpAddress: [10.0.0.5], State: [Available], OrchestratorContext: []] -2021/04/30 23:31:20 [1911] [Azure CNS] GetPrimaryInterfaceInfoFromMemory -2021/04/30 23:31:20 [1911] [Azure CNS] GetPrimaryInterfaceInfoFromHost -2021/04/30 23:31:20 [1911] GetHTTPServiceStruct url http://localhost:10090/debug/getrestdata - cnsclient_test.go:388: In-memory Data: - cnsclient_test.go:389: PodIPIDByOrchestratorContext: map[testpodname:testpodnamespace:8f5769a1-e970-420b-af83-bfdc92aa25d7] - cnsclient_test.go:390: PodIPConfigState: map[8f5769a1-e970-420b-af83-bfdc92aa25d7:IPConfigurationStatus: Id: [8f5769a1-e970-420b-af83-bfdc92aa25d7], NcId: [testNcId1], IpAddress: [10.0.0.5], State: [Allocated], OrchestratorContext: [{"PodName":"testpodname","PodNamespace":"testpodnamespace"}]] - cnsclient_test.go:391: IPAMPoolMonitor: {MinimumFreeIps:10 MaximumFreeIps:20 UpdatingIpsNotInUseCount:13 CachedNNC:{TypeMeta:{Kind: APIVersion:} ObjectMeta:{Name: GenerateName: Namespace: SelfLink: UID: ResourceVersion: Generation:0 CreationTimestamp:0001-01-01 00:00:00 +0000 UTC DeletionTimestamp: DeletionGracePeriodSeconds: Labels:map[] Annotations:map[] OwnerReferences:[] Finalizers:[] ClusterName: ManagedFields:[]} Spec:{RequestedIPCount:16 IPsNotInUse:[abc]} Status:{Scaler:{BatchSize:10 ReleaseThresholdPercent:50 RequestThresholdPercent:40 MaxIPCount:0} NetworkContainers:[{ID:nc1 PrimaryIP:10.0.0.11 SubnetName:sub1 IPAssignments:[{Name:ip1 IP:10.0.0.10}] DefaultGateway:10.0.0.1 SubnetAddressSpace:10.0.0.0/24 Version:2}]}}} ---- PASS: TestCNSClientDebugAPI (0.00s) -PASS -coverage: 5.1% of statements in ./... -ok github.com/Azure/azure-container-networking/cns/cnsclient 0.137s coverage: 5.1% of statements in ./... -? github.com/Azure/azure-container-networking/cns/cnsclient/httpapi [no test files] -? github.com/Azure/azure-container-networking/cns/common [no test files] -? github.com/Azure/azure-container-networking/cns/configuration [no test files] -? github.com/Azure/azure-container-networking/cns/dockerclient [no test files] -? github.com/Azure/azure-container-networking/cns/fakes [no test files] -? github.com/Azure/azure-container-networking/cns/hnsclient [no test files] -? github.com/Azure/azure-container-networking/cns/imdsclient [no test files] -2021/04/30 23:31:21 [1931] [Listener] Started listening on localhost:42424. -=== RUN TestAddressSpaces -2021/04/30 23:31:21 [1931] [Azure CNS] GetAddressSpace Request ---- PASS: TestAddressSpaces (0.00s) -=== RUN TestGetPoolID -2021/04/30 23:31:21 [1931] [Azure CNS] GetAddressSpace Request -2021/04/30 23:31:21 [1931] [Azure CNS] GetPoolID Request ---- PASS: TestGetPoolID (0.00s) -=== RUN TestReserveIP -2021/04/30 23:31:21 [1931] [Azure CNS] GetAddressSpace Request -2021/04/30 23:31:21 [1931] [Azure CNS] GetPoolID Request -2021/04/30 23:31:21 [1931] [Azure CNS] ReserveIpAddress -2021/04/30 23:31:21 [1931] [Azure CNS] ReserveIpAddress ---- PASS: TestReserveIP (0.00s) -=== RUN TestReleaseIP -2021/04/30 23:31:21 [1931] [Azure CNS] GetAddressSpace Request -2021/04/30 23:31:21 [1931] [Azure CNS] GetPoolID Request -2021/04/30 23:31:21 [1931] [Azure CNS] ReserveIpAddress -2021/04/30 23:31:21 [1931] [Azure CNS] ReleaseIpAddress -2021/04/30 23:31:21 [1931] [Azure CNS] ReleaseIP invalid http status code: 404 ---- PASS: TestReleaseIP (0.00s) -=== RUN TestIPAddressUtilization -2021/04/30 23:31:21 [1931] [Azure CNS] GetAddressSpace Request -2021/04/30 23:31:21 [1931] [Azure CNS] GetPoolID Request -2021/04/30 23:31:21 [1931] [Azure CNS] GetIPAddressUtilization -2021/04/30 23:31:21 Capacity 10 Available 7 Unhealthy [10.0.0.5 10.0.0.6 10.0.0.7] ---- PASS: TestIPAddressUtilization (0.00s) -PASS -coverage: 1.6% of statements in ./... -2021/04/30 23:31:21 [1931] [Listener] Stopped listening on localhost:42424 -ok github.com/Azure/azure-container-networking/cns/ipamclient 0.243s coverage: 1.6% of statements in ./... -=== RUN TestPoolSizeIncrease -2021/04/30 23:31:21 [1946] NewCNSIPAMPoolMonitor: Create IPAM Pool Monitor -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Update spec {RequestedIPCount:10 IPsNotInUse:[]}, pm.MinimumFreeIps 3, pm.MaximumFreeIps 15 -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Increasing pool size...[ipam-pool-monitor] Pool Size: 10, Goal Size: 10, BatchSize: 10, MaxIPCount: 30, MinFree: 3, MaxFree:15, Allocated: 8, Available: 2, Pending Release: 0, Free: 2, Pending Program: 0 -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Increasing pool size, Current Pool Size: 10, Updated Requested IP Count: 20, Pods with IP's:8, ToBeDeleted Count: 0 -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Increasing pool size: UpdateCRDSpec succeeded for spec {RequestedIPCount:20 IPsNotInUse:[]} -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Update spec {RequestedIPCount:10 IPsNotInUse:[]}, pm.MinimumFreeIps 3, pm.MaximumFreeIps 15 -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Increasing pool size...[ipam-pool-monitor] Pool Size: 20, Goal Size: 10, BatchSize: 10, MaxIPCount: 30, MinFree: 3, MaxFree:15, Allocated: 8, Available: 12, Pending Release: 0, Free: 2, Pending Program: 0 -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Increasing pool size, Current Pool Size: 20, Updated Requested IP Count: 20, Pods with IP's:8, ToBeDeleted Count: 0 -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Increasing pool size: UpdateCRDSpec succeeded for spec {RequestedIPCount:20 IPsNotInUse:[]} - ipampoolmonitor_test.go:86: Pool size 20, Target pool size 20, Allocated IP's 8, ---- PASS: TestPoolSizeIncrease (0.00s) -=== RUN TestPoolIncreaseDoesntChangeWhenIncreaseIsAlreadyInProgress -2021/04/30 23:31:21 [1946] NewCNSIPAMPoolMonitor: Create IPAM Pool Monitor -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Update spec {RequestedIPCount:10 IPsNotInUse:[]}, pm.MinimumFreeIps 3, pm.MaximumFreeIps 15 -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Increasing pool size...[ipam-pool-monitor] Pool Size: 10, Goal Size: 10, BatchSize: 10, MaxIPCount: 30, MinFree: 3, MaxFree:15, Allocated: 8, Available: 2, Pending Release: 0, Free: 2, Pending Program: 0 -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Increasing pool size, Current Pool Size: 10, Updated Requested IP Count: 20, Pods with IP's:8, ToBeDeleted Count: 0 -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Increasing pool size: UpdateCRDSpec succeeded for spec {RequestedIPCount:20 IPsNotInUse:[]} -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Update spec {RequestedIPCount:10 IPsNotInUse:[]}, pm.MinimumFreeIps 3, pm.MaximumFreeIps 15 -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Increasing pool size...[ipam-pool-monitor] Pool Size: 20, Goal Size: 10, BatchSize: 10, MaxIPCount: 30, MinFree: 3, MaxFree:15, Allocated: 9, Available: 11, Pending Release: 0, Free: 1, Pending Program: 0 -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Increasing pool size, Current Pool Size: 20, Updated Requested IP Count: 20, Pods with IP's:9, ToBeDeleted Count: 0 -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Increasing pool size: UpdateCRDSpec succeeded for spec {RequestedIPCount:20 IPsNotInUse:[]} - ipampoolmonitor_test.go:152: Pool size 20, Target pool size 20, Allocated IP's 9, ---- PASS: TestPoolIncreaseDoesntChangeWhenIncreaseIsAlreadyInProgress (0.00s) -=== RUN TestPoolSizeIncreaseIdempotency -2021/04/30 23:31:21 [1946] NewCNSIPAMPoolMonitor: Create IPAM Pool Monitor -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Update spec {RequestedIPCount:10 IPsNotInUse:[]}, pm.MinimumFreeIps 3, pm.MaximumFreeIps 15 - ipampoolmonitor_test.go:166: Minimum free IPs to request: 3 - ipampoolmonitor_test.go:167: Maximum free IPs to release: 15 -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Increasing pool size...[ipam-pool-monitor] Pool Size: 10, Goal Size: 10, BatchSize: 10, MaxIPCount: 30, MinFree: 3, MaxFree:15, Allocated: 8, Available: 2, Pending Release: 0, Free: 2, Pending Program: 0 -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Increasing pool size, Current Pool Size: 10, Updated Requested IP Count: 20, Pods with IP's:8, ToBeDeleted Count: 0 -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Increasing pool size: UpdateCRDSpec succeeded for spec {RequestedIPCount:20 IPsNotInUse:[]} ---- PASS: TestPoolSizeIncreaseIdempotency (0.00s) -=== RUN TestPoolIncreasePastNodeLimit -2021/04/30 23:31:21 [1946] NewCNSIPAMPoolMonitor: Create IPAM Pool Monitor -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Update spec {RequestedIPCount:16 IPsNotInUse:[]}, pm.MinimumFreeIps 8, pm.MaximumFreeIps 24 - ipampoolmonitor_test.go:209: Minimum free IPs to request: 8 - ipampoolmonitor_test.go:210: Maximum free IPs to release: 24 -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Increasing pool size...[ipam-pool-monitor] Pool Size: 16, Goal Size: 16, BatchSize: 16, MaxIPCount: 30, MinFree: 8, MaxFree:24, Allocated: 9, Available: 7, Pending Release: 0, Free: 7, Pending Program: 0 -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Requested IP count (32) is over max limit (30), requesting max limit instead. -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Increasing pool size, Current Pool Size: 16, Updated Requested IP Count: 30, Pods with IP's:9, ToBeDeleted Count: 0 -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Increasing pool size: UpdateCRDSpec succeeded for spec {RequestedIPCount:30 IPsNotInUse:[]} ---- PASS: TestPoolIncreasePastNodeLimit (0.00s) -=== RUN TestPoolIncreaseBatchSizeGreaterThanMaxPodIPCount -2021/04/30 23:31:21 [1946] NewCNSIPAMPoolMonitor: Create IPAM Pool Monitor -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Update spec {RequestedIPCount:16 IPsNotInUse:[]}, pm.MinimumFreeIps 15, pm.MaximumFreeIps 45 - ipampoolmonitor_test.go:241: Minimum free IPs to request: 15 - ipampoolmonitor_test.go:242: Maximum free IPs to release: 45 -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Increasing pool size...[ipam-pool-monitor] Pool Size: 16, Goal Size: 16, BatchSize: 30, MaxIPCount: 30, MinFree: 15, MaxFree:45, Allocated: 16, Available: 0, Pending Release: 0, Free: 0, Pending Program: 0 -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Requested IP count (46) is over max limit (30), requesting max limit instead. -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Increasing pool size, Current Pool Size: 16, Updated Requested IP Count: 30, Pods with IP's:16, ToBeDeleted Count: 0 -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Increasing pool size: UpdateCRDSpec succeeded for spec {RequestedIPCount:30 IPsNotInUse:[]} ---- PASS: TestPoolIncreaseBatchSizeGreaterThanMaxPodIPCount (0.00s) -=== RUN TestPoolIncreaseMaxIPCountSetToZero -2021/04/30 23:31:21 [1946] NewCNSIPAMPoolMonitor: Create IPAM Pool Monitor -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Update spec {RequestedIPCount:16 IPsNotInUse:[]}, pm.MinimumFreeIps 8, pm.MaximumFreeIps 24 ---- PASS: TestPoolIncreaseMaxIPCountSetToZero (0.00s) -=== RUN TestPoolDecrease -2021/04/30 23:31:21 [1946] NewCNSIPAMPoolMonitor: Create IPAM Pool Monitor -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Update spec {RequestedIPCount:20 IPsNotInUse:[]}, pm.MinimumFreeIps 3, pm.MaximumFreeIps 15 -2021/04/30 23:31:21 Min free IP's 3 -2021/04/30 23:31:21 Max free IP 15 -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Decreasing pool size...[ipam-pool-monitor] Pool Size: 20, Goal Size: 20, BatchSize: 10, MaxIPCount: 30, MinFree: 3, MaxFree:15, Allocated: 4, Available: 16, Pending Release: 0, Free: 16, Pending Program: 0 -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Previously RequestedIP Count 20 -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Batch size : 10 -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] modResult of (previously requested IP count mod batch size) = 0 -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] updatedRequestedIPCount 10 -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Marking IPs as PendingRelease, ipsToBeReleasedCount 10 -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Releasing IPCount in this batch 10, updatingPendingIpsNotInUse count 10 -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Decreasing pool size, Current Pool Size: 20, Requested IP Count: 10, Pods with IP's: 4, ToBeDeleted Count: 10 -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Decreasing pool size: UpdateCRDSpec succeeded for spec {RequestedIPCount:10 IPsNotInUse:[6d6779ae-ec6a-4346-b010-b9655f826d2e 8d55e09e-3ba7-499d-8065-f5e1702dc405 739b00c5-4884-46c9-adb3-c8f8876fb9da f43f7c68-b2a1-45a1-b34f-56acc113923f 9c78bc81-71c6-4b62-bf59-75cc4405aed6 d0074938-3f33-4754-b600-9ba9a681ca1e 2bcbed58-8cb2-49ec-974a-5e928bfe7ce8 cdd4922e-d597-47a4-96cb-f82d5012e97f c9cbf1f9-a09d-478a-808f-e6aa781f2898 ed916137-a352-4568-a6cc-9c4129e5abb7]} -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] cleaning the updatingPendingIpsNotInUse, existing length 10 -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Update spec {RequestedIPCount:10 IPsNotInUse:[]}, pm.MinimumFreeIps 3, pm.MaximumFreeIps 15 ---- PASS: TestPoolDecrease (0.00s) -=== RUN TestPoolSizeDecreaseWhenDecreaseHasAlreadyBeenRequested -2021/04/30 23:31:21 [1946] NewCNSIPAMPoolMonitor: Create IPAM Pool Monitor -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Update spec {RequestedIPCount:20 IPsNotInUse:[]}, pm.MinimumFreeIps 3, pm.MaximumFreeIps 10 -2021/04/30 23:31:21 Min free IP's 3 -2021/04/30 23:31:21 Max free IP 10 -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Decreasing pool size...[ipam-pool-monitor] Pool Size: 20, Goal Size: 20, BatchSize: 10, MaxIPCount: 30, MinFree: 3, MaxFree:10, Allocated: 5, Available: 15, Pending Release: 0, Free: 15, Pending Program: 0 -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Previously RequestedIP Count 20 -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Batch size : 10 -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] modResult of (previously requested IP count mod batch size) = 0 -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] updatedRequestedIPCount 10 -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Marking IPs as PendingRelease, ipsToBeReleasedCount 10 -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Releasing IPCount in this batch 10, updatingPendingIpsNotInUse count 10 -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Decreasing pool size, Current Pool Size: 20, Requested IP Count: 10, Pods with IP's: 5, ToBeDeleted Count: 10 -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Decreasing pool size: UpdateCRDSpec succeeded for spec {RequestedIPCount:10 IPsNotInUse:[b6093b04-6b47-4648-b3dc-b9108d849005 80e35579-000d-4858-93a4-3dbaa6cb7d5f dea6699f-b6ee-47a7-a84d-a660ca08ab1f 54802a1d-d2f8-4854-b461-ad4d6f137e54 b5af4d57-075e-4b13-979a-f6f8668f5701 0148bc7e-cb7c-49ef-aec8-b40357e18f7d 3c63a897-04f0-415a-8c20-d309d0c5ac3a ad4cdef7-68a9-4b0c-b595-61eb680f713b cb35f5bb-443a-41a3-9a28-62d9b333a36e cd932371-6444-48e5-b426-957f066a4d1e]} -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] cleaning the updatingPendingIpsNotInUse, existing length 10 -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Update spec {RequestedIPCount:10 IPsNotInUse:[]}, pm.MinimumFreeIps 3, pm.MaximumFreeIps 10 -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Removing Pending Release IP's from CRD...[ipam-pool-monitor] Pool Size: 10, Goal Size: 10, BatchSize: 10, MaxIPCount: 30, MinFree: 3, MaxFree:10, Allocated: 6, Available: 4, Pending Release: 0, Free: 4, Pending Program: 0 -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] cleanPendingRelease: UpdateCRDSpec succeeded for spec {RequestedIPCount:10 IPsNotInUse:[]} ---- PASS: TestPoolSizeDecreaseWhenDecreaseHasAlreadyBeenRequested (0.00s) -=== RUN TestPoolSizeDecreaseToReallyLow -2021/04/30 23:31:21 [1946] NewCNSIPAMPoolMonitor: Create IPAM Pool Monitor -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Update spec {RequestedIPCount:30 IPsNotInUse:[]}, pm.MinimumFreeIps 3, pm.MaximumFreeIps 10 -2021/04/30 23:31:21 Min free IP's 3 -2021/04/30 23:31:21 Max free IP 10 - ipampoolmonitor_test.go:437: Reconcile after Allocated count from 33 -> 3, Exepected free count = 10 -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Decreasing pool size...[ipam-pool-monitor] Pool Size: 30, Goal Size: 30, BatchSize: 10, MaxIPCount: 30, MinFree: 3, MaxFree:10, Allocated: 3, Available: 27, Pending Release: 0, Free: 27, Pending Program: 0 -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Previously RequestedIP Count 30 -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Batch size : 10 -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] modResult of (previously requested IP count mod batch size) = 0 -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] updatedRequestedIPCount 20 -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Marking IPs as PendingRelease, ipsToBeReleasedCount 10 -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Releasing IPCount in this batch 10, updatingPendingIpsNotInUse count 10 -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Decreasing pool size, Current Pool Size: 30, Requested IP Count: 20, Pods with IP's: 3, ToBeDeleted Count: 10 -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Decreasing pool size: UpdateCRDSpec succeeded for spec {RequestedIPCount:20 IPsNotInUse:[e614a67b-56d0-489e-a75f-3dbfe19c2745 99f971c7-2907-4305-bb58-6b67d87704de ae5238c1-5ac7-48a7-98e1-4f3148bb32d2 755a514b-17f9-42ea-9d55-268d90743a8f 52524f90-fbc3-4abe-84d4-526a95305fdd bb94164a-cd72-4e20-890e-68af5105f0b9 bc2d1ede-3132-4f73-8c66-86817e2281ce fbf89ec8-6246-48d7-9584-7aaa63fa96bd 352ea257-f8d6-4b20-95e9-57f0bf4fbd2b 64b09d05-2e02-4095-a3ca-62350da4f8cb]} -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] cleaning the updatingPendingIpsNotInUse, existing length 10 - ipampoolmonitor_test.go:454: Reconcile again - 2, Exepected free count = 20 -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Decreasing pool size...[ipam-pool-monitor] Pool Size: 30, Goal Size: 20, BatchSize: 10, MaxIPCount: 30, MinFree: 3, MaxFree:10, Allocated: 3, Available: 17, Pending Release: 10, Free: 17, Pending Program: 0 -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Previously RequestedIP Count 20 -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Batch size : 10 -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] modResult of (previously requested IP count mod batch size) = 0 -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] updatedRequestedIPCount 10 -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Marking IPs as PendingRelease, ipsToBeReleasedCount 10 -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Releasing IPCount in this batch 10, updatingPendingIpsNotInUse count 20 -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Decreasing pool size, Current Pool Size: 30, Requested IP Count: 10, Pods with IP's: 3, ToBeDeleted Count: 20 -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Decreasing pool size: UpdateCRDSpec succeeded for spec {RequestedIPCount:10 IPsNotInUse:[352ea257-f8d6-4b20-95e9-57f0bf4fbd2b 64b09d05-2e02-4095-a3ca-62350da4f8cb 62d9f933-4ba5-4e79-981a-853e0dab3107 e614a67b-56d0-489e-a75f-3dbfe19c2745 ae5238c1-5ac7-48a7-98e1-4f3148bb32d2 28dfc0fa-bff1-4074-ac75-776755fd21e0 5dc2c8b5-27a9-47dd-a3ab-1cba4901c38a 5e04e5e7-ac34-4f94-b92b-02c946d76a36 700d6611-6e4f-42d2-b939-72f574da73f9 bc2d1ede-3132-4f73-8c66-86817e2281ce fbf89ec8-6246-48d7-9584-7aaa63fa96bd 5bb1cb98-ed43-4646-be67-0c111430b56a 5b226262-60a1-4a9c-b9dd-4da633edf829 18b00350-8779-4ccf-90b2-051736d574e8 9a162413-572b-41a0-b76a-15cdf8535de5 99f971c7-2907-4305-bb58-6b67d87704de 755a514b-17f9-42ea-9d55-268d90743a8f 52524f90-fbc3-4abe-84d4-526a95305fdd bb94164a-cd72-4e20-890e-68af5105f0b9 e31452d1-f623-41f6-8c2e-2b621850f2b9]} -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] cleaning the updatingPendingIpsNotInUse, existing length 20 - ipampoolmonitor_test.go:470: Update Request Controller -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Update spec {RequestedIPCount:10 IPsNotInUse:[]}, pm.MinimumFreeIps 3, pm.MaximumFreeIps 10 -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Removing Pending Release IP's from CRD...[ipam-pool-monitor] Pool Size: 10, Goal Size: 10, BatchSize: 10, MaxIPCount: 30, MinFree: 3, MaxFree:10, Allocated: 3, Available: 7, Pending Release: 0, Free: 7, Pending Program: 0 -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] cleanPendingRelease: UpdateCRDSpec succeeded for spec {RequestedIPCount:10 IPsNotInUse:[]} ---- PASS: TestPoolSizeDecreaseToReallyLow (0.01s) -=== RUN TestDecreaseAfterNodeLimitReached -2021/04/30 23:31:21 [1946] NewCNSIPAMPoolMonitor: Create IPAM Pool Monitor -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Update spec {RequestedIPCount:30 IPsNotInUse:[]}, pm.MinimumFreeIps 8, pm.MaximumFreeIps 24 - ipampoolmonitor_test.go:500: Minimum free IPs to request: 8 - ipampoolmonitor_test.go:501: Maximum free IPs to release: 24 -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Decreasing pool size...[ipam-pool-monitor] Pool Size: 30, Goal Size: 30, BatchSize: 16, MaxIPCount: 30, MinFree: 8, MaxFree:24, Allocated: 5, Available: 25, Pending Release: 0, Free: 25, Pending Program: 0 -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Previously RequestedIP Count 30 -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Batch size : 16 -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] modResult of (previously requested IP count mod batch size) = 14 -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] updatedRequestedIPCount 16 -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Marking IPs as PendingRelease, ipsToBeReleasedCount 14 -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Releasing IPCount in this batch 14, updatingPendingIpsNotInUse count 14 -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Decreasing pool size, Current Pool Size: 30, Requested IP Count: 16, Pods with IP's: 5, ToBeDeleted Count: 14 -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Decreasing pool size: UpdateCRDSpec succeeded for spec {RequestedIPCount:16 IPsNotInUse:[c654d2b8-9ec3-4b29-b05e-6e81a211db15 8a8e0d70-711f-459b-8019-f46436d46eac c9211380-218d-4102-86e5-a61a648b0686 927c39c3-dfbc-4a56-964f-7779b0a6fd2b 09f9b0a9-08f7-41d3-ac14-f6361b0b673c 24cfc897-1f00-4000-ade0-d1022321558b fb931d6c-04a2-4fa7-8d90-9a5b9bb6bb37 cdf714f2-f231-4ab3-98a8-740063fa1550 bb813f28-f86b-42b3-9a21-7dbeebe340e6 06909b8e-ecbb-4d76-98bf-5c8fb01490e2 37eca699-15ba-4a9e-b3c3-3acacf56ee8a 92c9d54a-e9c4-4353-b3e5-b13beecd51b6 371a7d62-e561-48b1-adb7-82cded3ebbc4 03818ade-c847-4e5b-abf5-b5fe26086403]} -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] cleaning the updatingPendingIpsNotInUse, existing length 14 ---- PASS: TestDecreaseAfterNodeLimitReached (0.00s) -=== RUN TestPoolDecreaseBatchSizeGreaterThanMaxPodIPCount -2021/04/30 23:31:21 [1946] NewCNSIPAMPoolMonitor: Create IPAM Pool Monitor -2021/04/30 23:31:21 [1946] [ipam-pool-monitor] Update spec {RequestedIPCount:30 IPsNotInUse:[]}, pm.MinimumFreeIps 15, pm.MaximumFreeIps 45 - ipampoolmonitor_test.go:546: Minimum free IPs to request: 15 - ipampoolmonitor_test.go:547: Maximum free IPs to release: 45 ---- PASS: TestPoolDecreaseBatchSizeGreaterThanMaxPodIPCount (0.00s) -PASS -coverage: 2.8% of statements in ./... -ok github.com/Azure/azure-container-networking/cns/ipampoolmonitor 0.176s coverage: 2.8% of statements in ./... -? github.com/Azure/azure-container-networking/cns/logger [no test files] -? github.com/Azure/azure-container-networking/cns/networkcontainers [no test files] -? github.com/Azure/azure-container-networking/cns/nmagentclient [no test files] -? github.com/Azure/azure-container-networking/cns/requestcontroller [no test files] -=== RUN TestNewCrdRequestController ---- PASS: TestNewCrdRequestController (0.00s) -=== RUN TestGetNonExistingNodeNetConfig ---- PASS: TestGetNonExistingNodeNetConfig (0.00s) -=== RUN TestGetExistingNodeNetConfig ---- PASS: TestGetExistingNodeNetConfig (0.00s) -=== RUN TestUpdateNonExistingNodeNetConfig ---- PASS: TestUpdateNonExistingNodeNetConfig (0.00s) -=== RUN TestUpdateExistingNodeNetConfig ---- PASS: TestUpdateExistingNodeNetConfig (0.00s) -=== RUN TestUpdateSpecOnNonExistingNodeNetConfig -2021/04/30 23:31:21 [1945] [cns-rc] Error getting CRD when updating spec Node Net Config not found in mock store ---- PASS: TestUpdateSpecOnNonExistingNodeNetConfig (0.00s) -=== RUN TestUpdateSpecOnExistingNodeNetConfig -2021/04/30 23:31:21 [1945] [cns-rc] Received update for IP count {RequestedIPCount:10 IPsNotInUse:[539970a2-c2dd-11ea-b3de-0242ac130004 01a5dd00-cd5d-11ea-87d0-0242ac130003]} -2021/04/30 23:31:21 [1945] [cns-rc] After deep copy {RequestedIPCount:10 IPsNotInUse:[539970a2-c2dd-11ea-b3de-0242ac130004 01a5dd00-cd5d-11ea-87d0-0242ac130003]} ---- PASS: TestUpdateSpecOnExistingNodeNetConfig (0.00s) -=== RUN TestGetExistingNNCDirectClient ---- PASS: TestGetExistingNNCDirectClient (0.00s) -=== RUN TestGetNonExistingNNCDirectClient ---- PASS: TestGetNonExistingNNCDirectClient (0.00s) -=== RUN TestGetPodsExistingNodeDirectClient ---- PASS: TestGetPodsExistingNodeDirectClient (0.00s) -=== RUN TestGetPodsNonExistingNodeDirectClient ---- PASS: TestGetPodsNonExistingNodeDirectClient (0.00s) -=== RUN TestInitRequestController -2021/04/30 23:31:21 [1945] Set NC request info with NetworkContainerid 24fcd232-0364-41b0-8027-6e6ef9aeabc6, NetworkContainerType Docker, NC Version 1 ---- PASS: TestInitRequestController (0.00s) -=== RUN TestStatusToNCRequestMalformedPrimaryIP ---- PASS: TestStatusToNCRequestMalformedPrimaryIP (0.00s) -=== RUN TestStatusToNCRequestMalformedIPAssignment ---- PASS: TestStatusToNCRequestMalformedIPAssignment (0.00s) -=== RUN TestStatusToNCRequestPrimaryIPInCIDR ---- PASS: TestStatusToNCRequestPrimaryIPInCIDR (0.00s) -=== RUN TestStatusToNCRequestIPAssignmentNotCIDR ---- PASS: TestStatusToNCRequestIPAssignmentNotCIDR (0.00s) -=== RUN TestStatusToNCRequestWithIncorrectSubnetAddressSpace ---- PASS: TestStatusToNCRequestWithIncorrectSubnetAddressSpace (0.00s) -=== RUN TestStatusToNCRequestSuccess -2021/04/30 23:31:21 [1945] Set NC request info with NetworkContainerid 160005ba-cd02-11ea-87d0-0242ac130003, NetworkContainerType Docker, NC Version 1 ---- PASS: TestStatusToNCRequestSuccess (0.00s) -PASS -coverage: 1.6% of statements in ./... -ok github.com/Azure/azure-container-networking/cns/requestcontroller/kubecontroller 0.146s coverage: 1.6% of statements in ./... -2021/04/30 23:31:22 [2008] HTTP listener will be started later after CNS state has been reconciled -2021/04/30 23:31:22 [2008] [Azure CNS] restoreState -2021/04/30 23:31:22 [2008] [Azure CNS] Failed to restore state, err:EOF. Removing azure-cns.json -2021/04/30 23:31:22 [2008] [Azure CNS] Enter Restoring Network State -2021/04/30 23:31:22 [2008] os.stat() for file azure-cns.json failed: stat azure-cns.json: no such file or directory -2021/04/30 23:31:22 [2008] [Utils] Initializing HTTP client with connection timeout: 0, response header timeout: 0 -2021/04/30 23:31:22 [2008] SetContext details called with: orchestrator nodeID -2021/04/30 23:31:22 [2008] [Azure CNS] Listening. -2021/04/30 23:31:22 [2008] [Listener] Started listening on localhost:10090. -2021/04/30 23:31:22 [2008] [Listener] Started listening on localhost:9000. -=== RUN TestSetEnvironment -Test: SetEnvironment -2021/04/30 23:31:22 [2008] [Azure CNS] setEnvironment -2021/04/30 23:31:22 [2008] [Azure CNS] POST received for SetEnvironment. -2021/04/30 23:31:22 [2008] [Azure CNS] saveState -2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. -SetEnvironment Responded with {ReturnCode:0 Message:} ---- PASS: TestSetEnvironment (0.00s) -=== RUN TestSetOrchestratorType -Test: TestSetOrchestratorType -2021/04/30 23:31:22 [2008] [Azure CNS] setEnvironment -2021/04/30 23:31:22 [2008] [Azure CNS] POST received for SetEnvironment. -2021/04/30 23:31:22 [2008] [Azure CNS] saveState -2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. -2021/04/30 23:31:22 [2008] [Azure CNS] setOrchestratorType -2021/04/30 23:31:22 [2008] SetContext details called with: Kubernetes orchestrator nodeID -2021/04/30 23:31:22 [2008] [Azure CNS] saveState -2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. -Raw response: setOrchestratorType passed with response {ReturnCode:0 Message:} Err:setOrchestratorType succeeded with response {ReturnCode:0 Message:} ---- PASS: TestSetOrchestratorType (0.00s) -=== RUN TestCreateNetworkContainer -Test: TestCreateNetworkContainer -2021/04/30 23:31:22 [2008] [Azure CNS] setEnvironment -2021/04/30 23:31:22 [2008] [Azure CNS] POST received for SetEnvironment. -2021/04/30 23:31:22 [2008] [Azure CNS] saveState -2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. -2021/04/30 23:31:22 [2008] [Azure CNS] setOrchestratorType -2021/04/30 23:31:22 [2008] SetContext details called with: ServiceFabric orchestrator nodeID -2021/04/30 23:31:22 [2008] [Azure CNS] saveState -2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. -Raw response: setOrchestratorType passed with response {ReturnCode:0 Message:} Err:setOrchestratorType succeeded with response {ReturnCode:0 Message:} -TestCreateNetworkContainer: JobObject -2021/04/30 23:31:22 [2008] [Azure CNS] createOrUpdateNetworkContainer -2021/04/30 23:31:22 [2008] Pod info {testpod testpodnamespace} -2021/04/30 23:31:22 [2008] [Azure CNS] saveState -2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. -Raw response: CreateNetworkContainerRequest passed with response {Response:{ReturnCode:0 Message:}} Err:CreateNetworkContainerRequest succeeded with response {Response:{ReturnCode:0 Message:}} -Deleting the saved goal state for network container of type JobObject -2021/04/30 23:31:22 [2008] [Azure CNS] deleteNetworkContainer -2021/04/30 23:31:22 [2008] [Azure CNS] saveState -2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. -DeleteNetworkContainer succeded with response {Response:{ReturnCode:0 Message:}} -TestCreateNetworkContainer: WebApps -2021/04/30 23:31:22 [2008] [Azure CNS] createOrUpdateNetworkContainer -2021/04/30 23:31:22 [2008] [Azure CNS] NetworkContainers.Create called for NC: Swift_ethWebApp -2021/04/30 23:31:22 [2008] [Azure CNS] NetworkContainers.Create completed for NC: Swift_ethWebApp with error: -2021/04/30 23:31:22 [2008] Pod info {testpod testpodnamespace} -2021/04/30 23:31:22 [2008] [Azure CNS] saveState -2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. -Raw response: CreateNetworkContainerRequest passed with response {Response:{ReturnCode:0 Message:}} Err:CreateNetworkContainerRequest succeeded with response {Response:{ReturnCode:0 Message:}} -2021/04/30 23:31:22 [2008] [Azure CNS] createOrUpdateNetworkContainer -2021/04/30 23:31:22 [2008] Pod info {testpod testpodnamespace} -2021/04/30 23:31:22 [2008] [Azure CNS] saveState -2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. -Raw response: CreateNetworkContainerRequest passed with response {Response:{ReturnCode:0 Message:}} Err:CreateNetworkContainerRequest succeeded with response {Response:{ReturnCode:0 Message:}} -Now calling DeleteNetworkContainer -2021/04/30 23:31:22 [2008] [Azure CNS] deleteNetworkContainer -2021/04/30 23:31:22 [2008] [Azure CNS] NetworkContainers.Delete called for NC: Swift_ethWebApp -2021/04/30 23:31:22 [2008] [Azure CNS] NetworkContainers.Delete completed for NC: Swift_ethWebApp with error: -2021/04/30 23:31:22 [2008] [Azure CNS] saveState -2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. -DeleteNetworkContainer succeded with response {Response:{ReturnCode:0 Message:}} -2021/04/30 23:31:22 [2008] [Azure CNS] createOrUpdateNetworkContainer -2021/04/30 23:31:22 [2008] Pod info {testpod testpodnamespace} -2021/04/30 23:31:22 [2008] [Azure CNS] saveState -2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. -Raw response: CreateNetworkContainerRequest passed with response {Response:{ReturnCode:0 Message:}} Err:CreateNetworkContainerRequest succeeded with response {Response:{ReturnCode:0 Message:}} -Deleting the saved goal state for network container of type COW -2021/04/30 23:31:22 [2008] [Azure CNS] deleteNetworkContainer -2021/04/30 23:31:22 [2008] [Azure CNS] saveState -2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. -DeleteNetworkContainer succeded with response {Response:{ReturnCode:0 Message:}} ---- PASS: TestCreateNetworkContainer (0.02s) -=== RUN TestGetNetworkContainerByOrchestratorContext -Test: TestGetNetworkContainerByOrchestratorContext -2021/04/30 23:31:22 [2008] [Azure CNS] setEnvironment -2021/04/30 23:31:22 [2008] [Azure CNS] POST received for SetEnvironment. -2021/04/30 23:31:22 [2008] [Azure CNS] saveState -2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. -2021/04/30 23:31:22 [2008] [Azure CNS] setOrchestratorType -2021/04/30 23:31:22 [2008] SetContext details called with: Kubernetes orchestrator nodeID -2021/04/30 23:31:22 [2008] [Azure CNS] saveState -2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. -Raw response: setOrchestratorType passed with response {ReturnCode:0 Message:} Err:setOrchestratorType succeeded with response {ReturnCode:0 Message:} -2021/04/30 23:31:22 [2008] [Azure CNS] createOrUpdateNetworkContainer -2021/04/30 23:31:22 [2008] Pod info {testpod testpodnamespace} -2021/04/30 23:31:22 [2008] [Azure CNS] saveState -2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. -Raw response: CreateNetworkContainerRequest passed with response {Response:{ReturnCode:0 Message:}} Err:CreateNetworkContainerRequest succeeded with response {Response:{ReturnCode:0 Message:}} -Now calling getNetworkContainerByContext -2021/04/30 23:31:22 [2008] [Azure CNS] getNetworkContainerByOrchestratorContext -2021/04/30 23:31:22 [2008] pod info {PodName:testpod PodNamespace:testpodnamespace} -2021/04/30 23:31:22 [2008] [Azure CNS] getNCVersionURL for Network container Swift_ethWebApp not found. Skipping GetNCVersionStatus check from NMAgent -2021/04/30 23:31:22 [2008] containerid Swift_ethWebApp -**GetNetworkContainerByContext succeded with response {NetworkContainerID:Swift_ethWebApp IPConfiguration:{IPSubnet:{IPAddress:11.0.0.5 PrefixLength:24} DNSServers:[8.8.8.8 8.8.4.4] GatewayIPAddress:11.0.0.1} Routes:[] CnetAddressSpace:[] MultiTenancyInfo:{EncapType: ID:0} PrimaryInterfaceIdentifier:11.0.0.7 LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} Response:{ReturnCode:0 Message:} AllowHostToNCCommunication:false AllowNCToHostCommunication:false}, raw: -Now calling DeleteNetworkContainer -2021/04/30 23:31:22 [2008] [Azure CNS] deleteNetworkContainer -2021/04/30 23:31:22 [2008] [Azure CNS] saveState -2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. -DeleteNetworkContainer succeded with response {Response:{ReturnCode:0 Message:}} -2021/04/30 23:31:22 [2008] [Azure CNS] getNetworkContainerByOrchestratorContext -2021/04/30 23:31:22 [2008] pod info {PodName:testpod PodNamespace:testpodnamespace} -2021/04/30 23:31:22 [2008] containerid -2021/04/30 23:31:22 [2008] [cns-test-server] Code:UnknownContainerID, {NetworkContainerID: IPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} Routes:[] CnetAddressSpace:[] MultiTenancyInfo:{EncapType: ID:0} PrimaryInterfaceIdentifier: LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} Response:{ReturnCode:18 Message:NetworkContainer doesn't exist.} AllowHostToNCCommunication:false AllowNCToHostCommunication:false}. -**GetNonExistNetworkContainerByContext succeded with response {NetworkContainerID: IPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} Routes:[] CnetAddressSpace:[] MultiTenancyInfo:{EncapType: ID:0} PrimaryInterfaceIdentifier: LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} Response:{ReturnCode:18 Message:NetworkContainer doesn't exist.} AllowHostToNCCommunication:false AllowNCToHostCommunication:false}, raw: ---- PASS: TestGetNetworkContainerByOrchestratorContext (0.01s) -=== RUN TestGetInterfaceForNetworkContainer -Test: TestCreateNetworkContainer -2021/04/30 23:31:22 [2008] [Azure CNS] setEnvironment -2021/04/30 23:31:22 [2008] [Azure CNS] POST received for SetEnvironment. -2021/04/30 23:31:22 [2008] [Azure CNS] saveState -2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. -2021/04/30 23:31:22 [2008] [Azure CNS] setOrchestratorType -2021/04/30 23:31:22 [2008] SetContext details called with: Kubernetes orchestrator nodeID -2021/04/30 23:31:22 [2008] [Azure CNS] saveState -2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. -Raw response: setOrchestratorType passed with response {ReturnCode:0 Message:} Err:setOrchestratorType succeeded with response {ReturnCode:0 Message:} -2021/04/30 23:31:22 [2008] [Azure CNS] createOrUpdateNetworkContainer -2021/04/30 23:31:22 [2008] [Azure CNS] NetworkContainers.Create called for NC: Swift_ethWebApp -2021/04/30 23:31:22 [2008] [Azure CNS] NetworkContainers.Create completed for NC: Swift_ethWebApp with error: -2021/04/30 23:31:22 [2008] Pod info {testpod testpodnamespace} -2021/04/30 23:31:22 [2008] [Azure CNS] saveState -2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. -Raw response: CreateNetworkContainerRequest passed with response {Response:{ReturnCode:0 Message:}} Err:CreateNetworkContainerRequest succeeded with response {Response:{ReturnCode:0 Message:}} -Now calling getInterfaceForContainer -2021/04/30 23:31:22 [2008] [Azure CNS] getInterfaceForContainer -**GetInterfaceForContainer succeded with response {NetworkContainerVersion:0 NetworkInterface:{Name:Swift_ethWebApp IPAddress:11.0.0.5} CnetAddressSpace:[] DNSServers:[8.8.8.8 8.8.4.4] Response:{ReturnCode:0 Message:}}, raw: -Now calling DeleteNetworkContainer -2021/04/30 23:31:22 [2008] [Azure CNS] deleteNetworkContainer -2021/04/30 23:31:22 [2008] [Azure CNS] NetworkContainers.Delete called for NC: Swift_ethWebApp -2021/04/30 23:31:22 [2008] [Azure CNS] NetworkContainers.Delete completed for NC: Swift_ethWebApp with error: -2021/04/30 23:31:22 [2008] [Azure CNS] saveState -2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. -DeleteNetworkContainer succeded with response {Response:{ReturnCode:0 Message:}} ---- PASS: TestGetInterfaceForNetworkContainer (0.01s) -=== RUN TestGetNumOfCPUCores -Test: getNumberOfCPUCores -2021/04/30 23:31:22 [2008] [Azure-CNS] getNumberOfCPUCores -getNumberOfCPUCores Responded with {Response:{ReturnCode:0 Message:} NumOfCPUCores:4} ---- PASS: TestGetNumOfCPUCores (0.00s) -=== RUN TestGetNetworkContainerVersionStatus -Test: TestGetNetworkContainerVersionStatus -2021/04/30 23:31:22 [2008] [Azure CNS] setEnvironment -2021/04/30 23:31:22 [2008] [Azure CNS] POST received for SetEnvironment. -2021/04/30 23:31:22 [2008] [Azure CNS] saveState -2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. -2021/04/30 23:31:22 [2008] [Azure CNS] setOrchestratorType -2021/04/30 23:31:22 [2008] SetContext details called with: Kubernetes orchestrator nodeID -2021/04/30 23:31:22 [2008] [Azure CNS] saveState -2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. -Raw response: setOrchestratorType passed with response {ReturnCode:0 Message:} Err:setOrchestratorType succeeded with response {ReturnCode:0 Message:} -2021/04/30 23:31:22 [2008] [Azure CNS] createOrUpdateNetworkContainer -2021/04/30 23:31:22 [2008] Pod info {testpod testpodnamespace} -2021/04/30 23:31:22 [2008] [Azure CNS] saveState -2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. -Raw response: CreateNetworkContainerRequest passed with response {Response:{ReturnCode:0 Message:}} Err:CreateNetworkContainerRequest succeeded with response {Response:{ReturnCode:0 Message:}} -2021/04/30 23:31:22 [2008] [Azure-CNS] PublishNetworkContainer -2021/04/30 23:31:22 [2008] [NMAgentClient] JoinNetwork: vnet1 -2021/04/30 23:31:22 [2008] [NMAgentClient][Response] Join network: vnet1. Response: &{Status:200 OK StatusCode:200 Proto:HTTP/1.1 ProtoMajor:1 ProtoMinor:1 Header:map[Content-Length:[0] Content-Type:[application/json; charset=UTF-8] Date:[Fri, 30 Apr 2021 23:31:22 GMT]] Body:{} ContentLength:0 TransferEncoding:[] Close:false Uncompressed:false Trailer:map[] Request:0xc000122200 TLS:}. Error: -2021/04/30 23:31:22 [2008] [Azure-CNS] setNetworkStateJoined for network: vnet1 -2021/04/30 23:31:22 [2008] [NMAgentClient] PublishNetworkContainer NC: nc-nma-success -2021/04/30 23:31:22 [2008] [NMAgentClient][Response] Publish NC: nc-nma-success. Response: &{Status:200 OK StatusCode:200 Proto:HTTP/1.1 ProtoMajor:1 ProtoMinor:1 Header:map[Content-Length:[0] Content-Type:[application/json; charset=UTF-8] Date:[Fri, 30 Apr 2021 23:31:22 GMT]] Body:{} ContentLength:0 TransferEncoding:[] Close:false Uncompressed:false Trailer:map[] Request:0xc0004ac900 TLS:}. Error: -PublishNetworkContainer succeded with response {Response:{ReturnCode:0 Message:} PublishErrorStr: PublishStatusCode:200 PublishResponseBody:[]}, raw: -2021/04/30 23:31:22 [2008] [Azure CNS] getNetworkContainerByOrchestratorContext -2021/04/30 23:31:22 [2008] pod info {PodName:testpod PodNamespace:testpodnamespace} -2021/04/30 23:31:22 [2008] [NMAgentClient] GetNetworkContainerVersion NC: Swift_nc-nma-success -2021/04/30 23:31:22 [2008] [NMAgentClient][Response] GetNetworkContainerVersion NC: Swift_nc-nma-success. Response: &{Status:200 OK StatusCode:200 Proto:HTTP/1.1 ProtoMajor:1 ProtoMinor:1 Header:map[Content-Length:[76] Content-Type:[application/json; charset=UTF-8] Date:[Fri, 30 Apr 2021 23:31:22 GMT]] Body:0xc000457300 ContentLength:76 TransferEncoding:[] Close:false Uncompressed:false Trailer:map[] Request:0xc0004acc00 TLS:}. Error: -2021/04/30 23:31:22 [2008] [Azure CNS] Vfp programming complete for NC: Swift_nc-nma-success with version: 0 -2021/04/30 23:31:22 [2008] [Azure-CNS] Setting VfpUpdateComplete to true for NC: Swift_nc-nma-success -2021/04/30 23:31:22 [2008] [Azure CNS] saveState -2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. -2021/04/30 23:31:22 [2008] containerid Swift_nc-nma-success -**GetNetworkContainerByContext succeded with response {NetworkContainerID:Swift_nc-nma-success IPConfiguration:{IPSubnet:{IPAddress:11.0.0.5 PrefixLength:24} DNSServers:[8.8.8.8 8.8.4.4] GatewayIPAddress:11.0.0.1} Routes:[] CnetAddressSpace:[] MultiTenancyInfo:{EncapType: ID:0} PrimaryInterfaceIdentifier:11.0.0.7 LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} Response:{ReturnCode:0 Message:} AllowHostToNCCommunication:false AllowNCToHostCommunication:false}, raw: -2021/04/30 23:31:22 [2008] [Azure CNS] getNetworkContainerByOrchestratorContext -2021/04/30 23:31:22 [2008] pod info {PodName:testpod PodNamespace:testpodnamespace} -2021/04/30 23:31:22 [2008] [Azure CNS] Network container: Swift_nc-nma-success, version: 0 has VFP programming already completed -2021/04/30 23:31:22 [2008] containerid Swift_nc-nma-success -**GetNetworkContainerByContext succeded with response {NetworkContainerID:Swift_nc-nma-success IPConfiguration:{IPSubnet:{IPAddress:11.0.0.5 PrefixLength:24} DNSServers:[8.8.8.8 8.8.4.4] GatewayIPAddress:11.0.0.1} Routes:[] CnetAddressSpace:[] MultiTenancyInfo:{EncapType: ID:0} PrimaryInterfaceIdentifier:11.0.0.7 LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} Response:{ReturnCode:0 Message:} AllowHostToNCCommunication:false AllowNCToHostCommunication:false}, raw: -2021/04/30 23:31:22 [2008] [Azure CNS] deleteNetworkContainer -2021/04/30 23:31:22 [2008] [Azure CNS] saveState -2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. -DeleteNetworkContainer succeded with response {Response:{ReturnCode:0 Message:}} -2021/04/30 23:31:22 [2008] [Azure CNS] createOrUpdateNetworkContainer -2021/04/30 23:31:22 [2008] Pod info {testpod testpodnamespace} -2021/04/30 23:31:22 [2008] [Azure CNS] saveState -2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. -Raw response: CreateNetworkContainerRequest passed with response {Response:{ReturnCode:0 Message:}} Err:CreateNetworkContainerRequest succeeded with response {Response:{ReturnCode:0 Message:}} -2021/04/30 23:31:22 [2008] [Azure-CNS] PublishNetworkContainer -2021/04/30 23:31:22 [2008] [NMAgentClient] JoinNetwork: vnet1 -2021/04/30 23:31:22 [2008] [NMAgentClient][Response] Join network: vnet1. Response: &{Status:200 OK StatusCode:200 Proto:HTTP/1.1 ProtoMajor:1 ProtoMinor:1 Header:map[Content-Length:[0] Content-Type:[application/json; charset=UTF-8] Date:[Fri, 30 Apr 2021 23:31:22 GMT]] Body:{} ContentLength:0 TransferEncoding:[] Close:false Uncompressed:false Trailer:map[] Request:0xc0004ad300 TLS:}. Error: -2021/04/30 23:31:22 [2008] [Azure-CNS] setNetworkStateJoined for network: vnet1 -2021/04/30 23:31:22 [2008] [NMAgentClient] PublishNetworkContainer NC: nc-nma-fail-version-mismatch -2021/04/30 23:31:22 [2008] [NMAgentClient][Response] Publish NC: nc-nma-fail-version-mismatch. Response: &{Status:200 OK StatusCode:200 Proto:HTTP/1.1 ProtoMajor:1 ProtoMinor:1 Header:map[Content-Length:[0] Content-Type:[application/json; charset=UTF-8] Date:[Fri, 30 Apr 2021 23:31:22 GMT]] Body:{} ContentLength:0 TransferEncoding:[] Close:false Uncompressed:false Trailer:map[] Request:0xc000122400 TLS:}. Error: -PublishNetworkContainer succeded with response {Response:{ReturnCode:0 Message:} PublishErrorStr: PublishStatusCode:200 PublishResponseBody:[]}, raw: -2021/04/30 23:31:22 [2008] [Azure CNS] getNetworkContainerByOrchestratorContext -2021/04/30 23:31:22 [2008] pod info {PodName:testpod PodNamespace:testpodnamespace} -2021/04/30 23:31:22 [2008] [NMAgentClient] GetNetworkContainerVersion NC: Swift_nc-nma-fail-version-mismatch -2021/04/30 23:31:22 [2008] [NMAgentClient][Response] GetNetworkContainerVersion NC: Swift_nc-nma-fail-version-mismatch. Response: &{Status:200 OK StatusCode:200 Proto:HTTP/1.1 ProtoMajor:1 ProtoMinor:1 Header:map[Content-Length:[90] Content-Type:[application/json; charset=UTF-8] Date:[Fri, 30 Apr 2021 23:31:22 GMT]] Body:0xc00008ac00 ContentLength:90 TransferEncoding:[] Close:false Uncompressed:false Trailer:map[] Request:0xc000122700 TLS:}. Error: -2021/04/30 23:31:22 [2008] [Azure-CNS] isNCWaitingForUpdate failed for NC: Swift_nc-nma-fail-version-mismatch with error: Network container: Swift_nc-nma-fail-version-mismatch version: 1 is not yet programmed by NMAgent. Programmed version: 0 -2021/04/30 23:31:22 [2008] [cns-test-server] Code:NetworkContainerVfpProgramPending, {NetworkContainerID: IPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} Routes:[] CnetAddressSpace:[] MultiTenancyInfo:{EncapType: ID:0} PrimaryInterfaceIdentifier: LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} Response:{ReturnCode:31 Message:Network container: Swift_nc-nma-fail-version-mismatch version: 1 is not yet programmed by NMAgent. Programmed version: 0} AllowHostToNCCommunication:false AllowNCToHostCommunication:false}. -**getNetworkContainerByContextExpectedError succeded with response {NetworkContainerID: IPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} Routes:[] CnetAddressSpace:[] MultiTenancyInfo:{EncapType: ID:0} PrimaryInterfaceIdentifier: LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} Response:{ReturnCode:31 Message:Network container: Swift_nc-nma-fail-version-mismatch version: 1 is not yet programmed by NMAgent. Programmed version: 0} AllowHostToNCCommunication:false AllowNCToHostCommunication:false}, raw: -2021/04/30 23:31:22 [2008] [Azure CNS] deleteNetworkContainer -2021/04/30 23:31:22 [2008] [Azure CNS] saveState -2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. -DeleteNetworkContainer succeded with response {Response:{ReturnCode:0 Message:}} -2021/04/30 23:31:22 [2008] [Azure CNS] createOrUpdateNetworkContainer -2021/04/30 23:31:22 [2008] Pod info {testpod testpodnamespace} -2021/04/30 23:31:22 [2008] [Azure CNS] saveState -2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. -Raw response: CreateNetworkContainerRequest passed with response {Response:{ReturnCode:0 Message:}} Err:CreateNetworkContainerRequest succeeded with response {Response:{ReturnCode:0 Message:}} -2021/04/30 23:31:22 [2008] [Azure-CNS] PublishNetworkContainer -2021/04/30 23:31:22 [2008] [NMAgentClient] JoinNetwork: vnet1 -2021/04/30 23:31:22 [2008] [NMAgentClient][Response] Join network: vnet1. Response: &{Status:200 OK StatusCode:200 Proto:HTTP/1.1 ProtoMajor:1 ProtoMinor:1 Header:map[Content-Length:[0] Content-Type:[application/json; charset=UTF-8] Date:[Fri, 30 Apr 2021 23:31:22 GMT]] Body:{} ContentLength:0 TransferEncoding:[] Close:false Uncompressed:false Trailer:map[] Request:0xc000122d00 TLS:}. Error: -2021/04/30 23:31:22 [2008] [Azure-CNS] setNetworkStateJoined for network: vnet1 -2021/04/30 23:31:22 [2008] [NMAgentClient] PublishNetworkContainer NC: nc-nma-fail-500 -2021/04/30 23:31:22 [2008] [NMAgentClient][Response] Publish NC: nc-nma-fail-500. Response: &{Status:200 OK StatusCode:200 Proto:HTTP/1.1 ProtoMajor:1 ProtoMinor:1 Header:map[Content-Length:[0] Content-Type:[application/json; charset=UTF-8] Date:[Fri, 30 Apr 2021 23:31:22 GMT]] Body:{} ContentLength:0 TransferEncoding:[] Close:false Uncompressed:false Trailer:map[] Request:0xc000018100 TLS:}. Error: -PublishNetworkContainer succeded with response {Response:{ReturnCode:0 Message:} PublishErrorStr: PublishStatusCode:200 PublishResponseBody:[]}, raw: -2021/04/30 23:31:22 [2008] [Azure CNS] getNetworkContainerByOrchestratorContext -2021/04/30 23:31:22 [2008] pod info {PodName:testpod PodNamespace:testpodnamespace} -2021/04/30 23:31:22 [2008] [NMAgentClient] GetNetworkContainerVersion NC: Swift_nc-nma-fail-500 -2021/04/30 23:31:22 [2008] [NMAgentClient][Response] GetNetworkContainerVersion NC: Swift_nc-nma-fail-500. Response: &{Status:500 Internal Server Error StatusCode:500 Proto:HTTP/1.1 ProtoMajor:1 ProtoMinor:1 Header:map[Content-Length:[77] Content-Type:[application/json; charset=UTF-8] Date:[Fri, 30 Apr 2021 23:31:22 GMT]] Body:0xc000318380 ContentLength:77 TransferEncoding:[] Close:false Uncompressed:false Trailer:map[] Request:0xc000018400 TLS:}. Error: -2021/04/30 23:31:22 [2008] [Azure CNS] Failed to get NC version status from NMAgent with http status 500. Skipping GetNCVersionStatus check from NMAgent -2021/04/30 23:31:22 [2008] containerid Swift_nc-nma-fail-500 -**GetNetworkContainerByContext succeded with response {NetworkContainerID:Swift_nc-nma-fail-500 IPConfiguration:{IPSubnet:{IPAddress:11.0.0.5 PrefixLength:24} DNSServers:[8.8.8.8 8.8.4.4] GatewayIPAddress:11.0.0.1} Routes:[] CnetAddressSpace:[] MultiTenancyInfo:{EncapType: ID:0} PrimaryInterfaceIdentifier:11.0.0.7 LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} Response:{ReturnCode:0 Message:} AllowHostToNCCommunication:false AllowNCToHostCommunication:false}, raw: -2021/04/30 23:31:22 [2008] [Azure CNS] deleteNetworkContainer -2021/04/30 23:31:22 [2008] [Azure CNS] saveState -2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. -DeleteNetworkContainer succeded with response {Response:{ReturnCode:0 Message:}} -2021/04/30 23:31:22 [2008] [Azure CNS] createOrUpdateNetworkContainer -2021/04/30 23:31:22 [2008] Pod info {testpod testpodnamespace} -2021/04/30 23:31:22 [2008] [Azure CNS] saveState -2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. -Raw response: CreateNetworkContainerRequest passed with response {Response:{ReturnCode:0 Message:}} Err:CreateNetworkContainerRequest succeeded with response {Response:{ReturnCode:0 Message:}} -2021/04/30 23:31:22 [2008] [Azure-CNS] PublishNetworkContainer -2021/04/30 23:31:22 [2008] [NMAgentClient] JoinNetwork: vnet1 -2021/04/30 23:31:22 [2008] [NMAgentClient][Response] Join network: vnet1. Response: &{Status:200 OK StatusCode:200 Proto:HTTP/1.1 ProtoMajor:1 ProtoMinor:1 Header:map[Content-Length:[0] Content-Type:[application/json; charset=UTF-8] Date:[Fri, 30 Apr 2021 23:31:22 GMT]] Body:{} ContentLength:0 TransferEncoding:[] Close:false Uncompressed:false Trailer:map[] Request:0xc000018a00 TLS:}. Error: -2021/04/30 23:31:22 [2008] [Azure-CNS] setNetworkStateJoined for network: vnet1 -2021/04/30 23:31:22 [2008] [NMAgentClient] PublishNetworkContainer NC: nc-nma-fail-unavailable -2021/04/30 23:31:22 [2008] [NMAgentClient][Response] Publish NC: nc-nma-fail-unavailable. Response: &{Status:200 OK StatusCode:200 Proto:HTTP/1.1 ProtoMajor:1 ProtoMinor:1 Header:map[Content-Length:[0] Content-Type:[application/json; charset=UTF-8] Date:[Fri, 30 Apr 2021 23:31:22 GMT]] Body:{} ContentLength:0 TransferEncoding:[] Close:false Uncompressed:false Trailer:map[] Request:0xc000018c00 TLS:}. Error: -PublishNetworkContainer succeded with response {Response:{ReturnCode:0 Message:} PublishErrorStr: PublishStatusCode:200 PublishResponseBody:[]}, raw: -2021/04/30 23:31:22 [2008] [Azure CNS] getNetworkContainerByOrchestratorContext -2021/04/30 23:31:22 [2008] pod info {PodName:testpod PodNamespace:testpodnamespace} -2021/04/30 23:31:22 [2008] [NMAgentClient] GetNetworkContainerVersion NC: Swift_nc-nma-fail-unavailable -2021/04/30 23:31:22 [2008] [NMAgentClient][Response] GetNetworkContainerVersion NC: Swift_nc-nma-fail-unavailable. Response: &{Status:200 OK StatusCode:200 Proto:HTTP/1.1 ProtoMajor:1 ProtoMinor:1 Header:map[Content-Length:[85] Content-Type:[application/json; charset=UTF-8] Date:[Fri, 30 Apr 2021 23:31:22 GMT]] Body:0xc0003187c0 ContentLength:85 TransferEncoding:[] Close:false Uncompressed:false Trailer:map[] Request:0xc000123000 TLS:}. Error: -2021/04/30 23:31:22 [2008] [Azure-CNS] isNCWaitingForUpdate failed for NC: Swift_nc-nma-fail-unavailable with error: Failed to get NC version status from NMAgent. NC: Swift_nc-nma-fail-unavailable, Response {"httpStatusCode":"401","networkContainerId":"nc-nma-fail-unavailable","version":"0"} -2021/04/30 23:31:22 [2008] [cns-test-server] Code:NetworkContainerVfpProgramPending, {NetworkContainerID: IPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} Routes:[] CnetAddressSpace:[] MultiTenancyInfo:{EncapType: ID:0} PrimaryInterfaceIdentifier: LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} Response:{ReturnCode:31 Message:Failed to get NC version status from NMAgent. NC: Swift_nc-nma-fail-unavailable, Response {"httpStatusCode":"401","networkContainerId":"nc-nma-fail-unavailable","version":"0"}} AllowHostToNCCommunication:false AllowNCToHostCommunication:false}. -**getNetworkContainerByContextExpectedError succeded with response {NetworkContainerID: IPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} Routes:[] CnetAddressSpace:[] MultiTenancyInfo:{EncapType: ID:0} PrimaryInterfaceIdentifier: LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} Response:{ReturnCode:31 Message:Failed to get NC version status from NMAgent. NC: Swift_nc-nma-fail-unavailable, Response {"httpStatusCode":"401","networkContainerId":"nc-nma-fail-unavailable","version":"0"}} AllowHostToNCCommunication:false AllowNCToHostCommunication:false}, raw: -2021/04/30 23:31:22 [2008] [Azure CNS] deleteNetworkContainer -2021/04/30 23:31:22 [2008] [Azure CNS] saveState -2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. -DeleteNetworkContainer succeded with response {Response:{ReturnCode:0 Message:}} ---- PASS: TestGetNetworkContainerVersionStatus (0.26s) -=== RUN TestPublishNCViaCNS -Test: publishNetworkContainer -2021/04/30 23:31:22 [2008] [Azure-CNS] PublishNetworkContainer -2021/04/30 23:31:22 [2008] [NMAgentClient] JoinNetwork: vnet1 -2021/04/30 23:31:22 [2008] [NMAgentClient][Response] Join network: vnet1. Response: &{Status:200 OK StatusCode:200 Proto:HTTP/1.1 ProtoMajor:1 ProtoMinor:1 Header:map[Content-Length:[0] Content-Type:[application/json; charset=UTF-8] Date:[Fri, 30 Apr 2021 23:31:22 GMT]] Body:{} ContentLength:0 TransferEncoding:[] Close:false Uncompressed:false Trailer:map[] Request:0xc0004adb00 TLS:}. Error: -2021/04/30 23:31:22 [2008] [Azure-CNS] setNetworkStateJoined for network: vnet1 -2021/04/30 23:31:22 [2008] [NMAgentClient] PublishNetworkContainer NC: ethWebApp -2021/04/30 23:31:22 [2008] [NMAgentClient][Response] Publish NC: ethWebApp. Response: &{Status:200 OK StatusCode:200 Proto:HTTP/1.1 ProtoMajor:1 ProtoMinor:1 Header:map[Content-Length:[0] Content-Type:[application/json; charset=UTF-8] Date:[Fri, 30 Apr 2021 23:31:22 GMT]] Body:{} ContentLength:0 TransferEncoding:[] Close:false Uncompressed:false Trailer:map[] Request:0xc000018d00 TLS:}. Error: -PublishNetworkContainer succeded with response {Response:{ReturnCode:0 Message:} PublishErrorStr: PublishStatusCode:200 PublishResponseBody:[]}, raw: ---- PASS: TestPublishNCViaCNS (0.00s) -=== RUN TestExtractHost ---- PASS: TestExtractHost (0.00s) -=== RUN TestUnpublishNCViaCNS -Test: unpublishNetworkContainer -2021/04/30 23:31:22 [2008] [Azure-CNS] UnpublishNetworkContainer -2021/04/30 23:31:22 [2008] [NMAgentClient] UnpublishNetworkContainer NC: ethWebApp -2021/04/30 23:31:22 [2008] [NMAgentClient][Response] Unpublish NC: ethWebApp. Response: &{Status:200 OK StatusCode:200 Proto:HTTP/1.1 ProtoMajor:1 ProtoMinor:1 Header:map[Content-Length:[0] Content-Type:[application/json; charset=UTF-8] Date:[Fri, 30 Apr 2021 23:31:22 GMT]] Body:{} ContentLength:0 TransferEncoding:[] Close:false Uncompressed:false Trailer:map[] Request:0xc000123200 TLS:}. Error: -UnpublishNetworkContainer succeded with response {Response:{ReturnCode:0 Message:} UnpublishErrorStr: UnpublishStatusCode:200 UnpublishResponseBody:[]}, raw: ---- PASS: TestUnpublishNCViaCNS (0.00s) -=== RUN TestNmAgentSupportedApisHandler -Test: nmAgentSupportedApisHandler -nmAgentSupportedApisHandler Responded with {Response:{ReturnCode:0 Message:[Azure-CNS] NmAgentSupported API list expects a POST method.} SupportedApis:[]} ---- PASS: TestNmAgentSupportedApisHandler (0.00s) -=== RUN TestCreateHostNCApipaEndpoint -Test: createHostNCApipaEndpoint -2021/04/30 23:31:22 [2008] [Azure-CNS] createHostNCApipaEndpoint -2021/04/30 23:31:22 [2008] [cns-test-server] Code:UnknownContainerID, {Response:{ReturnCode:18 Message:CreateHostNCApipaEndpoint failed with error: Unable to find goal state for the given Network Container: } EndpointID:}. -createHostNCApipaEndpoint Responded with {Response:{ReturnCode:18 Message:CreateHostNCApipaEndpoint failed with error: Unable to find goal state for the given Network Container: } EndpointID:} ---- PASS: TestCreateHostNCApipaEndpoint (0.00s) -=== RUN TestCreateOrUpdateNetworkContainerInternal -Restart Service -2021/04/30 23:31:22 [2008] [Listener] Stopped listening on localhost:10090 -2021/04/30 23:31:22 [2008] [Azure CNS] Service stopped. -2021/04/30 23:31:22 [2008] HTTP listener will be started later after CNS state has been reconciled -2021/04/30 23:31:22 [2008] [Azure CNS] restoreState -2021/04/30 23:31:22 [2008] [Azure CNS] Failed to restore state, err:EOF. Removing azure-cns.json -2021/04/30 23:31:22 [2008] [Azure CNS] Enter Restoring Network State -2021/04/30 23:31:22 [2008] os.stat() for file azure-cns.json failed: stat azure-cns.json: no such file or directory -2021/04/30 23:31:22 [2008] [Utils] Initializing HTTP client with connection timeout: 0, response header timeout: 0 -2021/04/30 23:31:22 [2008] SetContext details called with: orchestrator nodeID -2021/04/30 23:31:22 [2008] [Azure CNS] Listening. -2021/04/30 23:31:22 [2008] [Listener] Started listening on localhost:10090. -2021/04/30 23:31:22 [2008] [Azure CNS] setEnvironment -2021/04/30 23:31:22 [2008] [Azure CNS] POST received for SetEnvironment. -2021/04/30 23:31:22 [2008] [Azure CNS] saveState -2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. -setOrchestratorTypeInternal -NC Request {Version:-1 NetworkContainerType:Docker NetworkContainerid:testNc1 PrimaryInterfaceIdentifier: AuthorizationToken: LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} OrchestratorContext:[] IPConfiguration:{IPSubnet:{IPAddress:10.0.0.5 PrefixLength:24} DNSServers:[8.8.8.8 8.8.4.4] GatewayIPAddress:10.0.0.1} SecondaryIPConfigs:map[2ac07740-55b2-4680-88f2-d8e67c7fac75:{IPAddress:10.0.0.7 NCVersion:-1} 682502f1-8a7c-404c-a42f-549ddc874b85:{IPAddress:10.0.0.6 NCVersion:-1}] MultiTenancyInfo:{EncapType: ID:0} CnetAddressSpace:[] Routes:[] AllowHostToNCCommunication:false AllowNCToHostCommunication:false EndpointPolicies:[]}2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.6 version to -1, programmed host nc version is -1 -2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.6 as Available -2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.7 version to -1, programmed host nc version is -1 -2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.7 as Available -2021/04/30 23:31:22 [2008] [Azure CNS] saveState -2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. - internalapi_test.go:406: NC version in container status is -1, HostVersion is -1 -Validate Scaleup -NC Request {Version:-1 NetworkContainerType:Docker NetworkContainerid:testNc1 PrimaryInterfaceIdentifier: AuthorizationToken: LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} OrchestratorContext:[] IPConfiguration:{IPSubnet:{IPAddress:10.0.0.5 PrefixLength:24} DNSServers:[8.8.8.8 8.8.4.4] GatewayIPAddress:10.0.0.1} SecondaryIPConfigs:map[2ac07740-55b2-4680-88f2-d8e67c7fac75:{IPAddress:10.0.0.7 NCVersion:-1} 682502f1-8a7c-404c-a42f-549ddc874b85:{IPAddress:10.0.0.6 NCVersion:-1} 897008b1-db88-41f7-8c67-4b1a4a458d2b:{IPAddress:10.0.0.8 NCVersion:-1} 9e457f2c-9106-44f9-89d8-b9f09b8ec0e1:{IPAddress:10.0.0.9 NCVersion:-1}] MultiTenancyInfo:{EncapType: ID:0} CnetAddressSpace:[] Routes:[] AllowHostToNCCommunication:false AllowNCToHostCommunication:false EndpointPolicies:[]}2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.7 version to -1, programmed host nc version is -1 -2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.8 version to -1, programmed host nc version is -1 -2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.8 as Available -2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.9 version to -1, programmed host nc version is -1 -2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.9 as Available -2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.6 version to -1, programmed host nc version is -1 -2021/04/30 23:31:22 [2008] [Azure CNS] saveState -2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. - internalapi_test.go:406: NC version in container status is -1, HostVersion is -1 -Validate Scale down -NC Request {Version:-1 NetworkContainerType:Docker NetworkContainerid:testNc1 PrimaryInterfaceIdentifier: AuthorizationToken: LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} OrchestratorContext:[] IPConfiguration:{IPSubnet:{IPAddress:10.0.0.5 PrefixLength:24} DNSServers:[8.8.8.8 8.8.4.4] GatewayIPAddress:10.0.0.1} SecondaryIPConfigs:map[9e457f2c-9106-44f9-89d8-b9f09b8ec0e1:{IPAddress:10.0.0.9 NCVersion:-1}] MultiTenancyInfo:{EncapType: ID:0} CnetAddressSpace:[] Routes:[] AllowHostToNCCommunication:false AllowNCToHostCommunication:false EndpointPolicies:[]}2021/04/30 23:31:22 [2008] [Azure-Cns] Delete the PodIpConfigState, IpId: 897008b1-db88-41f7-8c67-4b1a4a458d2b, IPConfigStatus: IPConfigurationStatus: Id: [897008b1-db88-41f7-8c67-4b1a4a458d2b], NcId: [testNc1], IpAddress: [10.0.0.8], State: [Available], OrchestratorContext: [] -2021/04/30 23:31:22 [2008] [Azure-Cns] Delete the PodIpConfigState, IpId: 682502f1-8a7c-404c-a42f-549ddc874b85, IPConfigStatus: IPConfigurationStatus: Id: [682502f1-8a7c-404c-a42f-549ddc874b85], NcId: [testNc1], IpAddress: [10.0.0.6], State: [Available], OrchestratorContext: [] -2021/04/30 23:31:22 [2008] [Azure-Cns] Delete the PodIpConfigState, IpId: 2ac07740-55b2-4680-88f2-d8e67c7fac75, IPConfigStatus: IPConfigurationStatus: Id: [2ac07740-55b2-4680-88f2-d8e67c7fac75], NcId: [testNc1], IpAddress: [10.0.0.7], State: [Available], OrchestratorContext: [] -2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.9 version to -1, programmed host nc version is -1 -2021/04/30 23:31:22 [2008] [Azure CNS] saveState -2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. - internalapi_test.go:406: NC version in container status is -1, HostVersion is -1 -Validate no SecondaryIpconfigs -NC Request {Version:-1 NetworkContainerType:Docker NetworkContainerid:testNc1 PrimaryInterfaceIdentifier: AuthorizationToken: LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} OrchestratorContext:[] IPConfiguration:{IPSubnet:{IPAddress:10.0.0.5 PrefixLength:24} DNSServers:[8.8.8.8 8.8.4.4] GatewayIPAddress:10.0.0.1} SecondaryIPConfigs:map[] MultiTenancyInfo:{EncapType: ID:0} CnetAddressSpace:[] Routes:[] AllowHostToNCCommunication:false AllowNCToHostCommunication:false EndpointPolicies:[]}2021/04/30 23:31:22 [2008] [Azure-Cns] Delete the PodIpConfigState, IpId: 9e457f2c-9106-44f9-89d8-b9f09b8ec0e1, IPConfigStatus: IPConfigurationStatus: Id: [9e457f2c-9106-44f9-89d8-b9f09b8ec0e1], NcId: [testNc1], IpAddress: [10.0.0.9], State: [Available], OrchestratorContext: [] -2021/04/30 23:31:22 [2008] [Azure CNS] saveState -2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. - internalapi_test.go:406: NC version in container status is -1, HostVersion is -1 ---- PASS: TestCreateOrUpdateNetworkContainerInternal (0.00s) -=== RUN TestCreateOrUpdateNCWithLargerVersionComparedToNMAgent -Restart Service -2021/04/30 23:31:22 [2008] [Listener] Stopped listening on localhost:10090 -2021/04/30 23:31:22 [2008] [Azure CNS] Service stopped. -2021/04/30 23:31:22 [2008] HTTP listener will be started later after CNS state has been reconciled -2021/04/30 23:31:22 [2008] [Azure CNS] restoreState -2021/04/30 23:31:22 [2008] [Azure CNS] Failed to restore state, err:EOF. Removing azure-cns.json -2021/04/30 23:31:22 [2008] [Azure CNS] Enter Restoring Network State -2021/04/30 23:31:22 [2008] os.stat() for file azure-cns.json failed: stat azure-cns.json: no such file or directory -2021/04/30 23:31:22 [2008] [Utils] Initializing HTTP client with connection timeout: 0, response header timeout: 0 -2021/04/30 23:31:22 [2008] SetContext details called with: orchestrator nodeID -2021/04/30 23:31:22 [2008] [Azure CNS] Listening. -2021/04/30 23:31:22 [2008] [Listener] Started listening on localhost:10090. -2021/04/30 23:31:22 [2008] [Azure CNS] setEnvironment -2021/04/30 23:31:22 [2008] [Azure CNS] POST received for SetEnvironment. -2021/04/30 23:31:22 [2008] [Azure CNS] saveState -2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. -setOrchestratorTypeInternal -NC Request {Version:1 NetworkContainerType:Docker NetworkContainerid:testNc1 PrimaryInterfaceIdentifier: AuthorizationToken: LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} OrchestratorContext:[] IPConfiguration:{IPSubnet:{IPAddress:10.0.0.5 PrefixLength:24} DNSServers:[8.8.8.8 8.8.4.4] GatewayIPAddress:10.0.0.1} SecondaryIPConfigs:map[3195cb51-ac69-441c-a973-3548b72fe3e6:{IPAddress:10.0.0.7 NCVersion:1} 521b9caf-6339-47dd-b5eb-41e27c2ccb1f:{IPAddress:10.0.0.6 NCVersion:1}] MultiTenancyInfo:{EncapType: ID:0} CnetAddressSpace:[] Routes:[] AllowHostToNCCommunication:false AllowNCToHostCommunication:false EndpointPolicies:[]}2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.6 version to 1, programmed host nc version is -1 -2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.6 as PendingProgramming -2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.7 version to 1, programmed host nc version is -1 -2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.7 as PendingProgramming -2021/04/30 23:31:22 [2008] [Azure CNS] saveState -2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. - internalapi_test.go:406: NC version in container status is 1, HostVersion is -1 ---- PASS: TestCreateOrUpdateNCWithLargerVersionComparedToNMAgent (0.01s) -=== RUN TestCreateAndUpdateNCWithSecondaryIPNCVersion -Restart Service -2021/04/30 23:31:22 [2008] [Listener] Stopped listening on localhost:10090 -2021/04/30 23:31:22 [2008] [Azure CNS] Service stopped. -2021/04/30 23:31:22 [2008] HTTP listener will be started later after CNS state has been reconciled -2021/04/30 23:31:22 [2008] [Azure CNS] restoreState -2021/04/30 23:31:22 [2008] [Azure CNS] Failed to restore state, err:EOF. Removing azure-cns.json -2021/04/30 23:31:22 [2008] [Azure CNS] Enter Restoring Network State -2021/04/30 23:31:22 [2008] os.stat() for file azure-cns.json failed: stat azure-cns.json: no such file or directory -2021/04/30 23:31:22 [2008] [Utils] Initializing HTTP client with connection timeout: 0, response header timeout: 0 -2021/04/30 23:31:22 [2008] SetContext details called with: orchestrator nodeID -2021/04/30 23:31:22 [2008] [Azure CNS] Listening. -2021/04/30 23:31:22 [2008] [Listener] Started listening on localhost:10090. -2021/04/30 23:31:22 [2008] [Azure CNS] setEnvironment -2021/04/30 23:31:22 [2008] [Azure CNS] POST received for SetEnvironment. -2021/04/30 23:31:22 [2008] [Azure CNS] saveState -2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. -setOrchestratorTypeInternal -NC Request {Version:0 NetworkContainerType:Docker NetworkContainerid:testNc1 PrimaryInterfaceIdentifier: AuthorizationToken: LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} OrchestratorContext:[] IPConfiguration:{IPSubnet:{IPAddress:10.0.0.5 PrefixLength:24} DNSServers:[8.8.8.8 8.8.4.4] GatewayIPAddress:10.0.0.1} SecondaryIPConfigs:map[bd59de26-a3a7-4ba6-98ce-8283c1a1ded7:{IPAddress:10.0.0.16 NCVersion:0}] MultiTenancyInfo:{EncapType: ID:0} CnetAddressSpace:[] Routes:[] AllowHostToNCCommunication:false AllowNCToHostCommunication:false EndpointPolicies:[]}2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.16 version to 0, programmed host nc version is -1 -2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.16 as PendingProgramming -2021/04/30 23:31:22 [2008] [Azure CNS] saveState -2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. -NC Request {Version:1 NetworkContainerType:Docker NetworkContainerid:testNc1 PrimaryInterfaceIdentifier: AuthorizationToken: LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} OrchestratorContext:[] IPConfiguration:{IPSubnet:{IPAddress:10.0.0.5 PrefixLength:24} DNSServers:[8.8.8.8 8.8.4.4] GatewayIPAddress:10.0.0.1} SecondaryIPConfigs:map[8f690f27-2671-4be6-97b0-07494c40b855:{IPAddress:10.0.0.17 NCVersion:1} bd59de26-a3a7-4ba6-98ce-8283c1a1ded7:{IPAddress:10.0.0.16 NCVersion:1}] MultiTenancyInfo:{EncapType: ID:0} CnetAddressSpace:[] Routes:[] AllowHostToNCCommunication:false AllowNCToHostCommunication:false EndpointPolicies:[]}2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.17 version to 1, programmed host nc version is -1 -2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.17 as PendingProgramming -2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.16 version to 0, programmed host nc version is -1 -2021/04/30 23:31:22 [2008] [Azure CNS] saveState -2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. ---- PASS: TestCreateAndUpdateNCWithSecondaryIPNCVersion (0.00s) -=== RUN TestSyncHostNCVersion -Restart Service -2021/04/30 23:31:22 [2008] [Listener] Stopped listening on localhost:10090 -2021/04/30 23:31:22 [2008] [Azure CNS] Service stopped. -2021/04/30 23:31:22 [2008] HTTP listener will be started later after CNS state has been reconciled -2021/04/30 23:31:22 [2008] [Azure CNS] restoreState -2021/04/30 23:31:22 [2008] [Azure CNS] Failed to restore state, err:EOF. Removing azure-cns.json -2021/04/30 23:31:22 [2008] [Azure CNS] Enter Restoring Network State -2021/04/30 23:31:22 [2008] os.stat() for file azure-cns.json failed: stat azure-cns.json: no such file or directory -2021/04/30 23:31:22 [2008] [Utils] Initializing HTTP client with connection timeout: 0, response header timeout: 0 -2021/04/30 23:31:22 [2008] SetContext details called with: orchestrator nodeID -2021/04/30 23:31:22 [2008] [Azure CNS] Listening. -2021/04/30 23:31:22 [2008] [Listener] Started listening on localhost:10090. -2021/04/30 23:31:22 [2008] [Azure CNS] setEnvironment -2021/04/30 23:31:22 [2008] [Azure CNS] POST received for SetEnvironment. -2021/04/30 23:31:22 [2008] [Azure CNS] saveState -2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. -setOrchestratorTypeInternal -NC Request {Version:0 NetworkContainerType:Docker NetworkContainerid:testNc1 PrimaryInterfaceIdentifier: AuthorizationToken: LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} OrchestratorContext:[] IPConfiguration:{IPSubnet:{IPAddress:10.0.0.5 PrefixLength:24} DNSServers:[8.8.8.8 8.8.4.4] GatewayIPAddress:10.0.0.1} SecondaryIPConfigs:map[f418a2f5-d16d-43b2-a687-bdc97f989c45:{IPAddress:10.0.0.16 NCVersion:0}] MultiTenancyInfo:{EncapType: ID:0} CnetAddressSpace:[] Routes:[] AllowHostToNCCommunication:false AllowNCToHostCommunication:false EndpointPolicies:[]}2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.16 version to 0, programmed host nc version is -1 -2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.16 as PendingProgramming -2021/04/30 23:31:22 [2008] [Azure CNS] saveState -2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. -2021/04/30 23:31:22 [2008] Updating version of the following NC IDs: [testNc1] -2021/04/30 23:31:22 [2008] Updated NC testNc1 host version from -1 to 0 -Restart Service -2021/04/30 23:31:22 [2008] [Listener] Stopped listening on localhost:10090 -2021/04/30 23:31:22 [2008] [Azure CNS] Service stopped. -2021/04/30 23:31:22 [2008] HTTP listener will be started later after CNS state has been reconciled -2021/04/30 23:31:22 [2008] [Azure CNS] restoreState -2021/04/30 23:31:22 [2008] [Azure CNS] Failed to restore state, err:EOF. Removing azure-cns.json -2021/04/30 23:31:22 [2008] [Azure CNS] Enter Restoring Network State -2021/04/30 23:31:22 [2008] os.stat() for file azure-cns.json failed: stat azure-cns.json: no such file or directory -2021/04/30 23:31:22 [2008] [Utils] Initializing HTTP client with connection timeout: 0, response header timeout: 0 -2021/04/30 23:31:22 [2008] SetContext details called with: orchestrator nodeID -2021/04/30 23:31:22 [2008] [Azure CNS] Listening. -2021/04/30 23:31:22 [2008] [Listener] Started listening on localhost:10090. -2021/04/30 23:31:22 [2008] [Azure CNS] setEnvironment -2021/04/30 23:31:22 [2008] [Azure CNS] POST received for SetEnvironment. -2021/04/30 23:31:22 [2008] [Azure CNS] saveState -2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. -setOrchestratorTypeInternal -NC Request {Version:0 NetworkContainerType:Docker NetworkContainerid:testNc1 PrimaryInterfaceIdentifier: AuthorizationToken: LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} OrchestratorContext:[] IPConfiguration:{IPSubnet:{IPAddress:10.0.0.5 PrefixLength:24} DNSServers:[8.8.8.8 8.8.4.4] GatewayIPAddress:10.0.0.1} SecondaryIPConfigs:map[f57eb521-49ac-4734-a9ad-545bbba43d94:{IPAddress:10.0.0.16 NCVersion:0}] MultiTenancyInfo:{EncapType: ID:0} CnetAddressSpace:[] Routes:[] AllowHostToNCCommunication:false AllowNCToHostCommunication:false EndpointPolicies:[]}2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.16 version to 0, programmed host nc version is -1 -2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.16 as PendingProgramming -2021/04/30 23:31:22 [2008] [Azure CNS] saveState -2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. -2021/04/30 23:31:22 [2008] Updating version of the following NC IDs: [testNc1] -2021/04/30 23:31:22 [2008] Updated NC testNc1 host version from -1 to 0 ---- PASS: TestSyncHostNCVersion (0.02s) -=== RUN TestPendingIPsGotUpdatedWhenSyncHostNCVersion -Restart Service -2021/04/30 23:31:22 [2008] [Listener] Stopped listening on localhost:10090 -2021/04/30 23:31:22 [2008] [Azure CNS] Service stopped. -2021/04/30 23:31:22 [2008] HTTP listener will be started later after CNS state has been reconciled -2021/04/30 23:31:22 [2008] [Azure CNS] restoreState -2021/04/30 23:31:22 [2008] [Azure CNS] Failed to restore state, err:EOF. Removing azure-cns.json -2021/04/30 23:31:22 [2008] [Azure CNS] Enter Restoring Network State -2021/04/30 23:31:22 [2008] os.stat() for file azure-cns.json failed: stat azure-cns.json: no such file or directory -2021/04/30 23:31:22 [2008] [Utils] Initializing HTTP client with connection timeout: 0, response header timeout: 0 -2021/04/30 23:31:22 [2008] SetContext details called with: orchestrator nodeID -2021/04/30 23:31:22 [2008] [Azure CNS] Listening. -2021/04/30 23:31:22 [2008] [Listener] Started listening on localhost:10090. -2021/04/30 23:31:22 [2008] [Azure CNS] setEnvironment -2021/04/30 23:31:22 [2008] [Azure CNS] POST received for SetEnvironment. -2021/04/30 23:31:22 [2008] [Azure CNS] saveState -2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. -setOrchestratorTypeInternal -NC Request {Version:0 NetworkContainerType:Docker NetworkContainerid:testNc1 PrimaryInterfaceIdentifier: AuthorizationToken: LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} OrchestratorContext:[] IPConfiguration:{IPSubnet:{IPAddress:10.0.0.5 PrefixLength:24} DNSServers:[8.8.8.8 8.8.4.4] GatewayIPAddress:10.0.0.1} SecondaryIPConfigs:map[4c099511-f5a3-46a7-bfa8-52dbd84f0341:{IPAddress:10.0.0.16 NCVersion:0}] MultiTenancyInfo:{EncapType: ID:0} CnetAddressSpace:[] Routes:[] AllowHostToNCCommunication:false AllowNCToHostCommunication:false EndpointPolicies:[]}2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.16 version to 0, programmed host nc version is -1 -2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.16 as PendingProgramming -2021/04/30 23:31:22 [2008] [Azure CNS] saveState -2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. -2021/04/30 23:31:22 [2008] Updating version of the following NC IDs: [testNc1] -2021/04/30 23:31:22 [2008] [updateIPConfigState] Changing IpId [4c099511-f5a3-46a7-bfa8-52dbd84f0341] state to [Available], orchestratorContext []. Current config [IPConfigurationStatus: Id: [4c099511-f5a3-46a7-bfa8-52dbd84f0341], NcId: [testNc1], IpAddress: [10.0.0.16], State: [PendingProgramming], OrchestratorContext: []] -2021/04/30 23:31:22 [2008] Change ip 10.0.0.16 with uuid 4c099511-f5a3-46a7-bfa8-52dbd84f0341 from pending programming to Available, current secondary ip configs is {IPAddress:10.0.0.16 NCVersion:0} -2021/04/30 23:31:22 [2008] Updated NC testNc1 host version from -1 to 0 ---- PASS: TestPendingIPsGotUpdatedWhenSyncHostNCVersion (0.00s) -=== RUN TestReconcileNCWithEmptyState -Restart Service -2021/04/30 23:31:22 [2008] [Listener] Stopped listening on localhost:10090 -2021/04/30 23:31:22 [2008] [Azure CNS] Service stopped. -2021/04/30 23:31:22 [2008] HTTP listener will be started later after CNS state has been reconciled -2021/04/30 23:31:22 [2008] [Azure CNS] restoreState -2021/04/30 23:31:22 [2008] [Azure CNS] Failed to restore state, err:EOF. Removing azure-cns.json -2021/04/30 23:31:22 [2008] [Azure CNS] Enter Restoring Network State -2021/04/30 23:31:22 [2008] os.stat() for file azure-cns.json failed: stat azure-cns.json: no such file or directory -2021/04/30 23:31:22 [2008] [Utils] Initializing HTTP client with connection timeout: 0, response header timeout: 0 -2021/04/30 23:31:22 [2008] SetContext details called with: orchestrator nodeID -2021/04/30 23:31:22 [2008] [Azure CNS] Listening. -2021/04/30 23:31:22 [2008] [Listener] Started listening on localhost:10090. -2021/04/30 23:31:22 [2008] [Azure CNS] setEnvironment -2021/04/30 23:31:22 [2008] [Azure CNS] POST received for SetEnvironment. -2021/04/30 23:31:22 [2008] [Azure CNS] saveState -2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. -setOrchestratorTypeInternal -2021/04/30 23:31:22 [2008] CNS starting with no NC state, podInfoMap count 0 ---- PASS: TestReconcileNCWithEmptyState (0.00s) -=== RUN TestReconcileNCWithExistingState -Restart Service -2021/04/30 23:31:22 [2008] [Listener] Stopped listening on localhost:10090 -2021/04/30 23:31:22 [2008] [Azure CNS] Service stopped. -2021/04/30 23:31:22 [2008] HTTP listener will be started later after CNS state has been reconciled -2021/04/30 23:31:22 [2008] [Azure CNS] restoreState -2021/04/30 23:31:22 [2008] [Azure CNS] Failed to restore state, err:EOF. Removing azure-cns.json -2021/04/30 23:31:22 [2008] [Azure CNS] Enter Restoring Network State -2021/04/30 23:31:22 [2008] os.stat() for file azure-cns.json failed: stat azure-cns.json: no such file or directory -2021/04/30 23:31:22 [2008] [Utils] Initializing HTTP client with connection timeout: 0, response header timeout: 0 -2021/04/30 23:31:22 [2008] SetContext details called with: orchestrator nodeID -2021/04/30 23:31:22 [2008] [Azure CNS] Listening. -2021/04/30 23:31:22 [2008] [Listener] Started listening on localhost:10090. -2021/04/30 23:31:22 [2008] [Azure CNS] setEnvironment -2021/04/30 23:31:22 [2008] [Azure CNS] POST received for SetEnvironment. -2021/04/30 23:31:22 [2008] [Azure CNS] saveState -2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. -setOrchestratorTypeInternal -NC Request {Version:-1 NetworkContainerType:Docker NetworkContainerid:reconcileNc1 PrimaryInterfaceIdentifier: AuthorizationToken: LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} OrchestratorContext:[] IPConfiguration:{IPSubnet:{IPAddress:10.0.0.5 PrefixLength:24} DNSServers:[8.8.8.8 8.8.4.4] GatewayIPAddress:10.0.0.1} SecondaryIPConfigs:map[2175b93d-5d81-4438-afa5-01ae96bf1a99:{IPAddress:10.0.0.8 NCVersion:-1} 39918656-0748-4060-becb-f7c4e972a75a:{IPAddress:10.0.0.7 NCVersion:-1} d11b5049-218f-4f5b-9e68-0ac8d17e4b21:{IPAddress:10.0.0.9 NCVersion:-1} dc18fb51-1234-4f05-9f77-490077cfa357:{IPAddress:10.0.0.6 NCVersion:-1}] MultiTenancyInfo:{EncapType: ID:0} CnetAddressSpace:[] Routes:[] AllowHostToNCCommunication:false AllowNCToHostCommunication:false EndpointPolicies:[]}2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.9 version to -1, programmed host nc version is -1 -2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.9 as Available -2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.6 version to -1, programmed host nc version is -1 -2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.6 as Available -2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.7 version to -1, programmed host nc version is -1 -2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.7 as Available -2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.8 version to -1, programmed host nc version is -1 -2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.8 as Available -2021/04/30 23:31:22 [2008] [Azure CNS] saveState -2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. -2021/04/30 23:31:22 [2008] SecondaryIP {IPAddress:10.0.0.8 NCVersion:-1} is not allocated. ncId: reconcileNc1 -2021/04/30 23:31:22 [2008] SecondaryIP {IPAddress:10.0.0.9 NCVersion:-1} is not allocated. ncId: reconcileNc1 -2021/04/30 23:31:22 [2008] SecondaryIP {IPAddress:10.0.0.6 NCVersion:-1} is allocated to Pod. {PodName:reconcilePod1 PodNamespace:PodNS1}, ncId: reconcileNc1 -2021/04/30 23:31:22 [2008] [updateIPConfigState] Changing IpId [dc18fb51-1234-4f05-9f77-490077cfa357] state to [Allocated], orchestratorContext [{"PodName":"reconcilePod1","PodNamespace":"PodNS1"}]. Current config [IPConfigurationStatus: Id: [dc18fb51-1234-4f05-9f77-490077cfa357], NcId: [reconcileNc1], IpAddress: [10.0.0.6], State: [Available], OrchestratorContext: []] -2021/04/30 23:31:22 [2008] [Azure CNS] GetPrimaryInterfaceInfoFromMemory -2021/04/30 23:31:22 [2008] [Azure CNS] GetPrimaryInterfaceInfoFromHost -2021/04/30 23:31:22 [2008] SecondaryIP {IPAddress:10.0.0.7 NCVersion:-1} is allocated to Pod. {PodName:reconcilePod2 PodNamespace:PodNS1}, ncId: reconcileNc1 -2021/04/30 23:31:22 [2008] [updateIPConfigState] Changing IpId [39918656-0748-4060-becb-f7c4e972a75a] state to [Allocated], orchestratorContext [{"PodName":"reconcilePod2","PodNamespace":"PodNS1"}]. Current config [IPConfigurationStatus: Id: [39918656-0748-4060-becb-f7c4e972a75a], NcId: [reconcileNc1], IpAddress: [10.0.0.7], State: [Available], OrchestratorContext: []] -2021/04/30 23:31:22 [2008] [Azure CNS] GetPrimaryInterfaceInfoFromMemory -2021/04/30 23:31:22 [2008] [Azure CNS] GetPrimaryInterfaceInfoFromHost - internalapi_test.go:406: NC version in container status is -1, HostVersion is -1 ---- PASS: TestReconcileNCWithExistingState (0.00s) -=== RUN TestReconcileNCWithSystemPods -Restart Service -2021/04/30 23:31:22 [2008] [Listener] Stopped listening on localhost:10090 -2021/04/30 23:31:22 [2008] [Azure CNS] Service stopped. -2021/04/30 23:31:22 [2008] HTTP listener will be started later after CNS state has been reconciled -2021/04/30 23:31:22 [2008] [Azure CNS] restoreState -2021/04/30 23:31:22 [2008] [Azure CNS] Failed to restore state, err:EOF. Removing azure-cns.json -2021/04/30 23:31:22 [2008] [Azure CNS] Enter Restoring Network State -2021/04/30 23:31:22 [2008] os.stat() for file azure-cns.json failed: stat azure-cns.json: no such file or directory -2021/04/30 23:31:22 [2008] [Utils] Initializing HTTP client with connection timeout: 0, response header timeout: 0 -2021/04/30 23:31:22 [2008] SetContext details called with: orchestrator nodeID -2021/04/30 23:31:22 [2008] [Azure CNS] Listening. -2021/04/30 23:31:22 [2008] [Listener] Started listening on localhost:10090. -2021/04/30 23:31:22 [2008] [Azure CNS] setEnvironment -2021/04/30 23:31:22 [2008] [Azure CNS] POST received for SetEnvironment. -2021/04/30 23:31:22 [2008] [Azure CNS] saveState -2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. -setOrchestratorTypeInternal -NC Request {Version:-1 NetworkContainerType:Docker NetworkContainerid:56e62d8f-a502-4fe8-a6e9-1657057b4fdb PrimaryInterfaceIdentifier: AuthorizationToken: LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} OrchestratorContext:[] IPConfiguration:{IPSubnet:{IPAddress:10.0.0.5 PrefixLength:24} DNSServers:[8.8.8.8 8.8.4.4] GatewayIPAddress:10.0.0.1} SecondaryIPConfigs:map[0fcb5205-5b6f-4c3c-8b3d-841c9ba46cb3:{IPAddress:10.0.0.9 NCVersion:-1} 3d56583e-e595-4665-afd7-73ae7ae87f64:{IPAddress:10.0.0.8 NCVersion:-1} 65374822-834b-49f8-b062-969ea6d81ef5:{IPAddress:10.0.0.7 NCVersion:-1} b73c215a-2872-4744-a76b-2d38fdcc9d91:{IPAddress:10.0.0.6 NCVersion:-1}] MultiTenancyInfo:{EncapType: ID:0} CnetAddressSpace:[] Routes:[] AllowHostToNCCommunication:false AllowNCToHostCommunication:false EndpointPolicies:[]}2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.8 version to -1, programmed host nc version is -1 -2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.8 as Available -2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.9 version to -1, programmed host nc version is -1 -2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.9 as Available -2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.6 version to -1, programmed host nc version is -1 -2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.6 as Available -2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.7 version to -1, programmed host nc version is -1 -2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.7 as Available -2021/04/30 23:31:22 [2008] [Azure CNS] saveState -2021/04/30 23:31:22 [2008] [Azure CNS] State saved successfully. -2021/04/30 23:31:22 [2008] SecondaryIP {IPAddress:10.0.0.7 NCVersion:-1} is not allocated. ncId: 56e62d8f-a502-4fe8-a6e9-1657057b4fdb -2021/04/30 23:31:22 [2008] SecondaryIP {IPAddress:10.0.0.8 NCVersion:-1} is not allocated. ncId: 56e62d8f-a502-4fe8-a6e9-1657057b4fdb -2021/04/30 23:31:22 [2008] SecondaryIP {IPAddress:10.0.0.9 NCVersion:-1} is not allocated. ncId: 56e62d8f-a502-4fe8-a6e9-1657057b4fdb -2021/04/30 23:31:22 [2008] SecondaryIP {IPAddress:10.0.0.6 NCVersion:-1} is allocated to Pod. {PodName:customerpod1 PodNamespace:PodNS1}, ncId: 56e62d8f-a502-4fe8-a6e9-1657057b4fdb -2021/04/30 23:31:22 [2008] [updateIPConfigState] Changing IpId [b73c215a-2872-4744-a76b-2d38fdcc9d91] state to [Allocated], orchestratorContext [{"PodName":"customerpod1","PodNamespace":"PodNS1"}]. Current config [IPConfigurationStatus: Id: [b73c215a-2872-4744-a76b-2d38fdcc9d91], NcId: [56e62d8f-a502-4fe8-a6e9-1657057b4fdb], IpAddress: [10.0.0.6], State: [Available], OrchestratorContext: []] -2021/04/30 23:31:22 [2008] [Azure CNS] GetPrimaryInterfaceInfoFromMemory -2021/04/30 23:31:22 [2008] [Azure CNS] GetPrimaryInterfaceInfoFromHost - internalapi_test.go:406: NC version in container status is -1, HostVersion is -1 ---- PASS: TestReconcileNCWithSystemPods (0.00s) -=== RUN TestIPAMGetAvailableIPConfig -setOrchestratorTypeInternal -NC Request {Version:-1 NetworkContainerType:Docker NetworkContainerid:06867cf3-332d-409d-8819-ed70d2c116b0 PrimaryInterfaceIdentifier: AuthorizationToken: LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} OrchestratorContext:[] IPConfiguration:{IPSubnet:{IPAddress:10.0.0.5 PrefixLength:24} DNSServers:[8.8.8.8 8.8.4.4] GatewayIPAddress:10.0.0.1} SecondaryIPConfigs:map[898fb8f1-f93e-4c96-9c31-6b89098949a3:{IPAddress:10.0.0.1 NCVersion:-1}] MultiTenancyInfo:{EncapType: ID:0} CnetAddressSpace:[] Routes:[] AllowHostToNCCommunication:false AllowNCToHostCommunication:false EndpointPolicies:[]}2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.1 version to -1, programmed host nc version is -1 -2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.1 as Available -2021/04/30 23:31:22 [2008] [Azure CNS] saveState -2021/04/30 23:31:22 [2008] [Azure CNS] store not initialized. - internalapi_test.go:406: NC version in container status is -1, HostVersion is -1 -2021/04/30 23:31:22 [2008] [updateIPConfigState] Changing IpId [898fb8f1-f93e-4c96-9c31-6b89098949a3] state to [Allocated], orchestratorContext [{"PodName":"testpod1","PodNamespace":"testpod1namespace"}]. Current config [IPConfigurationStatus: Id: [898fb8f1-f93e-4c96-9c31-6b89098949a3], NcId: [06867cf3-332d-409d-8819-ed70d2c116b0], IpAddress: [10.0.0.1], State: [Available], OrchestratorContext: []] -2021/04/30 23:31:22 [2008] [Azure CNS] GetPrimaryInterfaceInfoFromMemory -2021/04/30 23:31:22 [2008] [Azure CNS] GetPrimaryInterfaceInfoFromHost ---- PASS: TestIPAMGetAvailableIPConfig (0.00s) -=== RUN TestIPAMGetNextAvailableIPConfig -setOrchestratorTypeInternal -NC Request {Version:-1 NetworkContainerType:Docker NetworkContainerid:06867cf3-332d-409d-8819-ed70d2c116b0 PrimaryInterfaceIdentifier: AuthorizationToken: LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} OrchestratorContext:[] IPConfiguration:{IPSubnet:{IPAddress:10.0.0.5 PrefixLength:24} DNSServers:[8.8.8.8 8.8.4.4] GatewayIPAddress:10.0.0.1} SecondaryIPConfigs:map[898fb8f1-f93e-4c96-9c31-6b89098949a3:{IPAddress:10.0.0.1 NCVersion:-1} b21e1ee1-fb7e-4e6d-8c68-22ee5049944e:{IPAddress:10.0.0.2 NCVersion:-1}] MultiTenancyInfo:{EncapType: ID:0} CnetAddressSpace:[] Routes:[] AllowHostToNCCommunication:false AllowNCToHostCommunication:false EndpointPolicies:[]}2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.2 version to -1, programmed host nc version is -1 -2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.2 as Available -2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.1 version to -1, programmed host nc version is -1 -2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.1 as Available -2021/04/30 23:31:22 [2008] [Azure CNS] saveState -2021/04/30 23:31:22 [2008] [Azure CNS] store not initialized. - internalapi_test.go:406: NC version in container status is -1, HostVersion is -1 -2021/04/30 23:31:22 [2008] [updateIPConfigState] Changing IpId [b21e1ee1-fb7e-4e6d-8c68-22ee5049944e] state to [Allocated], orchestratorContext [{"PodName":"testpod2","PodNamespace":"testpod2namespace"}]. Current config [IPConfigurationStatus: Id: [b21e1ee1-fb7e-4e6d-8c68-22ee5049944e], NcId: [06867cf3-332d-409d-8819-ed70d2c116b0], IpAddress: [10.0.0.2], State: [Available], OrchestratorContext: []] -2021/04/30 23:31:22 [2008] [Azure CNS] GetPrimaryInterfaceInfoFromMemory -2021/04/30 23:31:22 [2008] [Azure CNS] GetPrimaryInterfaceInfoFromHost ---- PASS: TestIPAMGetNextAvailableIPConfig (0.00s) -=== RUN TestIPAMGetAlreadyAllocatedIPConfigForSamePod -setOrchestratorTypeInternal -NC Request {Version:-1 NetworkContainerType:Docker NetworkContainerid:06867cf3-332d-409d-8819-ed70d2c116b0 PrimaryInterfaceIdentifier: AuthorizationToken: LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} OrchestratorContext:[] IPConfiguration:{IPSubnet:{IPAddress:10.0.0.5 PrefixLength:24} DNSServers:[8.8.8.8 8.8.4.4] GatewayIPAddress:10.0.0.1} SecondaryIPConfigs:map[898fb8f1-f93e-4c96-9c31-6b89098949a3:{IPAddress:10.0.0.1 NCVersion:-1}] MultiTenancyInfo:{EncapType: ID:0} CnetAddressSpace:[] Routes:[] AllowHostToNCCommunication:false AllowNCToHostCommunication:false EndpointPolicies:[]}2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.1 version to -1, programmed host nc version is -1 -2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.1 as Available -2021/04/30 23:31:22 [2008] [Azure CNS] saveState -2021/04/30 23:31:22 [2008] [Azure CNS] store not initialized. - internalapi_test.go:406: NC version in container status is -1, HostVersion is -1 -2021/04/30 23:31:22 [2008] [Azure CNS] GetPrimaryInterfaceInfoFromMemory -2021/04/30 23:31:22 [2008] [Azure CNS] GetPrimaryInterfaceInfoFromHost ---- PASS: TestIPAMGetAlreadyAllocatedIPConfigForSamePod (0.00s) -=== RUN TestIPAMAttemptToRequestIPNotFoundInPool -setOrchestratorTypeInternal -NC Request {Version:-1 NetworkContainerType:Docker NetworkContainerid:06867cf3-332d-409d-8819-ed70d2c116b0 PrimaryInterfaceIdentifier: AuthorizationToken: LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} OrchestratorContext:[] IPConfiguration:{IPSubnet:{IPAddress:10.0.0.5 PrefixLength:24} DNSServers:[8.8.8.8 8.8.4.4] GatewayIPAddress:10.0.0.1} SecondaryIPConfigs:map[898fb8f1-f93e-4c96-9c31-6b89098949a3:{IPAddress:10.0.0.1 NCVersion:-1}] MultiTenancyInfo:{EncapType: ID:0} CnetAddressSpace:[] Routes:[] AllowHostToNCCommunication:false AllowNCToHostCommunication:false EndpointPolicies:[]}2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.1 version to -1, programmed host nc version is -1 -2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.1 as Available -2021/04/30 23:31:22 [2008] [Azure CNS] saveState -2021/04/30 23:31:22 [2008] [Azure CNS] store not initialized. - internalapi_test.go:406: NC version in container status is -1, HostVersion is -1 ---- PASS: TestIPAMAttemptToRequestIPNotFoundInPool (0.00s) -=== RUN TestIPAMGetDesiredIPConfigWithSpecfiedIP -setOrchestratorTypeInternal -NC Request {Version:-1 NetworkContainerType:Docker NetworkContainerid:06867cf3-332d-409d-8819-ed70d2c116b0 PrimaryInterfaceIdentifier: AuthorizationToken: LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} OrchestratorContext:[] IPConfiguration:{IPSubnet:{IPAddress:10.0.0.5 PrefixLength:24} DNSServers:[8.8.8.8 8.8.4.4] GatewayIPAddress:10.0.0.1} SecondaryIPConfigs:map[898fb8f1-f93e-4c96-9c31-6b89098949a3:{IPAddress:10.0.0.1 NCVersion:-1}] MultiTenancyInfo:{EncapType: ID:0} CnetAddressSpace:[] Routes:[] AllowHostToNCCommunication:false AllowNCToHostCommunication:false EndpointPolicies:[]}2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.1 version to -1, programmed host nc version is -1 -2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.1 as Available -2021/04/30 23:31:22 [2008] [Azure CNS] saveState -2021/04/30 23:31:22 [2008] [Azure CNS] store not initialized. - internalapi_test.go:406: NC version in container status is -1, HostVersion is -1 -2021/04/30 23:31:22 [2008] [updateIPConfigState] Changing IpId [898fb8f1-f93e-4c96-9c31-6b89098949a3] state to [Allocated], orchestratorContext [{"PodName":"testpod1","PodNamespace":"testpod1namespace"}]. Current config [IPConfigurationStatus: Id: [898fb8f1-f93e-4c96-9c31-6b89098949a3], NcId: [06867cf3-332d-409d-8819-ed70d2c116b0], IpAddress: [10.0.0.1], State: [Available], OrchestratorContext: []] -2021/04/30 23:31:22 [2008] [Azure CNS] GetPrimaryInterfaceInfoFromMemory -2021/04/30 23:31:22 [2008] [Azure CNS] GetPrimaryInterfaceInfoFromHost ---- PASS: TestIPAMGetDesiredIPConfigWithSpecfiedIP (0.00s) -=== RUN TestIPAMFailToGetDesiredIPConfigWithAlreadyAllocatedSpecfiedIP -setOrchestratorTypeInternal -NC Request {Version:-1 NetworkContainerType:Docker NetworkContainerid:06867cf3-332d-409d-8819-ed70d2c116b0 PrimaryInterfaceIdentifier: AuthorizationToken: LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} OrchestratorContext:[] IPConfiguration:{IPSubnet:{IPAddress:10.0.0.5 PrefixLength:24} DNSServers:[8.8.8.8 8.8.4.4] GatewayIPAddress:10.0.0.1} SecondaryIPConfigs:map[898fb8f1-f93e-4c96-9c31-6b89098949a3:{IPAddress:10.0.0.1 NCVersion:-1}] MultiTenancyInfo:{EncapType: ID:0} CnetAddressSpace:[] Routes:[] AllowHostToNCCommunication:false AllowNCToHostCommunication:false EndpointPolicies:[]}2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.1 version to -1, programmed host nc version is -1 -2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.1 as Available -2021/04/30 23:31:22 [2008] [Azure CNS] saveState -2021/04/30 23:31:22 [2008] [Azure CNS] store not initialized. - internalapi_test.go:406: NC version in container status is -1, HostVersion is -1 ---- PASS: TestIPAMFailToGetDesiredIPConfigWithAlreadyAllocatedSpecfiedIP (0.00s) -=== RUN TestIPAMFailToGetIPWhenAllIPsAreAllocated -setOrchestratorTypeInternal -NC Request {Version:-1 NetworkContainerType:Docker NetworkContainerid:06867cf3-332d-409d-8819-ed70d2c116b0 PrimaryInterfaceIdentifier: AuthorizationToken: LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} OrchestratorContext:[] IPConfiguration:{IPSubnet:{IPAddress:10.0.0.5 PrefixLength:24} DNSServers:[8.8.8.8 8.8.4.4] GatewayIPAddress:10.0.0.1} SecondaryIPConfigs:map[898fb8f1-f93e-4c96-9c31-6b89098949a3:{IPAddress:10.0.0.1 NCVersion:-1} b21e1ee1-fb7e-4e6d-8c68-22ee5049944e:{IPAddress:10.0.0.2 NCVersion:-1}] MultiTenancyInfo:{EncapType: ID:0} CnetAddressSpace:[] Routes:[] AllowHostToNCCommunication:false AllowNCToHostCommunication:false EndpointPolicies:[]}2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.1 version to -1, programmed host nc version is -1 -2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.1 as Available -2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.2 version to -1, programmed host nc version is -1 -2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.2 as Available -2021/04/30 23:31:22 [2008] [Azure CNS] saveState -2021/04/30 23:31:22 [2008] [Azure CNS] store not initialized. - internalapi_test.go:406: NC version in container status is -1, HostVersion is -1 ---- PASS: TestIPAMFailToGetIPWhenAllIPsAreAllocated (0.00s) -=== RUN TestIPAMRequestThenReleaseThenRequestAgain -setOrchestratorTypeInternal -NC Request {Version:-1 NetworkContainerType:Docker NetworkContainerid:06867cf3-332d-409d-8819-ed70d2c116b0 PrimaryInterfaceIdentifier: AuthorizationToken: LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} OrchestratorContext:[] IPConfiguration:{IPSubnet:{IPAddress:10.0.0.5 PrefixLength:24} DNSServers:[8.8.8.8 8.8.4.4] GatewayIPAddress:10.0.0.1} SecondaryIPConfigs:map[898fb8f1-f93e-4c96-9c31-6b89098949a3:{IPAddress:10.0.0.1 NCVersion:-1}] MultiTenancyInfo:{EncapType: ID:0} CnetAddressSpace:[] Routes:[] AllowHostToNCCommunication:false AllowNCToHostCommunication:false EndpointPolicies:[]}2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.1 version to -1, programmed host nc version is -1 -2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.1 as Available -2021/04/30 23:31:22 [2008] [Azure CNS] saveState -2021/04/30 23:31:22 [2008] [Azure CNS] store not initialized. - internalapi_test.go:406: NC version in container status is -1, HostVersion is -1 -2021/04/30 23:31:22 [2008] [releaseIPConfig] Releasing IP 10.0.0.1 for pod {PodName:testpod1 PodNamespace:testpod1namespace} -2021/04/30 23:31:22 [2008] [updateIPConfigState] Changing IpId [898fb8f1-f93e-4c96-9c31-6b89098949a3] state to [Available], orchestratorContext []. Current config [IPConfigurationStatus: Id: [898fb8f1-f93e-4c96-9c31-6b89098949a3], NcId: [06867cf3-332d-409d-8819-ed70d2c116b0], IpAddress: [10.0.0.1], State: [Allocated], OrchestratorContext: [{"PodName":"testpod1","PodNamespace":"testpod1namespace"}]] -2021/04/30 23:31:22 [2008] [setIPConfigAsAvailable] Deleted outdated pod info testpod1:testpod1namespace from PodIPIDByOrchestratorContext since IP 10.0.0.1 with ID 898fb8f1-f93e-4c96-9c31-6b89098949a3 will be released and set as Available -2021/04/30 23:31:22 [2008] [releaseIPConfig] Released IP 10.0.0.1 for pod {PodName:testpod1 PodNamespace:testpod1namespace} -2021/04/30 23:31:22 [2008] [updateIPConfigState] Changing IpId [898fb8f1-f93e-4c96-9c31-6b89098949a3] state to [Allocated], orchestratorContext [{"PodName":"testpod2","PodNamespace":"testpod2namespace"}]. Current config [IPConfigurationStatus: Id: [898fb8f1-f93e-4c96-9c31-6b89098949a3], NcId: [06867cf3-332d-409d-8819-ed70d2c116b0], IpAddress: [10.0.0.1], State: [Available], OrchestratorContext: []] -2021/04/30 23:31:22 [2008] [Azure CNS] GetPrimaryInterfaceInfoFromMemory -2021/04/30 23:31:22 [2008] [Azure CNS] GetPrimaryInterfaceInfoFromHost ---- PASS: TestIPAMRequestThenReleaseThenRequestAgain (0.00s) -=== RUN TestIPAMReleaseIPIdempotency -setOrchestratorTypeInternal -NC Request {Version:-1 NetworkContainerType:Docker NetworkContainerid:06867cf3-332d-409d-8819-ed70d2c116b0 PrimaryInterfaceIdentifier: AuthorizationToken: LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} OrchestratorContext:[] IPConfiguration:{IPSubnet:{IPAddress:10.0.0.5 PrefixLength:24} DNSServers:[8.8.8.8 8.8.4.4] GatewayIPAddress:10.0.0.1} SecondaryIPConfigs:map[898fb8f1-f93e-4c96-9c31-6b89098949a3:{IPAddress:10.0.0.1 NCVersion:-1}] MultiTenancyInfo:{EncapType: ID:0} CnetAddressSpace:[] Routes:[] AllowHostToNCCommunication:false AllowNCToHostCommunication:false EndpointPolicies:[]}2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.1 version to -1, programmed host nc version is -1 -2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.1 as Available -2021/04/30 23:31:22 [2008] [Azure CNS] saveState -2021/04/30 23:31:22 [2008] [Azure CNS] store not initialized. - internalapi_test.go:406: NC version in container status is -1, HostVersion is -1 -2021/04/30 23:31:22 [2008] [releaseIPConfig] Releasing IP 10.0.0.1 for pod {PodName:testpod1 PodNamespace:testpod1namespace} -2021/04/30 23:31:22 [2008] [updateIPConfigState] Changing IpId [898fb8f1-f93e-4c96-9c31-6b89098949a3] state to [Available], orchestratorContext []. Current config [IPConfigurationStatus: Id: [898fb8f1-f93e-4c96-9c31-6b89098949a3], NcId: [06867cf3-332d-409d-8819-ed70d2c116b0], IpAddress: [10.0.0.1], State: [Allocated], OrchestratorContext: [{"PodName":"testpod1","PodNamespace":"testpod1namespace"}]] -2021/04/30 23:31:22 [2008] [setIPConfigAsAvailable] Deleted outdated pod info testpod1:testpod1namespace from PodIPIDByOrchestratorContext since IP 10.0.0.1 with ID 898fb8f1-f93e-4c96-9c31-6b89098949a3 will be released and set as Available -2021/04/30 23:31:22 [2008] [releaseIPConfig] Released IP 10.0.0.1 for pod {PodName:testpod1 PodNamespace:testpod1namespace} -2021/04/30 23:31:22 [2008] [releaseIPConfig] SetIPConfigAsAvailable failed to release, no allocation found for pod [{PodName:testpod1 PodNamespace:testpod1namespace}] ---- PASS: TestIPAMReleaseIPIdempotency (0.00s) -=== RUN TestIPAMAllocateIPIdempotency -setOrchestratorTypeInternal -NC Request {Version:-1 NetworkContainerType:Docker NetworkContainerid:06867cf3-332d-409d-8819-ed70d2c116b0 PrimaryInterfaceIdentifier: AuthorizationToken: LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} OrchestratorContext:[] IPConfiguration:{IPSubnet:{IPAddress:10.0.0.5 PrefixLength:24} DNSServers:[8.8.8.8 8.8.4.4] GatewayIPAddress:10.0.0.1} SecondaryIPConfigs:map[898fb8f1-f93e-4c96-9c31-6b89098949a3:{IPAddress:10.0.0.1 NCVersion:-1}] MultiTenancyInfo:{EncapType: ID:0} CnetAddressSpace:[] Routes:[] AllowHostToNCCommunication:false AllowNCToHostCommunication:false EndpointPolicies:[]}2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.1 version to -1, programmed host nc version is -1 -2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.1 as Available -2021/04/30 23:31:22 [2008] [Azure CNS] saveState -2021/04/30 23:31:22 [2008] [Azure CNS] store not initialized. - internalapi_test.go:406: NC version in container status is -1, HostVersion is -1 -NC Request {Version:-1 NetworkContainerType:Docker NetworkContainerid:06867cf3-332d-409d-8819-ed70d2c116b0 PrimaryInterfaceIdentifier: AuthorizationToken: LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} OrchestratorContext:[] IPConfiguration:{IPSubnet:{IPAddress:10.0.0.5 PrefixLength:24} DNSServers:[8.8.8.8 8.8.4.4] GatewayIPAddress:10.0.0.1} SecondaryIPConfigs:map[898fb8f1-f93e-4c96-9c31-6b89098949a3:{IPAddress:10.0.0.1 NCVersion:-1}] MultiTenancyInfo:{EncapType: ID:0} CnetAddressSpace:[] Routes:[] AllowHostToNCCommunication:false AllowNCToHostCommunication:false EndpointPolicies:[]}2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.1 version to -1, programmed host nc version is -1 -2021/04/30 23:31:22 [2008] [Azure CNS] saveState -2021/04/30 23:31:22 [2008] [Azure CNS] store not initialized. - internalapi_test.go:406: NC version in container status is -1, HostVersion is -1 ---- PASS: TestIPAMAllocateIPIdempotency (0.00s) -=== RUN TestAvailableIPConfigs -setOrchestratorTypeInternal -NC Request {Version:-1 NetworkContainerType:Docker NetworkContainerid:06867cf3-332d-409d-8819-ed70d2c116b0 PrimaryInterfaceIdentifier: AuthorizationToken: LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} OrchestratorContext:[] IPConfiguration:{IPSubnet:{IPAddress:10.0.0.5 PrefixLength:24} DNSServers:[8.8.8.8 8.8.4.4] GatewayIPAddress:10.0.0.1} SecondaryIPConfigs:map[718e04ac-5a13-4dce-84b3-040accaa9b41:{IPAddress:10.0.0.3 NCVersion:-1} 898fb8f1-f93e-4c96-9c31-6b89098949a3:{IPAddress:10.0.0.1 NCVersion:-1} b21e1ee1-fb7e-4e6d-8c68-22ee5049944e:{IPAddress:10.0.0.2 NCVersion:-1}] MultiTenancyInfo:{EncapType: ID:0} CnetAddressSpace:[] Routes:[] AllowHostToNCCommunication:false AllowNCToHostCommunication:false EndpointPolicies:[]}2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.3 version to -1, programmed host nc version is -1 -2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.3 as Available -2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.1 version to -1, programmed host nc version is -1 -2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.1 as Available -2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.2 version to -1, programmed host nc version is -1 -2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.2 as Available -2021/04/30 23:31:22 [2008] [Azure CNS] saveState -2021/04/30 23:31:22 [2008] [Azure CNS] store not initialized. - internalapi_test.go:406: NC version in container status is -1, HostVersion is -1 -2021/04/30 23:31:22 [2008] [updateIPConfigState] Changing IpId [898fb8f1-f93e-4c96-9c31-6b89098949a3] state to [Allocated], orchestratorContext [{"PodName":"testpod1","PodNamespace":"testpod1namespace"}]. Current config [IPConfigurationStatus: Id: [898fb8f1-f93e-4c96-9c31-6b89098949a3], NcId: [06867cf3-332d-409d-8819-ed70d2c116b0], IpAddress: [10.0.0.1], State: [Available], OrchestratorContext: []] -2021/04/30 23:31:22 [2008] [Azure CNS] GetPrimaryInterfaceInfoFromMemory -2021/04/30 23:31:22 [2008] [Azure CNS] GetPrimaryInterfaceInfoFromHost ---- PASS: TestAvailableIPConfigs (0.00s) -=== RUN TestIPAMMarkIPCountAsPending -setOrchestratorTypeInternal -NC Request {Version:-1 NetworkContainerType:Docker NetworkContainerid:06867cf3-332d-409d-8819-ed70d2c116b0 PrimaryInterfaceIdentifier: AuthorizationToken: LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} OrchestratorContext:[] IPConfiguration:{IPSubnet:{IPAddress:10.0.0.5 PrefixLength:24} DNSServers:[8.8.8.8 8.8.4.4] GatewayIPAddress:10.0.0.1} SecondaryIPConfigs:map[898fb8f1-f93e-4c96-9c31-6b89098949a3:{IPAddress:10.0.0.1 NCVersion:-1}] MultiTenancyInfo:{EncapType: ID:0} CnetAddressSpace:[] Routes:[] AllowHostToNCCommunication:false AllowNCToHostCommunication:false EndpointPolicies:[]}2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.1 version to -1, programmed host nc version is -1 -2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.1 as Available -2021/04/30 23:31:22 [2008] [Azure CNS] saveState -2021/04/30 23:31:22 [2008] [Azure CNS] store not initialized. - internalapi_test.go:406: NC version in container status is -1, HostVersion is -1 -2021/04/30 23:31:22 [2008] [updateIPConfigState] Changing IpId [898fb8f1-f93e-4c96-9c31-6b89098949a3] state to [PendingRelease], orchestratorContext []. Current config [IPConfigurationStatus: Id: [898fb8f1-f93e-4c96-9c31-6b89098949a3], NcId: [06867cf3-332d-409d-8819-ed70d2c116b0], IpAddress: [10.0.0.1], State: [Available], OrchestratorContext: []] -2021/04/30 23:31:22 [2008] [releaseIPConfig] SetIPConfigAsAvailable failed to release, no allocation found for pod [{PodName:testpod1 PodNamespace:testpod1namespace}] -2021/04/30 23:31:22 [2008] [MarkIPAsPendingRelease] Set total ips to PendingRelease 0, expected 1 ---- PASS: TestIPAMMarkIPCountAsPending (0.00s) -=== RUN TestIPAMMarkIPAsPendingWithPendingProgrammingIPs -setOrchestratorTypeInternal -NC Request {Version:0 NetworkContainerType:Docker NetworkContainerid:06867cf3-332d-409d-8819-ed70d2c116b0 PrimaryInterfaceIdentifier: AuthorizationToken: LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} OrchestratorContext:[] IPConfiguration:{IPSubnet:{IPAddress:10.0.0.5 PrefixLength:24} DNSServers:[8.8.8.8 8.8.4.4] GatewayIPAddress:10.0.0.1} SecondaryIPConfigs:map[718e04ac-5a13-4dce-84b3-040accaa9b41:{IPAddress:10.0.0.3 NCVersion:0} 718e04ac-5a13-4dce-84b3-040accaa9b42:{IPAddress:10.0.0.4 NCVersion:-1} 898fb8f1-f93e-4c96-9c31-6b89098949a3:{IPAddress:10.0.0.1 NCVersion:0} b21e1ee1-fb7e-4e6d-8c68-22ee5049944e:{IPAddress:10.0.0.2 NCVersion:-1}] MultiTenancyInfo:{EncapType: ID:0} CnetAddressSpace:[] Routes:[] AllowHostToNCCommunication:false AllowNCToHostCommunication:false EndpointPolicies:[]}2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.3 version to 0, programmed host nc version is -1 -2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.3 as PendingProgramming -2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.2 version to -1, programmed host nc version is -1 -2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.2 as Available -2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.4 version to -1, programmed host nc version is -1 -2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.4 as Available -2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.1 version to 0, programmed host nc version is -1 -2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.1 as PendingProgramming -2021/04/30 23:31:22 [2008] [Azure CNS] saveState -2021/04/30 23:31:22 [2008] [Azure CNS] store not initialized. -2021/04/30 23:31:22 [2008] [updateIPConfigState] Changing IpId [718e04ac-5a13-4dce-84b3-040accaa9b41] state to [PendingRelease], orchestratorContext []. Current config [IPConfigurationStatus: Id: [718e04ac-5a13-4dce-84b3-040accaa9b41], NcId: [06867cf3-332d-409d-8819-ed70d2c116b0], IpAddress: [10.0.0.3], State: [PendingProgramming], OrchestratorContext: []] -2021/04/30 23:31:22 [2008] [updateIPConfigState] Changing IpId [898fb8f1-f93e-4c96-9c31-6b89098949a3] state to [PendingRelease], orchestratorContext []. Current config [IPConfigurationStatus: Id: [898fb8f1-f93e-4c96-9c31-6b89098949a3], NcId: [06867cf3-332d-409d-8819-ed70d2c116b0], IpAddress: [10.0.0.1], State: [PendingProgramming], OrchestratorContext: []] -2021/04/30 23:31:22 [2008] [releaseIPConfig] SetIPConfigAsAvailable failed to release, no allocation found for pod [{PodName:testpod1 PodNamespace:testpod1namespace}] -2021/04/30 23:31:22 [2008] [updateIPConfigState] Changing IpId [b21e1ee1-fb7e-4e6d-8c68-22ee5049944e] state to [PendingRelease], orchestratorContext []. Current config [IPConfigurationStatus: Id: [b21e1ee1-fb7e-4e6d-8c68-22ee5049944e], NcId: [06867cf3-332d-409d-8819-ed70d2c116b0], IpAddress: [10.0.0.2], State: [Available], OrchestratorContext: []] -2021/04/30 23:31:22 [2008] [updateIPConfigState] Changing IpId [718e04ac-5a13-4dce-84b3-040accaa9b42] state to [PendingRelease], orchestratorContext []. Current config [IPConfigurationStatus: Id: [718e04ac-5a13-4dce-84b3-040accaa9b42], NcId: [06867cf3-332d-409d-8819-ed70d2c116b0], IpAddress: [10.0.0.4], State: [Available], OrchestratorContext: []] ---- PASS: TestIPAMMarkIPAsPendingWithPendingProgrammingIPs (0.00s) -=== RUN TestIPAMMarkExistingIPConfigAsPending -setOrchestratorTypeInternal -NC Request {Version:-1 NetworkContainerType:Docker NetworkContainerid:06867cf3-332d-409d-8819-ed70d2c116b0 PrimaryInterfaceIdentifier: AuthorizationToken: LocalIPConfiguration:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] GatewayIPAddress:} OrchestratorContext:[] IPConfiguration:{IPSubnet:{IPAddress:10.0.0.5 PrefixLength:24} DNSServers:[8.8.8.8 8.8.4.4] GatewayIPAddress:10.0.0.1} SecondaryIPConfigs:map[898fb8f1-f93e-4c96-9c31-6b89098949a3:{IPAddress:10.0.0.1 NCVersion:-1} b21e1ee1-fb7e-4e6d-8c68-22ee5049944e:{IPAddress:10.0.0.2 NCVersion:-1}] MultiTenancyInfo:{EncapType: ID:0} CnetAddressSpace:[] Routes:[] AllowHostToNCCommunication:false AllowNCToHostCommunication:false EndpointPolicies:[]}2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.2 version to -1, programmed host nc version is -1 -2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.2 as Available -2021/04/30 23:31:22 [2008] [Azure-Cns] Set IP 10.0.0.1 version to -1, programmed host nc version is -1 -2021/04/30 23:31:22 [2008] [Azure-Cns] Add IP 10.0.0.1 as Available -2021/04/30 23:31:22 [2008] [Azure CNS] saveState -2021/04/30 23:31:22 [2008] [Azure CNS] store not initialized. - internalapi_test.go:406: NC version in container status is -1, HostVersion is -1 -2021/04/30 23:31:22 [2008] [MarkExistingIPsAsPending]: Marking IP [IPConfigurationStatus: Id: [b21e1ee1-fb7e-4e6d-8c68-22ee5049944e], NcId: [06867cf3-332d-409d-8819-ed70d2c116b0], IpAddress: [10.0.0.2], State: [Available], OrchestratorContext: []] to PendingRelease ---- PASS: TestIPAMMarkExistingIPConfigAsPending (0.00s) -PASS -coverage: 8.4% of statements in ./... -2021/04/30 23:31:22 [2008] [Listener] Stopped listening on localhost:10090 -2021/04/30 23:31:22 [2008] [Azure CNS] Service stopped. -2021/04/30 23:31:22 [2008] [Listener] Stopped listening on localhost:9000 -ok github.com/Azure/azure-container-networking/cns/restserver 0.494s coverage: 8.4% of statements in ./... -? github.com/Azure/azure-container-networking/cns/routes [no test files] -? github.com/Azure/azure-container-networking/cns/service [no test files] -? github.com/Azure/azure-container-networking/common [no test files] -? github.com/Azure/azure-container-networking/ebtables [no test files] -=== RUN TestAzure -Running Suite: Azure source Suite -================================= -Random Seed: 1619825482 -Will run 106 of 106 specs - -2021/04/30 23:31:23 [2026] [Listener] Started listening on localhost:42424. -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil -2021/04/30 23:31:23 [2026] [ipam] Starting source ipv6NodeIpam. -•2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. -2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server -•2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. -2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. -2021/04/30 23:31:23 [2026] [ipam] merging address space -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server -2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:true. -2021/04/30 23:31:23 [2026] [ipam] Checking pool ace:cab:deca:deed::/126. -2021/04/30 23:31:23 [2026] [ipam] Pool ace:cab:deca:deed::/126 matches requirements. -2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as:0xc00020a7b0 Id:ace:cab:deca:deed::/126 IfName: Subnet:{IP:ace:cab:deca:deed:: Mask:fffffffffffffffffffffffffffffffc} Gateway:ace:cab:deca:deed::1 Addresses:map[ace:cab:deca:deed::2:0xc000208100 ace:cab:deca:deed::3:0xc000208140] addrsByID:map[] IsIPv6:true Priority:0 RefCount:1 epoch:1} err:. -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -•2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. -2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. -2021/04/30 23:31:23 [2026] [ipam] merging address space -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server -2021/04/30 23:31:23 [2026] [ipam] Requesting address with address:ace:cab:deca:deed::2 options:map[]. -2021/04/30 23:31:23 [2026] [ipam] Address request completed with address:ace:cab:deca:deed::2/126 -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -•2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. -2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. -2021/04/30 23:31:23 [2026] [ipam] merging address space -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server -2021/04/30 23:31:23 [2026] [ipam] Requesting address with address: options:map[]. -2021/04/30 23:31:23 [2026] [ipam] Address request completed with address:ace:cab:deca:deed::3/126 -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -•2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. -2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. -2021/04/30 23:31:23 [2026] [ipam] merging address space -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server -2021/04/30 23:31:23 [2026] [ipam] Releasing address with address: options:map[]. -2021/04/30 23:31:23 [2026] Address not found. Not Returning error -2021/04/30 23:31:23 [2026] [ipam] Address release completed with address: err:. -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -•2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. -2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. -2021/04/30 23:31:23 [2026] [ipam] merging address space -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server -2021/04/30 23:31:23 [2026] [ipam] Releasing address with address: options:map[]. -2021/04/30 23:31:23 [2026] Address not found. Not Returning error -2021/04/30 23:31:23 [2026] [ipam] Address release completed with address: err:. -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. -2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. -2021/04/30 23:31:23 [2026] [ipam] merging address space -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server -2021/04/30 23:31:23 [2026] [ipam] Skip releasing pool with poolId:ace:cab:deca:deed::/126. due to address being in use -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -•2021/04/30 23:31:23 [2026] [ipam] ipam store is nil -•2021/04/30 23:31:23 [2026] [ipam] reboot time 2021-04-30 21:51:59 +0000 UTC store mod time 0001-01-01 00:00:00 +0000 UTC -2021/04/30 23:31:23 [2026] [ipam] Detected Reboot -2021/04/30 23:31:23 [2026] [ipam] store key not found -•2021/04/30 23:31:23 [2026] [ipam] reboot time 2021-04-30 21:51:59 +0000 UTC store mod time 0001-01-01 00:00:00 +0000 UTC -2021/04/30 23:31:23 [2026] [ipam] Detected Reboot -2021/04/30 23:31:23 [2026] [ipam] Failed to restore state, err:Error -•2021/04/30 23:31:23 [2026] [ipam] ipam store is nil -•2021/04/30 23:31:23 [2026] [ipam] ipam store is nil -•2021/04/30 23:31:23 [2026] [ipam] reboot time 2021-04-30 21:51:59 +0000 UTC store mod time 2021-04-30 22:51:59 +0000 UTC -2021/04/30 23:31:23 [2026] [ipam] Restored state, &{Version: TimeStamp:0001-01-01 00:00:00 +0000 UTC AddrSpaces:map[as-test:0xc0000203f0] store:0xc0002cea80 source: netApi: Mutex:{state:0 sema:0}} -•2021/04/30 23:31:23 [2026] [ipam] Restored state, &{Version: TimeStamp:0001-01-01 00:00:00 +0000 UTC AddrSpaces:map[as-test:0xc000020690] store:0xc0002ceb00 source: netApi: Mutex:{state:0 sema:0}} -•2021/04/30 23:31:23 [2026] [ipam] reboot time 2021-04-30 21:51:59 +0000 UTC store mod time 0001-01-01 00:00:00 +0000 UTC -2021/04/30 23:31:23 [2026] [ipam] Detected Reboot -2021/04/30 23:31:23 [2026] [ipam] Rehydrating ipam state from persistent store -2021/04/30 23:31:23 [2026] [ipam] Restored state, &{Version: TimeStamp:0001-01-01 00:00:00 +0000 UTC AddrSpaces:map[as-test:0xc000020810] store:0xc0002ceb80 source: netApi: Mutex:{state:0 sema:0}} -•2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -•2021/04/30 23:31:23 [2026] [ipam] Starting source azure. -•2021/04/30 23:31:23 [2026] [ipam] Starting source mas. -•2021/04/30 23:31:23 [2026] [ipam] Starting source null. -••••••••••2021/04/30 23:31:23 [2026] [ipam] Failed to find interface with MAC address:000D3A6E1825 -•2021/04/30 23:31:23 [2026] [ipam] Failed to find interface with MAC address:000D3A6E1825 -2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from config file -••••2021/04/30 23:31:23 [2026] [ipam] Failed to create address:1.1.1.6 err:Address already exists. -2021/04/30 23:31:23 [2026] [ipam] Failed to create address: err:Invalid address. -•2021/04/30 23:31:23 [2026] [ipam] Failed to create pool:{0.0.0.0/24 []} ifName:eth0 err:Address pool already exists. -2021/04/30 23:31:23 [2026] [ipam] Failed to parse subnet:invalid err:invalid CIDR address: invalid. -2021/04/30 23:31:23 [2026] [ipam] Failed to find interface with MAC address:222222222222 -•••••••••••••2021/04/30 23:31:23 [2026] [Utils] Initializing HTTP client with connection timeout: 10, response header timeout: 10 -2021/04/30 23:31:23 [2026] [ipam] Wireserver call http://localhost:42424 to retrieve IP List -2021/04/30 23:31:23 [2026] [ipam] got 1 addresses from interface lo, subnet 10.0.0.0/16 -2021/04/30 23:31:23 [2026] [ipam] got 1 addresses from interface lo, subnet 10.1.0.0/16 -•2021/04/30 23:31:23 [2026] [ipam] ipam store is nil -2021/04/30 23:31:23 [2026] [ipam] Starting source azure. -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -2021/04/30 23:31:23 [2026] [Utils] Initializing HTTP client with connection timeout: 10, response header timeout: 10 -2021/04/30 23:31:23 [2026] [ipam] Wireserver call http://localhost:42424 to retrieve IP List -2021/04/30 23:31:23 [2026] [ipam] got 1 addresses from interface lo, subnet 10.0.0.0/16 -2021/04/30 23:31:23 [2026] [ipam] got 1 addresses from interface lo, subnet 10.1.0.0/16 -2021/04/30 23:31:23 [2026] [ipam] merging address space -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -•••••••••••••2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -•2021/04/30 23:31:23 [2026] [ipam] merging address space -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -•••••••••••••2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId:10.0.0.0/16 options:map[] v6:false. -2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool: err:Address pool not found. -•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId:10.0.0.0/16 options:map[] v6:false. -2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as: Id:10.0.0.0/16 IfName: Subnet:{IP: Mask:} Gateway: Addresses:map[] addrsByID:map[] IsIPv6:false Priority:0 RefCount:1 epoch:0} err:. -•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:false. -2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. -2021/04/30 23:31:23 [2026] [ipam] Pool 10.0.0.0/16 is in use. -2021/04/30 23:31:23 [2026] [ipam] Releasing pool 10.0.0.0/16 as there are no allocations -2021/04/30 23:31:23 [2026] [ipam] Pool 10.0.0.0/16 matches requirements. -2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as: Id:10.0.0.0/16 IfName: Subnet:{IP: Mask:} Gateway: Addresses:map[10.0.0.2:0xc00060dfc0] addrsByID:map[] IsIPv6:false Priority:0 RefCount:1 epoch:0} err:. -•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:false. -2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. -2021/04/30 23:31:23 [2026] [ipam] Pool 10.0.0.0/16 is in use. -2021/04/30 23:31:23 [2026] [ipam] Skip releasing pool with poolId:10.0.0.0/16. due to address being in use -2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool: err:No available address pools. -•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId:10.0.0.0/16 options:map[] v6:false. -2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as: Id:10.0.0.0/16 IfName: Subnet:{IP: Mask:} Gateway: Addresses:map[10.0.0.1:0xc000648080 10.0.0.2:0xc0006480c0] addrsByID:map[] IsIPv6:false Priority:0 RefCount:1 epoch:0} err:. -•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:true. -2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. -2021/04/30 23:31:23 [2026] [ipam] Pool is of a different address family. -2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool: err:No available address pools. -•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[azure.interface.name:en0] v6:false. -2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. -2021/04/30 23:31:23 [2026] [ipam] Pool is not on the requested interface. -2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool: err:No available address pools. -•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:false. -2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. -2021/04/30 23:31:23 [2026] [ipam] Pool 10.0.0.0/16 matches requirements. -2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as: Id:10.0.0.0/16 IfName: Subnet:{IP: Mask:} Gateway: Addresses:map[] addrsByID:map[] IsIPv6:false Priority:0 RefCount:1 epoch:0} err:. -•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:false. -2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. -2021/04/30 23:31:23 [2026] [ipam] Pool 10.0.0.0/16 matches requirements. -2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.1.0.0/16. -2021/04/30 23:31:23 [2026] [ipam] Pool 10.1.0.0/16 matches requirements. -2021/04/30 23:31:23 [2026] [ipam] Pool is preferred because of priority. -2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as: Id:10.1.0.0/16 IfName: Subnet:{IP: Mask:} Gateway: Addresses:map[] addrsByID:map[] IsIPv6:false Priority:2 RefCount:1 epoch:0} err:. -•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:false. -2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. -2021/04/30 23:31:23 [2026] [ipam] Pool 10.0.0.0/16 matches requirements. -2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.1.0.0/16. -2021/04/30 23:31:23 [2026] [ipam] Pool 10.1.0.0/16 matches requirements. -2021/04/30 23:31:23 [2026] [ipam] Pool is preferred because of capacity. -2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as: Id:10.1.0.0/16 IfName: Subnet:{IP: Mask:} Gateway: Addresses:map[10.1.0.1/16:0xc000648100] addrsByID:map[] IsIPv6:false Priority:0 RefCount:1 epoch:0} err:. -••2021/04/30 23:31:23 [2026] [ipam] Releasing pool 10.0.0.0/16 as there are no allocations -•2021/04/30 23:31:23 [2026] [ipam] Skip releasing pool with poolId:10.0.0.0/16. due to address being in use -•2021/04/30 23:31:23 [2026] [ipam] Releasing pool 10.0.0.0/16 as there are no allocations -••••2021/04/30 23:31:23 [2026] [ipam] Requesting address with address:10.0.0.1/16 options:map[]. -2021/04/30 23:31:23 [2026] [ipam] Address request failed with Address not found -•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address:10.0.0.1/16 options:map[azure.address.id:10.0.0.1/16]. -2021/04/30 23:31:23 [2026] [ipam] Address request completed with address: -•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address: options:map[azure.address.id:f6082149-cc2f-4a9e-8d5e-e85c3b16396e]. -2021/04/30 23:31:23 [2026] [ipam] Address request completed with address:10.0.1.1/24 -•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address:10.0.0.1/16 options:map[]. -2021/04/30 23:31:23 [2026] [ipam] Address request failed with Address already in use -•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address:10.0.0.1/16 options:map[azure.address.id:10.0.0.2/16]. -2021/04/30 23:31:23 [2026] [ipam] Address request failed with Address already in use -•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address: options:map[azure.address.type:gateway]. -2021/04/30 23:31:23 [2026] [ipam] Address request completed with address: -•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address: options:map[azure.address.id:10.0.0.1/16]. -2021/04/30 23:31:23 [2026] [ipam] Address request completed with address: -•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address: options:map[]. -2021/04/30 23:31:23 [2026] [ipam] Address request failed with No available addresses -•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address: options:map[]. -2021/04/30 23:31:23 [2026] [ipam] Address request completed with address: -•2021/04/30 23:31:23 [2026] [ipam] Releasing address with address:0.0.0.0 options:map[]. -2021/04/30 23:31:23 [2026] [ipam] Address release completed with address:0.0.0.0 err:. -•2021/04/30 23:31:23 [2026] [ipam] Releasing address with address:0.0.0.0 options:map[]. -2021/04/30 23:31:23 [2026] [ipam] Address release completed with address:0.0.0.0 err:. -•2021/04/30 23:31:23 [2026] [ipam] Releasing address with address:10.0.0.1/16 options:map[]. -2021/04/30 23:31:23 [2026] Address not in use. Not Returning error -2021/04/30 23:31:23 [2026] [ipam] Address release completed with address:10.0.0.1/16 err:. -•2021/04/30 23:31:23 [2026] [ipam] Releasing address with address: options:map[azure.address.id:10.0.0.1/16]. -2021/04/30 23:31:23 [2026] [ipam] Address release completed with address:0.0.0.0 err:. -•2021/04/30 23:31:23 [2026] [ipam] Releasing address with address:10.0.0.1/16 options:map[]. -2021/04/30 23:31:23 [2026] Deleting Address record from address pool as metadata doesn't have this address -2021/04/30 23:31:23 [2026] [ipam] Address release completed with address:10.0.0.1/16 err:. -•2021/04/30 23:31:23 [2026] [Listener] Stopped listening on localhost:42424 - -Ran 106 of 106 Specs in 0.085 seconds -SUCCESS! -- 106 Passed | 0 Failed | 0 Pending | 0 Skipped ---- PASS: TestAzure (0.09s) -=== RUN TestFileIpam -Running Suite: MAS Suite -======================== -Random Seed: 1619825482 -Will run 106 of 106 specs - -2021/04/30 23:31:23 [2026] [Listener] Started listening on localhost:42424. -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil -2021/04/30 23:31:23 [2026] [ipam] Starting source ipv6NodeIpam. -•2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. -2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server -•2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. -2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. -2021/04/30 23:31:23 [2026] [ipam] merging address space -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server -2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:true. -2021/04/30 23:31:23 [2026] [ipam] Checking pool ace:cab:deca:deed::/126. -2021/04/30 23:31:23 [2026] [ipam] Pool ace:cab:deca:deed::/126 matches requirements. -2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as:0xc00020a990 Id:ace:cab:deca:deed::/126 IfName: Subnet:{IP:ace:cab:deca:deed:: Mask:fffffffffffffffffffffffffffffffc} Gateway:ace:cab:deca:deed::1 Addresses:map[ace:cab:deca:deed::2:0xc000648980 ace:cab:deca:deed::3:0xc0006489c0] addrsByID:map[] IsIPv6:true Priority:0 RefCount:1 epoch:1} err:. -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -•2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. -2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. -2021/04/30 23:31:23 [2026] [ipam] merging address space -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server -2021/04/30 23:31:23 [2026] [ipam] Requesting address with address:ace:cab:deca:deed::2 options:map[]. -2021/04/30 23:31:23 [2026] [ipam] Address request completed with address:ace:cab:deca:deed::2/126 -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -•2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. -2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. -2021/04/30 23:31:23 [2026] [ipam] merging address space -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server -2021/04/30 23:31:23 [2026] [ipam] Requesting address with address: options:map[]. -2021/04/30 23:31:23 [2026] [ipam] Address request completed with address:ace:cab:deca:deed::3/126 -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -•2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. -2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. -2021/04/30 23:31:23 [2026] [ipam] merging address space -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server -2021/04/30 23:31:23 [2026] [ipam] Releasing address with address: options:map[]. -2021/04/30 23:31:23 [2026] Address not found. Not Returning error -2021/04/30 23:31:23 [2026] [ipam] Address release completed with address: err:. -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -•2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. -2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. -2021/04/30 23:31:23 [2026] [ipam] merging address space -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server -2021/04/30 23:31:23 [2026] [ipam] Releasing address with address: options:map[]. -2021/04/30 23:31:23 [2026] Address not found. Not Returning error -2021/04/30 23:31:23 [2026] [ipam] Address release completed with address: err:. -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. -2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. -2021/04/30 23:31:23 [2026] [ipam] merging address space -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server -2021/04/30 23:31:23 [2026] [ipam] Skip releasing pool with poolId:ace:cab:deca:deed::/126. due to address being in use -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -•2021/04/30 23:31:23 [2026] [ipam] ipam store is nil -•2021/04/30 23:31:23 [2026] [ipam] reboot time 2021-04-30 21:51:59 +0000 UTC store mod time 0001-01-01 00:00:00 +0000 UTC -2021/04/30 23:31:23 [2026] [ipam] Detected Reboot -2021/04/30 23:31:23 [2026] [ipam] store key not found -•2021/04/30 23:31:23 [2026] [ipam] reboot time 2021-04-30 21:51:59 +0000 UTC store mod time 0001-01-01 00:00:00 +0000 UTC -2021/04/30 23:31:23 [2026] [ipam] Detected Reboot -2021/04/30 23:31:23 [2026] [ipam] Failed to restore state, err:Error -•2021/04/30 23:31:23 [2026] [ipam] ipam store is nil -•2021/04/30 23:31:23 [2026] [ipam] ipam store is nil -•2021/04/30 23:31:23 [2026] [ipam] reboot time 2021-04-30 21:51:59 +0000 UTC store mod time 2021-04-30 22:51:59 +0000 UTC -2021/04/30 23:31:23 [2026] [ipam] Restored state, &{Version: TimeStamp:0001-01-01 00:00:00 +0000 UTC AddrSpaces:map[as-test:0xc000439e30] store:0xc0005b7d80 source: netApi: Mutex:{state:0 sema:0}} -•2021/04/30 23:31:23 [2026] [ipam] Restored state, &{Version: TimeStamp:0001-01-01 00:00:00 +0000 UTC AddrSpaces:map[as-test:0xc000255410] store:0xc0005b7e00 source: netApi: Mutex:{state:0 sema:0}} -•2021/04/30 23:31:23 [2026] [ipam] reboot time 2021-04-30 21:51:59 +0000 UTC store mod time 0001-01-01 00:00:00 +0000 UTC -2021/04/30 23:31:23 [2026] [ipam] Detected Reboot -2021/04/30 23:31:23 [2026] [ipam] Rehydrating ipam state from persistent store -2021/04/30 23:31:23 [2026] [ipam] Restored state, &{Version: TimeStamp:0001-01-01 00:00:00 +0000 UTC AddrSpaces:map[as-test:0xc0003720c0] store:0xc0005b7e80 source: netApi: Mutex:{state:0 sema:0}} -•2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -•2021/04/30 23:31:23 [2026] [ipam] Starting source azure. -•2021/04/30 23:31:23 [2026] [ipam] Starting source mas. -•2021/04/30 23:31:23 [2026] [ipam] Starting source null. -••••••••••2021/04/30 23:31:23 [2026] [ipam] Failed to find interface with MAC address:000D3A6E1825 -•2021/04/30 23:31:23 [2026] [ipam] Failed to find interface with MAC address:000D3A6E1825 -2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from config file -••••2021/04/30 23:31:23 [2026] [ipam] Failed to create address:1.1.1.6 err:Address already exists. -2021/04/30 23:31:23 [2026] [ipam] Failed to create address: err:Invalid address. -•2021/04/30 23:31:23 [2026] [ipam] Failed to create pool:{0.0.0.0/24 []} ifName:eth0 err:Address pool already exists. -2021/04/30 23:31:23 [2026] [ipam] Failed to parse subnet:invalid err:invalid CIDR address: invalid. -2021/04/30 23:31:23 [2026] [ipam] Failed to find interface with MAC address:222222222222 -•••••••••••••2021/04/30 23:31:23 [2026] [Utils] Initializing HTTP client with connection timeout: 10, response header timeout: 10 -2021/04/30 23:31:23 [2026] [ipam] Wireserver call http://localhost:42424 to retrieve IP List -2021/04/30 23:31:23 [2026] [ipam] got 1 addresses from interface lo, subnet 10.0.0.0/16 -2021/04/30 23:31:23 [2026] [ipam] got 1 addresses from interface lo, subnet 10.1.0.0/16 -•2021/04/30 23:31:23 [2026] [ipam] ipam store is nil -2021/04/30 23:31:23 [2026] [ipam] Starting source azure. -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -2021/04/30 23:31:23 [2026] [Utils] Initializing HTTP client with connection timeout: 10, response header timeout: 10 -2021/04/30 23:31:23 [2026] [ipam] Wireserver call http://localhost:42424 to retrieve IP List -2021/04/30 23:31:23 [2026] [ipam] got 1 addresses from interface lo, subnet 10.0.0.0/16 -2021/04/30 23:31:23 [2026] [ipam] got 1 addresses from interface lo, subnet 10.1.0.0/16 -2021/04/30 23:31:23 [2026] [ipam] merging address space -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -•••••••••••••2021/04/30 23:31:23 [2026] [ipam] merging address space -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -•2021/04/30 23:31:23 [2026] [ipam] merging address space -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -•••••••••••••2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId:10.0.0.0/16 options:map[] v6:false. -2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool: err:Address pool not found. -•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId:10.0.0.0/16 options:map[] v6:false. -2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as: Id:10.0.0.0/16 IfName: Subnet:{IP: Mask:} Gateway: Addresses:map[] addrsByID:map[] IsIPv6:false Priority:0 RefCount:1 epoch:0} err:. -•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:false. -2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. -2021/04/30 23:31:23 [2026] [ipam] Pool 10.0.0.0/16 is in use. -2021/04/30 23:31:23 [2026] [ipam] Releasing pool 10.0.0.0/16 as there are no allocations -2021/04/30 23:31:23 [2026] [ipam] Pool 10.0.0.0/16 matches requirements. -2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as: Id:10.0.0.0/16 IfName: Subnet:{IP: Mask:} Gateway: Addresses:map[10.0.0.2:0xc00008b680] addrsByID:map[] IsIPv6:false Priority:0 RefCount:1 epoch:0} err:. -•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:false. -2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. -2021/04/30 23:31:23 [2026] [ipam] Pool 10.0.0.0/16 is in use. -2021/04/30 23:31:23 [2026] [ipam] Skip releasing pool with poolId:10.0.0.0/16. due to address being in use -2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool: err:No available address pools. -•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId:10.0.0.0/16 options:map[] v6:false. -2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as: Id:10.0.0.0/16 IfName: Subnet:{IP: Mask:} Gateway: Addresses:map[10.0.0.1:0xc00008b740 10.0.0.2:0xc00008b780] addrsByID:map[] IsIPv6:false Priority:0 RefCount:1 epoch:0} err:. -•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:true. -2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. -2021/04/30 23:31:23 [2026] [ipam] Pool is of a different address family. -2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool: err:No available address pools. -•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[azure.interface.name:en0] v6:false. -2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. -2021/04/30 23:31:23 [2026] [ipam] Pool is not on the requested interface. -2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool: err:No available address pools. -•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:false. -2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. -2021/04/30 23:31:23 [2026] [ipam] Pool 10.0.0.0/16 matches requirements. -2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as: Id:10.0.0.0/16 IfName: Subnet:{IP: Mask:} Gateway: Addresses:map[] addrsByID:map[] IsIPv6:false Priority:0 RefCount:1 epoch:0} err:. -•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:false. -2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. -2021/04/30 23:31:23 [2026] [ipam] Pool 10.0.0.0/16 matches requirements. -2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.1.0.0/16. -2021/04/30 23:31:23 [2026] [ipam] Pool 10.1.0.0/16 matches requirements. -2021/04/30 23:31:23 [2026] [ipam] Pool is preferred because of priority. -2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as: Id:10.1.0.0/16 IfName: Subnet:{IP: Mask:} Gateway: Addresses:map[] addrsByID:map[] IsIPv6:false Priority:2 RefCount:1 epoch:0} err:. -•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:false. -2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. -2021/04/30 23:31:23 [2026] [ipam] Pool 10.0.0.0/16 matches requirements. -2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.1.0.0/16. -2021/04/30 23:31:23 [2026] [ipam] Pool 10.1.0.0/16 matches requirements. -2021/04/30 23:31:23 [2026] [ipam] Pool is preferred because of capacity. -2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as: Id:10.1.0.0/16 IfName: Subnet:{IP: Mask:} Gateway: Addresses:map[10.1.0.1/16:0xc00008b7c0] addrsByID:map[] IsIPv6:false Priority:0 RefCount:1 epoch:0} err:. -••2021/04/30 23:31:23 [2026] [ipam] Releasing pool 10.0.0.0/16 as there are no allocations -•2021/04/30 23:31:23 [2026] [ipam] Skip releasing pool with poolId:10.0.0.0/16. due to address being in use -•2021/04/30 23:31:23 [2026] [ipam] Releasing pool 10.0.0.0/16 as there are no allocations -••••2021/04/30 23:31:23 [2026] [ipam] Requesting address with address:10.0.0.1/16 options:map[]. -2021/04/30 23:31:23 [2026] [ipam] Address request failed with Address not found -•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address:10.0.0.1/16 options:map[azure.address.id:10.0.0.1/16]. -2021/04/30 23:31:23 [2026] [ipam] Address request completed with address: -•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address: options:map[azure.address.id:b587f505-4225-44ec-8f01-d74982ed6cd5]. -2021/04/30 23:31:23 [2026] [ipam] Address request completed with address:10.0.1.3/24 -•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address:10.0.0.1/16 options:map[]. -2021/04/30 23:31:23 [2026] [ipam] Address request failed with Address already in use -•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address:10.0.0.1/16 options:map[azure.address.id:10.0.0.2/16]. -2021/04/30 23:31:23 [2026] [ipam] Address request failed with Address already in use -•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address: options:map[azure.address.type:gateway]. -2021/04/30 23:31:23 [2026] [ipam] Address request completed with address: -•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address: options:map[azure.address.id:10.0.0.1/16]. -2021/04/30 23:31:23 [2026] [ipam] Address request completed with address: -•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address: options:map[]. -2021/04/30 23:31:23 [2026] [ipam] Address request failed with No available addresses -•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address: options:map[]. -2021/04/30 23:31:23 [2026] [ipam] Address request completed with address: -•2021/04/30 23:31:23 [2026] [ipam] Releasing address with address:0.0.0.0 options:map[]. -2021/04/30 23:31:23 [2026] [ipam] Address release completed with address:0.0.0.0 err:. -•2021/04/30 23:31:23 [2026] [ipam] Releasing address with address:0.0.0.0 options:map[]. -2021/04/30 23:31:23 [2026] [ipam] Address release completed with address:0.0.0.0 err:. -•2021/04/30 23:31:23 [2026] [ipam] Releasing address with address:10.0.0.1/16 options:map[]. -2021/04/30 23:31:23 [2026] Address not in use. Not Returning error -2021/04/30 23:31:23 [2026] [ipam] Address release completed with address:10.0.0.1/16 err:. -•2021/04/30 23:31:23 [2026] [ipam] Releasing address with address: options:map[azure.address.id:10.0.0.1/16]. -2021/04/30 23:31:23 [2026] [ipam] Address release completed with address:0.0.0.0 err:. -•2021/04/30 23:31:23 [2026] [ipam] Releasing address with address:10.0.0.1/16 options:map[]. -2021/04/30 23:31:23 [2026] Deleting Address record from address pool as metadata doesn't have this address -2021/04/30 23:31:23 [2026] [ipam] Address release completed with address:10.0.0.1/16 err:. -•2021/04/30 23:31:23 [2026] [Listener] Stopped listening on localhost:42424 - -Ran 106 of 106 Specs in 0.042 seconds -SUCCESS! -- 106 Passed | 0 Failed | 0 Pending | 0 Skipped ---- PASS: TestFileIpam (0.04s) -=== RUN TestIpv6Ipam -Running Suite: Ipv6Ipam Suite -============================= -Random Seed: 1619825482 -Will run 106 of 106 specs - -2021/04/30 23:31:23 [2026] [Listener] Started listening on localhost:42424. -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil -2021/04/30 23:31:23 [2026] [ipam] Starting source ipv6NodeIpam. -•2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. -2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server -•2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. -2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. -2021/04/30 23:31:23 [2026] [ipam] merging address space -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server -2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:true. -2021/04/30 23:31:23 [2026] [ipam] Checking pool ace:cab:deca:deed::/126. -2021/04/30 23:31:23 [2026] [ipam] Pool ace:cab:deca:deed::/126 matches requirements. -2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as:0xc00037d980 Id:ace:cab:deca:deed::/126 IfName: Subnet:{IP:ace:cab:deca:deed:: Mask:fffffffffffffffffffffffffffffffc} Gateway:ace:cab:deca:deed::1 Addresses:map[ace:cab:deca:deed::2:0xc0002098c0 ace:cab:deca:deed::3:0xc000209900] addrsByID:map[] IsIPv6:true Priority:0 RefCount:1 epoch:1} err:. -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -•2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. -2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. -2021/04/30 23:31:23 [2026] [ipam] merging address space -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server -2021/04/30 23:31:23 [2026] [ipam] Requesting address with address:ace:cab:deca:deed::2 options:map[]. -2021/04/30 23:31:23 [2026] [ipam] Address request completed with address:ace:cab:deca:deed::2/126 -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -•2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. -2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. -2021/04/30 23:31:23 [2026] [ipam] merging address space -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server -2021/04/30 23:31:23 [2026] [ipam] Requesting address with address: options:map[]. -2021/04/30 23:31:23 [2026] [ipam] Address request completed with address:ace:cab:deca:deed::3/126 -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -•2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. -2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. -2021/04/30 23:31:23 [2026] [ipam] merging address space -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server -2021/04/30 23:31:23 [2026] [ipam] Releasing address with address: options:map[]. -2021/04/30 23:31:23 [2026] Address not found. Not Returning error -2021/04/30 23:31:23 [2026] [ipam] Address release completed with address: err:. -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -•2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. -2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. -2021/04/30 23:31:23 [2026] [ipam] merging address space -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server -2021/04/30 23:31:23 [2026] [ipam] Releasing address with address: options:map[]. -2021/04/30 23:31:23 [2026] Address not found. Not Returning error -2021/04/30 23:31:23 [2026] [ipam] Address release completed with address: err:. -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. -2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. -2021/04/30 23:31:23 [2026] [ipam] merging address space -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server -2021/04/30 23:31:23 [2026] [ipam] Skip releasing pool with poolId:ace:cab:deca:deed::/126. due to address being in use -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -•2021/04/30 23:31:23 [2026] [ipam] ipam store is nil -•2021/04/30 23:31:23 [2026] [ipam] reboot time 2021-04-30 21:51:59 +0000 UTC store mod time 0001-01-01 00:00:00 +0000 UTC -2021/04/30 23:31:23 [2026] [ipam] Detected Reboot -2021/04/30 23:31:23 [2026] [ipam] store key not found -•2021/04/30 23:31:23 [2026] [ipam] reboot time 2021-04-30 21:51:59 +0000 UTC store mod time 0001-01-01 00:00:00 +0000 UTC -2021/04/30 23:31:23 [2026] [ipam] Detected Reboot -2021/04/30 23:31:23 [2026] [ipam] Failed to restore state, err:Error -•2021/04/30 23:31:23 [2026] [ipam] ipam store is nil -•2021/04/30 23:31:23 [2026] [ipam] ipam store is nil -•2021/04/30 23:31:23 [2026] [ipam] reboot time 2021-04-30 21:51:59 +0000 UTC store mod time 2021-04-30 22:51:59 +0000 UTC -2021/04/30 23:31:23 [2026] [ipam] Restored state, &{Version: TimeStamp:0001-01-01 00:00:00 +0000 UTC AddrSpaces:map[as-test:0xc000519350] store:0xc000512400 source: netApi: Mutex:{state:0 sema:0}} -•2021/04/30 23:31:23 [2026] [ipam] Restored state, &{Version: TimeStamp:0001-01-01 00:00:00 +0000 UTC AddrSpaces:map[as-test:0xc0005195f0] store:0xc000512480 source: netApi: Mutex:{state:0 sema:0}} -•2021/04/30 23:31:23 [2026] [ipam] reboot time 2021-04-30 21:51:59 +0000 UTC store mod time 0001-01-01 00:00:00 +0000 UTC -2021/04/30 23:31:23 [2026] [ipam] Detected Reboot -2021/04/30 23:31:23 [2026] [ipam] Rehydrating ipam state from persistent store -2021/04/30 23:31:23 [2026] [ipam] Restored state, &{Version: TimeStamp:0001-01-01 00:00:00 +0000 UTC AddrSpaces:map[as-test:0xc000519770] store:0xc000512500 source: netApi: Mutex:{state:0 sema:0}} -•2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -•2021/04/30 23:31:23 [2026] [ipam] Starting source azure. -•2021/04/30 23:31:23 [2026] [ipam] Starting source mas. -•2021/04/30 23:31:23 [2026] [ipam] Starting source null. -••••••••••2021/04/30 23:31:23 [2026] [ipam] Failed to find interface with MAC address:000D3A6E1825 -•2021/04/30 23:31:23 [2026] [ipam] Failed to find interface with MAC address:000D3A6E1825 -2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from config file -••••2021/04/30 23:31:23 [2026] [ipam] Failed to create address:1.1.1.6 err:Address already exists. -2021/04/30 23:31:23 [2026] [ipam] Failed to create address: err:Invalid address. -•2021/04/30 23:31:23 [2026] [ipam] Failed to create pool:{0.0.0.0/24 []} ifName:eth0 err:Address pool already exists. -2021/04/30 23:31:23 [2026] [ipam] Failed to parse subnet:invalid err:invalid CIDR address: invalid. -2021/04/30 23:31:23 [2026] [ipam] Failed to find interface with MAC address:222222222222 -•••••••••••••2021/04/30 23:31:23 [2026] [Utils] Initializing HTTP client with connection timeout: 10, response header timeout: 10 -2021/04/30 23:31:23 [2026] [ipam] Wireserver call http://localhost:42424 to retrieve IP List -2021/04/30 23:31:23 [2026] [ipam] got 1 addresses from interface lo, subnet 10.0.0.0/16 -2021/04/30 23:31:23 [2026] [ipam] got 1 addresses from interface lo, subnet 10.1.0.0/16 -•2021/04/30 23:31:23 [2026] [ipam] ipam store is nil -2021/04/30 23:31:23 [2026] [ipam] Starting source azure. -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -2021/04/30 23:31:23 [2026] [Utils] Initializing HTTP client with connection timeout: 10, response header timeout: 10 -2021/04/30 23:31:23 [2026] [ipam] Wireserver call http://localhost:42424 to retrieve IP List -2021/04/30 23:31:23 [2026] [ipam] got 1 addresses from interface lo, subnet 10.0.0.0/16 -2021/04/30 23:31:23 [2026] [ipam] got 1 addresses from interface lo, subnet 10.1.0.0/16 -2021/04/30 23:31:23 [2026] [ipam] merging address space -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -•••••••••••••2021/04/30 23:31:23 [2026] [ipam] merging address space -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -•2021/04/30 23:31:23 [2026] [ipam] merging address space -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -•••••••••••••2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId:10.0.0.0/16 options:map[] v6:false. -2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool: err:Address pool not found. -•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId:10.0.0.0/16 options:map[] v6:false. -2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as: Id:10.0.0.0/16 IfName: Subnet:{IP: Mask:} Gateway: Addresses:map[] addrsByID:map[] IsIPv6:false Priority:0 RefCount:1 epoch:0} err:. -•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:false. -2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. -2021/04/30 23:31:23 [2026] [ipam] Pool 10.0.0.0/16 is in use. -2021/04/30 23:31:23 [2026] [ipam] Releasing pool 10.0.0.0/16 as there are no allocations -2021/04/30 23:31:23 [2026] [ipam] Pool 10.0.0.0/16 matches requirements. -2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as: Id:10.0.0.0/16 IfName: Subnet:{IP: Mask:} Gateway: Addresses:map[10.0.0.2:0xc000779b80] addrsByID:map[] IsIPv6:false Priority:0 RefCount:1 epoch:0} err:. -•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:false. -2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. -2021/04/30 23:31:23 [2026] [ipam] Pool 10.0.0.0/16 is in use. -2021/04/30 23:31:23 [2026] [ipam] Skip releasing pool with poolId:10.0.0.0/16. due to address being in use -2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool: err:No available address pools. -•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId:10.0.0.0/16 options:map[] v6:false. -2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as: Id:10.0.0.0/16 IfName: Subnet:{IP: Mask:} Gateway: Addresses:map[10.0.0.1:0xc000779c40 10.0.0.2:0xc000779c80] addrsByID:map[] IsIPv6:false Priority:0 RefCount:1 epoch:0} err:. -•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:true. -2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. -2021/04/30 23:31:23 [2026] [ipam] Pool is of a different address family. -2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool: err:No available address pools. -•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[azure.interface.name:en0] v6:false. -2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. -2021/04/30 23:31:23 [2026] [ipam] Pool is not on the requested interface. -2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool: err:No available address pools. -•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:false. -2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. -2021/04/30 23:31:23 [2026] [ipam] Pool 10.0.0.0/16 matches requirements. -2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as: Id:10.0.0.0/16 IfName: Subnet:{IP: Mask:} Gateway: Addresses:map[] addrsByID:map[] IsIPv6:false Priority:0 RefCount:1 epoch:0} err:. -•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:false. -2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. -2021/04/30 23:31:23 [2026] [ipam] Pool 10.0.0.0/16 matches requirements. -2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.1.0.0/16. -2021/04/30 23:31:23 [2026] [ipam] Pool 10.1.0.0/16 matches requirements. -2021/04/30 23:31:23 [2026] [ipam] Pool is preferred because of priority. -2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as: Id:10.1.0.0/16 IfName: Subnet:{IP: Mask:} Gateway: Addresses:map[] addrsByID:map[] IsIPv6:false Priority:2 RefCount:1 epoch:0} err:. -•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:false. -2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. -2021/04/30 23:31:23 [2026] [ipam] Pool 10.0.0.0/16 matches requirements. -2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.1.0.0/16. -2021/04/30 23:31:23 [2026] [ipam] Pool 10.1.0.0/16 matches requirements. -2021/04/30 23:31:23 [2026] [ipam] Pool is preferred because of capacity. -2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as: Id:10.1.0.0/16 IfName: Subnet:{IP: Mask:} Gateway: Addresses:map[10.1.0.1/16:0xc000779cc0] addrsByID:map[] IsIPv6:false Priority:0 RefCount:1 epoch:0} err:. -••2021/04/30 23:31:23 [2026] [ipam] Releasing pool 10.0.0.0/16 as there are no allocations -•2021/04/30 23:31:23 [2026] [ipam] Skip releasing pool with poolId:10.0.0.0/16. due to address being in use -•2021/04/30 23:31:23 [2026] [ipam] Releasing pool 10.0.0.0/16 as there are no allocations -••••2021/04/30 23:31:23 [2026] [ipam] Requesting address with address:10.0.0.1/16 options:map[]. -2021/04/30 23:31:23 [2026] [ipam] Address request failed with Address not found -•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address:10.0.0.1/16 options:map[azure.address.id:10.0.0.1/16]. -2021/04/30 23:31:23 [2026] [ipam] Address request completed with address: -•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address: options:map[azure.address.id:fc3e33ba-e50a-4750-aa9d-13bb2be9bc5c]. -2021/04/30 23:31:23 [2026] [ipam] Address request completed with address:10.0.1.1/24 -•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address:10.0.0.1/16 options:map[]. -2021/04/30 23:31:23 [2026] [ipam] Address request failed with Address already in use -•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address:10.0.0.1/16 options:map[azure.address.id:10.0.0.2/16]. -2021/04/30 23:31:23 [2026] [ipam] Address request failed with Address already in use -•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address: options:map[azure.address.type:gateway]. -2021/04/30 23:31:23 [2026] [ipam] Address request completed with address: -•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address: options:map[azure.address.id:10.0.0.1/16]. -2021/04/30 23:31:23 [2026] [ipam] Address request completed with address: -•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address: options:map[]. -2021/04/30 23:31:23 [2026] [ipam] Address request failed with No available addresses -•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address: options:map[]. -2021/04/30 23:31:23 [2026] [ipam] Address request completed with address: -•2021/04/30 23:31:23 [2026] [ipam] Releasing address with address:0.0.0.0 options:map[]. -2021/04/30 23:31:23 [2026] [ipam] Address release completed with address:0.0.0.0 err:. -•2021/04/30 23:31:23 [2026] [ipam] Releasing address with address:0.0.0.0 options:map[]. -2021/04/30 23:31:23 [2026] [ipam] Address release completed with address:0.0.0.0 err:. -•2021/04/30 23:31:23 [2026] [ipam] Releasing address with address:10.0.0.1/16 options:map[]. -2021/04/30 23:31:23 [2026] Address not in use. Not Returning error -2021/04/30 23:31:23 [2026] [ipam] Address release completed with address:10.0.0.1/16 err:. -•2021/04/30 23:31:23 [2026] [ipam] Releasing address with address: options:map[azure.address.id:10.0.0.1/16]. -2021/04/30 23:31:23 [2026] [ipam] Address release completed with address:0.0.0.0 err:. -•2021/04/30 23:31:23 [2026] [ipam] Releasing address with address:10.0.0.1/16 options:map[]. -2021/04/30 23:31:23 [2026] Deleting Address record from address pool as metadata doesn't have this address -2021/04/30 23:31:23 [2026] [ipam] Address release completed with address:10.0.0.1/16 err:. -•2021/04/30 23:31:23 [2026] [Listener] Stopped listening on localhost:42424 - -Ran 106 of 106 Specs in 0.079 seconds -SUCCESS! -- 106 Passed | 0 Failed | 0 Pending | 0 Skipped ---- PASS: TestIpv6Ipam (0.08s) -=== RUN TestManagerIpv6Ipam -Running Suite: Manager ipv6ipam Suite -===================================== -Random Seed: 1619825482 -Will run 106 of 106 specs - -2021/04/30 23:31:23 [2026] [Listener] Started listening on localhost:42424. -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil -2021/04/30 23:31:23 [2026] [ipam] Starting source ipv6NodeIpam. -•2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. -2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server -•2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. -2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. -2021/04/30 23:31:23 [2026] [ipam] merging address space -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server -2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:true. -2021/04/30 23:31:23 [2026] [ipam] Checking pool ace:cab:deca:deed::/126. -2021/04/30 23:31:23 [2026] [ipam] Pool ace:cab:deca:deed::/126 matches requirements. -2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as:0xc0002875c0 Id:ace:cab:deca:deed::/126 IfName: Subnet:{IP:ace:cab:deca:deed:: Mask:fffffffffffffffffffffffffffffffc} Gateway:ace:cab:deca:deed::1 Addresses:map[ace:cab:deca:deed::2:0xc00039e340 ace:cab:deca:deed::3:0xc00039e380] addrsByID:map[] IsIPv6:true Priority:0 RefCount:1 epoch:1} err:. -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -•2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. -2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. -2021/04/30 23:31:23 [2026] [ipam] merging address space -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server -2021/04/30 23:31:23 [2026] [ipam] Requesting address with address:ace:cab:deca:deed::2 options:map[]. -2021/04/30 23:31:23 [2026] [ipam] Address request completed with address:ace:cab:deca:deed::2/126 -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -•2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. -2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. -2021/04/30 23:31:23 [2026] [ipam] merging address space -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server -2021/04/30 23:31:23 [2026] [ipam] Requesting address with address: options:map[]. -2021/04/30 23:31:23 [2026] [ipam] Address request completed with address:ace:cab:deca:deed::3/126 -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -•2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. -2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. -2021/04/30 23:31:23 [2026] [ipam] merging address space -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server -2021/04/30 23:31:23 [2026] [ipam] Releasing address with address: options:map[]. -2021/04/30 23:31:23 [2026] Address not found. Not Returning error -2021/04/30 23:31:23 [2026] [ipam] Address release completed with address: err:. -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -•2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. -2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. -2021/04/30 23:31:23 [2026] [ipam] merging address space -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server -2021/04/30 23:31:23 [2026] [ipam] Releasing address with address: options:map[]. -2021/04/30 23:31:23 [2026] Address not found. Not Returning error -2021/04/30 23:31:23 [2026] [ipam] Address release completed with address: err:. -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. -2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. -2021/04/30 23:31:23 [2026] [ipam] merging address space -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server -2021/04/30 23:31:23 [2026] [ipam] Skip releasing pool with poolId:ace:cab:deca:deed::/126. due to address being in use -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -•2021/04/30 23:31:23 [2026] [ipam] ipam store is nil -•2021/04/30 23:31:23 [2026] [ipam] reboot time 2021-04-30 21:51:59 +0000 UTC store mod time 0001-01-01 00:00:00 +0000 UTC -2021/04/30 23:31:23 [2026] [ipam] Detected Reboot -2021/04/30 23:31:23 [2026] [ipam] store key not found -•2021/04/30 23:31:23 [2026] [ipam] reboot time 2021-04-30 21:51:59 +0000 UTC store mod time 0001-01-01 00:00:00 +0000 UTC -2021/04/30 23:31:23 [2026] [ipam] Detected Reboot -2021/04/30 23:31:23 [2026] [ipam] Failed to restore state, err:Error -•2021/04/30 23:31:23 [2026] [ipam] ipam store is nil -•2021/04/30 23:31:23 [2026] [ipam] ipam store is nil -•2021/04/30 23:31:23 [2026] [ipam] reboot time 2021-04-30 21:51:59 +0000 UTC store mod time 2021-04-30 22:51:59 +0000 UTC -2021/04/30 23:31:23 [2026] [ipam] Restored state, &{Version: TimeStamp:0001-01-01 00:00:00 +0000 UTC AddrSpaces:map[as-test:0xc00063b500] store:0xc000767680 source: netApi: Mutex:{state:0 sema:0}} -•2021/04/30 23:31:23 [2026] [ipam] Restored state, &{Version: TimeStamp:0001-01-01 00:00:00 +0000 UTC AddrSpaces:map[as-test:0xc00063b800] store:0xc000767700 source: netApi: Mutex:{state:0 sema:0}} -•2021/04/30 23:31:23 [2026] [ipam] reboot time 2021-04-30 21:51:59 +0000 UTC store mod time 0001-01-01 00:00:00 +0000 UTC -2021/04/30 23:31:23 [2026] [ipam] Detected Reboot -2021/04/30 23:31:23 [2026] [ipam] Rehydrating ipam state from persistent store -2021/04/30 23:31:23 [2026] [ipam] Restored state, &{Version: TimeStamp:0001-01-01 00:00:00 +0000 UTC AddrSpaces:map[as-test:0xc00063b9b0] store:0xc000767780 source: netApi: Mutex:{state:0 sema:0}} -•2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -•2021/04/30 23:31:23 [2026] [ipam] Starting source azure. -•2021/04/30 23:31:23 [2026] [ipam] Starting source mas. -•2021/04/30 23:31:23 [2026] [ipam] Starting source null. -••••••••••2021/04/30 23:31:23 [2026] [ipam] Failed to find interface with MAC address:000D3A6E1825 -•2021/04/30 23:31:23 [2026] [ipam] Failed to find interface with MAC address:000D3A6E1825 -2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from config file -••••2021/04/30 23:31:23 [2026] [ipam] Failed to create address:1.1.1.6 err:Address already exists. -2021/04/30 23:31:23 [2026] [ipam] Failed to create address: err:Invalid address. -•2021/04/30 23:31:23 [2026] [ipam] Failed to create pool:{0.0.0.0/24 []} ifName:eth0 err:Address pool already exists. -2021/04/30 23:31:23 [2026] [ipam] Failed to parse subnet:invalid err:invalid CIDR address: invalid. -2021/04/30 23:31:23 [2026] [ipam] Failed to find interface with MAC address:222222222222 -•••••••••••••2021/04/30 23:31:23 [2026] [Utils] Initializing HTTP client with connection timeout: 10, response header timeout: 10 -2021/04/30 23:31:23 [2026] [ipam] Wireserver call http://localhost:42424 to retrieve IP List -2021/04/30 23:31:23 [2026] [ipam] got 1 addresses from interface lo, subnet 10.0.0.0/16 -2021/04/30 23:31:23 [2026] [ipam] got 1 addresses from interface lo, subnet 10.1.0.0/16 -•2021/04/30 23:31:23 [2026] [ipam] ipam store is nil -2021/04/30 23:31:23 [2026] [ipam] Starting source azure. -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -2021/04/30 23:31:23 [2026] [Utils] Initializing HTTP client with connection timeout: 10, response header timeout: 10 -2021/04/30 23:31:23 [2026] [ipam] Wireserver call http://localhost:42424 to retrieve IP List -2021/04/30 23:31:23 [2026] [ipam] got 1 addresses from interface lo, subnet 10.0.0.0/16 -2021/04/30 23:31:23 [2026] [ipam] got 1 addresses from interface lo, subnet 10.1.0.0/16 -2021/04/30 23:31:23 [2026] [ipam] merging address space -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -•••••••••••••2021/04/30 23:31:23 [2026] [ipam] merging address space -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -•2021/04/30 23:31:23 [2026] [ipam] merging address space -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -•••••••••••••2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId:10.0.0.0/16 options:map[] v6:false. -2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool: err:Address pool not found. -•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId:10.0.0.0/16 options:map[] v6:false. -2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as: Id:10.0.0.0/16 IfName: Subnet:{IP: Mask:} Gateway: Addresses:map[] addrsByID:map[] IsIPv6:false Priority:0 RefCount:1 epoch:0} err:. -•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:false. -2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. -2021/04/30 23:31:23 [2026] [ipam] Pool 10.0.0.0/16 is in use. -2021/04/30 23:31:23 [2026] [ipam] Releasing pool 10.0.0.0/16 as there are no allocations -2021/04/30 23:31:23 [2026] [ipam] Pool 10.0.0.0/16 matches requirements. -2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as: Id:10.0.0.0/16 IfName: Subnet:{IP: Mask:} Gateway: Addresses:map[10.0.0.2:0xc000649180] addrsByID:map[] IsIPv6:false Priority:0 RefCount:1 epoch:0} err:. -•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:false. -2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. -2021/04/30 23:31:23 [2026] [ipam] Pool 10.0.0.0/16 is in use. -2021/04/30 23:31:23 [2026] [ipam] Skip releasing pool with poolId:10.0.0.0/16. due to address being in use -2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool: err:No available address pools. -•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId:10.0.0.0/16 options:map[] v6:false. -2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as: Id:10.0.0.0/16 IfName: Subnet:{IP: Mask:} Gateway: Addresses:map[10.0.0.1:0xc000649240 10.0.0.2:0xc000649280] addrsByID:map[] IsIPv6:false Priority:0 RefCount:1 epoch:0} err:. -•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:true. -2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. -2021/04/30 23:31:23 [2026] [ipam] Pool is of a different address family. -2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool: err:No available address pools. -•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[azure.interface.name:en0] v6:false. -2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. -2021/04/30 23:31:23 [2026] [ipam] Pool is not on the requested interface. -2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool: err:No available address pools. -•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:false. -2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. -2021/04/30 23:31:23 [2026] [ipam] Pool 10.0.0.0/16 matches requirements. -2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as: Id:10.0.0.0/16 IfName: Subnet:{IP: Mask:} Gateway: Addresses:map[] addrsByID:map[] IsIPv6:false Priority:0 RefCount:1 epoch:0} err:. -•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:false. -2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.1.0.0/16. -2021/04/30 23:31:23 [2026] [ipam] Pool 10.1.0.0/16 matches requirements. -2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. -2021/04/30 23:31:23 [2026] [ipam] Pool 10.0.0.0/16 matches requirements. -2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as: Id:10.1.0.0/16 IfName: Subnet:{IP: Mask:} Gateway: Addresses:map[] addrsByID:map[] IsIPv6:false Priority:2 RefCount:1 epoch:0} err:. -•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:false. -2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.1.0.0/16. -2021/04/30 23:31:23 [2026] [ipam] Pool 10.1.0.0/16 matches requirements. -2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. -2021/04/30 23:31:23 [2026] [ipam] Pool 10.0.0.0/16 matches requirements. -2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as: Id:10.1.0.0/16 IfName: Subnet:{IP: Mask:} Gateway: Addresses:map[10.1.0.1/16:0xc0006492c0] addrsByID:map[] IsIPv6:false Priority:0 RefCount:1 epoch:0} err:. -••2021/04/30 23:31:23 [2026] [ipam] Releasing pool 10.0.0.0/16 as there are no allocations -•2021/04/30 23:31:23 [2026] [ipam] Skip releasing pool with poolId:10.0.0.0/16. due to address being in use -•2021/04/30 23:31:23 [2026] [ipam] Releasing pool 10.0.0.0/16 as there are no allocations -••••2021/04/30 23:31:23 [2026] [ipam] Requesting address with address:10.0.0.1/16 options:map[]. -2021/04/30 23:31:23 [2026] [ipam] Address request failed with Address not found -•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address:10.0.0.1/16 options:map[azure.address.id:10.0.0.1/16]. -2021/04/30 23:31:23 [2026] [ipam] Address request completed with address: -•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address: options:map[azure.address.id:4320211b-113f-4985-bcaa-b6969121b606]. -2021/04/30 23:31:23 [2026] [ipam] Address request completed with address:10.0.1.1/24 -•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address:10.0.0.1/16 options:map[]. -2021/04/30 23:31:23 [2026] [ipam] Address request failed with Address already in use -•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address:10.0.0.1/16 options:map[azure.address.id:10.0.0.2/16]. -2021/04/30 23:31:23 [2026] [ipam] Address request failed with Address already in use -•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address: options:map[azure.address.type:gateway]. -2021/04/30 23:31:23 [2026] [ipam] Address request completed with address: -•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address: options:map[azure.address.id:10.0.0.1/16]. -2021/04/30 23:31:23 [2026] [ipam] Address request completed with address: -•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address: options:map[]. -2021/04/30 23:31:23 [2026] [ipam] Address request failed with No available addresses -•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address: options:map[]. -2021/04/30 23:31:23 [2026] [ipam] Address request completed with address: -•2021/04/30 23:31:23 [2026] [ipam] Releasing address with address:0.0.0.0 options:map[]. -2021/04/30 23:31:23 [2026] [ipam] Address release completed with address:0.0.0.0 err:. -•2021/04/30 23:31:23 [2026] [ipam] Releasing address with address:0.0.0.0 options:map[]. -2021/04/30 23:31:23 [2026] [ipam] Address release completed with address:0.0.0.0 err:. -•2021/04/30 23:31:23 [2026] [ipam] Releasing address with address:10.0.0.1/16 options:map[]. -2021/04/30 23:31:23 [2026] Address not in use. Not Returning error -2021/04/30 23:31:23 [2026] [ipam] Address release completed with address:10.0.0.1/16 err:. -•2021/04/30 23:31:23 [2026] [ipam] Releasing address with address: options:map[azure.address.id:10.0.0.1/16]. -2021/04/30 23:31:23 [2026] [ipam] Address release completed with address:0.0.0.0 err:. -•2021/04/30 23:31:23 [2026] [ipam] Releasing address with address:10.0.0.1/16 options:map[]. -2021/04/30 23:31:23 [2026] Deleting Address record from address pool as metadata doesn't have this address -2021/04/30 23:31:23 [2026] [ipam] Address release completed with address:10.0.0.1/16 err:. -•2021/04/30 23:31:23 [2026] [Listener] Stopped listening on localhost:42424 - -Ran 106 of 106 Specs in 0.088 seconds -SUCCESS! -- 106 Passed | 0 Failed | 0 Pending | 0 Skipped ---- PASS: TestManagerIpv6Ipam (0.09s) -=== RUN TestManager -Running Suite: Manager Suite -============================ -Random Seed: 1619825482 -Will run 106 of 106 specs - -2021/04/30 23:31:23 [2026] [Listener] Started listening on localhost:42424. -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil -2021/04/30 23:31:23 [2026] [ipam] Starting source ipv6NodeIpam. -•2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. -2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server -•2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. -2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. -2021/04/30 23:31:23 [2026] [ipam] merging address space -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server -2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:true. -2021/04/30 23:31:23 [2026] [ipam] Checking pool ace:cab:deca:deed::/126. -2021/04/30 23:31:23 [2026] [ipam] Pool ace:cab:deca:deed::/126 matches requirements. -2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as:0xc0003338f0 Id:ace:cab:deca:deed::/126 IfName: Subnet:{IP:ace:cab:deca:deed:: Mask:fffffffffffffffffffffffffffffffc} Gateway:ace:cab:deca:deed::1 Addresses:map[ace:cab:deca:deed::2:0xc000649b40 ace:cab:deca:deed::3:0xc000649b80] addrsByID:map[] IsIPv6:true Priority:0 RefCount:1 epoch:1} err:. -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -•2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. -2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. -2021/04/30 23:31:23 [2026] [ipam] merging address space -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server -2021/04/30 23:31:23 [2026] [ipam] Requesting address with address:ace:cab:deca:deed::2 options:map[]. -2021/04/30 23:31:23 [2026] [ipam] Address request completed with address:ace:cab:deca:deed::2/126 -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -•2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. -2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. -2021/04/30 23:31:23 [2026] [ipam] merging address space -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server -2021/04/30 23:31:23 [2026] [ipam] Requesting address with address: options:map[]. -2021/04/30 23:31:23 [2026] [ipam] Address request completed with address:ace:cab:deca:deed::3/126 -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -•2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. -2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. -2021/04/30 23:31:23 [2026] [ipam] merging address space -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server -2021/04/30 23:31:23 [2026] [ipam] Releasing address with address: options:map[]. -2021/04/30 23:31:23 [2026] Address not found. Not Returning error -2021/04/30 23:31:23 [2026] [ipam] Address release completed with address: err:. -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -•2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. -2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. -2021/04/30 23:31:23 [2026] [ipam] merging address space -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server -2021/04/30 23:31:23 [2026] [ipam] Releasing address with address: options:map[]. -2021/04/30 23:31:23 [2026] Address not found. Not Returning error -2021/04/30 23:31:23 [2026] [ipam] Address release completed with address: err:. -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. -2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. -2021/04/30 23:31:23 [2026] [ipam] merging address space -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server -2021/04/30 23:31:23 [2026] [ipam] Skip releasing pool with poolId:ace:cab:deca:deed::/126. due to address being in use -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -•2021/04/30 23:31:23 [2026] [ipam] ipam store is nil -•2021/04/30 23:31:23 [2026] [ipam] reboot time 2021-04-30 21:51:59 +0000 UTC store mod time 0001-01-01 00:00:00 +0000 UTC -2021/04/30 23:31:23 [2026] [ipam] Detected Reboot -2021/04/30 23:31:23 [2026] [ipam] store key not found -•2021/04/30 23:31:23 [2026] [ipam] reboot time 2021-04-30 21:51:59 +0000 UTC store mod time 0001-01-01 00:00:00 +0000 UTC -2021/04/30 23:31:23 [2026] [ipam] Detected Reboot -2021/04/30 23:31:23 [2026] [ipam] Failed to restore state, err:Error -•2021/04/30 23:31:23 [2026] [ipam] ipam store is nil -•2021/04/30 23:31:23 [2026] [ipam] ipam store is nil -•2021/04/30 23:31:23 [2026] [ipam] reboot time 2021-04-30 21:51:59 +0000 UTC store mod time 2021-04-30 22:51:59 +0000 UTC -2021/04/30 23:31:23 [2026] [ipam] Restored state, &{Version: TimeStamp:0001-01-01 00:00:00 +0000 UTC AddrSpaces:map[as-test:0xc000518210] store:0xc0002cee80 source: netApi: Mutex:{state:0 sema:0}} -•2021/04/30 23:31:23 [2026] [ipam] Restored state, &{Version: TimeStamp:0001-01-01 00:00:00 +0000 UTC AddrSpaces:map[as-test:0xc0005184e0] store:0xc0002cf080 source: netApi: Mutex:{state:0 sema:0}} -•2021/04/30 23:31:23 [2026] [ipam] reboot time 2021-04-30 21:51:59 +0000 UTC store mod time 0001-01-01 00:00:00 +0000 UTC -2021/04/30 23:31:23 [2026] [ipam] Detected Reboot -2021/04/30 23:31:23 [2026] [ipam] Rehydrating ipam state from persistent store -2021/04/30 23:31:23 [2026] [ipam] Restored state, &{Version: TimeStamp:0001-01-01 00:00:00 +0000 UTC AddrSpaces:map[as-test:0xc000518660] store:0xc0002cf100 source: netApi: Mutex:{state:0 sema:0}} -•2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -•2021/04/30 23:31:23 [2026] [ipam] Starting source azure. -•2021/04/30 23:31:23 [2026] [ipam] Starting source mas. -•2021/04/30 23:31:23 [2026] [ipam] Starting source null. -••••••••••2021/04/30 23:31:23 [2026] [ipam] Failed to find interface with MAC address:000D3A6E1825 -•2021/04/30 23:31:23 [2026] [ipam] Failed to find interface with MAC address:000D3A6E1825 -2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from config file -••••2021/04/30 23:31:23 [2026] [ipam] Failed to create address:1.1.1.6 err:Address already exists. -2021/04/30 23:31:23 [2026] [ipam] Failed to create address: err:Invalid address. -•2021/04/30 23:31:23 [2026] [ipam] Failed to create pool:{0.0.0.0/24 []} ifName:eth0 err:Address pool already exists. -2021/04/30 23:31:23 [2026] [ipam] Failed to parse subnet:invalid err:invalid CIDR address: invalid. -2021/04/30 23:31:23 [2026] [ipam] Failed to find interface with MAC address:222222222222 -•••••••••••••2021/04/30 23:31:23 [2026] [Utils] Initializing HTTP client with connection timeout: 10, response header timeout: 10 -2021/04/30 23:31:23 [2026] [ipam] Wireserver call http://localhost:42424 to retrieve IP List -2021/04/30 23:31:23 [2026] [ipam] got 1 addresses from interface lo, subnet 10.0.0.0/16 -2021/04/30 23:31:23 [2026] [ipam] got 1 addresses from interface lo, subnet 10.1.0.0/16 -•2021/04/30 23:31:23 [2026] [ipam] ipam store is nil -2021/04/30 23:31:23 [2026] [ipam] Starting source azure. -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -2021/04/30 23:31:23 [2026] [Utils] Initializing HTTP client with connection timeout: 10, response header timeout: 10 -2021/04/30 23:31:23 [2026] [ipam] Wireserver call http://localhost:42424 to retrieve IP List -2021/04/30 23:31:23 [2026] [ipam] got 1 addresses from interface lo, subnet 10.0.0.0/16 -2021/04/30 23:31:23 [2026] [ipam] got 1 addresses from interface lo, subnet 10.1.0.0/16 -2021/04/30 23:31:23 [2026] [ipam] merging address space -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -•••••••••••••2021/04/30 23:31:23 [2026] [ipam] merging address space -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -•2021/04/30 23:31:23 [2026] [ipam] merging address space -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -•••••••••••••2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId:10.0.0.0/16 options:map[] v6:false. -2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool: err:Address pool not found. -•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId:10.0.0.0/16 options:map[] v6:false. -2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as: Id:10.0.0.0/16 IfName: Subnet:{IP: Mask:} Gateway: Addresses:map[] addrsByID:map[] IsIPv6:false Priority:0 RefCount:1 epoch:0} err:. -•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:false. -2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. -2021/04/30 23:31:23 [2026] [ipam] Pool 10.0.0.0/16 is in use. -2021/04/30 23:31:23 [2026] [ipam] Releasing pool 10.0.0.0/16 as there are no allocations -2021/04/30 23:31:23 [2026] [ipam] Pool 10.0.0.0/16 matches requirements. -2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as: Id:10.0.0.0/16 IfName: Subnet:{IP: Mask:} Gateway: Addresses:map[10.0.0.2:0xc00060b580] addrsByID:map[] IsIPv6:false Priority:0 RefCount:1 epoch:0} err:. -•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:false. -2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. -2021/04/30 23:31:23 [2026] [ipam] Pool 10.0.0.0/16 is in use. -2021/04/30 23:31:23 [2026] [ipam] Skip releasing pool with poolId:10.0.0.0/16. due to address being in use -2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool: err:No available address pools. -•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId:10.0.0.0/16 options:map[] v6:false. -2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as: Id:10.0.0.0/16 IfName: Subnet:{IP: Mask:} Gateway: Addresses:map[10.0.0.1:0xc00052a0c0 10.0.0.2:0xc00052a100] addrsByID:map[] IsIPv6:false Priority:0 RefCount:1 epoch:0} err:. -•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:true. -2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. -2021/04/30 23:31:23 [2026] [ipam] Pool is of a different address family. -2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool: err:No available address pools. -•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[azure.interface.name:en0] v6:false. -2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. -2021/04/30 23:31:23 [2026] [ipam] Pool is not on the requested interface. -2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool: err:No available address pools. -•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:false. -2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. -2021/04/30 23:31:23 [2026] [ipam] Pool 10.0.0.0/16 matches requirements. -2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as: Id:10.0.0.0/16 IfName: Subnet:{IP: Mask:} Gateway: Addresses:map[] addrsByID:map[] IsIPv6:false Priority:0 RefCount:1 epoch:0} err:. -•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:false. -2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. -2021/04/30 23:31:23 [2026] [ipam] Pool 10.0.0.0/16 matches requirements. -2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.1.0.0/16. -2021/04/30 23:31:23 [2026] [ipam] Pool 10.1.0.0/16 matches requirements. -2021/04/30 23:31:23 [2026] [ipam] Pool is preferred because of priority. -2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as: Id:10.1.0.0/16 IfName: Subnet:{IP: Mask:} Gateway: Addresses:map[] addrsByID:map[] IsIPv6:false Priority:2 RefCount:1 epoch:0} err:. -•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:false. -2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. -2021/04/30 23:31:23 [2026] [ipam] Pool 10.0.0.0/16 matches requirements. -2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.1.0.0/16. -2021/04/30 23:31:23 [2026] [ipam] Pool 10.1.0.0/16 matches requirements. -2021/04/30 23:31:23 [2026] [ipam] Pool is preferred because of capacity. -2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as: Id:10.1.0.0/16 IfName: Subnet:{IP: Mask:} Gateway: Addresses:map[10.1.0.1/16:0xc00052a140] addrsByID:map[] IsIPv6:false Priority:0 RefCount:1 epoch:0} err:. -••2021/04/30 23:31:23 [2026] [ipam] Releasing pool 10.0.0.0/16 as there are no allocations -•2021/04/30 23:31:23 [2026] [ipam] Skip releasing pool with poolId:10.0.0.0/16. due to address being in use -•2021/04/30 23:31:23 [2026] [ipam] Releasing pool 10.0.0.0/16 as there are no allocations -••••2021/04/30 23:31:23 [2026] [ipam] Requesting address with address:10.0.0.1/16 options:map[]. -2021/04/30 23:31:23 [2026] [ipam] Address request failed with Address not found -•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address:10.0.0.1/16 options:map[azure.address.id:10.0.0.1/16]. -2021/04/30 23:31:23 [2026] [ipam] Address request completed with address: -•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address: options:map[azure.address.id:ae781e4e-a2a0-41b8-9c64-69378c4a903a]. -2021/04/30 23:31:23 [2026] [ipam] Address request completed with address:10.0.1.1/24 -•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address:10.0.0.1/16 options:map[]. -2021/04/30 23:31:23 [2026] [ipam] Address request failed with Address already in use -•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address:10.0.0.1/16 options:map[azure.address.id:10.0.0.2/16]. -2021/04/30 23:31:23 [2026] [ipam] Address request failed with Address already in use -•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address: options:map[azure.address.type:gateway]. -2021/04/30 23:31:23 [2026] [ipam] Address request completed with address: -•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address: options:map[azure.address.id:10.0.0.1/16]. -2021/04/30 23:31:23 [2026] [ipam] Address request completed with address: -•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address: options:map[]. -2021/04/30 23:31:23 [2026] [ipam] Address request failed with No available addresses -•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address: options:map[]. -2021/04/30 23:31:23 [2026] [ipam] Address request completed with address: -•2021/04/30 23:31:23 [2026] [ipam] Releasing address with address:0.0.0.0 options:map[]. -2021/04/30 23:31:23 [2026] [ipam] Address release completed with address:0.0.0.0 err:. -•2021/04/30 23:31:23 [2026] [ipam] Releasing address with address:0.0.0.0 options:map[]. -2021/04/30 23:31:23 [2026] [ipam] Address release completed with address:0.0.0.0 err:. -•2021/04/30 23:31:23 [2026] [ipam] Releasing address with address:10.0.0.1/16 options:map[]. -2021/04/30 23:31:23 [2026] Address not in use. Not Returning error -2021/04/30 23:31:23 [2026] [ipam] Address release completed with address:10.0.0.1/16 err:. -•2021/04/30 23:31:23 [2026] [ipam] Releasing address with address: options:map[azure.address.id:10.0.0.1/16]. -2021/04/30 23:31:23 [2026] [ipam] Address release completed with address:0.0.0.0 err:. -•2021/04/30 23:31:23 [2026] [ipam] Releasing address with address:10.0.0.1/16 options:map[]. -2021/04/30 23:31:23 [2026] Deleting Address record from address pool as metadata doesn't have this address -2021/04/30 23:31:23 [2026] [ipam] Address release completed with address:10.0.0.1/16 err:. -•2021/04/30 23:31:23 [2026] [Listener] Stopped listening on localhost:42424 - -Ran 106 of 106 Specs in 0.073 seconds -SUCCESS! -- 106 Passed | 0 Failed | 0 Pending | 0 Skipped ---- PASS: TestManager (0.07s) -=== RUN TestPool -Running Suite: Pool Suite -========================= -Random Seed: 1619825482 -Will run 106 of 106 specs - -2021/04/30 23:31:23 [2026] [Listener] Started listening on localhost:42424. -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil -2021/04/30 23:31:23 [2026] [ipam] Starting source ipv6NodeIpam. -•2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. -2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server -•2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. -2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. -2021/04/30 23:31:23 [2026] [ipam] merging address space -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server -2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:true. -2021/04/30 23:31:23 [2026] [ipam] Checking pool ace:cab:deca:deed::/126. -2021/04/30 23:31:23 [2026] [ipam] Pool ace:cab:deca:deed::/126 matches requirements. -2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as:0xc00073b9e0 Id:ace:cab:deca:deed::/126 IfName: Subnet:{IP:ace:cab:deca:deed:: Mask:fffffffffffffffffffffffffffffffc} Gateway:ace:cab:deca:deed::1 Addresses:map[ace:cab:deca:deed::2:0xc00052abc0 ace:cab:deca:deed::3:0xc00052ac00] addrsByID:map[] IsIPv6:true Priority:0 RefCount:1 epoch:1} err:. -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -•2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. -2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. -2021/04/30 23:31:23 [2026] [ipam] merging address space -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server -2021/04/30 23:31:23 [2026] [ipam] Requesting address with address:ace:cab:deca:deed::2 options:map[]. -2021/04/30 23:31:23 [2026] [ipam] Address request completed with address:ace:cab:deca:deed::2/126 -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -•2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. -2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. -2021/04/30 23:31:23 [2026] [ipam] merging address space -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server -2021/04/30 23:31:23 [2026] [ipam] Requesting address with address: options:map[]. -2021/04/30 23:31:23 [2026] [ipam] Address request completed with address:ace:cab:deca:deed::3/126 -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -•2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. -2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. -2021/04/30 23:31:23 [2026] [ipam] merging address space -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server -2021/04/30 23:31:23 [2026] [ipam] Releasing address with address: options:map[]. -2021/04/30 23:31:23 [2026] Address not found. Not Returning error -2021/04/30 23:31:23 [2026] [ipam] Address release completed with address: err:. -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -•2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. -2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. -2021/04/30 23:31:23 [2026] [ipam] merging address space -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server -2021/04/30 23:31:23 [2026] [ipam] Releasing address with address: options:map[]. -2021/04/30 23:31:23 [2026] Address not found. Not Returning error -2021/04/30 23:31:23 [2026] [ipam] Address release completed with address: err:. -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -2021/04/30 23:31:23 [2026] [ipam] Refreshing address source. -2021/04/30 23:31:23 [2026] [ipam] Discovered CIDR's [10.0.0.1/24 ace:cab:deca:deed::/64]. -2021/04/30 23:31:23 [2026] [ipam] merging address space -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from Kubernetes API Server -2021/04/30 23:31:23 [2026] [ipam] Skip releasing pool with poolId:ace:cab:deca:deed::/126. due to address being in use -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -•2021/04/30 23:31:23 [2026] [ipam] ipam store is nil -•2021/04/30 23:31:23 [2026] [ipam] reboot time 2021-04-30 21:51:59 +0000 UTC store mod time 0001-01-01 00:00:00 +0000 UTC -2021/04/30 23:31:23 [2026] [ipam] Detected Reboot -2021/04/30 23:31:23 [2026] [ipam] store key not found -•2021/04/30 23:31:23 [2026] [ipam] reboot time 2021-04-30 21:51:59 +0000 UTC store mod time 0001-01-01 00:00:00 +0000 UTC -2021/04/30 23:31:23 [2026] [ipam] Detected Reboot -2021/04/30 23:31:23 [2026] [ipam] Failed to restore state, err:Error -•2021/04/30 23:31:23 [2026] [ipam] ipam store is nil -•2021/04/30 23:31:23 [2026] [ipam] ipam store is nil -•2021/04/30 23:31:23 [2026] [ipam] reboot time 2021-04-30 21:51:59 +0000 UTC store mod time 2021-04-30 22:51:59 +0000 UTC -2021/04/30 23:31:23 [2026] [ipam] Restored state, &{Version: TimeStamp:0001-01-01 00:00:00 +0000 UTC AddrSpaces:map[as-test:0xc000519b00] store:0xc000513800 source: netApi: Mutex:{state:0 sema:0}} -•2021/04/30 23:31:23 [2026] [ipam] Restored state, &{Version: TimeStamp:0001-01-01 00:00:00 +0000 UTC AddrSpaces:map[as-test:0xc000519ef0] store:0xc000513880 source: netApi: Mutex:{state:0 sema:0}} -•2021/04/30 23:31:23 [2026] [ipam] reboot time 2021-04-30 21:51:59 +0000 UTC store mod time 0001-01-01 00:00:00 +0000 UTC -2021/04/30 23:31:23 [2026] [ipam] Detected Reboot -2021/04/30 23:31:23 [2026] [ipam] Rehydrating ipam state from persistent store -2021/04/30 23:31:23 [2026] [ipam] Restored state, &{Version: TimeStamp:0001-01-01 00:00:00 +0000 UTC AddrSpaces:map[as-test:0xc000678210] store:0xc000513900 source: netApi: Mutex:{state:0 sema:0}} -•2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -•2021/04/30 23:31:23 [2026] [ipam] Starting source azure. -•2021/04/30 23:31:23 [2026] [ipam] Starting source mas. -•2021/04/30 23:31:23 [2026] [ipam] Starting source null. -••••••••••2021/04/30 23:31:23 [2026] [ipam] Failed to find interface with MAC address:000D3A6E1825 -•2021/04/30 23:31:23 [2026] [ipam] Failed to find interface with MAC address:000D3A6E1825 -2021/04/30 23:31:23 [2026] [ipam] Address space successfully populated from config file -••••2021/04/30 23:31:23 [2026] [ipam] Failed to create address:1.1.1.6 err:Address already exists. -2021/04/30 23:31:23 [2026] [ipam] Failed to create address: err:Invalid address. -•2021/04/30 23:31:23 [2026] [ipam] Failed to create pool:{0.0.0.0/24 []} ifName:eth0 err:Address pool already exists. -2021/04/30 23:31:23 [2026] [ipam] Failed to parse subnet:invalid err:invalid CIDR address: invalid. -2021/04/30 23:31:23 [2026] [ipam] Failed to find interface with MAC address:222222222222 -•••••••••••••2021/04/30 23:31:23 [2026] [Utils] Initializing HTTP client with connection timeout: 10, response header timeout: 10 -2021/04/30 23:31:23 [2026] [ipam] Wireserver call http://localhost:42424 to retrieve IP List -2021/04/30 23:31:23 [2026] [ipam] got 1 addresses from interface lo, subnet 10.0.0.0/16 -2021/04/30 23:31:23 [2026] [ipam] got 1 addresses from interface lo, subnet 10.1.0.0/16 -•2021/04/30 23:31:23 [2026] [ipam] ipam store is nil -2021/04/30 23:31:23 [2026] [ipam] Starting source azure. -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -2021/04/30 23:31:23 [2026] [Utils] Initializing HTTP client with connection timeout: 10, response header timeout: 10 -2021/04/30 23:31:23 [2026] [ipam] Wireserver call http://localhost:42424 to retrieve IP List -2021/04/30 23:31:23 [2026] [ipam] got 1 addresses from interface lo, subnet 10.0.0.0/16 -2021/04/30 23:31:23 [2026] [ipam] got 1 addresses from interface lo, subnet 10.1.0.0/16 -2021/04/30 23:31:23 [2026] [ipam] merging address space -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -•••••••••••••2021/04/30 23:31:23 [2026] [ipam] merging address space -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -•2021/04/30 23:31:23 [2026] [ipam] merging address space -2021/04/30 23:31:23 [2026] [ipam] ipam store is nil. -•••••••••••••2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId:10.0.0.0/16 options:map[] v6:false. -2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool: err:Address pool not found. -•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId:10.0.0.0/16 options:map[] v6:false. -2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as: Id:10.0.0.0/16 IfName: Subnet:{IP: Mask:} Gateway: Addresses:map[] addrsByID:map[] IsIPv6:false Priority:0 RefCount:1 epoch:0} err:. -•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:false. -2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. -2021/04/30 23:31:23 [2026] [ipam] Pool 10.0.0.0/16 is in use. -2021/04/30 23:31:23 [2026] [ipam] Releasing pool 10.0.0.0/16 as there are no allocations -2021/04/30 23:31:23 [2026] [ipam] Pool 10.0.0.0/16 matches requirements. -2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as: Id:10.0.0.0/16 IfName: Subnet:{IP: Mask:} Gateway: Addresses:map[10.0.0.2:0xc000779ac0] addrsByID:map[] IsIPv6:false Priority:0 RefCount:1 epoch:0} err:. -•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:false. -2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. -2021/04/30 23:31:23 [2026] [ipam] Pool 10.0.0.0/16 is in use. -2021/04/30 23:31:23 [2026] [ipam] Skip releasing pool with poolId:10.0.0.0/16. due to address being in use -2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool: err:No available address pools. -•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId:10.0.0.0/16 options:map[] v6:false. -2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as: Id:10.0.0.0/16 IfName: Subnet:{IP: Mask:} Gateway: Addresses:map[10.0.0.1:0xc000779b80 10.0.0.2:0xc000779bc0] addrsByID:map[] IsIPv6:false Priority:0 RefCount:1 epoch:0} err:. -•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:true. -2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. -2021/04/30 23:31:23 [2026] [ipam] Pool is of a different address family. -2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool: err:No available address pools. -•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[azure.interface.name:en0] v6:false. -2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. -2021/04/30 23:31:23 [2026] [ipam] Pool is not on the requested interface. -2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool: err:No available address pools. -•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:false. -2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. -2021/04/30 23:31:23 [2026] [ipam] Pool 10.0.0.0/16 matches requirements. -2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as: Id:10.0.0.0/16 IfName: Subnet:{IP: Mask:} Gateway: Addresses:map[] addrsByID:map[] IsIPv6:false Priority:0 RefCount:1 epoch:0} err:. -•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:false. -2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. -2021/04/30 23:31:23 [2026] [ipam] Pool 10.0.0.0/16 matches requirements. -2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.1.0.0/16. -2021/04/30 23:31:23 [2026] [ipam] Pool 10.1.0.0/16 matches requirements. -2021/04/30 23:31:23 [2026] [ipam] Pool is preferred because of priority. -2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as: Id:10.1.0.0/16 IfName: Subnet:{IP: Mask:} Gateway: Addresses:map[] addrsByID:map[] IsIPv6:false Priority:2 RefCount:1 epoch:0} err:. -•2021/04/30 23:31:23 [2026] [ipam] Requesting pool with poolId: options:map[] v6:false. -2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.1.0.0/16. -2021/04/30 23:31:23 [2026] [ipam] Pool 10.1.0.0/16 matches requirements. -2021/04/30 23:31:23 [2026] [ipam] Checking pool 10.0.0.0/16. -2021/04/30 23:31:23 [2026] [ipam] Pool 10.0.0.0/16 matches requirements. -2021/04/30 23:31:23 [2026] [ipam] Pool request completed with pool:&{as: Id:10.1.0.0/16 IfName: Subnet:{IP: Mask:} Gateway: Addresses:map[10.1.0.1/16:0xc000779c00] addrsByID:map[] IsIPv6:false Priority:0 RefCount:1 epoch:0} err:. -••2021/04/30 23:31:23 [2026] [ipam] Releasing pool 10.0.0.0/16 as there are no allocations -•2021/04/30 23:31:23 [2026] [ipam] Skip releasing pool with poolId:10.0.0.0/16. due to address being in use -•2021/04/30 23:31:23 [2026] [ipam] Releasing pool 10.0.0.0/16 as there are no allocations -••••2021/04/30 23:31:23 [2026] [ipam] Requesting address with address:10.0.0.1/16 options:map[]. -2021/04/30 23:31:23 [2026] [ipam] Address request failed with Address not found -•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address:10.0.0.1/16 options:map[azure.address.id:10.0.0.1/16]. -2021/04/30 23:31:23 [2026] [ipam] Address request completed with address: -•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address: options:map[azure.address.id:651d7fb2-afca-4430-86a9-1184855d79bc]. -2021/04/30 23:31:23 [2026] [ipam] Address request completed with address:10.0.1.1/24 -•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address:10.0.0.1/16 options:map[]. -2021/04/30 23:31:23 [2026] [ipam] Address request failed with Address already in use -•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address:10.0.0.1/16 options:map[azure.address.id:10.0.0.2/16]. -2021/04/30 23:31:23 [2026] [ipam] Address request failed with Address already in use -•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address: options:map[azure.address.type:gateway]. -2021/04/30 23:31:23 [2026] [ipam] Address request completed with address: -•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address: options:map[azure.address.id:10.0.0.1/16]. -2021/04/30 23:31:23 [2026] [ipam] Address request completed with address: -•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address: options:map[]. -2021/04/30 23:31:23 [2026] [ipam] Address request failed with No available addresses -•2021/04/30 23:31:23 [2026] [ipam] Requesting address with address: options:map[]. -2021/04/30 23:31:23 [2026] [ipam] Address request completed with address: -•2021/04/30 23:31:23 [2026] [ipam] Releasing address with address:0.0.0.0 options:map[]. -2021/04/30 23:31:23 [2026] [ipam] Address release completed with address:0.0.0.0 err:. -•2021/04/30 23:31:23 [2026] [ipam] Releasing address with address:0.0.0.0 options:map[]. -2021/04/30 23:31:23 [2026] [ipam] Address release completed with address:0.0.0.0 err:. -•2021/04/30 23:31:23 [2026] [ipam] Releasing address with address:10.0.0.1/16 options:map[]. -2021/04/30 23:31:23 [2026] Address not in use. Not Returning error -2021/04/30 23:31:23 [2026] [ipam] Address release completed with address:10.0.0.1/16 err:. -•2021/04/30 23:31:23 [2026] [ipam] Releasing address with address: options:map[azure.address.id:10.0.0.1/16]. -2021/04/30 23:31:23 [2026] [ipam] Address release completed with address:0.0.0.0 err:. -•2021/04/30 23:31:23 [2026] [ipam] Releasing address with address:10.0.0.1/16 options:map[]. -2021/04/30 23:31:23 [2026] Deleting Address record from address pool as metadata doesn't have this address -2021/04/30 23:31:23 [2026] [ipam] Address release completed with address:10.0.0.1/16 err:. -•2021/04/30 23:31:23 [2026] [Listener] Stopped listening on localhost:42424 - -Ran 106 of 106 Specs in 0.072 seconds -SUCCESS! -- 106 Passed | 0 Failed | 0 Pending | 0 Skipped ---- PASS: TestPool (0.07s) -PASS -coverage: 5.3% of statements in ./... -ok github.com/Azure/azure-container-networking/ipam 0.718s coverage: 5.3% of statements in ./... -? github.com/Azure/azure-container-networking/iptables [no test files] -=== RUN TestLogFileRotatesWhenSizeLimitIsReached ---- PASS: TestLogFileRotatesWhenSizeLimitIsReached (0.00s) -=== RUN TestPid ---- PASS: TestPid (0.00s) -PASS -coverage: 1.1% of statements in ./... -ok github.com/Azure/azure-container-networking/log 0.196s coverage: 1.1% of statements in ./... -=== RUN TestEcho ---- PASS: TestEcho (0.00s) -=== RUN TestAddDeleteBridge ---- PASS: TestAddDeleteBridge (0.05s) -=== RUN TestAddDeleteVEth ---- PASS: TestAddDeleteVEth (0.02s) -=== RUN TestAddDeleteIPVlan ---- PASS: TestAddDeleteIPVlan (0.04s) -=== RUN TestSetLinkState ---- PASS: TestSetLinkState (0.02s) -=== RUN TestSetLinkPromisc ---- PASS: TestSetLinkPromisc (0.02s) -=== RUN TestSetLinkHairpin ---- PASS: TestSetLinkHairpin (0.11s) -=== RUN TestAddRemoveStaticArp ---- PASS: TestAddRemoveStaticArp (0.03s) -PASS -coverage: 2.8% of statements in ./... -ok github.com/Azure/azure-container-networking/netlink 0.467s coverage: 2.8% of statements in ./... -=== RUN TestEndpoint -Running Suite: Endpoint Suite -============================= -Random Seed: 1619825484 -Will run 38 of 38 specs - -2021/04/30 23:31:24 [2254] [net] Deleted ExternalInterface eth0. -•2021/04/30 23:31:24 [2254] [net] Deleted ExternalInterface eth0. -•2021/04/30 23:31:24 [2254] [net] network store is nil -•2021/04/30 23:31:24 [2254] [net] network store key not found -•2021/04/30 23:31:24 [2254] [net] Failed to restore state, err:error for test -•2021/04/30 23:31:24 [2254] [net] Restored state, &{Version: TimeStamp:0001-01-01 00:00:00 +0000 UTC ExternalInterfaces:map[eth0:0xc000591900] store:0xc000244e80 Mutex:{state:0 sema:0}} -2021/04/30 23:31:24 [2254] External Interface &{Name:eth0 Networks:map[nwId:0xc0002af2b0] Subnets:[] BridgeName: DNSInfo:{Suffix: Servers:[] Options:[]} MacAddress: IPAddresses:[] Routes:[] IPv4Gateway: IPv6Gateway:} -2021/04/30 23:31:24 [2254] Number of endpoints: 0 -••2021/04/30 23:31:24 [2254] [net] Save failed, err:error for test -•2021/04/30 23:31:24 [2254] Get number of endpoints for ifname network -•2021/04/30 23:31:24 [2254] Get number of endpoints for ifname eth0 network -•2021/04/30 23:31:24 [2254] Get number of endpoints for ifname eth0 network -•2021/04/30 23:31:24 [2254] Get number of endpoints for ifname eth0 network nwId -•2021/04/30 23:31:24 [2254] Get number of endpoints for ifname eth0 network nwId -•2021/04/30 23:31:24 [2254] Get number of endpoints for ifname eth0 network nwId -•2021/04/30 23:31:24 [2254] Get number of endpoints for ifname eth0 network nwId -••2021/04/30 23:31:24 [2254] [net] Deleted ExternalInterface eth0. -•••2021/04/30 23:31:24 [2254] [net] Creating network &{MasterIfName:eth0 AdapterName: Id: Mode: Subnets:[] PodSubnet:{Family:0 Prefix:{IP: Mask:} Gateway: PrimaryIP:} DNS:{Suffix: Servers:[] Options:[]} Policies:[] BridgeName: EnableSnatOnHost:false NetNs: Options:map[] DisableHairpinOnHostInterface:false IPV6Mode: IPAMType: ServiceCidrs:}. -2021/04/30 23:31:24 [2254] [net] Failed to create network , err:Subnet not found. -•2021/04/30 23:31:24 [2254] [net] Creating network &{MasterIfName:eth0 AdapterName: Id: Mode: Subnets:[] PodSubnet:{Family:0 Prefix:{IP: Mask:} Gateway: PrimaryIP:} DNS:{Suffix: Servers:[] Options:[]} Policies:[] BridgeName: EnableSnatOnHost:false NetNs: Options:map[] DisableHairpinOnHostInterface:false IPV6Mode: IPAMType: ServiceCidrs:}. -2021/04/30 23:31:24 [2254] [net] Failed to create network , err:Subnet not found. -•2021/04/30 23:31:24 [2254] [net] Creating network &{MasterIfName: AdapterName: Id: Mode: Subnets:[{Family:0 Prefix:{IP:10.0.0.1 Mask:ffff0000} Gateway: PrimaryIP:}] PodSubnet:{Family:0 Prefix:{IP: Mask:} Gateway: PrimaryIP:} DNS:{Suffix: Servers:[] Options:[]} Policies:[] BridgeName: EnableSnatOnHost:false NetNs: Options:map[] DisableHairpinOnHostInterface:false IPV6Mode: IPAMType: ServiceCidrs:}. -2021/04/30 23:31:24 [2254] [net] Failed to create network , err:Subnet not found. -•2021/04/30 23:31:24 [2254] [net] Creating network &{MasterIfName:eth0 AdapterName: Id:nw Mode: Subnets:[] PodSubnet:{Family:0 Prefix:{IP: Mask:} Gateway: PrimaryIP:} DNS:{Suffix: Servers:[] Options:[]} Policies:[] BridgeName: EnableSnatOnHost:false NetNs: Options:map[] DisableHairpinOnHostInterface:false IPV6Mode: IPAMType: ServiceCidrs:}. -2021/04/30 23:31:24 [2254] [net] Failed to create network nw, err:Network already exists. -•2021/04/30 23:31:24 [2254] [net] Deleting network invalid. -2021/04/30 23:31:24 [2254] [net] Failed to delete network invalid, err:Network not found. -••2021/04/30 23:31:24 [2254] Trying to retrieve endpoint id invalid -•2021/04/30 23:31:24 [2254] Trying to retrieve endpoint id epId -•2021/04/30 23:31:24 [2254] Trying to retrieve endpoint for pod name: test in namespace: ns -•2021/04/30 23:31:24 [2254] Trying to retrieve endpoint for pod name: invalid in namespace: -•2021/04/30 23:31:24 [2254] Trying to retrieve endpoint for pod name: test in namespace: ns -••2021/04/30 23:31:24 [2254] namesplit [nginx] -2021/04/30 23:31:24 [2254] namesplit [nginx deployment 5c689d88bb] -2021/04/30 23:31:24 [2254] Pod name after splitting based on - : [nginx] -2021/04/30 23:31:24 [2254] namesplit [nginx deployment 5c689d88bb qwq47] -2021/04/30 23:31:24 [2254] Pod name after splitting based on - : [nginx deployment] -••2021/04/30 23:31:24 [2254] [net] Attached endpoint to sandbox key. -••2021/04/30 23:31:24 [2254] [net] Detached endpoint from sandbox key. -•2021/04/30 23:31:24 [2254] [net] Updating existing endpoint [&{Id:test ContainerID: NetNsPath: IfName: SandboxKey: IfIndex:0 MacAddress: DNS:{Suffix: Servers:[] Options:[]} IPAddresses:[] IPsToRouteViaHost:[] InfraVnetIP:{IP: Mask:} Routes:[] Policies:[] Gateways:[] EnableSnatOnHost:false EnableInfraVnet:false EnableMultiTenancy:false EnableSnatForDns:false AllowInboundFromHostToNC:false AllowInboundFromNCToHost:false NetworkContainerID: PODName: PODNameSpace: Data:map[] InfraVnetAddressSpace: SkipHotAttachEp:false IPV6Mode: VnetCidrs: ServiceCidrs:}] in network to target [&{Id: ContainerID: NetNsPath: IfName: SandboxKey: IfIndex:0 MacAddress: DNS:{Suffix: Servers:[] Options:[]} IPAddresses:[] IPsToRouteViaHost:[] InfraVnetIP:{IP: Mask:} Routes:[] Policies:[] Gateways:[] EnableSnatOnHost:false EnableInfraVnet:false EnableMultiTenancy:false EnableSnatForDns:false AllowInboundFromHostToNC:false AllowInboundFromNCToHost:false NetworkContainerID: PODName: PODNameSpace: Data:map[] InfraVnetAddressSpace: SkipHotAttachEp:false IPV6Mode: VnetCidrs: ServiceCidrs:}]. -2021/04/30 23:31:24 [2254] Trying to retrieve endpoint id test -•2021/04/30 23:31:24 [2254] namesplit [nginx deployment 5c689d88bb] -2021/04/30 23:31:24 [2254] Pod name after splitting based on - : [nginx] -2021/04/30 23:31:24 [2254] namesplit [nginx deployment 5c689d88bb qwq47] -2021/04/30 23:31:24 [2254] Pod name after splitting based on - : [nginx deployment] -2021/04/30 23:31:24 [2254] namesplit [nginx] -• -Ran 38 of 38 Specs in 0.017 seconds -SUCCESS! -- 38 Passed | 0 Failed | 0 Pending | 0 Skipped ---- PASS: TestEndpoint (0.02s) -=== RUN TestManager -Running Suite: Manager Suite -============================ -Random Seed: 1619825484 -Will run 38 of 38 specs - -2021/04/30 23:31:24 [2254] [net] Deleted ExternalInterface eth0. -•2021/04/30 23:31:24 [2254] [net] Deleted ExternalInterface eth0. -•2021/04/30 23:31:24 [2254] [net] network store is nil -•2021/04/30 23:31:24 [2254] [net] network store key not found -•2021/04/30 23:31:24 [2254] [net] Failed to restore state, err:error for test -•2021/04/30 23:31:24 [2254] [net] Restored state, &{Version: TimeStamp:0001-01-01 00:00:00 +0000 UTC ExternalInterfaces:map[eth0:0xc0003af700] store:0xc000245200 Mutex:{state:0 sema:0}} -2021/04/30 23:31:24 [2254] External Interface &{Name:eth0 Networks:map[nwId:0xc0003d0dd0] Subnets:[] BridgeName: DNSInfo:{Suffix: Servers:[] Options:[]} MacAddress: IPAddresses:[] Routes:[] IPv4Gateway: IPv6Gateway:} -2021/04/30 23:31:24 [2254] Number of endpoints: 0 -••2021/04/30 23:31:24 [2254] [net] Save failed, err:error for test -•2021/04/30 23:31:24 [2254] Get number of endpoints for ifname network -•2021/04/30 23:31:24 [2254] Get number of endpoints for ifname eth0 network -•2021/04/30 23:31:24 [2254] Get number of endpoints for ifname eth0 network -•2021/04/30 23:31:24 [2254] Get number of endpoints for ifname eth0 network nwId -•2021/04/30 23:31:24 [2254] Get number of endpoints for ifname eth0 network nwId -•2021/04/30 23:31:24 [2254] Get number of endpoints for ifname eth0 network nwId -•2021/04/30 23:31:24 [2254] Get number of endpoints for ifname eth0 network nwId -••2021/04/30 23:31:24 [2254] [net] Deleted ExternalInterface eth0. -•••2021/04/30 23:31:24 [2254] [net] Creating network &{MasterIfName:eth0 AdapterName: Id: Mode: Subnets:[] PodSubnet:{Family:0 Prefix:{IP: Mask:} Gateway: PrimaryIP:} DNS:{Suffix: Servers:[] Options:[]} Policies:[] BridgeName: EnableSnatOnHost:false NetNs: Options:map[] DisableHairpinOnHostInterface:false IPV6Mode: IPAMType: ServiceCidrs:}. -2021/04/30 23:31:24 [2254] [net] Failed to create network , err:Subnet not found. -•2021/04/30 23:31:24 [2254] [net] Creating network &{MasterIfName:eth0 AdapterName: Id: Mode: Subnets:[] PodSubnet:{Family:0 Prefix:{IP: Mask:} Gateway: PrimaryIP:} DNS:{Suffix: Servers:[] Options:[]} Policies:[] BridgeName: EnableSnatOnHost:false NetNs: Options:map[] DisableHairpinOnHostInterface:false IPV6Mode: IPAMType: ServiceCidrs:}. -2021/04/30 23:31:24 [2254] [net] Failed to create network , err:Subnet not found. -•2021/04/30 23:31:24 [2254] [net] Creating network &{MasterIfName: AdapterName: Id: Mode: Subnets:[{Family:0 Prefix:{IP:10.0.0.1 Mask:ffff0000} Gateway: PrimaryIP:}] PodSubnet:{Family:0 Prefix:{IP: Mask:} Gateway: PrimaryIP:} DNS:{Suffix: Servers:[] Options:[]} Policies:[] BridgeName: EnableSnatOnHost:false NetNs: Options:map[] DisableHairpinOnHostInterface:false IPV6Mode: IPAMType: ServiceCidrs:}. -2021/04/30 23:31:24 [2254] [net] Failed to create network , err:Subnet not found. -•2021/04/30 23:31:24 [2254] [net] Creating network &{MasterIfName:eth0 AdapterName: Id:nw Mode: Subnets:[] PodSubnet:{Family:0 Prefix:{IP: Mask:} Gateway: PrimaryIP:} DNS:{Suffix: Servers:[] Options:[]} Policies:[] BridgeName: EnableSnatOnHost:false NetNs: Options:map[] DisableHairpinOnHostInterface:false IPV6Mode: IPAMType: ServiceCidrs:}. -2021/04/30 23:31:24 [2254] [net] Failed to create network nw, err:Network already exists. -•2021/04/30 23:31:24 [2254] [net] Deleting network invalid. -2021/04/30 23:31:24 [2254] [net] Failed to delete network invalid, err:Network not found. -••2021/04/30 23:31:24 [2254] Trying to retrieve endpoint id invalid -•2021/04/30 23:31:24 [2254] Trying to retrieve endpoint id epId -•2021/04/30 23:31:24 [2254] Trying to retrieve endpoint for pod name: test in namespace: ns -•2021/04/30 23:31:24 [2254] Trying to retrieve endpoint for pod name: invalid in namespace: -•2021/04/30 23:31:24 [2254] Trying to retrieve endpoint for pod name: test in namespace: ns -••2021/04/30 23:31:24 [2254] namesplit [nginx] -2021/04/30 23:31:24 [2254] namesplit [nginx deployment 5c689d88bb] -2021/04/30 23:31:24 [2254] Pod name after splitting based on - : [nginx] -2021/04/30 23:31:24 [2254] namesplit [nginx deployment 5c689d88bb qwq47] -2021/04/30 23:31:24 [2254] Pod name after splitting based on - : [nginx deployment] -••2021/04/30 23:31:24 [2254] [net] Attached endpoint to sandbox key. -••2021/04/30 23:31:24 [2254] [net] Detached endpoint from sandbox key. -•2021/04/30 23:31:24 [2254] [net] Updating existing endpoint [&{Id:test ContainerID: NetNsPath: IfName: SandboxKey: IfIndex:0 MacAddress: DNS:{Suffix: Servers:[] Options:[]} IPAddresses:[] IPsToRouteViaHost:[] InfraVnetIP:{IP: Mask:} Routes:[] Policies:[] Gateways:[] EnableSnatOnHost:false EnableInfraVnet:false EnableMultiTenancy:false EnableSnatForDns:false AllowInboundFromHostToNC:false AllowInboundFromNCToHost:false NetworkContainerID: PODName: PODNameSpace: Data:map[] InfraVnetAddressSpace: SkipHotAttachEp:false IPV6Mode: VnetCidrs: ServiceCidrs:}] in network to target [&{Id: ContainerID: NetNsPath: IfName: SandboxKey: IfIndex:0 MacAddress: DNS:{Suffix: Servers:[] Options:[]} IPAddresses:[] IPsToRouteViaHost:[] InfraVnetIP:{IP: Mask:} Routes:[] Policies:[] Gateways:[] EnableSnatOnHost:false EnableInfraVnet:false EnableMultiTenancy:false EnableSnatForDns:false AllowInboundFromHostToNC:false AllowInboundFromNCToHost:false NetworkContainerID: PODName: PODNameSpace: Data:map[] InfraVnetAddressSpace: SkipHotAttachEp:false IPV6Mode: VnetCidrs: ServiceCidrs:}]. -2021/04/30 23:31:24 [2254] Trying to retrieve endpoint id test -•2021/04/30 23:31:24 [2254] namesplit [nginx deployment 5c689d88bb] -2021/04/30 23:31:24 [2254] Pod name after splitting based on - : [nginx] -2021/04/30 23:31:24 [2254] namesplit [nginx deployment 5c689d88bb qwq47] -2021/04/30 23:31:24 [2254] Pod name after splitting based on - : [nginx deployment] -2021/04/30 23:31:24 [2254] namesplit [nginx] -• -Ran 38 of 38 Specs in 0.007 seconds -SUCCESS! -- 38 Passed | 0 Failed | 0 Pending | 0 Skipped ---- PASS: TestManager (0.01s) -=== RUN TestNetwork -Running Suite: Network Suite -============================ -Random Seed: 1619825484 -Will run 38 of 38 specs - -2021/04/30 23:31:24 [2254] [net] Deleted ExternalInterface eth0. -•2021/04/30 23:31:24 [2254] [net] Deleted ExternalInterface eth0. -•2021/04/30 23:31:24 [2254] [net] network store is nil -•2021/04/30 23:31:24 [2254] [net] network store key not found -•2021/04/30 23:31:24 [2254] [net] Failed to restore state, err:error for test -•2021/04/30 23:31:24 [2254] [net] Restored state, &{Version: TimeStamp:0001-01-01 00:00:00 +0000 UTC ExternalInterfaces:map[eth0:0xc000028e00] store:0xc0004b1100 Mutex:{state:0 sema:0}} -2021/04/30 23:31:24 [2254] External Interface &{Name:eth0 Networks:map[nwId:0xc000361380] Subnets:[] BridgeName: DNSInfo:{Suffix: Servers:[] Options:[]} MacAddress: IPAddresses:[] Routes:[] IPv4Gateway: IPv6Gateway:} -2021/04/30 23:31:24 [2254] Number of endpoints: 0 -••2021/04/30 23:31:24 [2254] [net] Save failed, err:error for test -•2021/04/30 23:31:24 [2254] Get number of endpoints for ifname network -•2021/04/30 23:31:24 [2254] Get number of endpoints for ifname eth0 network -•2021/04/30 23:31:24 [2254] Get number of endpoints for ifname eth0 network -•2021/04/30 23:31:24 [2254] Get number of endpoints for ifname eth0 network nwId -•2021/04/30 23:31:24 [2254] Get number of endpoints for ifname eth0 network nwId -•2021/04/30 23:31:24 [2254] Get number of endpoints for ifname eth0 network nwId -•2021/04/30 23:31:24 [2254] Get number of endpoints for ifname eth0 network nwId -••2021/04/30 23:31:24 [2254] [net] Deleted ExternalInterface eth0. -•••2021/04/30 23:31:24 [2254] [net] Creating network &{MasterIfName:eth0 AdapterName: Id: Mode: Subnets:[] PodSubnet:{Family:0 Prefix:{IP: Mask:} Gateway: PrimaryIP:} DNS:{Suffix: Servers:[] Options:[]} Policies:[] BridgeName: EnableSnatOnHost:false NetNs: Options:map[] DisableHairpinOnHostInterface:false IPV6Mode: IPAMType: ServiceCidrs:}. -2021/04/30 23:31:24 [2254] [net] Failed to create network , err:Subnet not found. -•2021/04/30 23:31:24 [2254] [net] Creating network &{MasterIfName:eth0 AdapterName: Id: Mode: Subnets:[] PodSubnet:{Family:0 Prefix:{IP: Mask:} Gateway: PrimaryIP:} DNS:{Suffix: Servers:[] Options:[]} Policies:[] BridgeName: EnableSnatOnHost:false NetNs: Options:map[] DisableHairpinOnHostInterface:false IPV6Mode: IPAMType: ServiceCidrs:}. -2021/04/30 23:31:24 [2254] [net] Failed to create network , err:Subnet not found. -•2021/04/30 23:31:24 [2254] [net] Creating network &{MasterIfName: AdapterName: Id: Mode: Subnets:[{Family:0 Prefix:{IP:10.0.0.1 Mask:ffff0000} Gateway: PrimaryIP:}] PodSubnet:{Family:0 Prefix:{IP: Mask:} Gateway: PrimaryIP:} DNS:{Suffix: Servers:[] Options:[]} Policies:[] BridgeName: EnableSnatOnHost:false NetNs: Options:map[] DisableHairpinOnHostInterface:false IPV6Mode: IPAMType: ServiceCidrs:}. -2021/04/30 23:31:24 [2254] [net] Failed to create network , err:Subnet not found. -•2021/04/30 23:31:24 [2254] [net] Creating network &{MasterIfName:eth0 AdapterName: Id:nw Mode: Subnets:[] PodSubnet:{Family:0 Prefix:{IP: Mask:} Gateway: PrimaryIP:} DNS:{Suffix: Servers:[] Options:[]} Policies:[] BridgeName: EnableSnatOnHost:false NetNs: Options:map[] DisableHairpinOnHostInterface:false IPV6Mode: IPAMType: ServiceCidrs:}. -2021/04/30 23:31:24 [2254] [net] Failed to create network nw, err:Network already exists. -•2021/04/30 23:31:24 [2254] [net] Deleting network invalid. -2021/04/30 23:31:24 [2254] [net] Failed to delete network invalid, err:Network not found. -••2021/04/30 23:31:24 [2254] Trying to retrieve endpoint id invalid -•2021/04/30 23:31:24 [2254] Trying to retrieve endpoint id epId -•2021/04/30 23:31:24 [2254] Trying to retrieve endpoint for pod name: test in namespace: ns -•2021/04/30 23:31:24 [2254] Trying to retrieve endpoint for pod name: invalid in namespace: -•2021/04/30 23:31:24 [2254] Trying to retrieve endpoint for pod name: test in namespace: ns -••2021/04/30 23:31:24 [2254] namesplit [nginx] -2021/04/30 23:31:24 [2254] namesplit [nginx deployment 5c689d88bb] -2021/04/30 23:31:24 [2254] Pod name after splitting based on - : [nginx] -2021/04/30 23:31:24 [2254] namesplit [nginx deployment 5c689d88bb qwq47] -2021/04/30 23:31:24 [2254] Pod name after splitting based on - : [nginx deployment] -••2021/04/30 23:31:24 [2254] [net] Attached endpoint to sandbox key. -••2021/04/30 23:31:24 [2254] [net] Detached endpoint from sandbox key. -•2021/04/30 23:31:24 [2254] [net] Updating existing endpoint [&{Id:test ContainerID: NetNsPath: IfName: SandboxKey: IfIndex:0 MacAddress: DNS:{Suffix: Servers:[] Options:[]} IPAddresses:[] IPsToRouteViaHost:[] InfraVnetIP:{IP: Mask:} Routes:[] Policies:[] Gateways:[] EnableSnatOnHost:false EnableInfraVnet:false EnableMultiTenancy:false EnableSnatForDns:false AllowInboundFromHostToNC:false AllowInboundFromNCToHost:false NetworkContainerID: PODName: PODNameSpace: Data:map[] InfraVnetAddressSpace: SkipHotAttachEp:false IPV6Mode: VnetCidrs: ServiceCidrs:}] in network to target [&{Id: ContainerID: NetNsPath: IfName: SandboxKey: IfIndex:0 MacAddress: DNS:{Suffix: Servers:[] Options:[]} IPAddresses:[] IPsToRouteViaHost:[] InfraVnetIP:{IP: Mask:} Routes:[] Policies:[] Gateways:[] EnableSnatOnHost:false EnableInfraVnet:false EnableMultiTenancy:false EnableSnatForDns:false AllowInboundFromHostToNC:false AllowInboundFromNCToHost:false NetworkContainerID: PODName: PODNameSpace: Data:map[] InfraVnetAddressSpace: SkipHotAttachEp:false IPV6Mode: VnetCidrs: ServiceCidrs:}]. -2021/04/30 23:31:24 [2254] Trying to retrieve endpoint id test -•2021/04/30 23:31:24 [2254] namesplit [nginx deployment 5c689d88bb] -2021/04/30 23:31:24 [2254] Pod name after splitting based on - : [nginx] -2021/04/30 23:31:24 [2254] namesplit [nginx deployment 5c689d88bb qwq47] -2021/04/30 23:31:24 [2254] Pod name after splitting based on - : [nginx deployment] -2021/04/30 23:31:24 [2254] namesplit [nginx] -• -Ran 38 of 38 Specs in 0.006 seconds -SUCCESS! -- 38 Passed | 0 Failed | 0 Pending | 0 Skipped ---- PASS: TestNetwork (0.01s) -PASS -coverage: 1.9% of statements in ./... -ok github.com/Azure/azure-container-networking/network 0.213s coverage: 1.9% of statements in ./... -? github.com/Azure/azure-container-networking/network/epcommon [no test files] -? github.com/Azure/azure-container-networking/network/ovsinfravnet [no test files] -=== RUN TestAllowInboundFromHostToNC -2021/04/30 23:31:24 [2290] [Azure-Utils] iptables -w 60 -t filter -L AZURECNIOUTPUT -2021/04/30 23:31:24 [2290] AZURECNIOUTPUT Chain exists in table filter -2021/04/30 23:31:24 [2290] [Azure-Utils] iptables -w 60 -t filter -C OUTPUT -j AZURECNIOUTPUT -2021/04/30 23:31:24 [2290] Rule already exists -2021/04/30 23:31:24 [2290] [Azure-Utils] iptables -w 60 -t filter -C AZURECNIOUTPUT -s 169.254.0.1 -d 169.254.0.4 -j ACCEPT -2021/04/30 23:31:24 [2290] [Azure-Utils] iptables -w 60 -t filter -I AZURECNIOUTPUT 1 -s 169.254.0.1 -d 169.254.0.4 -j ACCEPT -2021/04/30 23:31:24 [2290] [Azure-Utils] iptables -w 60 -t filter -L AZURECNIINPUT -2021/04/30 23:31:24 [2290] AZURECNIINPUT Chain exists in table filter -2021/04/30 23:31:24 [2290] [Azure-Utils] iptables -w 60 -t filter -C INPUT -j AZURECNIINPUT -2021/04/30 23:31:24 [2290] Rule already exists -2021/04/30 23:31:24 [2290] [Azure-Utils] iptables -w 60 -t filter -C AZURECNIINPUT -i azSnatbr -m state --state ESTABLISHED,RELATED -j ACCEPT -2021/04/30 23:31:24 [2290] Rule already exists -2021/04/30 23:31:24 [2290] Adding static arp entry for ip 169.254.0.4 mac f2:5f:c9:41:9f:a5 -2021/04/30 23:31:24 [2290] [Azure-Utils] iptables -w 60 -t filter -L AZURECNIOUTPUT -2021/04/30 23:31:24 [2290] AZURECNIOUTPUT Chain exists in table filter -2021/04/30 23:31:24 [2290] [Azure-Utils] iptables -w 60 -t filter -C OUTPUT -j AZURECNIOUTPUT -2021/04/30 23:31:24 [2290] Rule already exists -2021/04/30 23:31:24 [2290] [Azure-Utils] iptables -w 60 -t filter -C AZURECNIOUTPUT -s 169.254.0.1 -d 169.254.0.4 -j ACCEPT -2021/04/30 23:31:24 [2290] Rule already exists -2021/04/30 23:31:24 [2290] [Azure-Utils] iptables -w 60 -t filter -L AZURECNIINPUT -2021/04/30 23:31:24 [2290] AZURECNIINPUT Chain exists in table filter -2021/04/30 23:31:24 [2290] [Azure-Utils] iptables -w 60 -t filter -C INPUT -j AZURECNIINPUT -2021/04/30 23:31:24 [2290] Rule already exists -2021/04/30 23:31:24 [2290] [Azure-Utils] iptables -w 60 -t filter -C AZURECNIINPUT -i azSnatbr -m state --state ESTABLISHED,RELATED -j ACCEPT -2021/04/30 23:31:24 [2290] Rule already exists -2021/04/30 23:31:24 [2290] Adding static arp entry for ip 169.254.0.4 mac f2:5f:c9:41:9f:a5 -2021/04/30 23:31:24 [2290] [Azure-Utils] iptables -w 60 -t filter -D AZURECNIOUTPUT -s 169.254.0.1 -d 169.254.0.4 -j ACCEPT -2021/04/30 23:31:24 [2290] Removing static arp entry for ip 169.254.0.4 ---- PASS: TestAllowInboundFromHostToNC (0.16s) -=== RUN TestAllowInboundFromNCToHost -2021/04/30 23:31:24 [2290] [Azure-Utils] iptables -w 60 -t filter -L AZURECNIINPUT -2021/04/30 23:31:24 [2290] AZURECNIINPUT Chain exists in table filter -2021/04/30 23:31:24 [2290] [Azure-Utils] iptables -w 60 -t filter -C INPUT -j AZURECNIINPUT -2021/04/30 23:31:24 [2290] Rule already exists -2021/04/30 23:31:24 [2290] [Azure-Utils] iptables -w 60 -t filter -C AZURECNIINPUT -s 169.254.0.4 -d 169.254.0.1 -j ACCEPT -2021/04/30 23:31:24 [2290] [Azure-Utils] iptables -w 60 -t filter -I AZURECNIINPUT 1 -s 169.254.0.4 -d 169.254.0.1 -j ACCEPT -2021/04/30 23:31:24 [2290] [Azure-Utils] iptables -w 60 -t filter -L AZURECNIOUTPUT -2021/04/30 23:31:24 [2290] AZURECNIOUTPUT Chain exists in table filter -2021/04/30 23:31:24 [2290] [Azure-Utils] iptables -w 60 -t filter -C OUTPUT -j AZURECNIOUTPUT -2021/04/30 23:31:24 [2290] Rule already exists -2021/04/30 23:31:24 [2290] [Azure-Utils] iptables -w 60 -t filter -C AZURECNIOUTPUT -o azSnatbr -m state --state ESTABLISHED,RELATED -j ACCEPT -2021/04/30 23:31:24 [2290] Rule already exists -2021/04/30 23:31:24 [2290] Adding static arp entry for ip 169.254.0.4 mac be:da:fd:b5:15:80 -2021/04/30 23:31:24 [2290] [Azure-Utils] iptables -w 60 -t filter -L AZURECNIINPUT -2021/04/30 23:31:24 [2290] AZURECNIINPUT Chain exists in table filter -2021/04/30 23:31:24 [2290] [Azure-Utils] iptables -w 60 -t filter -C INPUT -j AZURECNIINPUT -2021/04/30 23:31:24 [2290] Rule already exists -2021/04/30 23:31:24 [2290] [Azure-Utils] iptables -w 60 -t filter -C AZURECNIINPUT -s 169.254.0.4 -d 169.254.0.1 -j ACCEPT -2021/04/30 23:31:24 [2290] Rule already exists -2021/04/30 23:31:24 [2290] [Azure-Utils] iptables -w 60 -t filter -L AZURECNIOUTPUT -2021/04/30 23:31:25 [2290] AZURECNIOUTPUT Chain exists in table filter -2021/04/30 23:31:25 [2290] [Azure-Utils] iptables -w 60 -t filter -C OUTPUT -j AZURECNIOUTPUT -2021/04/30 23:31:25 [2290] Rule already exists -2021/04/30 23:31:25 [2290] [Azure-Utils] iptables -w 60 -t filter -C AZURECNIOUTPUT -o azSnatbr -m state --state ESTABLISHED,RELATED -j ACCEPT -2021/04/30 23:31:25 [2290] Rule already exists -2021/04/30 23:31:25 [2290] Adding static arp entry for ip 169.254.0.4 mac be:da:fd:b5:15:80 -2021/04/30 23:31:25 [2290] [Azure-Utils] iptables -w 60 -t filter -D AZURECNIINPUT -s 169.254.0.4 -d 169.254.0.1 -j ACCEPT -2021/04/30 23:31:25 [2290] Removing static arp entry for ip 169.254.0.4 ---- PASS: TestAllowInboundFromNCToHost (0.14s) -PASS -coverage: 2.9% of statements in ./... -ok github.com/Azure/azure-container-networking/network/ovssnat 0.447s coverage: 2.9% of statements in ./... -? github.com/Azure/azure-container-networking/network/policy [no test files] -mock nns server started -=== RUN TestAddContainerNetworking -2021/04/30 23:31:24 [2367] [baremetal] Creating grpc connection to nns at endpoint ::6668 -Received request of type :Setup -2021/04/30 23:31:24 [2367] [baremetal] ConfigureContainerNetworking for container sf_8e9961f4-5b4f-4b3c-a9ae-c3294b0d9681 for nw namespace testnwspace succeeded with result: interfaces:{name:"azurevnet_45830dd4-1778-4735-9173-bba59b74cc8b_4ab80fb9-147e-4461-a213-56f4d44e806f" mac_address:"0036578BB0F1" network_namespace_id:"testnwspace" ipaddresses:{version:"4" ip:"10.91.149.1" prefix_length:"24" default_gateway:"10.91.148.1"}} ---- PASS: TestAddContainerNetworking (0.01s) -=== RUN TestDeleteContainerNetworking -2021/04/30 23:31:24 [2367] [baremetal] Creating grpc connection to nns at endpoint ::6668 -Received request of type :Teardown -2021/04/30 23:31:24 [2367] [baremetal] ConfigureContainerNetworking for container sf_8e9961f4-5b4f-4b3c-a9ae-c3294b0d9681 for nw namespace testnwspace succeeded with result: interfaces:{name:"azurevnet_45830dd4-1778-4735-9173-bba59b74cc8b_4ab80fb9-147e-4461-a213-56f4d44e806f" mac_address:"0036578BB0F1" network_namespace_id:"testnwspace" ipaddresses:{version:"4" ip:"10.91.149.1" prefix_length:"24" default_gateway:"10.91.148.1"}} ---- PASS: TestDeleteContainerNetworking (0.00s) -=== RUN TestAddContainerNetworkingFailure -2021/04/30 23:31:24 [2367] [baremetal] Creating grpc connection to nns at endpoint ::6668 -Received request of type :Setup -2021/04/30 23:31:24 [2367] [baremetal] ConfigureContainerNetworking for container testpod for nw namespace testnwspace failed with error: rpc error: code = Unknown desc = NnsMockServer: RequestType:Setup failed with error: Invalid PodName format. Should be in format podname_logicalContainerId. containerId should be uuid ---- PASS: TestAddContainerNetworkingFailure (0.00s) -=== RUN TestDeleteContainerNetworkingFailure -2021/04/30 23:31:24 [2367] [baremetal] Creating grpc connection to nns at endpoint ::6668 -Received request of type :Teardown -2021/04/30 23:31:24 [2367] [baremetal] ConfigureContainerNetworking for container testpod for nw namespace testnwspace failed with error: rpc error: code = Unknown desc = NnsMockServer: RequestType:Teardown failed with error: Invalid PodName format. Should be in format podname_logicalContainerId. containerId should be uuid ---- PASS: TestDeleteContainerNetworkingFailure (0.00s) -=== RUN TestAddContainerNetworkingGrpcServerDown -mock nns server stopped -2021/04/30 23:31:24 [2367] [baremetal] Creating grpc connection to nns at endpoint ::6668 -mock nns server started -Received request of type :Setup -2021/04/30 23:32:07 [2367] [baremetal] ConfigureContainerNetworking for container sf_8e9961f4-5b4f-4b3c-a9ae-c3294b0d9681 for nw namespace testnwspace succeeded with result: interfaces:{name:"azurevnet_45830dd4-1778-4735-9173-bba59b74cc8b_4ab80fb9-147e-4461-a213-56f4d44e806f" mac_address:"0036578BB0F1" network_namespace_id:"testnwspace" ipaddresses:{version:"4" ip:"10.91.149.1" prefix_length:"24" default_gateway:"10.91.148.1"}} ---- PASS: TestAddContainerNetworkingGrpcServerDown (42.81s) -PASS -coverage: 1.6% of statements in ./... -mock nns server stopped -ok github.com/Azure/azure-container-networking/nns 42.937s coverage: 1.6% of statements in ./... -? github.com/Azure/azure-container-networking/nodenetworkconfig/api/v1alpha [no test files] -2021/04/30 23:31:27 [2658] Finished initializing all Prometheus metrics -2021/04/30 23:31:27 [2658] Executing iptables command iptables [-w 60 -D FORWARD -j AZURE-NPM] -2021/04/30 23:31:27 [2658] AppInsights didn't initialized. -2021/04/30 23:31:27 [2658] Error: There was an error running command: [iptables -w 60 -D FORWARD -j AZURE-NPM] Stderr: [exit status 2, iptables v1.6.1: Couldn't load target `AZURE-NPM':No such file or directory - -Try `iptables -h' or 'iptables --help' for more information.] -2021/04/30 23:31:27 [2658] AppInsights didn't initialized. -2021/04/30 23:31:27 [2658] AppInsights didn't initialized. -2021/04/30 23:31:27 [2658] Error: failed to add default allow CONNECTED/RELATED rule to AZURE-NPM chain. -2021/04/30 23:31:27 [2658] AppInsights didn't initialized. -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-F -exist] -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-X -exist] -=== RUN TestNewNs ---- PASS: TestNewNs (0.00s) -=== RUN TestAddNamespace - nameSpaceController_test.go:79: Start storing ipset to /var/log/ipset-test.conf - nameSpaceController_test.go:104: Calling add namespace event -I0430 23:31:27.366758 2658 nameSpaceController.go:129] [NAMESPACE ADD EVENT] for namespace [test-namespace] -I0430 23:31:27.366835 2658 nameSpaceController.go:370] NAMESPACE UPDATING: - namespace: [ns-test-namespace/map[app:test-namespace]] -I0430 23:31:27.366878 2658 nameSpaceController.go:326] NAMESPACE CREATING: [ns-test-namespace/map[app:test-namespace]] -2021/04/30 23:31:27 [2658] Creating Set: &{operationFlag:-N name:ns-test-namespace set:azure-npm-2293040867 spec:[nethash]} -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-2293040867 nethash] -I0430 23:31:27.368223 2658 nameSpaceController.go:129] [NAMESPACE UPDATE EVENT] for namespace [test-namespace] -I0430 23:31:27.368278 2658 nameSpaceController.go:155] [NAMESPACE UPDATE EVENT] Resourceversion is same for this namespace [test-namespace] -2021/04/30 23:31:27 [2658] Creating List: &{operationFlag:-N name:all-namespaces set:azure-npm-530439631 spec:[setlist]} -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-530439631 setlist] -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-A -exist azure-npm-530439631 azure-npm-2293040867] -I0430 23:31:27.374013 2658 nameSpaceController.go:346] Adding namespace ns-test-namespace to ipset list ns-app -2021/04/30 23:31:27 [2658] Creating List: &{operationFlag:-N name:ns-app set:azure-npm-38964400 spec:[setlist]} -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-38964400 setlist] -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-A -exist azure-npm-38964400 azure-npm-2293040867] -I0430 23:31:27.378178 2658 nameSpaceController.go:353] Adding namespace ns-test-namespace to ipset list ns-app:test-namespace -2021/04/30 23:31:27 [2658] Creating List: &{operationFlag:-N name:ns-app:test-namespace set:azure-npm-3308517892 spec:[setlist]} -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-3308517892 setlist] -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-A -exist azure-npm-3308517892 azure-npm-2293040867] -I0430 23:31:27.394061 2658 nameSpaceController.go:269] Successfully synced 'test-namespace' - nameSpaceController_test.go:87: Start re-storing ipset to /var/log/ipset-test.conf -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-F -exist] -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-X -exist] ---- PASS: TestAddNamespace (0.06s) -=== RUN TestUpdateNamespace - nameSpaceController_test.go:79: Start storing ipset to /var/log/ipset-test.conf - nameSpaceController_test.go:104: Calling add namespace event -I0430 23:31:27.419814 2658 nameSpaceController.go:129] [NAMESPACE ADD EVENT] for namespace [test-namespace] -I0430 23:31:27.419896 2658 nameSpaceController.go:370] NAMESPACE UPDATING: - namespace: [ns-test-namespace/map[app:test-namespace]] -I0430 23:31:27.419931 2658 nameSpaceController.go:326] NAMESPACE CREATING: [ns-test-namespace/map[app:test-namespace]] -2021/04/30 23:31:27 [2658] Creating Set: &{operationFlag:-N name:ns-test-namespace set:azure-npm-2293040867 spec:[nethash]} -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-2293040867 nethash] -I0430 23:31:27.420832 2658 nameSpaceController.go:129] [NAMESPACE UPDATE EVENT] for namespace [test-namespace] -I0430 23:31:27.420872 2658 nameSpaceController.go:155] [NAMESPACE UPDATE EVENT] Resourceversion is same for this namespace [test-namespace] -2021/04/30 23:31:27 [2658] Creating List: &{operationFlag:-N name:all-namespaces set:azure-npm-530439631 spec:[setlist]} -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-530439631 setlist] -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-A -exist azure-npm-530439631 azure-npm-2293040867] -I0430 23:31:27.424887 2658 nameSpaceController.go:346] Adding namespace ns-test-namespace to ipset list ns-app -2021/04/30 23:31:27 [2658] Creating List: &{operationFlag:-N name:ns-app set:azure-npm-38964400 spec:[setlist]} -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-38964400 setlist] -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-A -exist azure-npm-38964400 azure-npm-2293040867] -I0430 23:31:27.434395 2658 nameSpaceController.go:353] Adding namespace ns-test-namespace to ipset list ns-app:test-namespace -2021/04/30 23:31:27 [2658] Creating List: &{operationFlag:-N name:ns-app:test-namespace set:azure-npm-3308517892 spec:[setlist]} -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-3308517892 setlist] -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-A -exist azure-npm-3308517892 azure-npm-2293040867] -I0430 23:31:27.438788 2658 nameSpaceController.go:269] Successfully synced 'test-namespace' - nameSpaceController_test.go:115: Complete add namespace event - nameSpaceController_test.go:117: Updating kubeinformer namespace object - nameSpaceController_test.go:120: Calling update namespace event -I0430 23:31:27.438916 2658 nameSpaceController.go:129] [NAMESPACE UPDATE EVENT] for namespace [test-namespace] -I0430 23:31:27.438963 2658 nameSpaceController.go:370] NAMESPACE UPDATING: - namespace: [ns-test-namespace/map[app:new-test-namespace]] -I0430 23:31:27.438990 2658 nameSpaceController.go:394] Deleting namespace ns-test-namespace from ipset list ns-app:test-namespace -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-D -exist azure-npm-3308517892 azure-npm-2293040867] -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-X -exist azure-npm-3308517892] -I0430 23:31:27.461516 2658 nameSpaceController.go:411] Adding namespace ns-test-namespace to ipset list ns-app:new-test-namespace -2021/04/30 23:31:27 [2658] Creating List: &{operationFlag:-N name:ns-app:new-test-namespace set:azure-npm-4070642153 spec:[setlist]} -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-4070642153 setlist] -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-A -exist azure-npm-4070642153 azure-npm-2293040867] -I0430 23:31:27.463265 2658 nameSpaceController.go:269] Successfully synced 'test-namespace' - nameSpaceController_test.go:87: Start re-storing ipset to /var/log/ipset-test.conf -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-F -exist] -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-X -exist] ---- PASS: TestUpdateNamespace (0.08s) -=== RUN TestAddNamespaceLabel - nameSpaceController_test.go:79: Start storing ipset to /var/log/ipset-test.conf - nameSpaceController_test.go:104: Calling add namespace event -I0430 23:31:27.495620 2658 nameSpaceController.go:129] [NAMESPACE ADD EVENT] for namespace [test-namespace] -I0430 23:31:27.495679 2658 nameSpaceController.go:370] NAMESPACE UPDATING: - namespace: [ns-test-namespace/map[app:test-namespace]] -I0430 23:31:27.495730 2658 nameSpaceController.go:326] NAMESPACE CREATING: [ns-test-namespace/map[app:test-namespace]] -2021/04/30 23:31:27 [2658] Creating Set: &{operationFlag:-N name:ns-test-namespace set:azure-npm-2293040867 spec:[nethash]} -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-2293040867 nethash] -I0430 23:31:27.496279 2658 nameSpaceController.go:129] [NAMESPACE UPDATE EVENT] for namespace [test-namespace] -I0430 23:31:27.496311 2658 nameSpaceController.go:155] [NAMESPACE UPDATE EVENT] Resourceversion is same for this namespace [test-namespace] -2021/04/30 23:31:27 [2658] Creating List: &{operationFlag:-N name:all-namespaces set:azure-npm-530439631 spec:[setlist]} -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-530439631 setlist] -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-A -exist azure-npm-530439631 azure-npm-2293040867] -I0430 23:31:27.499644 2658 nameSpaceController.go:346] Adding namespace ns-test-namespace to ipset list ns-app -2021/04/30 23:31:27 [2658] Creating List: &{operationFlag:-N name:ns-app set:azure-npm-38964400 spec:[setlist]} -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-38964400 setlist] -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-A -exist azure-npm-38964400 azure-npm-2293040867] -I0430 23:31:27.501309 2658 nameSpaceController.go:353] Adding namespace ns-test-namespace to ipset list ns-app:test-namespace -2021/04/30 23:31:27 [2658] Creating List: &{operationFlag:-N name:ns-app:test-namespace set:azure-npm-3308517892 spec:[setlist]} -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-3308517892 setlist] -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-A -exist azure-npm-3308517892 azure-npm-2293040867] -I0430 23:31:27.521212 2658 nameSpaceController.go:269] Successfully synced 'test-namespace' - nameSpaceController_test.go:115: Complete add namespace event - nameSpaceController_test.go:117: Updating kubeinformer namespace object - nameSpaceController_test.go:120: Calling update namespace event -I0430 23:31:27.521534 2658 nameSpaceController.go:129] [NAMESPACE UPDATE EVENT] for namespace [test-namespace] -I0430 23:31:27.521588 2658 nameSpaceController.go:370] NAMESPACE UPDATING: - namespace: [ns-test-namespace/map[app:new-test-namespace update:true]] -I0430 23:31:27.521646 2658 nameSpaceController.go:394] Deleting namespace ns-test-namespace from ipset list ns-app:test-namespace -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-D -exist azure-npm-3308517892 azure-npm-2293040867] -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-X -exist azure-npm-3308517892] -I0430 23:31:27.549611 2658 nameSpaceController.go:411] Adding namespace ns-test-namespace to ipset list ns-app:new-test-namespace -2021/04/30 23:31:27 [2658] Creating List: &{operationFlag:-N name:ns-app:new-test-namespace set:azure-npm-4070642153 spec:[setlist]} -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-4070642153 setlist] -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-A -exist azure-npm-4070642153 azure-npm-2293040867] -I0430 23:31:27.551833 2658 nameSpaceController.go:411] Adding namespace ns-test-namespace to ipset list ns-update -2021/04/30 23:31:27 [2658] Creating List: &{operationFlag:-N name:ns-update set:azure-npm-1460180784 spec:[setlist]} -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-1460180784 setlist] -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-A -exist azure-npm-1460180784 azure-npm-2293040867] -I0430 23:31:27.554128 2658 nameSpaceController.go:411] Adding namespace ns-test-namespace to ipset list ns-update:true -2021/04/30 23:31:27 [2658] Creating List: &{operationFlag:-N name:ns-update:true set:azure-npm-1082004050 spec:[setlist]} -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-1082004050 setlist] -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-A -exist azure-npm-1082004050 azure-npm-2293040867] -I0430 23:31:27.556817 2658 nameSpaceController.go:269] Successfully synced 'test-namespace' - nameSpaceController_test.go:87: Start re-storing ipset to /var/log/ipset-test.conf -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-F -exist] -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-X -exist] ---- PASS: TestAddNamespaceLabel (0.10s) -=== RUN TestAddNamespaceLabelSameRv - nameSpaceController_test.go:79: Start storing ipset to /var/log/ipset-test.conf - nameSpaceController_test.go:104: Calling add namespace event -I0430 23:31:27.592625 2658 nameSpaceController.go:129] [NAMESPACE ADD EVENT] for namespace [test-namespace] -I0430 23:31:27.592709 2658 nameSpaceController.go:370] NAMESPACE UPDATING: - namespace: [ns-test-namespace/map[app:test-namespace]] -I0430 23:31:27.592751 2658 nameSpaceController.go:326] NAMESPACE CREATING: [ns-test-namespace/map[app:test-namespace]] -2021/04/30 23:31:27 [2658] Creating Set: &{operationFlag:-N name:ns-test-namespace set:azure-npm-2293040867 spec:[nethash]} -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-2293040867 nethash] -2021/04/30 23:31:27 [2658] Creating List: &{operationFlag:-N name:all-namespaces set:azure-npm-530439631 spec:[setlist]} -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-530439631 setlist] -I0430 23:31:27.594400 2658 nameSpaceController.go:129] [NAMESPACE UPDATE EVENT] for namespace [test-namespace] -I0430 23:31:27.594442 2658 nameSpaceController.go:155] [NAMESPACE UPDATE EVENT] Resourceversion is same for this namespace [test-namespace] -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-A -exist azure-npm-530439631 azure-npm-2293040867] -I0430 23:31:27.603817 2658 nameSpaceController.go:346] Adding namespace ns-test-namespace to ipset list ns-app -2021/04/30 23:31:27 [2658] Creating List: &{operationFlag:-N name:ns-app set:azure-npm-38964400 spec:[setlist]} -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-38964400 setlist] -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-A -exist azure-npm-38964400 azure-npm-2293040867] -I0430 23:31:27.606698 2658 nameSpaceController.go:353] Adding namespace ns-test-namespace to ipset list ns-app:test-namespace -2021/04/30 23:31:27 [2658] Creating List: &{operationFlag:-N name:ns-app:test-namespace set:azure-npm-3308517892 spec:[setlist]} -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-3308517892 setlist] -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-A -exist azure-npm-3308517892 azure-npm-2293040867] -I0430 23:31:27.609433 2658 nameSpaceController.go:269] Successfully synced 'test-namespace' - nameSpaceController_test.go:115: Complete add namespace event - nameSpaceController_test.go:117: Updating kubeinformer namespace object - nameSpaceController_test.go:120: Calling update namespace event -I0430 23:31:27.609569 2658 nameSpaceController.go:129] [NAMESPACE UPDATE EVENT] for namespace [test-namespace] -I0430 23:31:27.609588 2658 nameSpaceController.go:155] [NAMESPACE UPDATE EVENT] Resourceversion is same for this namespace [test-namespace] - nameSpaceController_test.go:123: Update Namespace: worker queue length is 0 - nameSpaceController_test.go:87: Start re-storing ipset to /var/log/ipset-test.conf -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-F -exist] -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-X -exist] ---- PASS: TestAddNamespaceLabelSameRv (0.04s) -=== RUN TestDeleteandUpdateNamespaceLabel - nameSpaceController_test.go:79: Start storing ipset to /var/log/ipset-test.conf - nameSpaceController_test.go:104: Calling add namespace event -I0430 23:31:27.636088 2658 nameSpaceController.go:129] [NAMESPACE ADD EVENT] for namespace [test-namespace] -I0430 23:31:27.636188 2658 nameSpaceController.go:370] NAMESPACE UPDATING: - namespace: [ns-test-namespace/map[app:old-test-namespace group:test update:true]] -I0430 23:31:27.636276 2658 nameSpaceController.go:326] NAMESPACE CREATING: [ns-test-namespace/map[app:old-test-namespace group:test update:true]] -2021/04/30 23:31:27 [2658] Creating Set: &{operationFlag:-N name:ns-test-namespace set:azure-npm-2293040867 spec:[nethash]} -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-2293040867 nethash] -I0430 23:31:27.636552 2658 nameSpaceController.go:129] [NAMESPACE UPDATE EVENT] for namespace [test-namespace] -I0430 23:31:27.636601 2658 nameSpaceController.go:155] [NAMESPACE UPDATE EVENT] Resourceversion is same for this namespace [test-namespace] -2021/04/30 23:31:27 [2658] Creating List: &{operationFlag:-N name:all-namespaces set:azure-npm-530439631 spec:[setlist]} -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-530439631 setlist] -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-A -exist azure-npm-530439631 azure-npm-2293040867] -I0430 23:31:27.639893 2658 nameSpaceController.go:346] Adding namespace ns-test-namespace to ipset list ns-update -2021/04/30 23:31:27 [2658] Creating List: &{operationFlag:-N name:ns-update set:azure-npm-1460180784 spec:[setlist]} -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-1460180784 setlist] -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-A -exist azure-npm-1460180784 azure-npm-2293040867] -I0430 23:31:27.642381 2658 nameSpaceController.go:353] Adding namespace ns-test-namespace to ipset list ns-update:true -2021/04/30 23:31:27 [2658] Creating List: &{operationFlag:-N name:ns-update:true set:azure-npm-1082004050 spec:[setlist]} -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-1082004050 setlist] -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-A -exist azure-npm-1082004050 azure-npm-2293040867] -I0430 23:31:27.644487 2658 nameSpaceController.go:346] Adding namespace ns-test-namespace to ipset list ns-group -2021/04/30 23:31:27 [2658] Creating List: &{operationFlag:-N name:ns-group set:azure-npm-3501174184 spec:[setlist]} -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-3501174184 setlist] -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-A -exist azure-npm-3501174184 azure-npm-2293040867] -I0430 23:31:27.655049 2658 nameSpaceController.go:353] Adding namespace ns-test-namespace to ipset list ns-group:test -2021/04/30 23:31:27 [2658] Creating List: &{operationFlag:-N name:ns-group:test set:azure-npm-3079734622 spec:[setlist]} -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-3079734622 setlist] -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-A -exist azure-npm-3079734622 azure-npm-2293040867] -I0430 23:31:27.657064 2658 nameSpaceController.go:346] Adding namespace ns-test-namespace to ipset list ns-app -2021/04/30 23:31:27 [2658] Creating List: &{operationFlag:-N name:ns-app set:azure-npm-38964400 spec:[setlist]} -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-38964400 setlist] -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-A -exist azure-npm-38964400 azure-npm-2293040867] -I0430 23:31:27.659011 2658 nameSpaceController.go:353] Adding namespace ns-test-namespace to ipset list ns-app:old-test-namespace -2021/04/30 23:31:27 [2658] Creating List: &{operationFlag:-N name:ns-app:old-test-namespace set:azure-npm-442393800 spec:[setlist]} -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-442393800 setlist] -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-A -exist azure-npm-442393800 azure-npm-2293040867] -I0430 23:31:27.661658 2658 nameSpaceController.go:269] Successfully synced 'test-namespace' - nameSpaceController_test.go:115: Complete add namespace event - nameSpaceController_test.go:117: Updating kubeinformer namespace object - nameSpaceController_test.go:120: Calling update namespace event -I0430 23:31:27.661769 2658 nameSpaceController.go:129] [NAMESPACE UPDATE EVENT] for namespace [test-namespace] -I0430 23:31:27.661809 2658 nameSpaceController.go:370] NAMESPACE UPDATING: - namespace: [ns-test-namespace/map[app:old-test-namespace update:false]] -I0430 23:31:27.661844 2658 nameSpaceController.go:394] Deleting namespace ns-test-namespace from ipset list ns-group -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-D -exist azure-npm-3501174184 azure-npm-2293040867] -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-X -exist azure-npm-3501174184] -I0430 23:31:27.681613 2658 nameSpaceController.go:394] Deleting namespace ns-test-namespace from ipset list ns-group:test -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-D -exist azure-npm-3079734622 azure-npm-2293040867] -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-X -exist azure-npm-3079734622] -I0430 23:31:27.709567 2658 nameSpaceController.go:394] Deleting namespace ns-test-namespace from ipset list ns-update:true -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-D -exist azure-npm-1082004050 azure-npm-2293040867] -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-X -exist azure-npm-1082004050] -I0430 23:31:27.733563 2658 nameSpaceController.go:411] Adding namespace ns-test-namespace to ipset list ns-update:false -2021/04/30 23:31:27 [2658] Creating List: &{operationFlag:-N name:ns-update:false set:azure-npm-250870597 spec:[setlist]} -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-250870597 setlist] -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-A -exist azure-npm-250870597 azure-npm-2293040867] -I0430 23:31:27.735260 2658 nameSpaceController.go:269] Successfully synced 'test-namespace' - nameSpaceController_test.go:87: Start re-storing ipset to /var/log/ipset-test.conf -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-F -exist] -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-X -exist] ---- PASS: TestDeleteandUpdateNamespaceLabel (0.12s) -=== RUN TestNewNameSpaceUpdate - nameSpaceController_test.go:79: Start storing ipset to /var/log/ipset-test.conf - nameSpaceController_test.go:104: Calling add namespace event -I0430 23:31:27.759580 2658 nameSpaceController.go:129] [NAMESPACE ADD EVENT] for namespace [test-namespace] -I0430 23:31:27.759631 2658 nameSpaceController.go:370] NAMESPACE UPDATING: - namespace: [ns-test-namespace/map[app:old-test-namespace group:test update:true]] -I0430 23:31:27.759689 2658 nameSpaceController.go:326] NAMESPACE CREATING: [ns-test-namespace/map[app:old-test-namespace group:test update:true]] -2021/04/30 23:31:27 [2658] Creating Set: &{operationFlag:-N name:ns-test-namespace set:azure-npm-2293040867 spec:[nethash]} -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-2293040867 nethash] -I0430 23:31:27.760110 2658 nameSpaceController.go:129] [NAMESPACE UPDATE EVENT] for namespace [test-namespace] -I0430 23:31:27.760139 2658 nameSpaceController.go:155] [NAMESPACE UPDATE EVENT] Resourceversion is same for this namespace [test-namespace] -2021/04/30 23:31:27 [2658] Creating List: &{operationFlag:-N name:all-namespaces set:azure-npm-530439631 spec:[setlist]} -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-530439631 setlist] -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-A -exist azure-npm-530439631 azure-npm-2293040867] -I0430 23:31:27.762505 2658 nameSpaceController.go:346] Adding namespace ns-test-namespace to ipset list ns-app -2021/04/30 23:31:27 [2658] Creating List: &{operationFlag:-N name:ns-app set:azure-npm-38964400 spec:[setlist]} -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-38964400 setlist] -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-A -exist azure-npm-38964400 azure-npm-2293040867] -I0430 23:31:27.764073 2658 nameSpaceController.go:353] Adding namespace ns-test-namespace to ipset list ns-app:old-test-namespace -2021/04/30 23:31:27 [2658] Creating List: &{operationFlag:-N name:ns-app:old-test-namespace set:azure-npm-442393800 spec:[setlist]} -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-442393800 setlist] -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-A -exist azure-npm-442393800 azure-npm-2293040867] -I0430 23:31:27.765752 2658 nameSpaceController.go:346] Adding namespace ns-test-namespace to ipset list ns-update -2021/04/30 23:31:27 [2658] Creating List: &{operationFlag:-N name:ns-update set:azure-npm-1460180784 spec:[setlist]} -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-1460180784 setlist] -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-A -exist azure-npm-1460180784 azure-npm-2293040867] -I0430 23:31:27.767964 2658 nameSpaceController.go:353] Adding namespace ns-test-namespace to ipset list ns-update:true -2021/04/30 23:31:27 [2658] Creating List: &{operationFlag:-N name:ns-update:true set:azure-npm-1082004050 spec:[setlist]} -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-1082004050 setlist] -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-A -exist azure-npm-1082004050 azure-npm-2293040867] -I0430 23:31:27.769836 2658 nameSpaceController.go:346] Adding namespace ns-test-namespace to ipset list ns-group -2021/04/30 23:31:27 [2658] Creating List: &{operationFlag:-N name:ns-group set:azure-npm-3501174184 spec:[setlist]} -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-3501174184 setlist] -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-A -exist azure-npm-3501174184 azure-npm-2293040867] -I0430 23:31:27.771694 2658 nameSpaceController.go:353] Adding namespace ns-test-namespace to ipset list ns-group:test -2021/04/30 23:31:27 [2658] Creating List: &{operationFlag:-N name:ns-group:test set:azure-npm-3079734622 spec:[setlist]} -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-3079734622 setlist] -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-A -exist azure-npm-3079734622 azure-npm-2293040867] -I0430 23:31:27.773425 2658 nameSpaceController.go:269] Successfully synced 'test-namespace' - nameSpaceController_test.go:115: Complete add namespace event - nameSpaceController_test.go:117: Updating kubeinformer namespace object - nameSpaceController_test.go:120: Calling update namespace event -I0430 23:31:27.773644 2658 nameSpaceController.go:129] [NAMESPACE UPDATE EVENT] for namespace [test-namespace] -I0430 23:31:27.773691 2658 nameSpaceController.go:370] NAMESPACE UPDATING: - namespace: [ns-test-namespace/map[app:old-test-namespace update:false]] -I0430 23:31:27.773756 2658 nameSpaceController.go:394] Deleting namespace ns-test-namespace from ipset list ns-update:true -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-D -exist azure-npm-1082004050 azure-npm-2293040867] -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-X -exist azure-npm-1082004050] -I0430 23:31:27.805570 2658 nameSpaceController.go:394] Deleting namespace ns-test-namespace from ipset list ns-group -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-D -exist azure-npm-3501174184 azure-npm-2293040867] -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-X -exist azure-npm-3501174184] -I0430 23:31:27.825686 2658 nameSpaceController.go:394] Deleting namespace ns-test-namespace from ipset list ns-group:test -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-D -exist azure-npm-3079734622 azure-npm-2293040867] -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-X -exist azure-npm-3079734622] -I0430 23:31:27.845537 2658 nameSpaceController.go:411] Adding namespace ns-test-namespace to ipset list ns-update:false -2021/04/30 23:31:27 [2658] Creating List: &{operationFlag:-N name:ns-update:false set:azure-npm-250870597 spec:[setlist]} -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-250870597 setlist] -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-A -exist azure-npm-250870597 azure-npm-2293040867] -I0430 23:31:27.847505 2658 nameSpaceController.go:269] Successfully synced 'test-namespace' - nameSpaceController_test.go:87: Start re-storing ipset to /var/log/ipset-test.conf -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-F -exist] -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-X -exist] ---- PASS: TestNewNameSpaceUpdate (0.11s) -=== RUN TestDeleteNamespace - nameSpaceController_test.go:79: Start storing ipset to /var/log/ipset-test.conf - nameSpaceController_test.go:104: Calling add namespace event -I0430 23:31:27.867872 2658 nameSpaceController.go:129] [NAMESPACE ADD EVENT] for namespace [test-namespace] -I0430 23:31:27.867933 2658 nameSpaceController.go:370] NAMESPACE UPDATING: - namespace: [ns-test-namespace/map[app:test-namespace]] -I0430 23:31:27.867964 2658 nameSpaceController.go:326] NAMESPACE CREATING: [ns-test-namespace/map[app:test-namespace]] -2021/04/30 23:31:27 [2658] Creating Set: &{operationFlag:-N name:ns-test-namespace set:azure-npm-2293040867 spec:[nethash]} -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-2293040867 nethash] -I0430 23:31:27.868447 2658 nameSpaceController.go:129] [NAMESPACE UPDATE EVENT] for namespace [test-namespace] -I0430 23:31:27.868502 2658 nameSpaceController.go:155] [NAMESPACE UPDATE EVENT] Resourceversion is same for this namespace [test-namespace] -2021/04/30 23:31:27 [2658] Creating List: &{operationFlag:-N name:all-namespaces set:azure-npm-530439631 spec:[setlist]} -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-530439631 setlist] -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-A -exist azure-npm-530439631 azure-npm-2293040867] -I0430 23:31:27.870813 2658 nameSpaceController.go:346] Adding namespace ns-test-namespace to ipset list ns-app -2021/04/30 23:31:27 [2658] Creating List: &{operationFlag:-N name:ns-app set:azure-npm-38964400 spec:[setlist]} -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-38964400 setlist] -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-A -exist azure-npm-38964400 azure-npm-2293040867] -I0430 23:31:27.872659 2658 nameSpaceController.go:353] Adding namespace ns-test-namespace to ipset list ns-app:test-namespace -2021/04/30 23:31:27 [2658] Creating List: &{operationFlag:-N name:ns-app:test-namespace set:azure-npm-3308517892 spec:[setlist]} -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-N -exist azure-npm-3308517892 setlist] -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-A -exist azure-npm-3308517892 azure-npm-2293040867] -I0430 23:31:27.874437 2658 nameSpaceController.go:269] Successfully synced 'test-namespace' - nameSpaceController_test.go:131: Complete add namespace event - nameSpaceController_test.go:133: Updating kubeinformer namespace object - nameSpaceController_test.go:136: Calling delete namespace event -I0430 23:31:27.874679 2658 nameSpaceController.go:291] NameSpace test-namespace not found, may be it is deleted -I0430 23:31:27.874715 2658 nameSpaceController.go:435] NAMESPACE DELETING: [ns-test-namespace] -I0430 23:31:27.874749 2658 nameSpaceController.go:442] NAMESPACE DELETING cached labels: [ns-test-namespace/map[app:test-namespace]] -I0430 23:31:27.874805 2658 nameSpaceController.go:449] Deleting namespace ns-test-namespace from ipset list ns-app -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-D -exist azure-npm-38964400 azure-npm-2293040867] -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-X -exist azure-npm-38964400] -I0430 23:31:27.901547 2658 nameSpaceController.go:456] Deleting namespace ns-test-namespace from ipset list ns-app:test-namespace -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-D -exist azure-npm-3308517892 azure-npm-2293040867] -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-X -exist azure-npm-3308517892] -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-D -exist azure-npm-530439631 azure-npm-2293040867] -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-X -exist azure-npm-530439631] -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-X -exist azure-npm-2293040867] -I0430 23:31:27.981625 2658 nameSpaceController.go:269] Successfully synced 'test-namespace' - nameSpaceController_test.go:87: Start re-storing ipset to /var/log/ipset-test.conf -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-F -exist] -2021/04/30 23:31:27 [2658] Executing ipset command ipset [-X -exist] ---- PASS: TestDeleteNamespace (0.16s) -=== RUN TestDeleteNamespaceWithTombstone - nameSpaceController_test.go:79: Start storing ipset to /var/log/ipset-test.conf -I0430 23:31:28.023614 2658 nameSpaceController.go:208] [NAMESPACE DELETE EVENT] Namespace [test-namespace] does not exist in case, so returning - nameSpaceController_test.go:87: Start re-storing ipset to /var/log/ipset-test.conf -2021/04/30 23:31:28 [2658] Executing ipset command ipset [-F -exist] -2021/04/30 23:31:28 [2658] Executing ipset command ipset [-X -exist] ---- PASS: TestDeleteNamespaceWithTombstone (0.03s) -=== RUN TestDeleteNamespaceWithTombstoneAfterAddingNameSpace - nameSpaceController_test.go:104: Calling add namespace event -I0430 23:31:28.050863 2658 nameSpaceController.go:129] [NAMESPACE ADD EVENT] for namespace [test-namespace] -I0430 23:31:28.050938 2658 nameSpaceController.go:370] NAMESPACE UPDATING: - namespace: [ns-test-namespace/map[app:test-namespace]] -I0430 23:31:28.050971 2658 nameSpaceController.go:326] NAMESPACE CREATING: [ns-test-namespace/map[app:test-namespace]] -2021/04/30 23:31:28 [2658] Creating Set: &{operationFlag:-N name:ns-test-namespace set:azure-npm-2293040867 spec:[nethash]} -2021/04/30 23:31:28 [2658] Executing ipset command ipset [-N -exist azure-npm-2293040867 nethash] -I0430 23:31:28.052055 2658 nameSpaceController.go:129] [NAMESPACE UPDATE EVENT] for namespace [test-namespace] -I0430 23:31:28.052090 2658 nameSpaceController.go:155] [NAMESPACE UPDATE EVENT] Resourceversion is same for this namespace [test-namespace] -2021/04/30 23:31:28 [2658] Creating List: &{operationFlag:-N name:all-namespaces set:azure-npm-530439631 spec:[setlist]} -2021/04/30 23:31:28 [2658] Executing ipset command ipset [-N -exist azure-npm-530439631 setlist] -2021/04/30 23:31:28 [2658] Executing ipset command ipset [-A -exist azure-npm-530439631 azure-npm-2293040867] -I0430 23:31:28.081487 2658 nameSpaceController.go:346] Adding namespace ns-test-namespace to ipset list ns-app -2021/04/30 23:31:28 [2658] Creating List: &{operationFlag:-N name:ns-app set:azure-npm-38964400 spec:[setlist]} -2021/04/30 23:31:28 [2658] Executing ipset command ipset [-N -exist azure-npm-38964400 setlist] -2021/04/30 23:31:28 [2658] Executing ipset command ipset [-A -exist azure-npm-38964400 azure-npm-2293040867] -I0430 23:31:28.092469 2658 nameSpaceController.go:353] Adding namespace ns-test-namespace to ipset list ns-app:test-namespace -2021/04/30 23:31:28 [2658] Creating List: &{operationFlag:-N name:ns-app:test-namespace set:azure-npm-3308517892 spec:[setlist]} -2021/04/30 23:31:28 [2658] Executing ipset command ipset [-N -exist azure-npm-3308517892 setlist] -2021/04/30 23:31:28 [2658] Executing ipset command ipset [-A -exist azure-npm-3308517892 azure-npm-2293040867] -I0430 23:31:28.101060 2658 nameSpaceController.go:269] Successfully synced 'test-namespace' - nameSpaceController_test.go:131: Complete add namespace event - nameSpaceController_test.go:133: Updating kubeinformer namespace object - nameSpaceController_test.go:136: Calling delete namespace event -I0430 23:31:28.101336 2658 nameSpaceController.go:291] NameSpace test-namespace not found, may be it is deleted -I0430 23:31:28.101376 2658 nameSpaceController.go:435] NAMESPACE DELETING: [ns-test-namespace] -I0430 23:31:28.101411 2658 nameSpaceController.go:442] NAMESPACE DELETING cached labels: [ns-test-namespace/map[app:test-namespace]] -I0430 23:31:28.101458 2658 nameSpaceController.go:449] Deleting namespace ns-test-namespace from ipset list ns-app -2021/04/30 23:31:28 [2658] Executing ipset command ipset [-D -exist azure-npm-38964400 azure-npm-2293040867] -2021/04/30 23:31:28 [2658] Executing ipset command ipset [-X -exist azure-npm-38964400] -I0430 23:31:28.141600 2658 nameSpaceController.go:456] Deleting namespace ns-test-namespace from ipset list ns-app:test-namespace -2021/04/30 23:31:28 [2658] Executing ipset command ipset [-D -exist azure-npm-3308517892 azure-npm-2293040867] -2021/04/30 23:31:28 [2658] Executing ipset command ipset [-X -exist azure-npm-3308517892] -2021/04/30 23:31:28 [2658] Executing ipset command ipset [-D -exist azure-npm-530439631 azure-npm-2293040867] -2021/04/30 23:31:28 [2658] Executing ipset command ipset [-X -exist azure-npm-530439631] -2021/04/30 23:31:28 [2658] Executing ipset command ipset [-X -exist azure-npm-2293040867] -I0430 23:31:28.241754 2658 nameSpaceController.go:269] Successfully synced 'test-namespace' ---- PASS: TestDeleteNamespaceWithTombstoneAfterAddingNameSpace (0.19s) -=== RUN TestGetNamespaceObjFromNsObj ---- PASS: TestGetNamespaceObjFromNsObj (0.00s) -=== RUN TestIsSystemNs ---- PASS: TestIsSystemNs (0.00s) -=== RUN TestAddMultipleNetworkPolicies -2021/04/30 23:31:28 [2658] Error creating metric num_policies -2021/04/30 23:31:28 [2658] Error creating metric add_policy_exec_time -2021/04/30 23:31:28 [2658] Error creating metric num_iptables_rules -2021/04/30 23:31:28 [2658] Error creating metric add_iptables_rule_exec_time -2021/04/30 23:31:28 [2658] Error creating metric num_ipsets -2021/04/30 23:31:28 [2658] Error creating metric add_ipset_exec_time -2021/04/30 23:31:28 [2658] Error creating metric num_ipset_entries -2021/04/30 23:31:28 [2658] Error creating metric ipset_counts -2021/04/30 23:31:28 [2658] Finished initializing all Prometheus metrics -2021/04/30 23:31:28 [2658] Creating Set: &{operationFlag:-N name:kube-system set:azure-npm-2725615454 spec:[nethash]} -2021/04/30 23:31:28 [2658] Executing ipset command ipset [-N -exist azure-npm-2725615454 nethash] -2021/04/30 23:31:28 [2658] Initializing AZURE-NPM chains. -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-ACCEPT] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-INGRESS] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-EGRESS] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-INGRESS-PORT] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-INGRESS-FROM] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-EGRESS-PORT] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-EGRESS-TO] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-INGRESS-DROPS] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-EGRESS-DROPS] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -I FORWARD 1 -j AZURE-NPM] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM -j AZURE-NPM-INGRESS] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM -j AZURE-NPM-EGRESS] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM -j AZURE-NPM-ACCEPT -m mark --mark 0x3000 -m comment --comment ACCEPT-on-INGRESS-and-EGRESS-mark-0x3000] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM -j AZURE-NPM-ACCEPT -m mark --mark 0x2000 -m comment --comment ACCEPT-on-INGRESS-mark-0x2000] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM -j AZURE-NPM-ACCEPT -m mark --mark 0x1000 -m comment --comment ACCEPT-on-EGRESS-mark-0x1000] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM -m state --state RELATED,ESTABLISHED -j ACCEPT -m comment --comment ACCEPT-on-connection-state] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-ACCEPT -j MARK --set-mark 0x0 -m comment --comment Clear-AZURE-NPM-MARKS] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-ACCEPT -j ACCEPT -m comment --comment ACCEPT-All-packets] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS -j AZURE-NPM-INGRESS-PORT] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS -j RETURN -m mark --mark 0x2000 -m comment --comment RETURN-on-INGRESS-mark-0x2000] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS -j AZURE-NPM-INGRESS-DROPS] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS-PORT -j RETURN -m mark --mark 0x2000 -m comment --comment RETURN-on-INGRESS-mark-0x2000] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS-FROM -j RETURN -m mark --mark 0x2000 -m comment --comment RETURN-on-INGRESS-mark-0x2000] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS -j AZURE-NPM-EGRESS-PORT] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS -j RETURN -m mark --mark 0x3000 -m comment --comment RETURN-on-EGRESS-and-INGRESS-mark-0x3000] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS -j RETURN -m mark --mark 0x1000 -m comment --comment RETURN-on-EGRESS-mark-0x1000] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS -j AZURE-NPM-EGRESS-DROPS] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS-PORT -j RETURN -m mark --mark 0x3000 -m comment --comment RETURN-on-EGRESS-and-INGRESS-mark-0x3000] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS-PORT -j RETURN -m mark --mark 0x1000 -m comment --comment RETURN-on-EGRESS-mark-0x1000] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS-TO -j RETURN -m mark --mark 0x3000 -m comment --comment RETURN-on-EGRESS-and-INGRESS-mark-0x3000] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS-TO -j RETURN -m mark --mark 0x1000 -m comment --comment RETURN-on-EGRESS-mark-0x1000] -2021/04/30 23:31:28 [2658] started parsing ingress rule -2021/04/30 23:31:28 [2658] finished parsing ingress rule -2021/04/30 23:31:28 [2658] started parsing egress rule -2021/04/30 23:31:28 [2658] finished parsing egress rule -2021/04/30 23:31:28 [2658] Finished translatePolicy -2021/04/30 23:31:28 [2658] sets: [ns-test-nwpolicy app:test ns-test-nwpolicy app:test] -2021/04/30 23:31:28 [2658] lists: [] -2021/04/30 23:31:28 [2658] entries: -2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-3260345197 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-allow-ingress-in-ns-test-nwpolicy-0in-AND-TCP-PORT-8000-TO-ns-test-nwpolicy]} -2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-8000-TO-ns-test-nwpolicy]} -2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS]} -2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-0-FROM-ns-test-nwpolicy]} -2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS]} -2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -j DROP -m comment --comment DROP-ALL-TO-ns-test-nwpolicy]} -2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 src -j DROP -m comment --comment DROP-ALL-FROM-ns-test-nwpolicy]} -I0430 23:31:28.353059 2658 networkPolicyController.go:343] Creating set: ns-test-nwpolicy, hashedSet: azure-npm-806075013 -2021/04/30 23:31:28 [2658] Creating Set: &{operationFlag:-N name:ns-test-nwpolicy set:azure-npm-806075013 spec:[nethash]} -2021/04/30 23:31:28 [2658] Executing ipset command ipset [-N -exist azure-npm-806075013 nethash] -I0430 23:31:28.354150 2658 networkPolicyController.go:343] Creating set: app:test, hashedSet: azure-npm-2817129730 -2021/04/30 23:31:28 [2658] Creating Set: &{operationFlag:-N name:app:test set:azure-npm-2817129730 spec:[nethash]} -2021/04/30 23:31:28 [2658] Executing ipset command ipset [-N -exist azure-npm-2817129730 nethash] -I0430 23:31:28.354993 2658 networkPolicyController.go:349] Creating set: namedport:0, hashedSet: azure-npm-1468440115 -2021/04/30 23:31:28 [2658] Creating Set: &{operationFlag:-N name:namedport:0 set:azure-npm-1468440115 spec:[hash:ip,port]} -2021/04/30 23:31:28 [2658] Executing ipset command ipset [-N -exist azure-npm-1468440115 hash:ip,port] -I0430 23:31:28.358490 2658 networkPolicyController.go:436] Creating set: allow-ingress-in-ns-test-nwpolicy-0in, hashedSet: azure-npm-3260345197 -2021/04/30 23:31:28 [2658] Creating Set: &{operationFlag:-N name:allow-ingress-in-ns-test-nwpolicy-0in set:azure-npm-3260345197 spec:[nethash maxelem 4294967295]} -2021/04/30 23:31:28 [2658] Executing ipset command ipset [-N -exist azure-npm-3260345197 nethash maxelem 4294967295] -2021/04/30 23:31:28 [2658] Executing ipset command ipset [-A -exist azure-npm-3260345197 1.0.0.0/1] -2021/04/30 23:31:28 [2658] Executing ipset command ipset [-A -exist azure-npm-3260345197 128.0.0.0/1] -I0430 23:31:28.363706 2658 networkPolicyController.go:436] Creating set: allow-ingress-in-ns-test-nwpolicy-0out, hashedSet: azure-npm-3481675862 -2021/04/30 23:31:28 [2658] Creating Set: &{operationFlag:-N name:allow-ingress-in-ns-test-nwpolicy-0out set:azure-npm-3481675862 spec:[nethash maxelem 4294967295]} -2021/04/30 23:31:28 [2658] Executing ipset command ipset [-N -exist azure-npm-3481675862 nethash maxelem 4294967295] -2021/04/30 23:31:28 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-3260345197 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-allow-ingress-in-ns-test-nwpolicy-0in-AND-TCP-PORT-8000-TO-ns-test-nwpolicy]}. -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-INGRESS-PORT -m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-3260345197 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-allow-ingress-in-ns-test-nwpolicy-0in-AND-TCP-PORT-8000-TO-ns-test-nwpolicy] -2021/04/30 23:31:28 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-8000-TO-ns-test-nwpolicy]}. -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-INGRESS-PORT -m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-8000-TO-ns-test-nwpolicy] -2021/04/30 23:31:28 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS]}. -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS-PORT -m set --match-set azure-npm-806075013 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS] -2021/04/30 23:31:28 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-0-FROM-ns-test-nwpolicy]}. -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-EGRESS-PORT -m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-0-FROM-ns-test-nwpolicy] -2021/04/30 23:31:28 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS]}. -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS-PORT -m set --match-set azure-npm-806075013 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS] -2021/04/30 23:31:28 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -j DROP -m comment --comment DROP-ALL-TO-ns-test-nwpolicy]}. -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-INGRESS-DROPS -m set --match-set azure-npm-806075013 dst -j DROP -m comment --comment DROP-ALL-TO-ns-test-nwpolicy] -2021/04/30 23:31:28 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 src -j DROP -m comment --comment DROP-ALL-FROM-ns-test-nwpolicy]}. -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-EGRESS-DROPS -m set --match-set azure-npm-806075013 src -j DROP -m comment --comment DROP-ALL-FROM-ns-test-nwpolicy] -I0430 23:31:28.374417 2658 networkPolicyController.go:216] Successfully synced 'test-nwpolicy/allow-ingress' -2021/04/30 23:31:28 [2658] started parsing ingress rule -2021/04/30 23:31:28 [2658] finished parsing ingress rule -2021/04/30 23:31:28 [2658] started parsing egress rule -2021/04/30 23:31:28 [2658] finished parsing egress rule -2021/04/30 23:31:28 [2658] Finished translatePolicy -2021/04/30 23:31:28 [2658] sets: [ns-test-nwpolicy-new app:test ns-test-nwpolicy-new app:test] -2021/04/30 23:31:28 [2658] lists: [] -2021/04/30 23:31:28 [2658] entries: -2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-4288785846 dst -m set --match-set azure-npm-1835913541 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x2000 -m comment --comment ALLOW-allow-ingress-new-in-ns-test-nwpolicy-new-0in-AND-TCP-PORT-0-TO-ns-test-nwpolicy-new]} -2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-4288785846 dst -m set --match-set azure-npm-4288785846 src -m set --match-set azure-npm-2817129730 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-new-AND-TCP-PORT-0-TO-ns-test-nwpolicy-new]} -2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-4288785846 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-ns-test-nwpolicy-new-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS]} -2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-4288785846 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-4288785846 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-new-AND-TCP-PORT-0-FROM-ns-test-nwpolicy-new]} -2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-4288785846 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-ns-test-nwpolicy-new-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS]} -2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-4288785846 dst -j DROP -m comment --comment DROP-ALL-TO-ns-test-nwpolicy-new]} -2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-4288785846 src -j DROP -m comment --comment DROP-ALL-FROM-ns-test-nwpolicy-new]} -I0430 23:31:28.375898 2658 networkPolicyController.go:343] Creating set: ns-test-nwpolicy-new, hashedSet: azure-npm-4288785846 -2021/04/30 23:31:28 [2658] Creating Set: &{operationFlag:-N name:ns-test-nwpolicy-new set:azure-npm-4288785846 spec:[nethash]} -2021/04/30 23:31:28 [2658] Executing ipset command ipset [-N -exist azure-npm-4288785846 nethash] -I0430 23:31:28.376890 2658 networkPolicyController.go:343] Creating set: app:test, hashedSet: azure-npm-2817129730 -I0430 23:31:28.376949 2658 networkPolicyController.go:349] Creating set: namedport:0, hashedSet: azure-npm-1468440115 -I0430 23:31:28.376973 2658 networkPolicyController.go:436] Creating set: allow-ingress-new-in-ns-test-nwpolicy-new-0in, hashedSet: azure-npm-1835913541 -2021/04/30 23:31:28 [2658] Creating Set: &{operationFlag:-N name:allow-ingress-new-in-ns-test-nwpolicy-new-0in set:azure-npm-1835913541 spec:[nethash maxelem 4294967295]} -2021/04/30 23:31:28 [2658] Executing ipset command ipset [-N -exist azure-npm-1835913541 nethash maxelem 4294967295] -2021/04/30 23:31:28 [2658] Executing ipset command ipset [-A -exist azure-npm-1835913541 1.0.0.0/1] -2021/04/30 23:31:28 [2658] Executing ipset command ipset [-A -exist azure-npm-1835913541 128.0.0.0/1] -I0430 23:31:28.379772 2658 networkPolicyController.go:436] Creating set: allow-ingress-new-in-ns-test-nwpolicy-new-0out, hashedSet: azure-npm-1613714382 -2021/04/30 23:31:28 [2658] Creating Set: &{operationFlag:-N name:allow-ingress-new-in-ns-test-nwpolicy-new-0out set:azure-npm-1613714382 spec:[nethash maxelem 4294967295]} -2021/04/30 23:31:28 [2658] Executing ipset command ipset [-N -exist azure-npm-1613714382 nethash maxelem 4294967295] -2021/04/30 23:31:28 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-4288785846 dst -m set --match-set azure-npm-1835913541 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x2000 -m comment --comment ALLOW-allow-ingress-new-in-ns-test-nwpolicy-new-0in-AND-TCP-PORT-0-TO-ns-test-nwpolicy-new]}. -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-INGRESS-PORT -m set --match-set azure-npm-4288785846 dst -m set --match-set azure-npm-1835913541 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x2000 -m comment --comment ALLOW-allow-ingress-new-in-ns-test-nwpolicy-new-0in-AND-TCP-PORT-0-TO-ns-test-nwpolicy-new] -2021/04/30 23:31:28 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-4288785846 dst -m set --match-set azure-npm-4288785846 src -m set --match-set azure-npm-2817129730 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-new-AND-TCP-PORT-0-TO-ns-test-nwpolicy-new]}. -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-INGRESS-PORT -m set --match-set azure-npm-4288785846 dst -m set --match-set azure-npm-4288785846 src -m set --match-set azure-npm-2817129730 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-new-AND-TCP-PORT-0-TO-ns-test-nwpolicy-new] -2021/04/30 23:31:28 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-4288785846 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-ns-test-nwpolicy-new-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS]}. -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS-PORT -m set --match-set azure-npm-4288785846 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-ns-test-nwpolicy-new-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS] -2021/04/30 23:31:28 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-4288785846 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-4288785846 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-new-AND-TCP-PORT-0-FROM-ns-test-nwpolicy-new]}. -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-EGRESS-PORT -m set --match-set azure-npm-4288785846 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-4288785846 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-new-AND-TCP-PORT-0-FROM-ns-test-nwpolicy-new] -2021/04/30 23:31:28 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-4288785846 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-ns-test-nwpolicy-new-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS]}. -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS-PORT -m set --match-set azure-npm-4288785846 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-ns-test-nwpolicy-new-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS] -2021/04/30 23:31:28 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-4288785846 dst -j DROP -m comment --comment DROP-ALL-TO-ns-test-nwpolicy-new]}. -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-INGRESS-DROPS -m set --match-set azure-npm-4288785846 dst -j DROP -m comment --comment DROP-ALL-TO-ns-test-nwpolicy-new] -2021/04/30 23:31:28 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-4288785846 src -j DROP -m comment --comment DROP-ALL-FROM-ns-test-nwpolicy-new]}. -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-EGRESS-DROPS -m set --match-set azure-npm-4288785846 src -j DROP -m comment --comment DROP-ALL-FROM-ns-test-nwpolicy-new] -I0430 23:31:28.389385 2658 networkPolicyController.go:216] Successfully synced 'test-nwpolicy-new/allow-ingress-new' ---- PASS: TestAddMultipleNetworkPolicies (0.15s) -=== RUN TestAddNetworkPolicy -2021/04/30 23:31:28 [2658] Error creating metric num_policies -2021/04/30 23:31:28 [2658] Error creating metric add_policy_exec_time -2021/04/30 23:31:28 [2658] Error creating metric num_iptables_rules -2021/04/30 23:31:28 [2658] Error creating metric add_iptables_rule_exec_time -2021/04/30 23:31:28 [2658] Error creating metric num_ipsets -2021/04/30 23:31:28 [2658] Error creating metric add_ipset_exec_time -2021/04/30 23:31:28 [2658] Error creating metric num_ipset_entries -2021/04/30 23:31:28 [2658] Error creating metric ipset_counts -2021/04/30 23:31:28 [2658] Finished initializing all Prometheus metrics -2021/04/30 23:31:28 [2658] Creating Set: &{operationFlag:-N name:kube-system set:azure-npm-2725615454 spec:[nethash]} -2021/04/30 23:31:28 [2658] Executing ipset command ipset [-N -exist azure-npm-2725615454 nethash] -2021/04/30 23:31:28 [2658] Initializing AZURE-NPM chains. -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-ACCEPT] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-INGRESS] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-EGRESS] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-INGRESS-PORT] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-INGRESS-FROM] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-EGRESS-PORT] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-EGRESS-TO] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-INGRESS-DROPS] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-EGRESS-DROPS] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM] -2021/04/30 23:31:28 [2658] started parsing ingress rule -2021/04/30 23:31:28 [2658] finished parsing ingress rule -2021/04/30 23:31:28 [2658] started parsing egress rule -2021/04/30 23:31:28 [2658] finished parsing egress rule -2021/04/30 23:31:28 [2658] Finished translatePolicy -2021/04/30 23:31:28 [2658] sets: [ns-test-nwpolicy app:test ns-test-nwpolicy app:test] -2021/04/30 23:31:28 [2658] lists: [] -2021/04/30 23:31:28 [2658] entries: -2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-3260345197 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-allow-ingress-in-ns-test-nwpolicy-0in-AND-TCP-PORT-8000-TO-ns-test-nwpolicy]} -2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-8000-TO-ns-test-nwpolicy]} -2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS]} -2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-0-FROM-ns-test-nwpolicy]} -2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS]} -2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -j DROP -m comment --comment DROP-ALL-TO-ns-test-nwpolicy]} -2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 src -j DROP -m comment --comment DROP-ALL-FROM-ns-test-nwpolicy]} -I0430 23:31:28.448248 2658 networkPolicyController.go:343] Creating set: ns-test-nwpolicy, hashedSet: azure-npm-806075013 -2021/04/30 23:31:28 [2658] Creating Set: &{operationFlag:-N name:ns-test-nwpolicy set:azure-npm-806075013 spec:[nethash]} -2021/04/30 23:31:28 [2658] Executing ipset command ipset [-N -exist azure-npm-806075013 nethash] -I0430 23:31:28.449171 2658 networkPolicyController.go:343] Creating set: app:test, hashedSet: azure-npm-2817129730 -2021/04/30 23:31:28 [2658] Creating Set: &{operationFlag:-N name:app:test set:azure-npm-2817129730 spec:[nethash]} -2021/04/30 23:31:28 [2658] Executing ipset command ipset [-N -exist azure-npm-2817129730 nethash] -I0430 23:31:28.450103 2658 networkPolicyController.go:349] Creating set: namedport:0, hashedSet: azure-npm-1468440115 -2021/04/30 23:31:28 [2658] Creating Set: &{operationFlag:-N name:namedport:0 set:azure-npm-1468440115 spec:[hash:ip,port]} -2021/04/30 23:31:28 [2658] Executing ipset command ipset [-N -exist azure-npm-1468440115 hash:ip,port] -I0430 23:31:28.450967 2658 networkPolicyController.go:436] Creating set: allow-ingress-in-ns-test-nwpolicy-0in, hashedSet: azure-npm-3260345197 -2021/04/30 23:31:28 [2658] Creating Set: &{operationFlag:-N name:allow-ingress-in-ns-test-nwpolicy-0in set:azure-npm-3260345197 spec:[nethash maxelem 4294967295]} -2021/04/30 23:31:28 [2658] Executing ipset command ipset [-N -exist azure-npm-3260345197 nethash maxelem 4294967295] -2021/04/30 23:31:28 [2658] Executing ipset command ipset [-A -exist azure-npm-3260345197 1.0.0.0/1] -2021/04/30 23:31:28 [2658] Executing ipset command ipset [-A -exist azure-npm-3260345197 128.0.0.0/1] -I0430 23:31:28.453717 2658 networkPolicyController.go:436] Creating set: allow-ingress-in-ns-test-nwpolicy-0out, hashedSet: azure-npm-3481675862 -2021/04/30 23:31:28 [2658] Creating Set: &{operationFlag:-N name:allow-ingress-in-ns-test-nwpolicy-0out set:azure-npm-3481675862 spec:[nethash maxelem 4294967295]} -2021/04/30 23:31:28 [2658] Executing ipset command ipset [-N -exist azure-npm-3481675862 nethash maxelem 4294967295] -2021/04/30 23:31:28 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-3260345197 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-allow-ingress-in-ns-test-nwpolicy-0in-AND-TCP-PORT-8000-TO-ns-test-nwpolicy]}. -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-INGRESS-PORT -m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-3260345197 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-allow-ingress-in-ns-test-nwpolicy-0in-AND-TCP-PORT-8000-TO-ns-test-nwpolicy] -2021/04/30 23:31:28 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-8000-TO-ns-test-nwpolicy]}. -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-INGRESS-PORT -m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-8000-TO-ns-test-nwpolicy] -2021/04/30 23:31:28 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS]}. -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS-PORT -m set --match-set azure-npm-806075013 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS] -2021/04/30 23:31:28 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-0-FROM-ns-test-nwpolicy]}. -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-EGRESS-PORT -m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-0-FROM-ns-test-nwpolicy] -2021/04/30 23:31:28 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS]}. -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS-PORT -m set --match-set azure-npm-806075013 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS] -2021/04/30 23:31:28 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -j DROP -m comment --comment DROP-ALL-TO-ns-test-nwpolicy]}. -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-INGRESS-DROPS -m set --match-set azure-npm-806075013 dst -j DROP -m comment --comment DROP-ALL-TO-ns-test-nwpolicy] -2021/04/30 23:31:28 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 src -j DROP -m comment --comment DROP-ALL-FROM-ns-test-nwpolicy]}. -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-EGRESS-DROPS -m set --match-set azure-npm-806075013 src -j DROP -m comment --comment DROP-ALL-FROM-ns-test-nwpolicy] -I0430 23:31:28.471876 2658 networkPolicyController.go:216] Successfully synced 'test-nwpolicy/allow-ingress' ---- PASS: TestAddNetworkPolicy (0.08s) -=== RUN TestDeleteNetworkPolicy -2021/04/30 23:31:28 [2658] Error creating metric num_policies -2021/04/30 23:31:28 [2658] Error creating metric add_policy_exec_time -2021/04/30 23:31:28 [2658] Error creating metric num_iptables_rules -2021/04/30 23:31:28 [2658] Error creating metric add_iptables_rule_exec_time -2021/04/30 23:31:28 [2658] Error creating metric num_ipsets -2021/04/30 23:31:28 [2658] Error creating metric add_ipset_exec_time -2021/04/30 23:31:28 [2658] Error creating metric num_ipset_entries -2021/04/30 23:31:28 [2658] Error creating metric ipset_counts -2021/04/30 23:31:28 [2658] Finished initializing all Prometheus metrics -2021/04/30 23:31:28 [2658] Creating Set: &{operationFlag:-N name:kube-system set:azure-npm-2725615454 spec:[nethash]} -2021/04/30 23:31:28 [2658] Executing ipset command ipset [-N -exist azure-npm-2725615454 nethash] -2021/04/30 23:31:28 [2658] Initializing AZURE-NPM chains. -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-ACCEPT] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-INGRESS] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-EGRESS] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-INGRESS-PORT] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-INGRESS-FROM] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-EGRESS-PORT] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-EGRESS-TO] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-INGRESS-DROPS] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-EGRESS-DROPS] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM] -2021/04/30 23:31:28 [2658] started parsing ingress rule -2021/04/30 23:31:28 [2658] finished parsing ingress rule -2021/04/30 23:31:28 [2658] started parsing egress rule -2021/04/30 23:31:28 [2658] finished parsing egress rule -2021/04/30 23:31:28 [2658] Finished translatePolicy -2021/04/30 23:31:28 [2658] sets: [ns-test-nwpolicy app:test ns-test-nwpolicy app:test] -2021/04/30 23:31:28 [2658] lists: [] -2021/04/30 23:31:28 [2658] entries: -2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-3260345197 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-allow-ingress-in-ns-test-nwpolicy-0in-AND-TCP-PORT-8000-TO-ns-test-nwpolicy]} -2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-8000-TO-ns-test-nwpolicy]} -2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS]} -2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-0-FROM-ns-test-nwpolicy]} -2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS]} -2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -j DROP -m comment --comment DROP-ALL-TO-ns-test-nwpolicy]} -2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 src -j DROP -m comment --comment DROP-ALL-FROM-ns-test-nwpolicy]} -I0430 23:31:28.556005 2658 networkPolicyController.go:343] Creating set: ns-test-nwpolicy, hashedSet: azure-npm-806075013 -2021/04/30 23:31:28 [2658] Creating Set: &{operationFlag:-N name:ns-test-nwpolicy set:azure-npm-806075013 spec:[nethash]} -2021/04/30 23:31:28 [2658] Executing ipset command ipset [-N -exist azure-npm-806075013 nethash] -I0430 23:31:28.557974 2658 networkPolicyController.go:343] Creating set: app:test, hashedSet: azure-npm-2817129730 -2021/04/30 23:31:28 [2658] Creating Set: &{operationFlag:-N name:app:test set:azure-npm-2817129730 spec:[nethash]} -2021/04/30 23:31:28 [2658] Executing ipset command ipset [-N -exist azure-npm-2817129730 nethash] -I0430 23:31:28.562259 2658 networkPolicyController.go:349] Creating set: namedport:0, hashedSet: azure-npm-1468440115 -2021/04/30 23:31:28 [2658] Creating Set: &{operationFlag:-N name:namedport:0 set:azure-npm-1468440115 spec:[hash:ip,port]} -2021/04/30 23:31:28 [2658] Executing ipset command ipset [-N -exist azure-npm-1468440115 hash:ip,port] -I0430 23:31:28.563727 2658 networkPolicyController.go:436] Creating set: allow-ingress-in-ns-test-nwpolicy-0in, hashedSet: azure-npm-3260345197 -2021/04/30 23:31:28 [2658] Creating Set: &{operationFlag:-N name:allow-ingress-in-ns-test-nwpolicy-0in set:azure-npm-3260345197 spec:[nethash maxelem 4294967295]} -2021/04/30 23:31:28 [2658] Executing ipset command ipset [-N -exist azure-npm-3260345197 nethash maxelem 4294967295] -2021/04/30 23:31:28 [2658] Executing ipset command ipset [-A -exist azure-npm-3260345197 1.0.0.0/1] -2021/04/30 23:31:28 [2658] Executing ipset command ipset [-A -exist azure-npm-3260345197 128.0.0.0/1] -I0430 23:31:28.568675 2658 networkPolicyController.go:436] Creating set: allow-ingress-in-ns-test-nwpolicy-0out, hashedSet: azure-npm-3481675862 -2021/04/30 23:31:28 [2658] Creating Set: &{operationFlag:-N name:allow-ingress-in-ns-test-nwpolicy-0out set:azure-npm-3481675862 spec:[nethash maxelem 4294967295]} -2021/04/30 23:31:28 [2658] Executing ipset command ipset [-N -exist azure-npm-3481675862 nethash maxelem 4294967295] -2021/04/30 23:31:28 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-3260345197 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-allow-ingress-in-ns-test-nwpolicy-0in-AND-TCP-PORT-8000-TO-ns-test-nwpolicy]}. -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-INGRESS-PORT -m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-3260345197 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-allow-ingress-in-ns-test-nwpolicy-0in-AND-TCP-PORT-8000-TO-ns-test-nwpolicy] -2021/04/30 23:31:28 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-8000-TO-ns-test-nwpolicy]}. -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-INGRESS-PORT -m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-8000-TO-ns-test-nwpolicy] -2021/04/30 23:31:28 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS]}. -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS-PORT -m set --match-set azure-npm-806075013 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS] -2021/04/30 23:31:28 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-0-FROM-ns-test-nwpolicy]}. -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-EGRESS-PORT -m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-0-FROM-ns-test-nwpolicy] -2021/04/30 23:31:28 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS]}. -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS-PORT -m set --match-set azure-npm-806075013 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS] -2021/04/30 23:31:28 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -j DROP -m comment --comment DROP-ALL-TO-ns-test-nwpolicy]}. -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-INGRESS-DROPS -m set --match-set azure-npm-806075013 dst -j DROP -m comment --comment DROP-ALL-TO-ns-test-nwpolicy] -2021/04/30 23:31:28 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 src -j DROP -m comment --comment DROP-ALL-FROM-ns-test-nwpolicy]}. -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-EGRESS-DROPS -m set --match-set azure-npm-806075013 src -j DROP -m comment --comment DROP-ALL-FROM-ns-test-nwpolicy] -I0430 23:31:28.585795 2658 networkPolicyController.go:216] Successfully synced 'test-nwpolicy/allow-ingress' - networkPolicyController_test.go:172: Complete adding network policy event -I0430 23:31:28.586015 2658 networkPolicyController.go:247] Network Policy test-nwpolicy/allow-ingress is not found, may be it is deleted -2021/04/30 23:31:28 [2658] started parsing ingress rule -2021/04/30 23:31:28 [2658] finished parsing ingress rule -2021/04/30 23:31:28 [2658] started parsing egress rule -2021/04/30 23:31:28 [2658] finished parsing egress rule -2021/04/30 23:31:28 [2658] Finished translatePolicy -2021/04/30 23:31:28 [2658] sets: [ns-test-nwpolicy app:test ns-test-nwpolicy app:test] -2021/04/30 23:31:28 [2658] lists: [] -2021/04/30 23:31:28 [2658] entries: -2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-3260345197 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-allow-ingress-in-ns-test-nwpolicy-0in-AND-TCP-PORT-8000-TO-ns-test-nwpolicy]} -2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-8000-TO-ns-test-nwpolicy]} -2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS]} -2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-0-FROM-ns-test-nwpolicy]} -2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS]} -2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -j DROP -m comment --comment DROP-ALL-TO-ns-test-nwpolicy]} -2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 src -j DROP -m comment --comment DROP-ALL-FROM-ns-test-nwpolicy]} -2021/04/30 23:31:28 [2658] Deleting iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-3260345197 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-allow-ingress-in-ns-test-nwpolicy-0in-AND-TCP-PORT-8000-TO-ns-test-nwpolicy]} -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -D AZURE-NPM-INGRESS-PORT -m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-3260345197 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-allow-ingress-in-ns-test-nwpolicy-0in-AND-TCP-PORT-8000-TO-ns-test-nwpolicy] -2021/04/30 23:31:28 [2658] Deleting iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-8000-TO-ns-test-nwpolicy]} -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -D AZURE-NPM-INGRESS-PORT -m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-8000-TO-ns-test-nwpolicy] -2021/04/30 23:31:28 [2658] Deleting iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS]} -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -D AZURE-NPM-INGRESS-PORT -m set --match-set azure-npm-806075013 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS] -2021/04/30 23:31:28 [2658] Deleting iptables entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-0-FROM-ns-test-nwpolicy]} -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -D AZURE-NPM-EGRESS-PORT -m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-0-FROM-ns-test-nwpolicy] -2021/04/30 23:31:28 [2658] Deleting iptables entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS]} -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -D AZURE-NPM-EGRESS-PORT -m set --match-set azure-npm-806075013 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS] -2021/04/30 23:31:28 [2658] Deleting iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -j DROP -m comment --comment DROP-ALL-TO-ns-test-nwpolicy]} -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -D AZURE-NPM-INGRESS-DROPS -m set --match-set azure-npm-806075013 dst -j DROP -m comment --comment DROP-ALL-TO-ns-test-nwpolicy] -2021/04/30 23:31:28 [2658] Deleting iptables entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 src -j DROP -m comment --comment DROP-ALL-FROM-ns-test-nwpolicy]} -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -D AZURE-NPM-EGRESS-DROPS -m set --match-set azure-npm-806075013 src -j DROP -m comment --comment DROP-ALL-FROM-ns-test-nwpolicy] -I0430 23:31:28.611192 2658 networkPolicyController.go:467] Delete set: allow-ingress-in-ns-test-nwpolicy-0in, hashedSet: azure-npm-3260345197 -2021/04/30 23:31:28 [2658] Executing ipset command ipset [-X -exist azure-npm-3260345197] -2021/04/30 23:31:28 [2658] AppInsights didn't initialized. -2021/04/30 23:31:28 [2658] Error: There was an error running command: [ipset -X -exist azure-npm-3260345197] Stderr: [exit status 1, ipset v6.34: Set cannot be destroyed: it is in use by a kernel component] -2021/04/30 23:31:28 [2658] AppInsights didn't initialized. -I0430 23:31:28.633912 2658 networkPolicyController.go:467] Delete set: allow-ingress-in-ns-test-nwpolicy-0out, hashedSet: azure-npm-3481675862 -2021/04/30 23:31:28 [2658] Executing ipset command ipset [-X -exist azure-npm-3481675862] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -D FORWARD -j AZURE-NPM] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -F AZURE-NPM] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -F AZURE-NPM-ACCEPT] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -F AZURE-NPM-INGRESS] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -F AZURE-NPM-EGRESS] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -F AZURE-NPM-INGRESS-PORT] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -F AZURE-NPM-INGRESS-FROM] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -F AZURE-NPM-EGRESS-PORT] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -F AZURE-NPM-EGRESS-TO] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -F AZURE-NPM-INGRESS-DROPS] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -F AZURE-NPM-EGRESS-DROPS] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -F AZURE-NPM-TARGET-SETS] -2021/04/30 23:31:28 [2658] AppInsights didn't initialized. -2021/04/30 23:31:28 [2658] Error: There was an error running command: [iptables -w 60 -F AZURE-NPM-TARGET-SETS] Stderr: [exit status 1, iptables: No chain/target/match by that name.] -2021/04/30 23:31:28 [2658] AppInsights didn't initialized. -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -F AZURE-NPM-INRGESS-DROPS] -2021/04/30 23:31:28 [2658] AppInsights didn't initialized. -2021/04/30 23:31:28 [2658] Error: There was an error running command: [iptables -w 60 -F AZURE-NPM-INRGESS-DROPS] Stderr: [exit status 1, iptables: No chain/target/match by that name.] -2021/04/30 23:31:28 [2658] AppInsights didn't initialized. -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -X AZURE-NPM] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -X AZURE-NPM-ACCEPT] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -X AZURE-NPM-INGRESS] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -X AZURE-NPM-EGRESS] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -X AZURE-NPM-INGRESS-PORT] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -X AZURE-NPM-INGRESS-FROM] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -X AZURE-NPM-EGRESS-PORT] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -X AZURE-NPM-EGRESS-TO] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -X AZURE-NPM-INGRESS-DROPS] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -X AZURE-NPM-EGRESS-DROPS] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -X AZURE-NPM-TARGET-SETS] -2021/04/30 23:31:28 [2658] AppInsights didn't initialized. -2021/04/30 23:31:28 [2658] Error: There was an error running command: [iptables -w 60 -X AZURE-NPM-TARGET-SETS] Stderr: [exit status 1, iptables: No chain/target/match by that name.] -2021/04/30 23:31:28 [2658] AppInsights didn't initialized. -2021/04/30 23:31:28 [2658] Chain doesn't exist AZURE-NPM-TARGET-SETS. -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -X AZURE-NPM-INRGESS-DROPS] -2021/04/30 23:31:28 [2658] AppInsights didn't initialized. -2021/04/30 23:31:28 [2658] Error: There was an error running command: [iptables -w 60 -X AZURE-NPM-INRGESS-DROPS] Stderr: [exit status 1, iptables: No chain/target/match by that name.] -2021/04/30 23:31:28 [2658] AppInsights didn't initialized. -2021/04/30 23:31:28 [2658] Chain doesn't exist AZURE-NPM-INRGESS-DROPS. -I0430 23:31:28.692943 2658 networkPolicyController.go:216] Successfully synced 'test-nwpolicy/allow-ingress' ---- PASS: TestDeleteNetworkPolicy (0.22s) -=== RUN TestDeleteNetworkPolicyWithTombstone -2021/04/30 23:31:28 [2658] Error creating metric num_policies -2021/04/30 23:31:28 [2658] Error creating metric add_policy_exec_time -2021/04/30 23:31:28 [2658] Error creating metric num_iptables_rules -2021/04/30 23:31:28 [2658] Error creating metric add_iptables_rule_exec_time -2021/04/30 23:31:28 [2658] Error creating metric num_ipsets -2021/04/30 23:31:28 [2658] Error creating metric add_ipset_exec_time -2021/04/30 23:31:28 [2658] Error creating metric num_ipset_entries -2021/04/30 23:31:28 [2658] Error creating metric ipset_counts -2021/04/30 23:31:28 [2658] Finished initializing all Prometheus metrics ---- PASS: TestDeleteNetworkPolicyWithTombstone (0.00s) -=== RUN TestDeleteNetworkPolicyWithTombstoneAfterAddingNetworkPolicy -2021/04/30 23:31:28 [2658] Error creating metric num_policies -2021/04/30 23:31:28 [2658] Error creating metric add_policy_exec_time -2021/04/30 23:31:28 [2658] Error creating metric num_iptables_rules -2021/04/30 23:31:28 [2658] Error creating metric add_iptables_rule_exec_time -2021/04/30 23:31:28 [2658] Error creating metric num_ipsets -2021/04/30 23:31:28 [2658] Error creating metric add_ipset_exec_time -2021/04/30 23:31:28 [2658] Error creating metric num_ipset_entries -2021/04/30 23:31:28 [2658] Error creating metric ipset_counts -2021/04/30 23:31:28 [2658] Finished initializing all Prometheus metrics -2021/04/30 23:31:28 [2658] Creating Set: &{operationFlag:-N name:kube-system set:azure-npm-2725615454 spec:[nethash]} -2021/04/30 23:31:28 [2658] Executing ipset command ipset [-N -exist azure-npm-2725615454 nethash] -2021/04/30 23:31:28 [2658] Initializing AZURE-NPM chains. -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-ACCEPT] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-INGRESS] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-EGRESS] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-INGRESS-PORT] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-INGRESS-FROM] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-EGRESS-PORT] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-EGRESS-TO] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-INGRESS-DROPS] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-EGRESS-DROPS] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -I FORWARD 1 -j AZURE-NPM] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM -j AZURE-NPM-INGRESS] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM -j AZURE-NPM-EGRESS] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM -j AZURE-NPM-ACCEPT -m mark --mark 0x3000 -m comment --comment ACCEPT-on-INGRESS-and-EGRESS-mark-0x3000] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM -j AZURE-NPM-ACCEPT -m mark --mark 0x2000 -m comment --comment ACCEPT-on-INGRESS-mark-0x2000] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM -j AZURE-NPM-ACCEPT -m mark --mark 0x1000 -m comment --comment ACCEPT-on-EGRESS-mark-0x1000] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM -m state --state RELATED,ESTABLISHED -j ACCEPT -m comment --comment ACCEPT-on-connection-state] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-ACCEPT -j MARK --set-mark 0x0 -m comment --comment Clear-AZURE-NPM-MARKS] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-ACCEPT -j ACCEPT -m comment --comment ACCEPT-All-packets] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS -j AZURE-NPM-INGRESS-PORT] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS -j RETURN -m mark --mark 0x2000 -m comment --comment RETURN-on-INGRESS-mark-0x2000] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS -j AZURE-NPM-INGRESS-DROPS] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS-PORT -j RETURN -m mark --mark 0x2000 -m comment --comment RETURN-on-INGRESS-mark-0x2000] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS-FROM -j RETURN -m mark --mark 0x2000 -m comment --comment RETURN-on-INGRESS-mark-0x2000] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS -j AZURE-NPM-EGRESS-PORT] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS -j RETURN -m mark --mark 0x3000 -m comment --comment RETURN-on-EGRESS-and-INGRESS-mark-0x3000] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS -j RETURN -m mark --mark 0x1000 -m comment --comment RETURN-on-EGRESS-mark-0x1000] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS -j AZURE-NPM-EGRESS-DROPS] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS-PORT -j RETURN -m mark --mark 0x3000 -m comment --comment RETURN-on-EGRESS-and-INGRESS-mark-0x3000] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS-PORT -j RETURN -m mark --mark 0x1000 -m comment --comment RETURN-on-EGRESS-mark-0x1000] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS-TO -j RETURN -m mark --mark 0x3000 -m comment --comment RETURN-on-EGRESS-and-INGRESS-mark-0x3000] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS-TO -j RETURN -m mark --mark 0x1000 -m comment --comment RETURN-on-EGRESS-mark-0x1000] -2021/04/30 23:31:28 [2658] started parsing ingress rule -2021/04/30 23:31:28 [2658] finished parsing ingress rule -2021/04/30 23:31:28 [2658] started parsing egress rule -2021/04/30 23:31:28 [2658] finished parsing egress rule -2021/04/30 23:31:28 [2658] Finished translatePolicy -2021/04/30 23:31:28 [2658] sets: [ns-test-nwpolicy app:test ns-test-nwpolicy app:test] -2021/04/30 23:31:28 [2658] lists: [] -2021/04/30 23:31:28 [2658] entries: -2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-3260345197 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-allow-ingress-in-ns-test-nwpolicy-0in-AND-TCP-PORT-8000-TO-ns-test-nwpolicy]} -2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-8000-TO-ns-test-nwpolicy]} -2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS]} -2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-0-FROM-ns-test-nwpolicy]} -2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS]} -2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -j DROP -m comment --comment DROP-ALL-TO-ns-test-nwpolicy]} -2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 src -j DROP -m comment --comment DROP-ALL-FROM-ns-test-nwpolicy]} -I0430 23:31:28.774738 2658 networkPolicyController.go:343] Creating set: ns-test-nwpolicy, hashedSet: azure-npm-806075013 -2021/04/30 23:31:28 [2658] Creating Set: &{operationFlag:-N name:ns-test-nwpolicy set:azure-npm-806075013 spec:[nethash]} -2021/04/30 23:31:28 [2658] Executing ipset command ipset [-N -exist azure-npm-806075013 nethash] -I0430 23:31:28.776626 2658 networkPolicyController.go:343] Creating set: app:test, hashedSet: azure-npm-2817129730 -2021/04/30 23:31:28 [2658] Creating Set: &{operationFlag:-N name:app:test set:azure-npm-2817129730 spec:[nethash]} -2021/04/30 23:31:28 [2658] Executing ipset command ipset [-N -exist azure-npm-2817129730 nethash] -I0430 23:31:28.778064 2658 networkPolicyController.go:349] Creating set: namedport:0, hashedSet: azure-npm-1468440115 -2021/04/30 23:31:28 [2658] Creating Set: &{operationFlag:-N name:namedport:0 set:azure-npm-1468440115 spec:[hash:ip,port]} -2021/04/30 23:31:28 [2658] Executing ipset command ipset [-N -exist azure-npm-1468440115 hash:ip,port] -I0430 23:31:28.779267 2658 networkPolicyController.go:436] Creating set: allow-ingress-in-ns-test-nwpolicy-0in, hashedSet: azure-npm-3260345197 -2021/04/30 23:31:28 [2658] Creating Set: &{operationFlag:-N name:allow-ingress-in-ns-test-nwpolicy-0in set:azure-npm-3260345197 spec:[nethash maxelem 4294967295]} -2021/04/30 23:31:28 [2658] Executing ipset command ipset [-N -exist azure-npm-3260345197 nethash maxelem 4294967295] -2021/04/30 23:31:28 [2658] Executing ipset command ipset [-A -exist azure-npm-3260345197 1.0.0.0/1] -2021/04/30 23:31:28 [2658] Executing ipset command ipset [-A -exist azure-npm-3260345197 128.0.0.0/1] -I0430 23:31:28.782383 2658 networkPolicyController.go:436] Creating set: allow-ingress-in-ns-test-nwpolicy-0out, hashedSet: azure-npm-3481675862 -2021/04/30 23:31:28 [2658] Creating Set: &{operationFlag:-N name:allow-ingress-in-ns-test-nwpolicy-0out set:azure-npm-3481675862 spec:[nethash maxelem 4294967295]} -2021/04/30 23:31:28 [2658] Executing ipset command ipset [-N -exist azure-npm-3481675862 nethash maxelem 4294967295] -2021/04/30 23:31:28 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-3260345197 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-allow-ingress-in-ns-test-nwpolicy-0in-AND-TCP-PORT-8000-TO-ns-test-nwpolicy]}. -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-INGRESS-PORT -m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-3260345197 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-allow-ingress-in-ns-test-nwpolicy-0in-AND-TCP-PORT-8000-TO-ns-test-nwpolicy] -2021/04/30 23:31:28 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-8000-TO-ns-test-nwpolicy]}. -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-INGRESS-PORT -m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-8000-TO-ns-test-nwpolicy] -2021/04/30 23:31:28 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS]}. -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS-PORT -m set --match-set azure-npm-806075013 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS] -2021/04/30 23:31:28 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-0-FROM-ns-test-nwpolicy]}. -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-EGRESS-PORT -m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-0-FROM-ns-test-nwpolicy] -2021/04/30 23:31:28 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS]}. -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS-PORT -m set --match-set azure-npm-806075013 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS] -2021/04/30 23:31:28 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -j DROP -m comment --comment DROP-ALL-TO-ns-test-nwpolicy]}. -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-INGRESS-DROPS -m set --match-set azure-npm-806075013 dst -j DROP -m comment --comment DROP-ALL-TO-ns-test-nwpolicy] -2021/04/30 23:31:28 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 src -j DROP -m comment --comment DROP-ALL-FROM-ns-test-nwpolicy]}. -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-EGRESS-DROPS -m set --match-set azure-npm-806075013 src -j DROP -m comment --comment DROP-ALL-FROM-ns-test-nwpolicy] -I0430 23:31:28.802974 2658 networkPolicyController.go:216] Successfully synced 'test-nwpolicy/allow-ingress' - networkPolicyController_test.go:172: Complete adding network policy event -I0430 23:31:28.803333 2658 networkPolicyController.go:247] Network Policy test-nwpolicy/allow-ingress is not found, may be it is deleted -2021/04/30 23:31:28 [2658] started parsing ingress rule -2021/04/30 23:31:28 [2658] finished parsing ingress rule -2021/04/30 23:31:28 [2658] started parsing egress rule -2021/04/30 23:31:28 [2658] finished parsing egress rule -2021/04/30 23:31:28 [2658] Finished translatePolicy -2021/04/30 23:31:28 [2658] sets: [ns-test-nwpolicy app:test ns-test-nwpolicy app:test] -2021/04/30 23:31:28 [2658] lists: [] -2021/04/30 23:31:28 [2658] entries: -2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-3260345197 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-allow-ingress-in-ns-test-nwpolicy-0in-AND-TCP-PORT-8000-TO-ns-test-nwpolicy]} -2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-8000-TO-ns-test-nwpolicy]} -2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS]} -2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-0-FROM-ns-test-nwpolicy]} -2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS]} -2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -j DROP -m comment --comment DROP-ALL-TO-ns-test-nwpolicy]} -2021/04/30 23:31:28 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 src -j DROP -m comment --comment DROP-ALL-FROM-ns-test-nwpolicy]} -2021/04/30 23:31:28 [2658] Deleting iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-3260345197 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-allow-ingress-in-ns-test-nwpolicy-0in-AND-TCP-PORT-8000-TO-ns-test-nwpolicy]} -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -D AZURE-NPM-INGRESS-PORT -m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-3260345197 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-allow-ingress-in-ns-test-nwpolicy-0in-AND-TCP-PORT-8000-TO-ns-test-nwpolicy] -2021/04/30 23:31:28 [2658] Deleting iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-8000-TO-ns-test-nwpolicy]} -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -D AZURE-NPM-INGRESS-PORT -m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-8000-TO-ns-test-nwpolicy] -2021/04/30 23:31:28 [2658] Deleting iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS]} -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -D AZURE-NPM-INGRESS-PORT -m set --match-set azure-npm-806075013 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS] -2021/04/30 23:31:28 [2658] Deleting iptables entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-0-FROM-ns-test-nwpolicy]} -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -D AZURE-NPM-EGRESS-PORT -m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-0-FROM-ns-test-nwpolicy] -2021/04/30 23:31:28 [2658] Deleting iptables entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS]} -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -D AZURE-NPM-EGRESS-PORT -m set --match-set azure-npm-806075013 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS] -2021/04/30 23:31:28 [2658] Deleting iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -j DROP -m comment --comment DROP-ALL-TO-ns-test-nwpolicy]} -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -D AZURE-NPM-INGRESS-DROPS -m set --match-set azure-npm-806075013 dst -j DROP -m comment --comment DROP-ALL-TO-ns-test-nwpolicy] -2021/04/30 23:31:28 [2658] Deleting iptables entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 src -j DROP -m comment --comment DROP-ALL-FROM-ns-test-nwpolicy]} -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -D AZURE-NPM-EGRESS-DROPS -m set --match-set azure-npm-806075013 src -j DROP -m comment --comment DROP-ALL-FROM-ns-test-nwpolicy] -I0430 23:31:28.834608 2658 networkPolicyController.go:467] Delete set: allow-ingress-in-ns-test-nwpolicy-0in, hashedSet: azure-npm-3260345197 -2021/04/30 23:31:28 [2658] Executing ipset command ipset [-X -exist azure-npm-3260345197] -I0430 23:31:28.873629 2658 networkPolicyController.go:467] Delete set: allow-ingress-in-ns-test-nwpolicy-0out, hashedSet: azure-npm-3481675862 -2021/04/30 23:31:28 [2658] Executing ipset command ipset [-X -exist azure-npm-3481675862] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -D FORWARD -j AZURE-NPM] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -F AZURE-NPM] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -F AZURE-NPM-ACCEPT] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -F AZURE-NPM-INGRESS] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -F AZURE-NPM-EGRESS] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -F AZURE-NPM-INGRESS-PORT] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -F AZURE-NPM-INGRESS-FROM] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -F AZURE-NPM-EGRESS-PORT] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -F AZURE-NPM-EGRESS-TO] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -F AZURE-NPM-INGRESS-DROPS] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -F AZURE-NPM-EGRESS-DROPS] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -F AZURE-NPM-TARGET-SETS] -2021/04/30 23:31:28 [2658] AppInsights didn't initialized. -2021/04/30 23:31:28 [2658] Error: There was an error running command: [iptables -w 60 -F AZURE-NPM-TARGET-SETS] Stderr: [exit status 1, iptables: No chain/target/match by that name.] -2021/04/30 23:31:28 [2658] AppInsights didn't initialized. -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -F AZURE-NPM-INRGESS-DROPS] -2021/04/30 23:31:28 [2658] AppInsights didn't initialized. -2021/04/30 23:31:28 [2658] Error: There was an error running command: [iptables -w 60 -F AZURE-NPM-INRGESS-DROPS] Stderr: [exit status 1, iptables: No chain/target/match by that name.] -2021/04/30 23:31:28 [2658] AppInsights didn't initialized. -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -X AZURE-NPM] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -X AZURE-NPM-ACCEPT] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -X AZURE-NPM-INGRESS] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -X AZURE-NPM-EGRESS] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -X AZURE-NPM-INGRESS-PORT] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -X AZURE-NPM-INGRESS-FROM] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -X AZURE-NPM-EGRESS-PORT] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -X AZURE-NPM-EGRESS-TO] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -X AZURE-NPM-INGRESS-DROPS] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -X AZURE-NPM-EGRESS-DROPS] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -X AZURE-NPM-TARGET-SETS] -2021/04/30 23:31:28 [2658] AppInsights didn't initialized. -2021/04/30 23:31:28 [2658] Error: There was an error running command: [iptables -w 60 -X AZURE-NPM-TARGET-SETS] Stderr: [exit status 1, iptables: No chain/target/match by that name.] -2021/04/30 23:31:28 [2658] AppInsights didn't initialized. -2021/04/30 23:31:28 [2658] Chain doesn't exist AZURE-NPM-TARGET-SETS. -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -X AZURE-NPM-INRGESS-DROPS] -2021/04/30 23:31:28 [2658] AppInsights didn't initialized. -2021/04/30 23:31:28 [2658] Error: There was an error running command: [iptables -w 60 -X AZURE-NPM-INRGESS-DROPS] Stderr: [exit status 1, iptables: No chain/target/match by that name.] -2021/04/30 23:31:28 [2658] AppInsights didn't initialized. -2021/04/30 23:31:28 [2658] Chain doesn't exist AZURE-NPM-INRGESS-DROPS. -I0430 23:31:28.987320 2658 networkPolicyController.go:216] Successfully synced 'test-nwpolicy/allow-ingress' ---- PASS: TestDeleteNetworkPolicyWithTombstoneAfterAddingNetworkPolicy (0.29s) -=== RUN TestUpdateNetworkPolicy -2021/04/30 23:31:28 [2658] Error creating metric num_policies -2021/04/30 23:31:28 [2658] Error creating metric add_policy_exec_time -2021/04/30 23:31:28 [2658] Error creating metric num_iptables_rules -2021/04/30 23:31:28 [2658] Error creating metric add_iptables_rule_exec_time -2021/04/30 23:31:28 [2658] Error creating metric num_ipsets -2021/04/30 23:31:28 [2658] Error creating metric add_ipset_exec_time -2021/04/30 23:31:28 [2658] Error creating metric num_ipset_entries -2021/04/30 23:31:28 [2658] Error creating metric ipset_counts -2021/04/30 23:31:28 [2658] Finished initializing all Prometheus metrics -2021/04/30 23:31:28 [2658] Creating Set: &{operationFlag:-N name:kube-system set:azure-npm-2725615454 spec:[nethash]} -2021/04/30 23:31:28 [2658] Executing ipset command ipset [-N -exist azure-npm-2725615454 nethash] -2021/04/30 23:31:28 [2658] Initializing AZURE-NPM chains. -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-ACCEPT] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-INGRESS] -2021/04/30 23:31:28 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-EGRESS] -2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-INGRESS-PORT] -2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-INGRESS-FROM] -2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-EGRESS-PORT] -2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-EGRESS-TO] -2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-INGRESS-DROPS] -2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-EGRESS-DROPS] -2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM] -2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -I FORWARD 1 -j AZURE-NPM] -2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM -j AZURE-NPM-INGRESS] -2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM -j AZURE-NPM-EGRESS] -2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM -j AZURE-NPM-ACCEPT -m mark --mark 0x3000 -m comment --comment ACCEPT-on-INGRESS-and-EGRESS-mark-0x3000] -2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM -j AZURE-NPM-ACCEPT -m mark --mark 0x2000 -m comment --comment ACCEPT-on-INGRESS-mark-0x2000] -2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM -j AZURE-NPM-ACCEPT -m mark --mark 0x1000 -m comment --comment ACCEPT-on-EGRESS-mark-0x1000] -2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM -m state --state RELATED,ESTABLISHED -j ACCEPT -m comment --comment ACCEPT-on-connection-state] -2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-ACCEPT -j MARK --set-mark 0x0 -m comment --comment Clear-AZURE-NPM-MARKS] -2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-ACCEPT -j ACCEPT -m comment --comment ACCEPT-All-packets] -2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS -j AZURE-NPM-INGRESS-PORT] -2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS -j RETURN -m mark --mark 0x2000 -m comment --comment RETURN-on-INGRESS-mark-0x2000] -2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS -j AZURE-NPM-INGRESS-DROPS] -2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS-PORT -j RETURN -m mark --mark 0x2000 -m comment --comment RETURN-on-INGRESS-mark-0x2000] -2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS-FROM -j RETURN -m mark --mark 0x2000 -m comment --comment RETURN-on-INGRESS-mark-0x2000] -2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS -j AZURE-NPM-EGRESS-PORT] -2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS -j RETURN -m mark --mark 0x3000 -m comment --comment RETURN-on-EGRESS-and-INGRESS-mark-0x3000] -2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS -j RETURN -m mark --mark 0x1000 -m comment --comment RETURN-on-EGRESS-mark-0x1000] -2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS -j AZURE-NPM-EGRESS-DROPS] -2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS-PORT -j RETURN -m mark --mark 0x3000 -m comment --comment RETURN-on-EGRESS-and-INGRESS-mark-0x3000] -2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS-PORT -j RETURN -m mark --mark 0x1000 -m comment --comment RETURN-on-EGRESS-mark-0x1000] -2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS-TO -j RETURN -m mark --mark 0x3000 -m comment --comment RETURN-on-EGRESS-and-INGRESS-mark-0x3000] -2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS-TO -j RETURN -m mark --mark 0x1000 -m comment --comment RETURN-on-EGRESS-mark-0x1000] -2021/04/30 23:31:29 [2658] started parsing ingress rule -2021/04/30 23:31:29 [2658] finished parsing ingress rule -2021/04/30 23:31:29 [2658] started parsing egress rule -2021/04/30 23:31:29 [2658] finished parsing egress rule -2021/04/30 23:31:29 [2658] Finished translatePolicy -2021/04/30 23:31:29 [2658] sets: [ns-test-nwpolicy app:test ns-test-nwpolicy app:test] -2021/04/30 23:31:29 [2658] lists: [] -2021/04/30 23:31:29 [2658] entries: -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-3260345197 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-allow-ingress-in-ns-test-nwpolicy-0in-AND-TCP-PORT-8000-TO-ns-test-nwpolicy]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-8000-TO-ns-test-nwpolicy]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-0-FROM-ns-test-nwpolicy]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -j DROP -m comment --comment DROP-ALL-TO-ns-test-nwpolicy]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 src -j DROP -m comment --comment DROP-ALL-FROM-ns-test-nwpolicy]} -I0430 23:31:29.077857 2658 networkPolicyController.go:343] Creating set: ns-test-nwpolicy, hashedSet: azure-npm-806075013 -2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:ns-test-nwpolicy set:azure-npm-806075013 spec:[nethash]} -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-806075013 nethash] -I0430 23:31:29.079058 2658 networkPolicyController.go:343] Creating set: app:test, hashedSet: azure-npm-2817129730 -2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:app:test set:azure-npm-2817129730 spec:[nethash]} -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-2817129730 nethash] -I0430 23:31:29.080432 2658 networkPolicyController.go:349] Creating set: namedport:0, hashedSet: azure-npm-1468440115 -2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:namedport:0 set:azure-npm-1468440115 spec:[hash:ip,port]} -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-1468440115 hash:ip,port] -I0430 23:31:29.081668 2658 networkPolicyController.go:436] Creating set: allow-ingress-in-ns-test-nwpolicy-0in, hashedSet: azure-npm-3260345197 -2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:allow-ingress-in-ns-test-nwpolicy-0in set:azure-npm-3260345197 spec:[nethash maxelem 4294967295]} -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-3260345197 nethash maxelem 4294967295] -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-3260345197 1.0.0.0/1] -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-3260345197 128.0.0.0/1] -I0430 23:31:29.088034 2658 networkPolicyController.go:436] Creating set: allow-ingress-in-ns-test-nwpolicy-0out, hashedSet: azure-npm-3481675862 -2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:allow-ingress-in-ns-test-nwpolicy-0out set:azure-npm-3481675862 spec:[nethash maxelem 4294967295]} -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-3481675862 nethash maxelem 4294967295] -2021/04/30 23:31:29 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-3260345197 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-allow-ingress-in-ns-test-nwpolicy-0in-AND-TCP-PORT-8000-TO-ns-test-nwpolicy]}. -2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-INGRESS-PORT -m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-3260345197 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-allow-ingress-in-ns-test-nwpolicy-0in-AND-TCP-PORT-8000-TO-ns-test-nwpolicy] -2021/04/30 23:31:29 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-8000-TO-ns-test-nwpolicy]}. -2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-INGRESS-PORT -m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-8000-TO-ns-test-nwpolicy] -2021/04/30 23:31:29 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS]}. -2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS-PORT -m set --match-set azure-npm-806075013 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS] -2021/04/30 23:31:29 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-0-FROM-ns-test-nwpolicy]}. -2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-EGRESS-PORT -m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-0-FROM-ns-test-nwpolicy] -2021/04/30 23:31:29 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS]}. -2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS-PORT -m set --match-set azure-npm-806075013 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS] -2021/04/30 23:31:29 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -j DROP -m comment --comment DROP-ALL-TO-ns-test-nwpolicy]}. -2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-INGRESS-DROPS -m set --match-set azure-npm-806075013 dst -j DROP -m comment --comment DROP-ALL-TO-ns-test-nwpolicy] -2021/04/30 23:31:29 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 src -j DROP -m comment --comment DROP-ALL-FROM-ns-test-nwpolicy]}. -2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-EGRESS-DROPS -m set --match-set azure-npm-806075013 src -j DROP -m comment --comment DROP-ALL-FROM-ns-test-nwpolicy] -I0430 23:31:29.100307 2658 networkPolicyController.go:216] Successfully synced 'test-nwpolicy/allow-ingress' - networkPolicyController_test.go:197: Complete adding network policy event ---- PASS: TestUpdateNetworkPolicy (0.11s) -=== RUN TestLabelUpdateNetworkPolicy -2021/04/30 23:31:29 [2658] Error creating metric num_policies -2021/04/30 23:31:29 [2658] Error creating metric add_policy_exec_time -2021/04/30 23:31:29 [2658] Error creating metric num_iptables_rules -2021/04/30 23:31:29 [2658] Error creating metric add_iptables_rule_exec_time -2021/04/30 23:31:29 [2658] Error creating metric num_ipsets -2021/04/30 23:31:29 [2658] Error creating metric add_ipset_exec_time -2021/04/30 23:31:29 [2658] Error creating metric num_ipset_entries -2021/04/30 23:31:29 [2658] Error creating metric ipset_counts -2021/04/30 23:31:29 [2658] Finished initializing all Prometheus metrics -2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:kube-system set:azure-npm-2725615454 spec:[nethash]} -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-2725615454 nethash] -2021/04/30 23:31:29 [2658] Initializing AZURE-NPM chains. -2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM] -2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-ACCEPT] -2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-INGRESS] -2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-EGRESS] -2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-INGRESS-PORT] -2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-INGRESS-FROM] -2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-EGRESS-PORT] -2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-EGRESS-TO] -2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-INGRESS-DROPS] -2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM-EGRESS-DROPS] -2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -N AZURE-NPM] -2021/04/30 23:31:29 [2658] started parsing ingress rule -2021/04/30 23:31:29 [2658] finished parsing ingress rule -2021/04/30 23:31:29 [2658] started parsing egress rule -2021/04/30 23:31:29 [2658] finished parsing egress rule -2021/04/30 23:31:29 [2658] Finished translatePolicy -2021/04/30 23:31:29 [2658] sets: [ns-test-nwpolicy app:test ns-test-nwpolicy app:test] -2021/04/30 23:31:29 [2658] lists: [] -2021/04/30 23:31:29 [2658] entries: -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-3260345197 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-allow-ingress-in-ns-test-nwpolicy-0in-AND-TCP-PORT-8000-TO-ns-test-nwpolicy]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-8000-TO-ns-test-nwpolicy]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-0-FROM-ns-test-nwpolicy]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -j DROP -m comment --comment DROP-ALL-TO-ns-test-nwpolicy]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 src -j DROP -m comment --comment DROP-ALL-FROM-ns-test-nwpolicy]} -I0430 23:31:29.159798 2658 networkPolicyController.go:343] Creating set: ns-test-nwpolicy, hashedSet: azure-npm-806075013 -2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:ns-test-nwpolicy set:azure-npm-806075013 spec:[nethash]} -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-806075013 nethash] -I0430 23:31:29.160752 2658 networkPolicyController.go:343] Creating set: app:test, hashedSet: azure-npm-2817129730 -2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:app:test set:azure-npm-2817129730 spec:[nethash]} -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-2817129730 nethash] -I0430 23:31:29.161722 2658 networkPolicyController.go:349] Creating set: namedport:0, hashedSet: azure-npm-1468440115 -2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:namedport:0 set:azure-npm-1468440115 spec:[hash:ip,port]} -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-1468440115 hash:ip,port] -I0430 23:31:29.162756 2658 networkPolicyController.go:436] Creating set: allow-ingress-in-ns-test-nwpolicy-0in, hashedSet: azure-npm-3260345197 -2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:allow-ingress-in-ns-test-nwpolicy-0in set:azure-npm-3260345197 spec:[nethash maxelem 4294967295]} -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-3260345197 nethash maxelem 4294967295] -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-3260345197 1.0.0.0/1] -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-3260345197 128.0.0.0/1] -I0430 23:31:29.165768 2658 networkPolicyController.go:436] Creating set: allow-ingress-in-ns-test-nwpolicy-0out, hashedSet: azure-npm-3481675862 -2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:allow-ingress-in-ns-test-nwpolicy-0out set:azure-npm-3481675862 spec:[nethash maxelem 4294967295]} -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-3481675862 nethash maxelem 4294967295] -2021/04/30 23:31:29 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-3260345197 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-allow-ingress-in-ns-test-nwpolicy-0in-AND-TCP-PORT-8000-TO-ns-test-nwpolicy]}. -2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-INGRESS-PORT -m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-3260345197 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-allow-ingress-in-ns-test-nwpolicy-0in-AND-TCP-PORT-8000-TO-ns-test-nwpolicy] -2021/04/30 23:31:29 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-8000-TO-ns-test-nwpolicy]}. -2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-INGRESS-PORT -m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-8000-TO-ns-test-nwpolicy] -2021/04/30 23:31:29 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS]}. -2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS-PORT -m set --match-set azure-npm-806075013 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS] -2021/04/30 23:31:29 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-0-FROM-ns-test-nwpolicy]}. -2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-EGRESS-PORT -m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-0-FROM-ns-test-nwpolicy] -2021/04/30 23:31:29 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS]}. -2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS-PORT -m set --match-set azure-npm-806075013 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS] -2021/04/30 23:31:29 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -j DROP -m comment --comment DROP-ALL-TO-ns-test-nwpolicy]}. -2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-INGRESS-DROPS -m set --match-set azure-npm-806075013 dst -j DROP -m comment --comment DROP-ALL-TO-ns-test-nwpolicy] -2021/04/30 23:31:29 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 src -j DROP -m comment --comment DROP-ALL-FROM-ns-test-nwpolicy]}. -2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-EGRESS-DROPS -m set --match-set azure-npm-806075013 src -j DROP -m comment --comment DROP-ALL-FROM-ns-test-nwpolicy] -I0430 23:31:29.181288 2658 networkPolicyController.go:216] Successfully synced 'test-nwpolicy/allow-ingress' - networkPolicyController_test.go:197: Complete adding network policy event -2021/04/30 23:31:29 [2658] started parsing ingress rule -2021/04/30 23:31:29 [2658] finished parsing ingress rule -2021/04/30 23:31:29 [2658] started parsing egress rule -2021/04/30 23:31:29 [2658] finished parsing egress rule -2021/04/30 23:31:29 [2658] Finished translatePolicy -2021/04/30 23:31:29 [2658] sets: [ns-test-nwpolicy app:test ns-test-nwpolicy app:test] -2021/04/30 23:31:29 [2658] lists: [] -2021/04/30 23:31:29 [2658] entries: -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-3260345197 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-allow-ingress-in-ns-test-nwpolicy-0in-AND-TCP-PORT-8000-TO-ns-test-nwpolicy]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-8000-TO-ns-test-nwpolicy]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-0-FROM-ns-test-nwpolicy]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -j DROP -m comment --comment DROP-ALL-TO-ns-test-nwpolicy]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 src -j DROP -m comment --comment DROP-ALL-FROM-ns-test-nwpolicy]} -2021/04/30 23:31:29 [2658] Deleting iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-3260345197 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-allow-ingress-in-ns-test-nwpolicy-0in-AND-TCP-PORT-8000-TO-ns-test-nwpolicy]} -2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -D AZURE-NPM-INGRESS-PORT -m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-3260345197 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-allow-ingress-in-ns-test-nwpolicy-0in-AND-TCP-PORT-8000-TO-ns-test-nwpolicy] -2021/04/30 23:31:29 [2658] Deleting iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-8000-TO-ns-test-nwpolicy]} -2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -D AZURE-NPM-INGRESS-PORT -m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-8000-TO-ns-test-nwpolicy] -2021/04/30 23:31:29 [2658] Deleting iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS]} -2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -D AZURE-NPM-INGRESS-PORT -m set --match-set azure-npm-806075013 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS] -2021/04/30 23:31:29 [2658] Deleting iptables entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-0-FROM-ns-test-nwpolicy]} -2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -D AZURE-NPM-EGRESS-PORT -m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-0-FROM-ns-test-nwpolicy] -2021/04/30 23:31:29 [2658] Deleting iptables entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS]} -2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -D AZURE-NPM-EGRESS-PORT -m set --match-set azure-npm-806075013 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS] -2021/04/30 23:31:29 [2658] Deleting iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -j DROP -m comment --comment DROP-ALL-TO-ns-test-nwpolicy]} -2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -D AZURE-NPM-INGRESS-DROPS -m set --match-set azure-npm-806075013 dst -j DROP -m comment --comment DROP-ALL-TO-ns-test-nwpolicy] -2021/04/30 23:31:29 [2658] Deleting iptables entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 src -j DROP -m comment --comment DROP-ALL-FROM-ns-test-nwpolicy]} -2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -D AZURE-NPM-EGRESS-DROPS -m set --match-set azure-npm-806075013 src -j DROP -m comment --comment DROP-ALL-FROM-ns-test-nwpolicy] -I0430 23:31:29.207273 2658 networkPolicyController.go:467] Delete set: allow-ingress-in-ns-test-nwpolicy-0in, hashedSet: azure-npm-3260345197 -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-X -exist azure-npm-3260345197] -2021/04/30 23:31:29 [2658] AppInsights didn't initialized. -2021/04/30 23:31:29 [2658] Error: There was an error running command: [ipset -X -exist azure-npm-3260345197] Stderr: [exit status 1, ipset v6.34: Set cannot be destroyed: it is in use by a kernel component] -2021/04/30 23:31:29 [2658] AppInsights didn't initialized. -I0430 23:31:29.229820 2658 networkPolicyController.go:467] Delete set: allow-ingress-in-ns-test-nwpolicy-0out, hashedSet: azure-npm-3481675862 -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-X -exist azure-npm-3481675862] -2021/04/30 23:31:29 [2658] started parsing ingress rule -2021/04/30 23:31:29 [2658] finished parsing ingress rule -2021/04/30 23:31:29 [2658] started parsing egress rule -2021/04/30 23:31:29 [2658] finished parsing egress rule -2021/04/30 23:31:29 [2658] Finished translatePolicy -2021/04/30 23:31:29 [2658] sets: [app:test new:test ns-test-nwpolicy app:test app:test new:test ns-test-nwpolicy app:test] -2021/04/30 23:31:29 [2658] lists: [] -2021/04/30 23:31:29 [2658] entries: -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-1144646857 dst -m set --match-set azure-npm-3260345197 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-allow-ingress-in-ns-test-nwpolicy-0in-AND-TCP-PORT-8000-TO-app:test-AND-new:test-IN-ns-test-nwpolicy]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-1144646857 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-8000-TO-app:test-AND-new:test-IN-ns-test-nwpolicy]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-1144646857 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-app:test-AND-new:test-IN-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -m set --match-set azure-npm-1144646857 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-0-FROM-app:test-AND-new:test-IN-ns-test-nwpolicy]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -m set --match-set azure-npm-1144646857 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-app:test-AND-new:test-IN-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-1144646857 dst -j DROP -m comment --comment DROP-ALL-TO-app:test-AND-new:test-IN-ns-test-nwpolicy]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -m set --match-set azure-npm-1144646857 src -j DROP -m comment --comment DROP-ALL-FROM-app:test-AND-new:test-IN-ns-test-nwpolicy]} -I0430 23:31:29.262601 2658 networkPolicyController.go:343] Creating set: app:test, hashedSet: azure-npm-2817129730 -I0430 23:31:29.262641 2658 networkPolicyController.go:343] Creating set: new:test, hashedSet: azure-npm-1144646857 -2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:new:test set:azure-npm-1144646857 spec:[nethash]} -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-1144646857 nethash] -I0430 23:31:29.264318 2658 networkPolicyController.go:343] Creating set: ns-test-nwpolicy, hashedSet: azure-npm-806075013 -I0430 23:31:29.264379 2658 networkPolicyController.go:349] Creating set: namedport:0, hashedSet: azure-npm-1468440115 -I0430 23:31:29.264420 2658 networkPolicyController.go:436] Creating set: allow-ingress-in-ns-test-nwpolicy-0in, hashedSet: azure-npm-3260345197 -I0430 23:31:29.264483 2658 networkPolicyController.go:436] Creating set: allow-ingress-in-ns-test-nwpolicy-0out, hashedSet: azure-npm-3481675862 -2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:allow-ingress-in-ns-test-nwpolicy-0out set:azure-npm-3481675862 spec:[nethash maxelem 4294967295]} -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-3481675862 nethash maxelem 4294967295] -2021/04/30 23:31:29 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-1144646857 dst -m set --match-set azure-npm-3260345197 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-allow-ingress-in-ns-test-nwpolicy-0in-AND-TCP-PORT-8000-TO-app:test-AND-new:test-IN-ns-test-nwpolicy]}. -2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-INGRESS-PORT -m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-1144646857 dst -m set --match-set azure-npm-3260345197 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-allow-ingress-in-ns-test-nwpolicy-0in-AND-TCP-PORT-8000-TO-app:test-AND-new:test-IN-ns-test-nwpolicy] -2021/04/30 23:31:29 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-1144646857 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-8000-TO-app:test-AND-new:test-IN-ns-test-nwpolicy]}. -2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-INGRESS-PORT -m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-1144646857 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -p TCP --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-8000-TO-app:test-AND-new:test-IN-ns-test-nwpolicy] -2021/04/30 23:31:29 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-1144646857 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-app:test-AND-new:test-IN-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS]}. -2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS-PORT -m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-1144646857 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-app:test-AND-new:test-IN-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS] -2021/04/30 23:31:29 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -m set --match-set azure-npm-1144646857 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-0-FROM-app:test-AND-new:test-IN-ns-test-nwpolicy]}. -2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-EGRESS-PORT -m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -m set --match-set azure-npm-1144646857 src -m set --match-set azure-npm-1468440115 dst,dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-app:test-IN-ns-test-nwpolicy-AND-TCP-PORT-0-FROM-app:test-AND-new:test-IN-ns-test-nwpolicy] -2021/04/30 23:31:29 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -m set --match-set azure-npm-1144646857 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-app:test-AND-new:test-IN-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS]}. -2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS-PORT -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -m set --match-set azure-npm-1144646857 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-app:test-AND-new:test-IN-ns-test-nwpolicy-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS] -2021/04/30 23:31:29 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-1144646857 dst -j DROP -m comment --comment DROP-ALL-TO-app:test-AND-new:test-IN-ns-test-nwpolicy]}. -2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-INGRESS-DROPS -m set --match-set azure-npm-806075013 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-1144646857 dst -j DROP -m comment --comment DROP-ALL-TO-app:test-AND-new:test-IN-ns-test-nwpolicy] -2021/04/30 23:31:29 [2658] Adding iptables entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -m set --match-set azure-npm-1144646857 src -j DROP -m comment --comment DROP-ALL-FROM-app:test-AND-new:test-IN-ns-test-nwpolicy]}. -2021/04/30 23:31:29 [2658] Executing iptables command iptables [-w 60 -I AZURE-NPM-EGRESS-DROPS -m set --match-set azure-npm-806075013 src -m set --match-set azure-npm-2817129730 src -m set --match-set azure-npm-1144646857 src -j DROP -m comment --comment DROP-ALL-FROM-app:test-AND-new:test-IN-ns-test-nwpolicy] -I0430 23:31:29.294909 2658 networkPolicyController.go:216] Successfully synced 'test-nwpolicy/allow-ingress' ---- PASS: TestLabelUpdateNetworkPolicy (0.19s) -=== RUN TestAddPolicy ---- PASS: TestAddPolicy (0.00s) -=== RUN TestDeductPolicy ---- PASS: TestDeductPolicy (0.00s) -=== RUN TestParseLabel ---- PASS: TestParseLabel (0.00s) -=== RUN TestGetOperatorAndLabel ---- PASS: TestGetOperatorAndLabel (0.00s) -=== RUN TestGetOperatorsAndLabels ---- PASS: TestGetOperatorsAndLabels (0.00s) -=== RUN TestReqHeap ---- PASS: TestReqHeap (0.00s) -=== RUN TestSortSelector ---- PASS: TestSortSelector (0.00s) -=== RUN TestHashSelector ---- PASS: TestHashSelector (0.00s) -=== RUN TestParseSelector ---- PASS: TestParseSelector (0.00s) -=== RUN TestAddMultiplePods -I0430 23:31:29.297423 2658 podController.go:148] [POD ADD EVENT] for test-pod-1 in test-namespace -I0430 23:31:29.297512 2658 podController.go:438] [syncAddAndUpdatePod] updating Pod with key test-namespace/test-pod-1 -I0430 23:31:29.297569 2658 podController.go:447] Creating set: ns-test-namespace, hashedSet: azure-npm-2293040867 -2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:ns-test-namespace set:azure-npm-2293040867 spec:[nethash]} -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-2293040867 nethash] -I0430 23:31:29.297776 2658 podController.go:385] POD CREATING: [ns-test-namespace/test-pod-1/map[app:test-pod]1.2.3.4] -I0430 23:31:29.297823 2658 podController.go:400] Adding pod 1.2.3.4 to ipset ns-test-namespace -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-2293040867 1.2.3.4] -I0430 23:31:29.297999 2658 podController.go:410] Adding pod 1.2.3.4 to ipset app -2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:app set:azure-npm-527074092 spec:[nethash]} -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-527074092 nethash] -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-527074092 1.2.3.4] -I0430 23:31:29.298243 2658 podController.go:416] Adding pod 1.2.3.4 to ipset app:test-pod -2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:app:test-pod set:azure-npm-873617220 spec:[nethash]} -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-873617220 nethash] -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-873617220 1.2.3.4] -I0430 23:31:29.298471 2658 podController.go:424] Adding named port ipsets -I0430 23:31:29.298513 2658 podController.go:633] port is {Name:app:test-pod-1 HostPort:0 ContainerPort:8080 Protocol: HostIP:} -I0430 23:31:29.298576 2658 podController.go:654] in Adding named port ipsets -2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:namedport:app:test-pod-1 set:azure-npm-36138882 spec:[hash:ip,port]} -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-36138882 hash:ip,port] -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-36138882 1.2.3.4,8080] -I0430 23:31:29.298797 2658 podController.go:321] Successfully synced 'test-namespace/test-pod-1' -I0430 23:31:29.298858 2658 podController.go:148] [POD ADD EVENT] for test-pod-2 in test-namespace -I0430 23:31:29.298929 2658 podController.go:438] [syncAddAndUpdatePod] updating Pod with key test-namespace/test-pod-2 -I0430 23:31:29.298976 2658 podController.go:385] POD CREATING: [ns-test-namespace/test-pod-2/map[app:test-pod]1.2.3.5] -I0430 23:31:29.299045 2658 podController.go:400] Adding pod 1.2.3.5 to ipset ns-test-namespace -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-2293040867 1.2.3.5] -I0430 23:31:29.299158 2658 podController.go:410] Adding pod 1.2.3.5 to ipset app -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-527074092 1.2.3.5] -I0430 23:31:29.299288 2658 podController.go:416] Adding pod 1.2.3.5 to ipset app:test-pod -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-873617220 1.2.3.5] -I0430 23:31:29.299416 2658 podController.go:424] Adding named port ipsets -I0430 23:31:29.299466 2658 podController.go:633] port is {Name:app:test-pod-2 HostPort:0 ContainerPort:8080 Protocol: HostIP:} -I0430 23:31:29.299525 2658 podController.go:654] in Adding named port ipsets -2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:namedport:app:test-pod-2 set:azure-npm-19361263 spec:[hash:ip,port]} -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-19361263 hash:ip,port] -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-19361263 1.2.3.5,8080] -I0430 23:31:29.299777 2658 podController.go:321] Successfully synced 'test-namespace/test-pod-2' ---- PASS: TestAddMultiplePods (0.00s) -=== RUN TestAddPod -I0430 23:31:29.301140 2658 podController.go:148] [POD ADD EVENT] for test-pod in test-namespace -I0430 23:31:29.301254 2658 podController.go:438] [syncAddAndUpdatePod] updating Pod with key test-namespace/test-pod -I0430 23:31:29.301471 2658 podController.go:447] Creating set: ns-test-namespace, hashedSet: azure-npm-2293040867 -I0430 23:31:29.302103 2658 podController.go:148] [POD UPDATE EVENT] for test-pod in test-namespace -I0430 23:31:29.302149 2658 podController.go:201] [POD UPDATE EVENT] Two pods have the same RVs -2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:ns-test-namespace set:azure-npm-2293040867 spec:[nethash]} -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-2293040867 nethash] -I0430 23:31:29.302751 2658 podController.go:385] POD CREATING: [ns-test-namespace/test-pod/map[app:test-pod]1.2.3.4] -I0430 23:31:29.302824 2658 podController.go:400] Adding pod 1.2.3.4 to ipset ns-test-namespace -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-2293040867 1.2.3.4] -I0430 23:31:29.303019 2658 podController.go:410] Adding pod 1.2.3.4 to ipset app -2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:app set:azure-npm-527074092 spec:[nethash]} -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-527074092 nethash] -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-527074092 1.2.3.4] -I0430 23:31:29.303304 2658 podController.go:416] Adding pod 1.2.3.4 to ipset app:test-pod -2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:app:test-pod set:azure-npm-873617220 spec:[nethash]} -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-873617220 nethash] -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-873617220 1.2.3.4] -I0430 23:31:29.303537 2658 podController.go:424] Adding named port ipsets -I0430 23:31:29.303588 2658 podController.go:633] port is {Name:app:test-pod HostPort:0 ContainerPort:8080 Protocol: HostIP:} -I0430 23:31:29.303655 2658 podController.go:654] in Adding named port ipsets -2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:namedport:app:test-pod set:azure-npm-1395119760 spec:[hash:ip,port]} -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-1395119760 hash:ip,port] -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-1395119760 1.2.3.4,8080] -I0430 23:31:29.303948 2658 podController.go:321] Successfully synced 'test-namespace/test-pod' -[[ipset -N -exist azure-npm-2293040867 nethash] [ipset -A -exist azure-npm-2293040867 1.2.3.4] [ipset -N -exist azure-npm-527074092 nethash] [ipset -A -exist azure-npm-527074092 1.2.3.4] [ipset -N -exist azure-npm-873617220 nethash] [ipset -A -exist azure-npm-873617220 1.2.3.4] [ipset -N -exist azure-npm-1395119760 hash:ip,port] [ipset -A -exist azure-npm-1395119760 1.2.3.4,8080]] ---- PASS: TestAddPod (0.00s) -=== RUN TestAddHostNetworkPod -I0430 23:31:29.304825 2658 podController.go:148] [POD ADD EVENT] for test-pod in test-namespace -I0430 23:31:29.304857 2658 podController.go:155] [POD ADD EVENT] HostNetwork POD IGNORED: [/test-namespace/test-pod/map[app:test-pod]1.2.3.4] - podController_test.go:123: Add Pod: worker queue length is 0 ---- PASS: TestAddHostNetworkPod (0.00s) -=== RUN TestDeletePod -I0430 23:31:29.305290 2658 podController.go:148] [POD ADD EVENT] for test-pod in test-namespace -I0430 23:31:29.305364 2658 podController.go:438] [syncAddAndUpdatePod] updating Pod with key test-namespace/test-pod -I0430 23:31:29.305392 2658 podController.go:447] Creating set: ns-test-namespace, hashedSet: azure-npm-2293040867 -2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:ns-test-namespace set:azure-npm-2293040867 spec:[nethash]} -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-2293040867 nethash] -I0430 23:31:29.305533 2658 podController.go:385] POD CREATING: [ns-test-namespace/test-pod/map[app:test-pod]1.2.3.4] -I0430 23:31:29.305557 2658 podController.go:400] Adding pod 1.2.3.4 to ipset ns-test-namespace -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-2293040867 1.2.3.4] -I0430 23:31:29.305631 2658 podController.go:410] Adding pod 1.2.3.4 to ipset app -2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:app set:azure-npm-527074092 spec:[nethash]} -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-527074092 nethash] -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-527074092 1.2.3.4] -I0430 23:31:29.305749 2658 podController.go:416] Adding pod 1.2.3.4 to ipset app:test-pod -2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:app:test-pod set:azure-npm-873617220 spec:[nethash]} -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-873617220 nethash] -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-873617220 1.2.3.4] -I0430 23:31:29.305872 2658 podController.go:424] Adding named port ipsets -I0430 23:31:29.305890 2658 podController.go:633] port is {Name:app:test-pod HostPort:0 ContainerPort:8080 Protocol: HostIP:} -I0430 23:31:29.305918 2658 podController.go:654] in Adding named port ipsets -2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:namedport:app:test-pod set:azure-npm-1395119760 spec:[hash:ip,port]} -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-1395119760 hash:ip,port] -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-1395119760 1.2.3.4,8080] -I0430 23:31:29.306063 2658 podController.go:321] Successfully synced 'test-namespace/test-pod' - podController_test.go:132: Complete add pod event -I0430 23:31:29.306118 2658 podController.go:240] [POD DELETE EVENT] for test-pod in test-namespace -I0430 23:31:29.306151 2658 podController.go:350] pod test-namespace/test-pod not found, may be it is deleted -I0430 23:31:29.306164 2658 podController.go:550] [cleanUpDeletedPod] deleting Pod with key test-namespace/test-pod -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-D -exist azure-npm-2293040867 1.2.3.4] -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-X -exist azure-npm-2293040867] -I0430 23:31:29.306249 2658 podController.go:567] Deleting pod 1.2.3.4 from ipset app -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-D -exist azure-npm-527074092 1.2.3.4] -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-X -exist azure-npm-527074092] -I0430 23:31:29.306323 2658 podController.go:573] Deleting pod 1.2.3.4 from ipset app:test-pod -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-D -exist azure-npm-873617220 1.2.3.4] -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-X -exist azure-npm-873617220] -I0430 23:31:29.306392 2658 podController.go:633] port is {Name:app:test-pod HostPort:0 ContainerPort:8080 Protocol: HostIP:} -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-D -exist azure-npm-1395119760 1.2.3.4,8080] -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-X -exist azure-npm-1395119760] -I0430 23:31:29.306482 2658 podController.go:321] Successfully synced 'test-namespace/test-pod' ---- PASS: TestDeletePod (0.00s) -=== RUN TestDeleteHostNetworkPod -I0430 23:31:29.307711 2658 podController.go:148] [POD ADD EVENT] for test-pod in test-namespace -I0430 23:31:29.307752 2658 podController.go:155] [POD ADD EVENT] HostNetwork POD IGNORED: [/test-namespace/test-pod/map[app:test-pod]1.2.3.4] - podController_test.go:123: Add Pod: worker queue length is 0 - podController_test.go:132: Complete add pod event -I0430 23:31:29.307834 2658 podController.go:240] [POD DELETE EVENT] for test-pod in test-namespace -I0430 23:31:29.307849 2658 podController.go:242] [POD DELETE EVENT] HostNetwork POD IGNORED: [/test-namespace/test-pod/map[app:test-pod]1.2.3.4] - podController_test.go:149: Delete Pod: worker queue length is 0 ---- PASS: TestDeleteHostNetworkPod (0.00s) -=== RUN TestDeletePodWithTombstone -I0430 23:31:29.308510 2658 podController.go:240] [POD DELETE EVENT] for test-pod in test-namespace ---- PASS: TestDeletePodWithTombstone (0.00s) -=== RUN TestDeletePodWithTombstoneAfterAddingPod -I0430 23:31:29.309711 2658 podController.go:148] [POD ADD EVENT] for test-pod in test-namespace -I0430 23:31:29.310544 2658 podController.go:438] [syncAddAndUpdatePod] updating Pod with key test-namespace/test-pod -I0430 23:31:29.311034 2658 podController.go:148] [POD UPDATE EVENT] for test-pod in test-namespace -I0430 23:31:29.310632 2658 podController.go:447] Creating set: ns-test-namespace, hashedSet: azure-npm-2293040867 -I0430 23:31:29.311094 2658 podController.go:201] [POD UPDATE EVENT] Two pods have the same RVs -2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:ns-test-namespace set:azure-npm-2293040867 spec:[nethash]} -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-2293040867 nethash] -I0430 23:31:29.311341 2658 podController.go:385] POD CREATING: [ns-test-namespace/test-pod/map[app:test-pod]1.2.3.4] -I0430 23:31:29.311395 2658 podController.go:400] Adding pod 1.2.3.4 to ipset ns-test-namespace -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-2293040867 1.2.3.4] -I0430 23:31:29.311539 2658 podController.go:410] Adding pod 1.2.3.4 to ipset app -2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:app set:azure-npm-527074092 spec:[nethash]} -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-527074092 nethash] -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-527074092 1.2.3.4] -I0430 23:31:29.311771 2658 podController.go:416] Adding pod 1.2.3.4 to ipset app:test-pod -2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:app:test-pod set:azure-npm-873617220 spec:[nethash]} -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-873617220 nethash] -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-873617220 1.2.3.4] -I0430 23:31:29.312061 2658 podController.go:424] Adding named port ipsets -I0430 23:31:29.312211 2658 podController.go:633] port is {Name:app:test-pod HostPort:0 ContainerPort:8080 Protocol: HostIP:} -I0430 23:31:29.312250 2658 podController.go:654] in Adding named port ipsets -2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:namedport:app:test-pod set:azure-npm-1395119760 spec:[hash:ip,port]} -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-1395119760 hash:ip,port] -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-1395119760 1.2.3.4,8080] -I0430 23:31:29.312406 2658 podController.go:321] Successfully synced 'test-namespace/test-pod' - podController_test.go:132: Complete add pod event -I0430 23:31:29.312490 2658 podController.go:240] [POD DELETE EVENT] for test-pod in test-namespace -I0430 23:31:29.312557 2658 podController.go:350] pod test-namespace/test-pod not found, may be it is deleted -I0430 23:31:29.312610 2658 podController.go:550] [cleanUpDeletedPod] deleting Pod with key test-namespace/test-pod -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-D -exist azure-npm-2293040867 1.2.3.4] -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-X -exist azure-npm-2293040867] -I0430 23:31:29.312730 2658 podController.go:567] Deleting pod 1.2.3.4 from ipset app -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-D -exist azure-npm-527074092 1.2.3.4] -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-X -exist azure-npm-527074092] -I0430 23:31:29.312900 2658 podController.go:573] Deleting pod 1.2.3.4 from ipset app:test-pod -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-D -exist azure-npm-873617220 1.2.3.4] -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-X -exist azure-npm-873617220] -I0430 23:31:29.313055 2658 podController.go:633] port is {Name:app:test-pod HostPort:0 ContainerPort:8080 Protocol: HostIP:} -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-D -exist azure-npm-1395119760 1.2.3.4,8080] -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-X -exist azure-npm-1395119760] -I0430 23:31:29.313293 2658 podController.go:321] Successfully synced 'test-namespace/test-pod' ---- PASS: TestDeletePodWithTombstoneAfterAddingPod (0.00s) -=== RUN TestLabelUpdatePod -I0430 23:31:29.314460 2658 podController.go:148] [POD ADD EVENT] for test-pod in test-namespace -I0430 23:31:29.314568 2658 podController.go:438] [syncAddAndUpdatePod] updating Pod with key test-namespace/test-pod -I0430 23:31:29.314616 2658 podController.go:447] Creating set: ns-test-namespace, hashedSet: azure-npm-2293040867 -2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:ns-test-namespace set:azure-npm-2293040867 spec:[nethash]} -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-2293040867 nethash] -I0430 23:31:29.314809 2658 podController.go:385] POD CREATING: [ns-test-namespace/test-pod/map[app:test-pod]1.2.3.4] -I0430 23:31:29.314846 2658 podController.go:400] Adding pod 1.2.3.4 to ipset ns-test-namespace -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-2293040867 1.2.3.4] -I0430 23:31:29.315041 2658 podController.go:410] Adding pod 1.2.3.4 to ipset app -2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:app set:azure-npm-527074092 spec:[nethash]} -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-527074092 nethash] -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-527074092 1.2.3.4] -I0430 23:31:29.315310 2658 podController.go:416] Adding pod 1.2.3.4 to ipset app:test-pod -2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:app:test-pod set:azure-npm-873617220 spec:[nethash]} -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-873617220 nethash] -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-873617220 1.2.3.4] -I0430 23:31:29.315619 2658 podController.go:424] Adding named port ipsets -I0430 23:31:29.315668 2658 podController.go:633] port is {Name:app:test-pod HostPort:0 ContainerPort:8080 Protocol: HostIP:} -I0430 23:31:29.315737 2658 podController.go:654] in Adding named port ipsets -I0430 23:31:29.315712 2658 podController.go:148] [POD UPDATE EVENT] for test-pod in test-namespace -I0430 23:31:29.315819 2658 podController.go:201] [POD UPDATE EVENT] Two pods have the same RVs -2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:namedport:app:test-pod set:azure-npm-1395119760 spec:[hash:ip,port]} -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-1395119760 hash:ip,port] -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-1395119760 1.2.3.4,8080] -I0430 23:31:29.316312 2658 podController.go:321] Successfully synced 'test-namespace/test-pod' - podController_test.go:159: Complete add pod event -I0430 23:31:29.316418 2658 podController.go:148] [POD UPDATE EVENT] for test-pod in test-namespace -I0430 23:31:29.316496 2658 podController.go:438] [syncAddAndUpdatePod] updating Pod with key test-namespace/test-pod -I0430 23:31:29.316562 2658 podController.go:494] Deleting pod 1.2.3.4 from ipset app:test-pod -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-D -exist azure-npm-873617220 1.2.3.4] -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-X -exist azure-npm-873617220] -I0430 23:31:29.316798 2658 podController.go:508] Adding pod 1.2.3.4 to ipset app:new-test-pod -2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:app:new-test-pod set:azure-npm-2579824545 spec:[nethash]} -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-2579824545 nethash] -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-2579824545 1.2.3.4] -I0430 23:31:29.317120 2658 podController.go:321] Successfully synced 'test-namespace/test-pod' ---- PASS: TestLabelUpdatePod (0.00s) -=== RUN TestIPAddressUpdatePod -I0430 23:31:29.318234 2658 podController.go:148] [POD ADD EVENT] for test-pod in test-namespace -I0430 23:31:29.318511 2658 podController.go:438] [syncAddAndUpdatePod] updating Pod with key test-namespace/test-pod -I0430 23:31:29.318560 2658 podController.go:447] Creating set: ns-test-namespace, hashedSet: azure-npm-2293040867 -2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:ns-test-namespace set:azure-npm-2293040867 spec:[nethash]} -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-2293040867 nethash] -I0430 23:31:29.318775 2658 podController.go:148] [POD UPDATE EVENT] for test-pod in test-namespace -I0430 23:31:29.318832 2658 podController.go:201] [POD UPDATE EVENT] Two pods have the same RVs -I0430 23:31:29.318840 2658 podController.go:385] POD CREATING: [ns-test-namespace/test-pod/map[app:test-pod]1.2.3.4] -I0430 23:31:29.318910 2658 podController.go:400] Adding pod 1.2.3.4 to ipset ns-test-namespace -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-2293040867 1.2.3.4] -I0430 23:31:29.319075 2658 podController.go:410] Adding pod 1.2.3.4 to ipset app -2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:app set:azure-npm-527074092 spec:[nethash]} -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-527074092 nethash] -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-527074092 1.2.3.4] -I0430 23:31:29.319311 2658 podController.go:416] Adding pod 1.2.3.4 to ipset app:test-pod -2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:app:test-pod set:azure-npm-873617220 spec:[nethash]} -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-873617220 nethash] -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-873617220 1.2.3.4] -I0430 23:31:29.319627 2658 podController.go:424] Adding named port ipsets -I0430 23:31:29.319685 2658 podController.go:633] port is {Name:app:test-pod HostPort:0 ContainerPort:8080 Protocol: HostIP:} -I0430 23:31:29.319753 2658 podController.go:654] in Adding named port ipsets -2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:namedport:app:test-pod set:azure-npm-1395119760 spec:[hash:ip,port]} -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-1395119760 hash:ip,port] -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-1395119760 1.2.3.4,8080] -I0430 23:31:29.320058 2658 podController.go:321] Successfully synced 'test-namespace/test-pod' - podController_test.go:159: Complete add pod event -I0430 23:31:29.320213 2658 podController.go:148] [POD UPDATE EVENT] for test-pod in test-namespace -I0430 23:31:29.320298 2658 podController.go:438] [syncAddAndUpdatePod] updating Pod with key test-namespace/test-pod -2021/04/30 23:31:29 [2658] AppInsights didn't initialized. -2021/04/30 23:31:29 [2658] [syncAddAndUpdatePod] Info: Unexpected state. Pod (Namespace:ns-test-namespace, Name:test-pod, newUid:) , has cachedPodIp:1.2.3.4 which is different from PodIp:4.3.2.1 -2021/04/30 23:31:29 [2658] AppInsights didn't initialized. -I0430 23:31:29.320468 2658 podController.go:474] Deleting cached Pod with key:test-namespace/test-pod first due to IP Mistmatch -I0430 23:31:29.320485 2658 podController.go:550] [cleanUpDeletedPod] deleting Pod with key test-namespace/test-pod -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-D -exist azure-npm-2293040867 1.2.3.4] -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-X -exist azure-npm-2293040867] -I0430 23:31:29.320650 2658 podController.go:567] Deleting pod 1.2.3.4 from ipset app -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-D -exist azure-npm-527074092 1.2.3.4] -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-X -exist azure-npm-527074092] -I0430 23:31:29.320782 2658 podController.go:573] Deleting pod 1.2.3.4 from ipset app:test-pod -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-D -exist azure-npm-873617220 1.2.3.4] -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-X -exist azure-npm-873617220] -I0430 23:31:29.320902 2658 podController.go:633] port is {Name:app:test-pod HostPort:0 ContainerPort:8080 Protocol: HostIP:} -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-D -exist azure-npm-1395119760 1.2.3.4,8080] -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-X -exist azure-npm-1395119760] -I0430 23:31:29.321074 2658 podController.go:479] Adding back Pod with key:test-namespace/test-pod after IP Mistmatch -I0430 23:31:29.321113 2658 podController.go:385] POD CREATING: [ns-test-namespace/test-pod/map[app:test-pod]4.3.2.1] -I0430 23:31:29.321159 2658 podController.go:400] Adding pod 4.3.2.1 to ipset ns-test-namespace -2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:ns-test-namespace set:azure-npm-2293040867 spec:[nethash]} -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-2293040867 nethash] -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-2293040867 4.3.2.1] -I0430 23:31:29.321377 2658 podController.go:410] Adding pod 4.3.2.1 to ipset app -2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:app set:azure-npm-527074092 spec:[nethash]} -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-527074092 nethash] -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-527074092 4.3.2.1] -I0430 23:31:29.321505 2658 podController.go:416] Adding pod 4.3.2.1 to ipset app:test-pod -2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:app:test-pod set:azure-npm-873617220 spec:[nethash]} -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-873617220 nethash] -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-873617220 4.3.2.1] -I0430 23:31:29.321614 2658 podController.go:424] Adding named port ipsets -I0430 23:31:29.321628 2658 podController.go:633] port is {Name:app:test-pod HostPort:0 ContainerPort:8080 Protocol: HostIP:} -I0430 23:31:29.321650 2658 podController.go:654] in Adding named port ipsets -2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:namedport:app:test-pod set:azure-npm-1395119760 spec:[hash:ip,port]} -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-1395119760 hash:ip,port] -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-1395119760 4.3.2.1,8080] -I0430 23:31:29.321759 2658 podController.go:321] Successfully synced 'test-namespace/test-pod' ---- PASS: TestIPAddressUpdatePod (0.00s) -=== RUN TestPodStatusUpdatePod -I0430 23:31:29.322625 2658 podController.go:148] [POD ADD EVENT] for test-pod in test-namespace -I0430 23:31:29.322693 2658 podController.go:438] [syncAddAndUpdatePod] updating Pod with key test-namespace/test-pod -I0430 23:31:29.322719 2658 podController.go:447] Creating set: ns-test-namespace, hashedSet: azure-npm-2293040867 -2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:ns-test-namespace set:azure-npm-2293040867 spec:[nethash]} -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-2293040867 nethash] -I0430 23:31:29.322871 2658 podController.go:385] POD CREATING: [ns-test-namespace/test-pod/map[app:test-pod]1.2.3.4] -I0430 23:31:29.322900 2658 podController.go:400] Adding pod 1.2.3.4 to ipset ns-test-namespace -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-2293040867 1.2.3.4] -I0430 23:31:29.322987 2658 podController.go:410] Adding pod 1.2.3.4 to ipset app -2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:app set:azure-npm-527074092 spec:[nethash]} -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-527074092 nethash] -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-527074092 1.2.3.4] -I0430 23:31:29.323238 2658 podController.go:416] Adding pod 1.2.3.4 to ipset app:test-pod -2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:app:test-pod set:azure-npm-873617220 spec:[nethash]} -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-873617220 nethash] -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-873617220 1.2.3.4] -I0430 23:31:29.323420 2658 podController.go:424] Adding named port ipsets -I0430 23:31:29.323449 2658 podController.go:633] port is {Name:app:test-pod HostPort:0 ContainerPort:8080 Protocol: HostIP:} -I0430 23:31:29.323490 2658 podController.go:654] in Adding named port ipsets -2021/04/30 23:31:29 [2658] Creating Set: &{operationFlag:-N name:namedport:app:test-pod set:azure-npm-1395119760 spec:[hash:ip,port]} -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-N -exist azure-npm-1395119760 hash:ip,port] -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-A -exist azure-npm-1395119760 1.2.3.4,8080] -I0430 23:31:29.323681 2658 podController.go:321] Successfully synced 'test-namespace/test-pod' - podController_test.go:159: Complete add pod event -I0430 23:31:29.323778 2658 podController.go:148] [POD UPDATE EVENT] for test-pod in test-namespace -I0430 23:31:29.323839 2658 podController.go:550] [cleanUpDeletedPod] deleting Pod with key test-namespace/test-pod -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-D -exist azure-npm-2293040867 1.2.3.4] -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-X -exist azure-npm-2293040867] -I0430 23:31:29.323983 2658 podController.go:567] Deleting pod 1.2.3.4 from ipset app -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-D -exist azure-npm-527074092 1.2.3.4] -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-X -exist azure-npm-527074092] -I0430 23:31:29.324134 2658 podController.go:573] Deleting pod 1.2.3.4 from ipset app:test-pod -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-D -exist azure-npm-873617220 1.2.3.4] -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-X -exist azure-npm-873617220] -I0430 23:31:29.324279 2658 podController.go:633] port is {Name:app:test-pod HostPort:0 ContainerPort:8080 Protocol: HostIP:} -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-D -exist azure-npm-1395119760 1.2.3.4,8080] -2021/04/30 23:31:29 [2658] Executing ipset command ipset [-X -exist azure-npm-1395119760] -I0430 23:31:29.324459 2658 podController.go:321] Successfully synced 'test-namespace/test-pod' ---- PASS: TestPodStatusUpdatePod (0.00s) -=== RUN TestHasValidPodIP ---- PASS: TestHasValidPodIP (0.00s) -=== RUN TestCraftPartialIptEntrySpecFromPort -I0430 23:31:29.324875 2658 podController.go:148] [POD UPDATE EVENT] for test-pod in test-namespace ---- PASS: TestCraftPartialIptEntrySpecFromPort (0.00s) -=== RUN TestCraftPartialIptablesCommentFromPort ---- PASS: TestCraftPartialIptablesCommentFromPort (0.00s) -=== RUN TestCraftPartialIptEntrySpecFromOpAndLabel ---- PASS: TestCraftPartialIptEntrySpecFromOpAndLabel (0.00s) -=== RUN TestCraftPartialIptEntrySpecFromOpsAndLabels ---- PASS: TestCraftPartialIptEntrySpecFromOpsAndLabels (0.00s) -=== RUN TestCraftPartialIptEntryFromSelector ---- PASS: TestCraftPartialIptEntryFromSelector (0.00s) -=== RUN TestCraftPartialIptablesCommentFromSelector ---- PASS: TestCraftPartialIptablesCommentFromSelector (0.00s) -=== RUN TestGetDefaultDropEntries ---- PASS: TestGetDefaultDropEntries (0.00s) -=== RUN TestTranslateIngress -2021/04/30 23:31:29 [2658] started parsing ingress rule -2021/04/30 23:31:29 [2658] finished parsing ingress rule ---- PASS: TestTranslateIngress (0.00s) -=== RUN TestTranslateEgress -2021/04/30 23:31:29 [2658] started parsing egress rule -2021/04/30 23:31:29 [2658] finished parsing egress rule ---- PASS: TestTranslateEgress (0.00s) -=== RUN TestDenyAllPolicy -2021/04/30 23:31:29 [2658] started parsing ingress rule -2021/04/30 23:31:29 [2658] finished parsing ingress rule -2021/04/30 23:31:29 [2658] Finished translatePolicy -2021/04/30 23:31:29 [2658] sets: [ns-testnamespace] -2021/04/30 23:31:29 [2658] lists: [] -2021/04/30 23:31:29 [2658] entries: -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-2173871756 dst -j DROP -m comment --comment DROP-ALL-TO-ns-testnamespace]} ---- PASS: TestDenyAllPolicy (0.00s) -=== RUN TestAllowBackendToFrontend -2021/04/30 23:31:29 [2658] started parsing ingress rule -2021/04/30 23:31:29 [2658] finished parsing ingress rule -2021/04/30 23:31:29 [2658] Finished translatePolicy -2021/04/30 23:31:29 [2658] sets: [app:backend ns-testnamespace app:frontend] -2021/04/30 23:31:29 [2658] lists: [] -2021/04/30 23:31:29 [2658] entries: -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-FROM Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-2173871756 src -m set --match-set azure-npm-837532042 src -m set --match-set azure-npm-2173871756 dst -m set --match-set azure-npm-3038731686 dst -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:frontend-IN-ns-testnamespace-TO-app:backend-IN-ns-testnamespace]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-2173871756 dst -m set --match-set azure-npm-3038731686 dst -j AZURE-NPM-INGRESS-FROM -m comment --comment ALLOW-ALL-TO-app:backend-IN-ns-testnamespace-TO-JUMP-TO-AZURE-NPM-INGRESS-FROM]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-FROM Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-2173871756 dst -m set --match-set azure-npm-3038731686 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-app:backend-IN-ns-testnamespace-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-2173871756 dst -m set --match-set azure-npm-3038731686 dst -j DROP -m comment --comment DROP-ALL-TO-app:backend-IN-ns-testnamespace]} ---- PASS: TestAllowBackendToFrontend (0.00s) -=== RUN TestAllowAllToAppFrontend -2021/04/30 23:31:29 [2658] started parsing ingress rule -2021/04/30 23:31:29 [2658] finished parsing ingress rule -2021/04/30 23:31:29 [2658] Finished translatePolicy -2021/04/30 23:31:29 [2658] sets: [app:frontend ns-testnamespace] -2021/04/30 23:31:29 [2658] lists: [] -2021/04/30 23:31:29 [2658] entries: -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-2173871756 dst -m set --match-set azure-npm-837532042 dst -j MARK --set-mark 0x2000 -m comment --comment ALLOW-ALL-TO-app:frontend-IN-ns-testnamespace]} ---- PASS: TestAllowAllToAppFrontend (0.00s) -=== RUN TestDenyAllToAppFrontend -2021/04/30 23:31:29 [2658] started parsing ingress rule -2021/04/30 23:31:29 [2658] finished parsing ingress rule -2021/04/30 23:31:29 [2658] Finished translatePolicy -2021/04/30 23:31:29 [2658] sets: [app:frontend ns-testnamespace] -2021/04/30 23:31:29 [2658] lists: [] -2021/04/30 23:31:29 [2658] entries: -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-2173871756 dst -m set --match-set azure-npm-837532042 dst -j DROP -m comment --comment DROP-ALL-TO-app:frontend-IN-ns-testnamespace]} ---- PASS: TestDenyAllToAppFrontend (0.00s) -=== RUN TestNamespaceToFrontend -2021/04/30 23:31:29 [2658] started parsing ingress rule -2021/04/30 23:31:29 [2658] finished parsing ingress rule -2021/04/30 23:31:29 [2658] Finished translatePolicy -2021/04/30 23:31:29 [2658] sets: [app:frontend ns-testnamespace] -2021/04/30 23:31:29 [2658] lists: [] -2021/04/30 23:31:29 [2658] entries: -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-FROM Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-2173871756 src -m set --match-set azure-npm-2173871756 dst -m set --match-set azure-npm-837532042 dst -j MARK --set-mark 0x2000 -m comment --comment ALLOW-ns-testnamespace-TO-app:frontend-IN-ns-testnamespace]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-2173871756 dst -m set --match-set azure-npm-837532042 dst -j AZURE-NPM-INGRESS-FROM -m comment --comment ALLOW-ALL-TO-app:frontend-IN-ns-testnamespace-TO-JUMP-TO-AZURE-NPM-INGRESS-FROM]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-FROM Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-2173871756 dst -m set --match-set azure-npm-837532042 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-app:frontend-IN-ns-testnamespace-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-2173871756 dst -m set --match-set azure-npm-837532042 dst -j DROP -m comment --comment DROP-ALL-TO-app:frontend-IN-ns-testnamespace]} ---- PASS: TestNamespaceToFrontend (0.00s) -=== RUN TestAllowAllNamespacesToAppFrontend -2021/04/30 23:31:29 [2658] started parsing ingress rule -2021/04/30 23:31:29 [2658] finished parsing ingress rule -2021/04/30 23:31:29 [2658] Finished translatePolicy -2021/04/30 23:31:29 [2658] sets: [app:frontend ns-testnamespace] -2021/04/30 23:31:29 [2658] lists: [all-namespaces] -2021/04/30 23:31:29 [2658] entries: -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-FROM Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-530439631 src -m set --match-set azure-npm-2173871756 dst -m set --match-set azure-npm-837532042 dst -j MARK --set-mark 0x2000 -m comment --comment ALLOW-all-namespaces-TO-app:frontend-IN-ns-testnamespace]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-2173871756 dst -m set --match-set azure-npm-837532042 dst -j AZURE-NPM-INGRESS-FROM -m comment --comment ALLOW-ALL-TO-app:frontend-IN-ns-testnamespace-TO-JUMP-TO-AZURE-NPM-INGRESS-FROM]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-FROM Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-2173871756 dst -m set --match-set azure-npm-837532042 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-app:frontend-IN-ns-testnamespace-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-2173871756 dst -m set --match-set azure-npm-837532042 dst -j DROP -m comment --comment DROP-ALL-TO-app:frontend-IN-ns-testnamespace]} ---- PASS: TestAllowAllNamespacesToAppFrontend (0.00s) -=== RUN TestAllowNamespaceDevToAppFrontend -2021/04/30 23:31:29 [2658] started parsing ingress rule -2021/04/30 23:31:29 [2658] finished parsing ingress rule -2021/04/30 23:31:29 [2658] Finished translatePolicy -2021/04/30 23:31:29 [2658] sets: [app:frontend ns-testnamespace] -2021/04/30 23:31:29 [2658] lists: [ns-namespace:dev ns-namespace:test0 ns-namespace:test1] -2021/04/30 23:31:29 [2658] entries: -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-FROM Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-2343777025 src -m set ! --match-set azure-npm-1217484542 src -m set ! --match-set azure-npm-1234262161 src -m set --match-set azure-npm-2173871756 dst -m set --match-set azure-npm-837532042 dst -j MARK --set-mark 0x2000 -m comment --comment ALLOW-ns-namespace:dev-AND-ns-!namespace:test0-AND-ns-!namespace:test1-TO-app:frontend-IN-ns-testnamespace]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-2173871756 dst -m set --match-set azure-npm-837532042 dst -j AZURE-NPM-INGRESS-FROM -m comment --comment ALLOW-ALL-TO-app:frontend-IN-ns-testnamespace-TO-JUMP-TO-AZURE-NPM-INGRESS-FROM]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-FROM Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-2173871756 dst -m set --match-set azure-npm-837532042 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-app:frontend-IN-ns-testnamespace-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-2173871756 dst -m set --match-set azure-npm-837532042 dst -j DROP -m comment --comment DROP-ALL-TO-app:frontend-IN-ns-testnamespace]} ---- PASS: TestAllowNamespaceDevToAppFrontend (0.00s) -=== RUN TestAllowAllToK0AndK1AndAppFrontend -2021/04/30 23:31:29 [2658] started parsing ingress rule -2021/04/30 23:31:29 [2658] finished parsing ingress rule -2021/04/30 23:31:29 [2658] Finished translatePolicy -2021/04/30 23:31:29 [2658] sets: [app:frontend k0 k1:v0 k1:v1 ns-testnamespace] -2021/04/30 23:31:29 [2658] lists: [all-namespaces] -2021/04/30 23:31:29 [2658] entries: -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-FROM Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-530439631 src -m set --match-set azure-npm-2173871756 dst -m set --match-set azure-npm-837532042 dst -m set ! --match-set azure-npm-2537389870 dst -m set --match-set azure-npm-456904991 dst -m set --match-set azure-npm-440127372 dst -j MARK --set-mark 0x2000 -m comment --comment ALLOW-all-namespaces-TO-app:frontend-AND-!k0-AND-k1:v0-AND-k1:v1-IN-ns-testnamespace]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-2173871756 dst -m set --match-set azure-npm-837532042 dst -m set ! --match-set azure-npm-2537389870 dst -m set --match-set azure-npm-456904991 dst -m set --match-set azure-npm-440127372 dst -j AZURE-NPM-INGRESS-FROM -m comment --comment ALLOW-ALL-TO-app:frontend-AND-!k0-AND-k1:v0-AND-k1:v1-IN-ns-testnamespace-TO-JUMP-TO-AZURE-NPM-INGRESS-FROM]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-FROM Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-2173871756 dst -m set --match-set azure-npm-837532042 dst -m set ! --match-set azure-npm-2537389870 dst -m set --match-set azure-npm-456904991 dst -m set --match-set azure-npm-440127372 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-app:frontend-AND-!k0-AND-k1:v0-AND-k1:v1-IN-ns-testnamespace-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-2173871756 dst -m set --match-set azure-npm-837532042 dst -m set ! --match-set azure-npm-2537389870 dst -m set --match-set azure-npm-456904991 dst -m set --match-set azure-npm-440127372 dst -j DROP -m comment --comment DROP-ALL-TO-app:frontend-AND-!k0-AND-k1:v0-AND-k1:v1-IN-ns-testnamespace]} ---- PASS: TestAllowAllToK0AndK1AndAppFrontend (0.00s) -=== RUN TestAllowNsDevAndAppBackendToAppFrontend -2021/04/30 23:31:29 [2658] started parsing ingress rule -2021/04/30 23:31:29 [2658] finished parsing ingress rule -2021/04/30 23:31:29 [2658] Finished translatePolicy -2021/04/30 23:31:29 [2658] sets: [app:frontend ns-testnamespace app:backend] -2021/04/30 23:31:29 [2658] lists: [ns-ns:dev] -2021/04/30 23:31:29 [2658] entries: -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-FROM Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-2173871756 dst -m set --match-set azure-npm-837532042 dst -m set --match-set azure-npm-2624359271 src -m set --match-set azure-npm-3038731686 src -j MARK --set-mark 0x2000 -m comment --comment ALLOW-ns-ns:dev-AND-app:backend-TO-app:frontend-IN-ns-testnamespace]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-2173871756 dst -m set --match-set azure-npm-837532042 dst -j AZURE-NPM-INGRESS-FROM -m comment --comment ALLOW-ALL-TO-app:frontend-IN-ns-testnamespace-TO-JUMP-TO-AZURE-NPM-INGRESS-FROM]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-FROM Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-2173871756 dst -m set --match-set azure-npm-837532042 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-app:frontend-IN-ns-testnamespace-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-2173871756 dst -m set --match-set azure-npm-837532042 dst -j DROP -m comment --comment DROP-ALL-TO-app:frontend-IN-ns-testnamespace]} ---- PASS: TestAllowNsDevAndAppBackendToAppFrontend (0.00s) -=== RUN TestAllowInternalAndExternal -2021/04/30 23:31:29 [2658] started parsing ingress rule -2021/04/30 23:31:29 [2658] finished parsing ingress rule -2021/04/30 23:31:29 [2658] Finished translatePolicy -2021/04/30 23:31:29 [2658] sets: [app:backdoor ns-dangerous] -2021/04/30 23:31:29 [2658] lists: [] -2021/04/30 23:31:29 [2658] entries: -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-256277463 dst -m set --match-set azure-npm-2688166573 dst -j MARK --set-mark 0x2000 -m comment --comment ALLOW-ALL-TO-app:backdoor-IN-ns-dangerous]} ---- PASS: TestAllowInternalAndExternal (0.00s) -=== RUN TestAllowBackendToFrontendPort8000 -2021/04/30 23:31:29 [2658] started parsing ingress rule -2021/04/30 23:31:29 [2658] finished parsing ingress rule -2021/04/30 23:31:29 [2658] Finished translatePolicy -2021/04/30 23:31:29 [2658] sets: [app:frontend ns-testnamespace app:backend] -2021/04/30 23:31:29 [2658] lists: [] -2021/04/30 23:31:29 [2658] entries: -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-2173871756 dst -m set --match-set azure-npm-837532042 dst -m set --match-set azure-npm-2173871756 src -m set --match-set azure-npm-3038731686 src --dport 8000 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:backend-IN-ns-testnamespace-AND-PORT-8000-TO-app:frontend-IN-ns-testnamespace]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-2173871756 dst -m set --match-set azure-npm-837532042 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-app:frontend-IN-ns-testnamespace-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-2173871756 dst -m set --match-set azure-npm-837532042 dst -j DROP -m comment --comment DROP-ALL-TO-app:frontend-IN-ns-testnamespace]} ---- PASS: TestAllowBackendToFrontendPort8000 (0.00s) -=== RUN TestAllowBackendToFrontendWithMissingPort -2021/04/30 23:31:29 [2658] started parsing ingress rule -2021/04/30 23:31:29 [2658] finished parsing ingress rule -2021/04/30 23:31:29 [2658] Finished translatePolicy -2021/04/30 23:31:29 [2658] sets: [app:frontend ns-testnamespace app:backend] -2021/04/30 23:31:29 [2658] lists: [] -2021/04/30 23:31:29 [2658] entries: -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-2173871756 dst -m set --match-set azure-npm-837532042 dst -m set --match-set azure-npm-2173871756 src -m set --match-set azure-npm-3038731686 src -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:backend-IN-ns-testnamespace-AND--TO-app:frontend-IN-ns-testnamespace]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-2173871756 dst -m set --match-set azure-npm-837532042 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-app:frontend-IN-ns-testnamespace-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-2173871756 dst -m set --match-set azure-npm-837532042 dst -j DROP -m comment --comment DROP-ALL-TO-app:frontend-IN-ns-testnamespace]} ---- PASS: TestAllowBackendToFrontendWithMissingPort (0.00s) -=== RUN TestAllowMultipleLabelsToMultipleLabels -2021/04/30 23:31:29 [2658] started parsing ingress rule -2021/04/30 23:31:29 [2658] finished parsing ingress rule -2021/04/30 23:31:29 [2658] Finished translatePolicy -2021/04/30 23:31:29 [2658] sets: [app:k8s team:aks ns-acn program:cni team:acn binary:cns group:container] -2021/04/30 23:31:29 [2658] lists: [] -2021/04/30 23:31:29 [2658] entries: -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-FROM Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-42068709 src -m set --match-set azure-npm-3345321849 src -m set --match-set azure-npm-2802478816 src -m set --match-set azure-npm-42068709 dst -m set --match-set azure-npm-3926344238 dst -m set --match-set azure-npm-3019307935 dst -j MARK --set-mark 0x2000 -m comment --comment ALLOW-program:cni-AND-team:acn-IN-ns-acn-TO-app:k8s-AND-team:aks-IN-ns-acn]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-FROM Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-42068709 src -m set --match-set azure-npm-3315585516 src -m set --match-set azure-npm-3955682017 src -m set --match-set azure-npm-42068709 dst -m set --match-set azure-npm-3926344238 dst -m set --match-set azure-npm-3019307935 dst -j MARK --set-mark 0x2000 -m comment --comment ALLOW-binary:cns-AND-group:container-IN-ns-acn-TO-app:k8s-AND-team:aks-IN-ns-acn]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-42068709 dst -m set --match-set azure-npm-3926344238 dst -m set --match-set azure-npm-3019307935 dst -j AZURE-NPM-INGRESS-FROM -m comment --comment ALLOW-ALL-TO-app:k8s-AND-team:aks-IN-ns-acn-TO-JUMP-TO-AZURE-NPM-INGRESS-FROM]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-FROM Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-42068709 dst -m set --match-set azure-npm-3926344238 dst -m set --match-set azure-npm-3019307935 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-app:k8s-AND-team:aks-IN-ns-acn-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-42068709 dst -m set --match-set azure-npm-3926344238 dst -m set --match-set azure-npm-3019307935 dst -j DROP -m comment --comment DROP-ALL-TO-app:k8s-AND-team:aks-IN-ns-acn]} ---- PASS: TestAllowMultipleLabelsToMultipleLabels (0.00s) -=== RUN TestDenyAllFromAppBackend -2021/04/30 23:31:29 [2658] started parsing egress rule -2021/04/30 23:31:29 [2658] finished parsing egress rule -2021/04/30 23:31:29 [2658] Finished translatePolicy -2021/04/30 23:31:29 [2658] sets: [app:backend ns-testnamespace] -2021/04/30 23:31:29 [2658] lists: [] -2021/04/30 23:31:29 [2658] entries: -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-2173871756 src -m set --match-set azure-npm-3038731686 src -j DROP -m comment --comment DROP-ALL-FROM-app:backend-IN-ns-testnamespace]} ---- PASS: TestDenyAllFromAppBackend (0.00s) -=== RUN TestAllowAllFromAppBackend -2021/04/30 23:31:29 [2658] started parsing egress rule -2021/04/30 23:31:29 [2658] finished parsing egress rule -2021/04/30 23:31:29 [2658] Finished translatePolicy -2021/04/30 23:31:29 [2658] sets: [app:backend ns-testnamespace] -2021/04/30 23:31:29 [2658] lists: [] -2021/04/30 23:31:29 [2658] entries: -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-2173871756 src -m set --match-set azure-npm-3038731686 src -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-ALL-FROM-app:backend-IN-ns-testnamespace]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-2173871756 src -m set --match-set azure-npm-3038731686 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-app:backend-IN-ns-testnamespace-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS]} ---- PASS: TestAllowAllFromAppBackend (0.00s) -=== RUN TestDenyAllFromNsUnsafe -2021/04/30 23:31:29 [2658] started parsing egress rule -2021/04/30 23:31:29 [2658] finished parsing egress rule -2021/04/30 23:31:29 [2658] Finished translatePolicy -2021/04/30 23:31:29 [2658] sets: [ns-unsafe] -2021/04/30 23:31:29 [2658] lists: [] -2021/04/30 23:31:29 [2658] entries: -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-3909944339 src -j DROP -m comment --comment DROP-ALL-FROM-ns-unsafe]} ---- PASS: TestDenyAllFromNsUnsafe (0.00s) -=== RUN TestAllowAppFrontendToTCPPort53UDPPort53Policy -2021/04/30 23:31:29 [2658] started parsing egress rule -2021/04/30 23:31:29 [2658] finished parsing egress rule -2021/04/30 23:31:29 [2658] Finished translatePolicy -2021/04/30 23:31:29 [2658] sets: [app:frontend ns-testnamespace] -2021/04/30 23:31:29 [2658] lists: [all-namespaces] -2021/04/30 23:31:29 [2658] entries: -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-p TCP --dport 53 -m set --match-set azure-npm-2173871756 src -m set --match-set azure-npm-837532042 src -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-ALL-TO-TCP-PORT-53-FROM-app:frontend-IN-ns-testnamespace]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-p UDP --dport 53 -m set --match-set azure-npm-2173871756 src -m set --match-set azure-npm-837532042 src -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-ALL-TO-UDP-PORT-53-FROM-app:frontend-IN-ns-testnamespace]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-TO Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-2173871756 src -m set --match-set azure-npm-837532042 src -m set --match-set azure-npm-530439631 dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-app:frontend-IN-ns-testnamespace-TO-all-namespaces]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-2173871756 src -m set --match-set azure-npm-837532042 src -j AZURE-NPM-EGRESS-TO -m comment --comment ALLOW-ALL-FROM-app:frontend-IN-ns-testnamespace-TO-JUMP-TO-AZURE-NPM-EGRESS-TO]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-TO Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-2173871756 src -m set --match-set azure-npm-837532042 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-app:frontend-IN-ns-testnamespace-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-2173871756 src -m set --match-set azure-npm-837532042 src -j DROP -m comment --comment DROP-ALL-FROM-app:frontend-IN-ns-testnamespace]} ---- PASS: TestAllowAppFrontendToTCPPort53UDPPort53Policy (0.01s) -=== RUN TestComplexPolicy -2021/04/30 23:31:29 [2658] started parsing ingress rule -2021/04/30 23:31:29 [2658] finished parsing ingress rule -2021/04/30 23:31:29 [2658] started parsing egress rule -2021/04/30 23:31:29 [2658] finished parsing egress rule -2021/04/30 23:31:29 [2658] Finished translatePolicy -2021/04/30 23:31:29 [2658] sets: [role:db ns-default role:frontend] -2021/04/30 23:31:29 [2658] lists: [ns-project:myproject] -2021/04/30 23:31:29 [2658] entries: -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-784554818 dst -m set --match-set azure-npm-1547420863 dst -m set --match-set azure-npm-2329341111 src -p TCP --dport 6379 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-k8s-example-policy-in-ns-default-0in-AND-TCP-PORT-6379-TO-role:db-IN-ns-default]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-784554818 dst -m set --match-set azure-npm-1547420863 dst -m set --match-set azure-npm-1883405147 src -p TCP --dport 6379 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-ns-project:myproject-AND-TCP-PORT-6379-TO-role:db-IN-ns-default]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-784554818 dst -m set --match-set azure-npm-1547420863 dst -m set --match-set azure-npm-784554818 src -m set --match-set azure-npm-2574419033 src -p TCP --dport 6379 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-role:frontend-IN-ns-default-AND-TCP-PORT-6379-TO-role:db-IN-ns-default]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-784554818 dst -m set --match-set azure-npm-1547420863 dst -j AZURE-NPM-INGRESS-FROM -m comment --comment ALLOW-ALL-TO-role:db-IN-ns-default-TO-JUMP-TO-AZURE-NPM-INGRESS-FROM]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-FROM Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-784554818 dst -m set --match-set azure-npm-1547420863 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-role:db-IN-ns-default-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-p TCP --dport 5978 -m set --match-set azure-npm-784554818 src -m set --match-set azure-npm-1547420863 src -m set --match-set azure-npm-3675320636 dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-k8s-example-policy-in-ns-default-0out-AND-TCP-PORT-5978-FROM-role:db-IN-ns-default]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-784554818 src -m set --match-set azure-npm-1547420863 src -j AZURE-NPM-EGRESS-TO -m comment --comment ALLOW-ALL-FROM-role:db-IN-ns-default-TO-JUMP-TO-AZURE-NPM-EGRESS-TO]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-TO Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-784554818 src -m set --match-set azure-npm-1547420863 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-role:db-IN-ns-default-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-784554818 dst -m set --match-set azure-npm-1547420863 dst -j DROP -m comment --comment DROP-ALL-TO-role:db-IN-ns-default]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-784554818 src -m set --match-set azure-npm-1547420863 src -j DROP -m comment --comment DROP-ALL-FROM-role:db-IN-ns-default]} -2021/04/30 23:31:29 [2658] started parsing ingress rule -2021/04/30 23:31:29 [2658] finished parsing ingress rule -2021/04/30 23:31:29 [2658] started parsing egress rule -2021/04/30 23:31:29 [2658] finished parsing egress rule -2021/04/30 23:31:29 [2658] Finished translatePolicy -2021/04/30 23:31:29 [2658] sets: [role:db ns-default role:frontend] -2021/04/30 23:31:29 [2658] lists: [ns-project:myproject] -2021/04/30 23:31:29 [2658] entries: -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-784554818 dst -m set --match-set azure-npm-1547420863 dst -m set --match-set azure-npm-2329341111 src -p TCP --dport 6379 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-k8s-example-policy-in-ns-default-0in-AND-TCP-PORT-6379-TO-role:db-IN-ns-default]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-784554818 dst -m set --match-set azure-npm-1547420863 dst -m set --match-set azure-npm-1883405147 src -p TCP --dport 6379 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-ns-project:myproject-AND-TCP-PORT-6379-TO-role:db-IN-ns-default]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-784554818 dst -m set --match-set azure-npm-1547420863 dst -m set --match-set azure-npm-784554818 src -m set --match-set azure-npm-2574419033 src -p TCP --dport 6379 -j MARK --set-mark 0x2000 -m comment --comment ALLOW-role:frontend-IN-ns-default-AND-TCP-PORT-6379-TO-role:db-IN-ns-default]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-784554818 dst -m set --match-set azure-npm-1547420863 dst -j AZURE-NPM-INGRESS-FROM -m comment --comment ALLOW-ALL-TO-role:db-IN-ns-default-TO-JUMP-TO-AZURE-NPM-INGRESS-FROM]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-FROM Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-784554818 dst -m set --match-set azure-npm-1547420863 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-role:db-IN-ns-default-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-p TCP --dport 5978 -m set --match-set azure-npm-784554818 src -m set --match-set azure-npm-1547420863 src -m set --match-set azure-npm-3675320636 dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-k8s-example-policy-in-ns-default-0out-AND-TCP-PORT-5978-FROM-role:db-IN-ns-default]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-784554818 src -m set --match-set azure-npm-1547420863 src -j AZURE-NPM-EGRESS-TO -m comment --comment ALLOW-ALL-FROM-role:db-IN-ns-default-TO-JUMP-TO-AZURE-NPM-EGRESS-TO]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-TO Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-784554818 src -m set --match-set azure-npm-1547420863 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-role:db-IN-ns-default-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-784554818 dst -m set --match-set azure-npm-1547420863 dst -j DROP -m comment --comment DROP-ALL-TO-role:db-IN-ns-default]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-784554818 src -m set --match-set azure-npm-1547420863 src -j DROP -m comment --comment DROP-ALL-FROM-role:db-IN-ns-default]} ---- PASS: TestComplexPolicy (0.01s) -=== RUN TestDropPrecedenceOverAllow -2021/04/30 23:31:29 [2658] started parsing ingress rule -2021/04/30 23:31:29 [2658] finished parsing ingress rule -2021/04/30 23:31:29 [2658] Finished translatePolicy -2021/04/30 23:31:29 [2658] sets: [ns-default] -2021/04/30 23:31:29 [2658] lists: [] -2021/04/30 23:31:29 [2658] entries: -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-784554818 dst -j DROP -m comment --comment DROP-ALL-TO-ns-default]} -2021/04/30 23:31:29 [2658] started parsing ingress rule -2021/04/30 23:31:29 [2658] finished parsing ingress rule -2021/04/30 23:31:29 [2658] started parsing egress rule -2021/04/30 23:31:29 [2658] finished parsing egress rule -2021/04/30 23:31:29 [2658] Finished translatePolicy -2021/04/30 23:31:29 [2658] sets: [app:test testIn:pod-A ns-default testIn:pod-B testIn:pod-C] -2021/04/30 23:31:29 [2658] lists: [all-namespaces] -2021/04/30 23:31:29 [2658] entries: -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-FROM Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-784554818 src -m set --match-set azure-npm-2817129730 src -m set --match-set azure-npm-2346935388 src -m set --match-set azure-npm-784554818 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-2397268245 dst -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:test-AND-testIn:pod-B-IN-ns-default-TO-app:test-AND-testIn:pod-A-IN-ns-default]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-FROM Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-784554818 src -m set --match-set azure-npm-2817129730 src -m set --match-set azure-npm-2363713007 src -m set --match-set azure-npm-784554818 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-2397268245 dst -j MARK --set-mark 0x2000 -m comment --comment ALLOW-app:test-AND-testIn:pod-C-IN-ns-default-TO-app:test-AND-testIn:pod-A-IN-ns-default]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-784554818 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-2397268245 dst -j AZURE-NPM-INGRESS-FROM -m comment --comment ALLOW-ALL-TO-app:test-AND-testIn:pod-A-IN-ns-default-TO-JUMP-TO-AZURE-NPM-INGRESS-FROM]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-FROM Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-784554818 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-2397268245 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-app:test-AND-testIn:pod-A-IN-ns-default-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-TO Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-784554818 src -m set --match-set azure-npm-2817129730 src -m set --match-set azure-npm-2397268245 src -m set --match-set azure-npm-530439631 dst -j MARK --set-mark 0x1000/0x1000 -m comment --comment ALLOW-app:test-AND-testIn:pod-A-IN-ns-default-TO-all-namespaces]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-784554818 src -m set --match-set azure-npm-2817129730 src -m set --match-set azure-npm-2397268245 src -j AZURE-NPM-EGRESS-TO -m comment --comment ALLOW-ALL-FROM-app:test-AND-testIn:pod-A-IN-ns-default-TO-JUMP-TO-AZURE-NPM-EGRESS-TO]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-TO Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-784554818 src -m set --match-set azure-npm-2817129730 src -m set --match-set azure-npm-2397268245 src -j AZURE-NPM-EGRESS-DROPS -m comment --comment ALLOW-ALL-FROM-app:test-AND-testIn:pod-A-IN-ns-default-TO-JUMP-TO-AZURE-NPM-EGRESS-DROPS]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-784554818 dst -m set --match-set azure-npm-2817129730 dst -m set --match-set azure-npm-2397268245 dst -j DROP -m comment --comment DROP-ALL-TO-app:test-AND-testIn:pod-A-IN-ns-default]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-EGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-784554818 src -m set --match-set azure-npm-2817129730 src -m set --match-set azure-npm-2397268245 src -j DROP -m comment --comment DROP-ALL-FROM-app:test-AND-testIn:pod-A-IN-ns-default]} ---- PASS: TestDropPrecedenceOverAllow (0.00s) -=== RUN TestNamedPorts -2021/04/30 23:31:29 [2658] started parsing ingress rule -2021/04/30 23:31:29 [2658] finished parsing ingress rule -2021/04/30 23:31:29 [2658] Finished translatePolicy -2021/04/30 23:31:29 [2658] sets: [app:server ns-test] -2021/04/30 23:31:29 [2658] lists: [] -2021/04/30 23:31:29 [2658] entries: -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-3863441321 dst -m set --match-set azure-npm-1519775445 dst -m set --match-set azure-npm-3050895063 dst,dst -j MARK --set-mark 0x2000 -m comment --comment ALLOW-ALL-TCP-PORT-serve-80-TO-app:server-IN-ns-test]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-PORT Flag: LockWaitTimeInSeconds: IsJumpEntry:true Specs:[-m set --match-set azure-npm-3863441321 dst -m set --match-set azure-npm-1519775445 dst -j AZURE-NPM-INGRESS-DROPS -m comment --comment ALLOW-ALL-TO-app:server-IN-ns-test-TO-JUMP-TO-AZURE-NPM-INGRESS-DROPS]} -2021/04/30 23:31:29 [2658] entry: &{Command: Name: Chain:AZURE-NPM-INGRESS-DROPS Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-m set --match-set azure-npm-3863441321 dst -m set --match-set azure-npm-1519775445 dst -j DROP -m comment --comment DROP-ALL-TO-app:server-IN-ns-test]} ---- PASS: TestNamedPorts (0.00s) -PASS -coverage: 12.3% of statements in ./... -ok github.com/Azure/azure-container-networking/npm 2.252s coverage: 12.3% of statements in ./... -? github.com/Azure/azure-container-networking/npm/http/api [no test files] -? github.com/Azure/azure-container-networking/npm/http/client [no test files] -=== RUN TestGetNpmMgrHandler ---- PASS: TestGetNpmMgrHandler (0.00s) -PASS -coverage: 0.8% of statements in ./... -ok github.com/Azure/azure-container-networking/npm/http/server 0.116s coverage: 0.8% of statements in ./... -2021/04/30 23:31:26 [2544] Finished initializing all Prometheus metrics -2021/04/30 23:31:26 Uniniting iptables -2021/04/30 23:31:26 [2544] Executing iptables command iptables [-w 60 -D FORWARD -j AZURE-NPM] -2021/04/30 23:31:26 [2544] AppInsights didn't initialized. -2021/04/30 23:31:26 [2544] Error: There was an error running command: [iptables -w 60 -D FORWARD -j AZURE-NPM] Stderr: [exit status 2, iptables v1.6.1: Couldn't load target `AZURE-NPM':No such file or directory - -Try `iptables -h' or 'iptables --help' for more information.] -2021/04/30 23:31:26 [2544] AppInsights didn't initialized. -2021/04/30 23:31:26 [2544] AppInsights didn't initialized. -2021/04/30 23:31:26 [2544] Error: failed to add default allow CONNECTED/RELATED rule to AZURE-NPM chain. -2021/04/30 23:31:26 [2544] AppInsights didn't initialized. -2021/04/30 23:31:26 Uniniting ipsets -2021/04/30 23:31:26 [2544] Executing ipset command ipset [-F -exist] -2021/04/30 23:31:26 [2544] Executing ipset command ipset [-X -exist] -=== RUN TestSave ---- PASS: TestSave (0.00s) -=== RUN TestRestore -2021/04/30 23:31:26 [2544] Executing ipset command ipset [-F -exist] -2021/04/30 23:31:26 [2544] Executing ipset command ipset [-X -exist] ---- PASS: TestRestore (0.02s) -=== RUN TestCreateList -2021/04/30 23:31:26 [2544] Creating List: &{operationFlag:-N name:test-list set:azure-npm-3265379360 spec:[setlist]} -2021/04/30 23:31:26 [2544] Executing ipset command ipset [-N -exist azure-npm-3265379360 setlist] -2021/04/30 23:31:26 [2544] Executing ipset command ipset [-F -exist] -2021/04/30 23:31:26 [2544] Executing ipset command ipset [-X -exist] ---- PASS: TestCreateList (0.04s) -=== RUN TestDeleteList -2021/04/30 23:31:26 [2544] Creating List: &{operationFlag:-N name:test-list set:azure-npm-3265379360 spec:[setlist]} -2021/04/30 23:31:26 [2544] Executing ipset command ipset [-N -exist azure-npm-3265379360 setlist] -2021/04/30 23:31:26 [2544] Executing ipset command ipset [-X -exist azure-npm-3265379360] -2021/04/30 23:31:26 [2544] Executing ipset command ipset [-F -exist] -2021/04/30 23:31:26 [2544] Executing ipset command ipset [-X -exist] ---- PASS: TestDeleteList (0.04s) -=== RUN TestAddToList -2021/04/30 23:31:26 [2544] Creating Set: &{operationFlag:-N name:test-set set:azure-npm-922816856 spec:[nethash]} -2021/04/30 23:31:26 [2544] Executing ipset command ipset [-N -exist azure-npm-922816856 nethash] -2021/04/30 23:31:26 [2544] Creating List: &{operationFlag:-N name:test-list set:azure-npm-3265379360 spec:[setlist]} -2021/04/30 23:31:26 [2544] Executing ipset command ipset [-N -exist azure-npm-3265379360 setlist] -2021/04/30 23:31:26 [2544] Executing ipset command ipset [-A -exist azure-npm-3265379360 azure-npm-922816856] -2021/04/30 23:31:26 [2544] Executing ipset command ipset [-F -exist] -2021/04/30 23:31:26 [2544] Executing ipset command ipset [-X -exist] ---- PASS: TestAddToList (0.04s) -=== RUN TestDeleteFromList -2021/04/30 23:31:26 [2544] Creating Set: &{operationFlag:-N name:test-set set:azure-npm-922816856 spec:[nethash]} -2021/04/30 23:31:26 [2544] Executing ipset command ipset [-N -exist azure-npm-922816856 nethash] -2021/04/30 23:31:26 [2544] Creating List: &{operationFlag:-N name:test-list set:azure-npm-3265379360 spec:[setlist]} -2021/04/30 23:31:26 [2544] Executing ipset command ipset [-N -exist azure-npm-3265379360 setlist] -2021/04/30 23:31:26 [2544] Executing ipset command ipset [-A -exist azure-npm-3265379360 azure-npm-922816856] -2021/04/30 23:31:26 [2544] Executing ipset command ipset [-D -exist azure-npm-3265379360 azure-npm-922816856] -2021/04/30 23:31:26 [2544] Executing ipset command ipset [-X -exist azure-npm-3265379360] -2021/04/30 23:31:26 [2544] AppInsights didn't initialized. -2021/04/30 23:31:26 [2544] Set [nonexistentsetname] does not exist when attempting to delete from list [test-list] -2021/04/30 23:31:26 [2544] AppInsights didn't initialized. -2021/04/30 23:31:26 [2544] AppInsights didn't initialized. -2021/04/30 23:31:26 [2544] Set [test-set] is of the wrong type when attempting to delete list [test-set], actual type [setgeneric] -2021/04/30 23:31:26 [2544] AppInsights didn't initialized. -2021/04/30 23:31:26 [2544] AppInsights didn't initialized. -2021/04/30 23:31:26 [2544] ipset with name test-list not found -2021/04/30 23:31:26 [2544] AppInsights didn't initialized. -2021/04/30 23:31:26 [2544] Executing ipset command ipset [-X -exist azure-npm-922816856] ---- PASS: TestDeleteFromList (0.00s) -=== RUN TestCreateSet -2021/04/30 23:31:26 [2544] Creating Set: &{operationFlag:-N name:test-set set:azure-npm-922816856 spec:[nethash]} -2021/04/30 23:31:26 [2544] Executing ipset command ipset [-N -exist azure-npm-922816856 nethash] -2021/04/30 23:31:26 [2544] Creating Set: &{operationFlag:-N name:test-set-with-maxelem set:azure-npm-2955872475 spec:[nethash maxelem 4294967295]} -2021/04/30 23:31:26 [2544] Executing ipset command ipset [-N -exist azure-npm-2955872475 nethash maxelem 4294967295] -2021/04/30 23:31:26 [2544] Creating Set: &{operationFlag:-N name:test-set-with-port set:azure-npm-2238625833 spec:[hash:ip,port]} -2021/04/30 23:31:26 [2544] Executing ipset command ipset [-N -exist azure-npm-2238625833 hash:ip,port] -2021/04/30 23:31:26 [2544] Executing ipset command ipset [-A -exist azure-npm-2238625833 1.1.1.1,tcp8080] -2021/04/30 23:31:26 [2544] AppInsights didn't initialized. -2021/04/30 23:31:26 [2544] Error: There was an error running command: [ipset -A -exist azure-npm-2238625833 1.1.1.1,tcp8080] Stderr: [exit status 1, ipset v6.34: Syntax error: 'tcp8080' is invalid as number -Syntax error: cannot parse 'tcp8080' as a tcp port] -2021/04/30 23:31:26 [2544] AppInsights didn't initialized. -2021/04/30 23:31:26 [2544] Executing ipset command ipset [-F -exist] -2021/04/30 23:31:26 [2544] Executing ipset command ipset [-X -exist] ---- PASS: TestCreateSet (0.03s) -=== RUN TestDeleteSet -2021/04/30 23:31:26 [2544] Creating Set: &{operationFlag:-N name:test-delete-set set:azure-npm-2040195562 spec:[nethash]} -2021/04/30 23:31:26 [2544] Executing ipset command ipset [-N -exist azure-npm-2040195562 nethash] -2021/04/30 23:31:26 [2544] Executing ipset command ipset [-X -exist azure-npm-2040195562] -2021/04/30 23:31:26 [2544] Executing ipset command ipset [-F -exist] -2021/04/30 23:31:26 [2544] Executing ipset command ipset [-X -exist] ---- PASS: TestDeleteSet (0.04s) -=== RUN TestAddToSet -2021/04/30 23:31:26 [2544] Creating Set: &{operationFlag:-N name:test-set set:azure-npm-922816856 spec:[nethash]} -2021/04/30 23:31:26 [2544] Executing ipset command ipset [-N -exist azure-npm-922816856 nethash] -2021/04/30 23:31:26 [2544] Executing ipset command ipset [-A -exist azure-npm-922816856 1.2.3.4] -2021/04/30 23:31:26 [2544] Executing ipset command ipset [-A -exist azure-npm-922816856 1.2.3.4/ nomatch] -2021/04/30 23:31:26 [2544] AppInsights didn't initialized. -2021/04/30 23:31:26 [2544] Error: There was an error running command: [ipset -A -exist azure-npm-922816856 1.2.3.4/ nomatch] Stderr: [exit status 1, ipset v6.34: Syntax error: cannot parse 1.2.3.4/: resolving to IPv4 address failed] -2021/04/30 23:31:26 [2544] AppInsights didn't initialized. -2021/04/30 23:31:26 [2544] Executing ipset command ipset [-A -exist azure-npm-922816856 1.1.1.1,tcp:8080] -2021/04/30 23:31:26 [2544] AppInsights didn't initialized. -2021/04/30 23:31:26 [2544] Error: There was an error running command: [ipset -A -exist azure-npm-922816856 1.1.1.1,tcp:8080] Stderr: [exit status 1, ipset v6.34: Syntax error: Elem separator in 1.1.1.1,tcp:8080, but settype hash:net supports none.] -2021/04/30 23:31:26 [2544] AppInsights didn't initialized. -2021/04/30 23:31:26 [2544] Executing ipset command ipset [-A -exist azure-npm-922816856 1.1.1.1,:] -2021/04/30 23:31:26 [2544] AppInsights didn't initialized. -2021/04/30 23:31:26 [2544] Error: There was an error running command: [ipset -A -exist azure-npm-922816856 1.1.1.1,:] Stderr: [exit status 1, ipset v6.34: Syntax error: Elem separator in 1.1.1.1,:, but settype hash:net supports none.] -2021/04/30 23:31:26 [2544] AppInsights didn't initialized. -2021/04/30 23:31:26 [2544] Executing ipset command ipset [-A -exist azure-npm-922816856 1.1.1.1] -2021/04/30 23:31:26 [2544] Executing ipset command ipset [-F -exist] -2021/04/30 23:31:26 [2544] Executing ipset command ipset [-X -exist] ---- PASS: TestAddToSet (0.04s) -=== RUN TestAddToSetWithCachePodInfo -2021/04/30 23:31:26 [2544] Creating Set: &{operationFlag:-N name:test-podcache_new set:azure-npm-1317588150 spec:[nethash]} -2021/04/30 23:31:26 [2544] Executing ipset command ipset [-N -exist azure-npm-1317588150 nethash] -2021/04/30 23:31:26 [2544] Executing ipset command ipset [-A -exist azure-npm-1317588150 10.0.2.7] -2021/04/30 23:31:26 [2544] AddToSet: PodOwner has changed for Ip: 10.0.2.7, setName:test-podcache_new, Old podKey: pod1, new podKey: pod2. Replace context with new PodOwner. -2021/04/30 23:31:26 [2544] Executing ipset command ipset [-D -exist azure-npm-1317588150 10.0.2.7] -2021/04/30 23:31:26 [2544] Executing ipset command ipset [-X -exist azure-npm-1317588150] -2021/04/30 23:31:26 [2544] Executing ipset command ipset [-F -exist] -2021/04/30 23:31:26 [2544] Executing ipset command ipset [-X -exist] ---- PASS: TestAddToSetWithCachePodInfo (0.06s) -=== RUN TestDeleteFromSet -2021/04/30 23:31:26 [2544] Creating Set: &{operationFlag:-N name:test-delete-from-set set:azure-npm-3649380207 spec:[nethash]} -2021/04/30 23:31:26 [2544] Executing ipset command ipset [-N -exist azure-npm-3649380207 nethash] -2021/04/30 23:31:26 [2544] Executing ipset command ipset [-A -exist azure-npm-3649380207 1.2.3.4] -2021/04/30 23:31:26 [2544] Executing ipset command ipset [-D -exist azure-npm-3649380207 1.2.3.4] -2021/04/30 23:31:26 [2544] Executing ipset command ipset [-X -exist azure-npm-3649380207] -2021/04/30 23:31:26 [2544] Executing ipset command ipset [-F -exist] -2021/04/30 23:31:26 [2544] Executing ipset command ipset [-X -exist] ---- PASS: TestDeleteFromSet (0.04s) -=== RUN TestDeleteFromSetWithPodCache -2021/04/30 23:31:26 [2544] Creating Set: &{operationFlag:-N name:test-deleteset-withcache set:azure-npm-2616783254 spec:[nethash]} -2021/04/30 23:31:26 [2544] Executing ipset command ipset [-N -exist azure-npm-2616783254 nethash] -2021/04/30 23:31:26 [2544] Executing ipset command ipset [-A -exist azure-npm-2616783254 10.0.2.8] -2021/04/30 23:31:26 [2544] Executing ipset command ipset [-D -exist azure-npm-2616783254 10.0.2.8] -2021/04/30 23:31:26 [2544] Executing ipset command ipset [-X -exist azure-npm-2616783254] -2021/04/30 23:31:26 [2544] Creating Set: &{operationFlag:-N name:test-deleteset-withcache set:azure-npm-2616783254 spec:[nethash]} -2021/04/30 23:31:26 [2544] Executing ipset command ipset [-N -exist azure-npm-2616783254 nethash] -2021/04/30 23:31:26 [2544] Executing ipset command ipset [-A -exist azure-npm-2616783254 10.0.2.8] -2021/04/30 23:31:26 [2544] AddToSet: PodOwner has changed for Ip: 10.0.2.8, setName:test-deleteset-withcache, Old podKey: pod1, new podKey: pod2. Replace context with new PodOwner. -2021/04/30 23:31:26 [2544] DeleteFromSet: PodOwner has changed for Ip: 10.0.2.8, setName:test-deleteset-withcache, Old podKey: pod2, new podKey: pod1. Ignore the delete as this is stale update -2021/04/30 23:31:26 [2544] Executing ipset command ipset [-D -exist azure-npm-2616783254 10.0.2.8] -2021/04/30 23:31:26 [2544] Executing ipset command ipset [-X -exist azure-npm-2616783254] -2021/04/30 23:31:26 [2544] Executing ipset command ipset [-F -exist] -2021/04/30 23:31:26 [2544] Executing ipset command ipset [-X -exist] ---- PASS: TestDeleteFromSetWithPodCache (0.07s) -=== RUN TestClean -2021/04/30 23:31:26 [2544] Creating Set: &{operationFlag:-N name:test-set set:azure-npm-922816856 spec:[nethash]} -2021/04/30 23:31:26 [2544] Executing ipset command ipset [-N -exist azure-npm-922816856 nethash] -2021/04/30 23:31:26 [2544] Executing ipset command ipset [-X -exist azure-npm-922816856] -2021/04/30 23:31:26 [2544] Executing ipset command ipset [-F -exist] -2021/04/30 23:31:26 [2544] Executing ipset command ipset [-X -exist] ---- PASS: TestClean (0.09s) -=== RUN TestDestroy -2021/04/30 23:31:27 [2544] Creating Set: &{operationFlag:-N name:test-destroy set:azure-npm-1230852354 spec:[nethash]} -2021/04/30 23:31:27 [2544] Executing ipset command ipset [-N -exist azure-npm-1230852354 nethash] -2021/04/30 23:31:27 [2544] Executing ipset command ipset [-A -exist azure-npm-1230852354 1.2.3.4] -2021/04/30 23:31:27 [2544] Executing ipset command ipset [-F -exist] -2021/04/30 23:31:27 [2544] Executing ipset command ipset [-X -exist] -2021/04/30 23:31:27 [2544] Executing ipset command ipset [list -exist azure-npm-1230852354] -2021/04/30 23:31:27 [2544] AppInsights didn't initialized. -2021/04/30 23:31:27 [2544] Error: There was an error running command: [ipset list -exist azure-npm-1230852354] Stderr: [exit status 1, ipset v6.34: The set with the given name does not exist] -2021/04/30 23:31:27 [2544] AppInsights didn't initialized. -2021/04/30 23:31:27 [2544] Executing ipset command ipset [-F -exist] -2021/04/30 23:31:27 [2544] Executing ipset command ipset [-X -exist] ---- PASS: TestDestroy (0.08s) -=== RUN TestRun -2021/04/30 23:31:27 [2544] Executing ipset command ipset [-N -exist test-set nethash] -2021/04/30 23:31:27 [2544] Executing ipset command ipset [-F -exist] -2021/04/30 23:31:27 [2544] Executing ipset command ipset [-X -exist] ---- PASS: TestRun (0.05s) -=== RUN TestDestroyNpmIpsets -2021/04/30 23:31:27 [2544] Creating Set: &{operationFlag:-N name:azure-npm-123456 set:azure-npm-1280682156 spec:[nethash]} -2021/04/30 23:31:27 [2544] Executing ipset command ipset [-N -exist azure-npm-1280682156 nethash] -2021/04/30 23:31:27 [2544] Creating Set: &{operationFlag:-N name:azure-npm-56543 set:azure-npm-30682274 spec:[nethash]} -2021/04/30 23:31:27 [2544] Executing ipset command ipset [-N -exist azure-npm-30682274 nethash] -2021/04/30 23:31:27 [2544] Executing ipset command ipset [-F -exist azure-npm-1280682156] -2021/04/30 23:31:27 [2544] Executing ipset command ipset [-F -exist azure-npm-30682274] -2021/04/30 23:31:27 [2544] Executing ipset command ipset [-X -exist azure-npm-1280682156] -2021/04/30 23:31:27 [2544] Executing ipset command ipset [-X -exist azure-npm-30682274] ---- PASS: TestDestroyNpmIpsets (0.06s) -PASS -coverage: 3.3% of statements in ./... -ok github.com/Azure/azure-container-networking/npm/ipsm 0.852s coverage: 3.3% of statements in ./... -2021/04/30 23:31:27 [2701] Finished initializing all Prometheus metrics -=== RUN TestGetAllChainsAndRules ---- PASS: TestGetAllChainsAndRules (0.00s) -=== RUN TestSave ---- PASS: TestSave (0.00s) -=== RUN TestRestore ---- PASS: TestRestore (0.01s) -=== RUN TestInitNpmChains -2021/04/30 23:31:27 [2701] Initializing AZURE-NPM chains. -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N AZURE-NPM] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N AZURE-NPM-ACCEPT] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N AZURE-NPM-INGRESS] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N AZURE-NPM-EGRESS] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N AZURE-NPM-INGRESS-PORT] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N AZURE-NPM-INGRESS-FROM] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N AZURE-NPM-EGRESS-PORT] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N AZURE-NPM-EGRESS-TO] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N AZURE-NPM-INGRESS-DROPS] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N AZURE-NPM-EGRESS-DROPS] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N AZURE-NPM] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -I FORWARD 1 -j AZURE-NPM] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM -j AZURE-NPM-INGRESS] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM -j AZURE-NPM-EGRESS] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM -j AZURE-NPM-ACCEPT -m mark --mark 0x3000 -m comment --comment ACCEPT-on-INGRESS-and-EGRESS-mark-0x3000] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM -j AZURE-NPM-ACCEPT -m mark --mark 0x2000 -m comment --comment ACCEPT-on-INGRESS-mark-0x2000] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM -j AZURE-NPM-ACCEPT -m mark --mark 0x1000 -m comment --comment ACCEPT-on-EGRESS-mark-0x1000] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM -m state --state RELATED,ESTABLISHED -j ACCEPT -m comment --comment ACCEPT-on-connection-state] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-ACCEPT -j MARK --set-mark 0x0 -m comment --comment Clear-AZURE-NPM-MARKS] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-ACCEPT -j ACCEPT -m comment --comment ACCEPT-All-packets] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS -j AZURE-NPM-INGRESS-PORT] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS -j RETURN -m mark --mark 0x2000 -m comment --comment RETURN-on-INGRESS-mark-0x2000] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS -j AZURE-NPM-INGRESS-DROPS] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS-PORT -j RETURN -m mark --mark 0x2000 -m comment --comment RETURN-on-INGRESS-mark-0x2000] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS-FROM -j RETURN -m mark --mark 0x2000 -m comment --comment RETURN-on-INGRESS-mark-0x2000] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS -j AZURE-NPM-EGRESS-PORT] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS -j RETURN -m mark --mark 0x3000 -m comment --comment RETURN-on-EGRESS-and-INGRESS-mark-0x3000] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS -j RETURN -m mark --mark 0x1000 -m comment --comment RETURN-on-EGRESS-mark-0x1000] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS -j AZURE-NPM-EGRESS-DROPS] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS-PORT -j RETURN -m mark --mark 0x3000 -m comment --comment RETURN-on-EGRESS-and-INGRESS-mark-0x3000] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS-PORT -j RETURN -m mark --mark 0x1000 -m comment --comment RETURN-on-EGRESS-mark-0x1000] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS-TO -j RETURN -m mark --mark 0x3000 -m comment --comment RETURN-on-EGRESS-and-INGRESS-mark-0x3000] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS-TO -j RETURN -m mark --mark 0x1000 -m comment --comment RETURN-on-EGRESS-mark-0x1000] ---- PASS: TestInitNpmChains (0.09s) -=== RUN TestUninitNpmChains -2021/04/30 23:31:27 [2701] Initializing AZURE-NPM chains. -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N AZURE-NPM] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N AZURE-NPM-ACCEPT] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N AZURE-NPM-INGRESS] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N AZURE-NPM-EGRESS] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N AZURE-NPM-INGRESS-PORT] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N AZURE-NPM-INGRESS-FROM] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N AZURE-NPM-EGRESS-PORT] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N AZURE-NPM-EGRESS-TO] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N AZURE-NPM-INGRESS-DROPS] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N AZURE-NPM-EGRESS-DROPS] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N AZURE-NPM] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -I FORWARD 1 -j AZURE-NPM] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM -j AZURE-NPM-INGRESS] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM -j AZURE-NPM-EGRESS] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM -j AZURE-NPM-ACCEPT -m mark --mark 0x3000 -m comment --comment ACCEPT-on-INGRESS-and-EGRESS-mark-0x3000] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM -j AZURE-NPM-ACCEPT -m mark --mark 0x2000 -m comment --comment ACCEPT-on-INGRESS-mark-0x2000] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM -j AZURE-NPM-ACCEPT -m mark --mark 0x1000 -m comment --comment ACCEPT-on-EGRESS-mark-0x1000] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM -m state --state RELATED,ESTABLISHED -j ACCEPT -m comment --comment ACCEPT-on-connection-state] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-ACCEPT -j MARK --set-mark 0x0 -m comment --comment Clear-AZURE-NPM-MARKS] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-ACCEPT -j ACCEPT -m comment --comment ACCEPT-All-packets] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS -j AZURE-NPM-INGRESS-PORT] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS -j RETURN -m mark --mark 0x2000 -m comment --comment RETURN-on-INGRESS-mark-0x2000] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS -j AZURE-NPM-INGRESS-DROPS] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS-PORT -j RETURN -m mark --mark 0x2000 -m comment --comment RETURN-on-INGRESS-mark-0x2000] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS-FROM -j RETURN -m mark --mark 0x2000 -m comment --comment RETURN-on-INGRESS-mark-0x2000] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS -j AZURE-NPM-EGRESS-PORT] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS -j RETURN -m mark --mark 0x3000 -m comment --comment RETURN-on-EGRESS-and-INGRESS-mark-0x3000] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS -j RETURN -m mark --mark 0x1000 -m comment --comment RETURN-on-EGRESS-mark-0x1000] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS -j AZURE-NPM-EGRESS-DROPS] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS-PORT -j RETURN -m mark --mark 0x3000 -m comment --comment RETURN-on-EGRESS-and-INGRESS-mark-0x3000] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS-PORT -j RETURN -m mark --mark 0x1000 -m comment --comment RETURN-on-EGRESS-mark-0x1000] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS-TO -j RETURN -m mark --mark 0x3000 -m comment --comment RETURN-on-EGRESS-and-INGRESS-mark-0x3000] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS-TO -j RETURN -m mark --mark 0x1000 -m comment --comment RETURN-on-EGRESS-mark-0x1000] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -D FORWARD -j AZURE-NPM] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -F AZURE-NPM] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -F AZURE-NPM-ACCEPT] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -F AZURE-NPM-INGRESS] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -F AZURE-NPM-EGRESS] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -F AZURE-NPM-INGRESS-PORT] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -F AZURE-NPM-INGRESS-FROM] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -F AZURE-NPM-EGRESS-PORT] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -F AZURE-NPM-EGRESS-TO] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -F AZURE-NPM-INGRESS-DROPS] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -F AZURE-NPM-EGRESS-DROPS] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -F AZURE-NPM-TARGET-SETS] -2021/04/30 23:31:27 [2701] AppInsights didn't initialized. -2021/04/30 23:31:27 [2701] Error: There was an error running command: [iptables -w 60 -F AZURE-NPM-TARGET-SETS] Stderr: [exit status 1, iptables: No chain/target/match by that name.] -2021/04/30 23:31:27 [2701] AppInsights didn't initialized. -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -F AZURE-NPM-INRGESS-DROPS] -2021/04/30 23:31:27 [2701] AppInsights didn't initialized. -2021/04/30 23:31:27 [2701] Error: There was an error running command: [iptables -w 60 -F AZURE-NPM-INRGESS-DROPS] Stderr: [exit status 1, iptables: No chain/target/match by that name.] -2021/04/30 23:31:27 [2701] AppInsights didn't initialized. -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -X AZURE-NPM] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -X AZURE-NPM-ACCEPT] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -X AZURE-NPM-INGRESS] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -X AZURE-NPM-EGRESS] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -X AZURE-NPM-INGRESS-PORT] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -X AZURE-NPM-INGRESS-FROM] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -X AZURE-NPM-EGRESS-PORT] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -X AZURE-NPM-EGRESS-TO] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -X AZURE-NPM-INGRESS-DROPS] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -X AZURE-NPM-EGRESS-DROPS] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -X AZURE-NPM-TARGET-SETS] -2021/04/30 23:31:27 [2701] AppInsights didn't initialized. -2021/04/30 23:31:27 [2701] Error: There was an error running command: [iptables -w 60 -X AZURE-NPM-TARGET-SETS] Stderr: [exit status 1, iptables: No chain/target/match by that name.] -2021/04/30 23:31:27 [2701] AppInsights didn't initialized. -2021/04/30 23:31:27 [2701] Chain doesn't exist AZURE-NPM-TARGET-SETS. -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -X AZURE-NPM-INRGESS-DROPS] -2021/04/30 23:31:27 [2701] AppInsights didn't initialized. -2021/04/30 23:31:27 [2701] Error: There was an error running command: [iptables -w 60 -X AZURE-NPM-INRGESS-DROPS] Stderr: [exit status 1, iptables: No chain/target/match by that name.] -2021/04/30 23:31:27 [2701] AppInsights didn't initialized. -2021/04/30 23:31:27 [2701] Chain doesn't exist AZURE-NPM-INRGESS-DROPS. ---- PASS: TestUninitNpmChains (0.10s) -=== RUN TestExists ---- PASS: TestExists (0.00s) -=== RUN TestAddChain -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N TEST-CHAIN] ---- PASS: TestAddChain (0.00s) -=== RUN TestDeleteChain -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N TEST-CHAIN] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -X TEST-CHAIN] ---- PASS: TestDeleteChain (0.00s) -=== RUN TestAdd -2021/04/30 23:31:27 [2701] Adding iptables entry: &{Command: Name: Chain:FORWARD Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-j REJECT]}. -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -I FORWARD -j REJECT] ---- PASS: TestAdd (0.00s) -=== RUN TestDelete -2021/04/30 23:31:27 [2701] Adding iptables entry: &{Command: Name: Chain:FORWARD Flag: LockWaitTimeInSeconds: IsJumpEntry:false Specs:[-j REJECT]}. -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -I FORWARD -j REJECT] -2021/04/30 23:31:27 [2701] Deleting iptables entry: &{Command: Name: Chain:FORWARD Flag: LockWaitTimeInSeconds:60 IsJumpEntry:false Specs:[-j REJECT]} -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -D FORWARD -j REJECT] ---- PASS: TestDelete (0.00s) -=== RUN TestRun -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N TEST-CHAIN] ---- PASS: TestRun (0.00s) -=== RUN TestGetChainLineNumber -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N KUBE-SERVICES] -2021/04/30 23:31:27 [2701] Initializing AZURE-NPM chains. -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N AZURE-NPM] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N AZURE-NPM-ACCEPT] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N AZURE-NPM-INGRESS] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N AZURE-NPM-EGRESS] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N AZURE-NPM-INGRESS-PORT] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N AZURE-NPM-INGRESS-FROM] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N AZURE-NPM-EGRESS-PORT] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N AZURE-NPM-EGRESS-TO] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N AZURE-NPM-INGRESS-DROPS] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N AZURE-NPM-EGRESS-DROPS] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -N AZURE-NPM] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -I FORWARD 1 -j AZURE-NPM] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM -j AZURE-NPM-INGRESS] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM -j AZURE-NPM-EGRESS] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM -j AZURE-NPM-ACCEPT -m mark --mark 0x3000 -m comment --comment ACCEPT-on-INGRESS-and-EGRESS-mark-0x3000] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM -j AZURE-NPM-ACCEPT -m mark --mark 0x2000 -m comment --comment ACCEPT-on-INGRESS-mark-0x2000] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM -j AZURE-NPM-ACCEPT -m mark --mark 0x1000 -m comment --comment ACCEPT-on-EGRESS-mark-0x1000] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM -m state --state RELATED,ESTABLISHED -j ACCEPT -m comment --comment ACCEPT-on-connection-state] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-ACCEPT -j MARK --set-mark 0x0 -m comment --comment Clear-AZURE-NPM-MARKS] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-ACCEPT -j ACCEPT -m comment --comment ACCEPT-All-packets] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS -j AZURE-NPM-INGRESS-PORT] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS -j RETURN -m mark --mark 0x2000 -m comment --comment RETURN-on-INGRESS-mark-0x2000] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS -j AZURE-NPM-INGRESS-DROPS] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS-PORT -j RETURN -m mark --mark 0x2000 -m comment --comment RETURN-on-INGRESS-mark-0x2000] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-INGRESS-FROM -j RETURN -m mark --mark 0x2000 -m comment --comment RETURN-on-INGRESS-mark-0x2000] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS -j AZURE-NPM-EGRESS-PORT] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS -j RETURN -m mark --mark 0x3000 -m comment --comment RETURN-on-EGRESS-and-INGRESS-mark-0x3000] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS -j RETURN -m mark --mark 0x1000 -m comment --comment RETURN-on-EGRESS-mark-0x1000] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS -j AZURE-NPM-EGRESS-DROPS] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS-PORT -j RETURN -m mark --mark 0x3000 -m comment --comment RETURN-on-EGRESS-and-INGRESS-mark-0x3000] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS-PORT -j RETURN -m mark --mark 0x1000 -m comment --comment RETURN-on-EGRESS-mark-0x1000] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS-TO -j RETURN -m mark --mark 0x3000 -m comment --comment RETURN-on-EGRESS-and-INGRESS-mark-0x3000] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -A AZURE-NPM-EGRESS-TO -j RETURN -m mark --mark 0x1000 -m comment --comment RETURN-on-EGRESS-mark-0x1000] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -D FORWARD -j AZURE-NPM] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -F AZURE-NPM] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -F AZURE-NPM-ACCEPT] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -F AZURE-NPM-INGRESS] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -F AZURE-NPM-EGRESS] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -F AZURE-NPM-INGRESS-PORT] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -F AZURE-NPM-INGRESS-FROM] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -F AZURE-NPM-EGRESS-PORT] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -F AZURE-NPM-EGRESS-TO] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -F AZURE-NPM-INGRESS-DROPS] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -F AZURE-NPM-EGRESS-DROPS] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -F AZURE-NPM-TARGET-SETS] -2021/04/30 23:31:27 [2701] AppInsights didn't initialized. -2021/04/30 23:31:27 [2701] Error: There was an error running command: [iptables -w 60 -F AZURE-NPM-TARGET-SETS] Stderr: [exit status 1, iptables: No chain/target/match by that name.] -2021/04/30 23:31:27 [2701] AppInsights didn't initialized. -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -F AZURE-NPM-INRGESS-DROPS] -2021/04/30 23:31:27 [2701] AppInsights didn't initialized. -2021/04/30 23:31:27 [2701] Error: There was an error running command: [iptables -w 60 -F AZURE-NPM-INRGESS-DROPS] Stderr: [exit status 1, iptables: No chain/target/match by that name.] -2021/04/30 23:31:27 [2701] AppInsights didn't initialized. -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -X AZURE-NPM] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -X AZURE-NPM-ACCEPT] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -X AZURE-NPM-INGRESS] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -X AZURE-NPM-EGRESS] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -X AZURE-NPM-INGRESS-PORT] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -X AZURE-NPM-INGRESS-FROM] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -X AZURE-NPM-EGRESS-PORT] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -X AZURE-NPM-EGRESS-TO] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -X AZURE-NPM-INGRESS-DROPS] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -X AZURE-NPM-EGRESS-DROPS] -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -X AZURE-NPM-TARGET-SETS] -2021/04/30 23:31:27 [2701] AppInsights didn't initialized. -2021/04/30 23:31:27 [2701] Error: There was an error running command: [iptables -w 60 -X AZURE-NPM-TARGET-SETS] Stderr: [exit status 1, iptables: No chain/target/match by that name.] -2021/04/30 23:31:27 [2701] AppInsights didn't initialized. -2021/04/30 23:31:27 [2701] Chain doesn't exist AZURE-NPM-TARGET-SETS. -2021/04/30 23:31:27 [2701] Executing iptables command iptables [-w 60 -X AZURE-NPM-INRGESS-DROPS] -2021/04/30 23:31:27 [2701] AppInsights didn't initialized. -2021/04/30 23:31:27 [2701] Error: There was an error running command: [iptables -w 60 -X AZURE-NPM-INRGESS-DROPS] Stderr: [exit status 1, iptables: No chain/target/match by that name.] -2021/04/30 23:31:27 [2701] AppInsights didn't initialized. -2021/04/30 23:31:27 [2701] Chain doesn't exist AZURE-NPM-INRGESS-DROPS. ---- PASS: TestGetChainLineNumber (0.09s) -PASS -coverage: 2.7% of statements in ./... -ok github.com/Azure/azure-container-networking/npm/iptm 0.434s coverage: 2.7% of statements in ./... -=== RUN TestPrometheusNodeHandler -2021/04/30 23:31:28 [3199] Finished initializing all Prometheus metrics ---- PASS: TestPrometheusNodeHandler (0.00s) -=== RUN TestPrometheusClusterHandler ---- PASS: TestPrometheusClusterHandler (0.00s) -PASS -coverage: 1.0% of statements in ./... -ok github.com/Azure/azure-container-networking/npm/metrics 0.122s coverage: 1.0% of statements in ./... -? github.com/Azure/azure-container-networking/npm/metrics/promutil [no test files] -? github.com/Azure/azure-container-networking/npm/plugin [no test files] -=== RUN TestSortMap ---- PASS: TestSortMap (0.00s) -=== RUN TestCompareK8sVer ---- PASS: TestCompareK8sVer (0.00s) -=== RUN TestIsNewNwPolicyVer ---- PASS: TestIsNewNwPolicyVer (0.00s) -=== RUN TestDropEmptyFields ---- PASS: TestDropEmptyFields (0.00s) -=== RUN TestCompareResourceVersions ---- PASS: TestCompareResourceVersions (0.00s) -=== RUN TestInValidOldResourceVersions -2021/04/30 23:31:29 [3597] Error: while parsing resource version to uint64 sssss ---- PASS: TestInValidOldResourceVersions (0.00s) -=== RUN TestInValidNewResourceVersions -2021/04/30 23:31:29 [3597] Error: while parsing resource version to uint64 sssss ---- PASS: TestInValidNewResourceVersions (0.00s) -=== RUN TestParseResourceVersion -2021/04/30 23:31:29 [3597] Error: while parsing resource version to uint64 string ---- PASS: TestParseResourceVersion (0.00s) -PASS -coverage: 1.2% of statements in ./... -ok github.com/Azure/azure-container-networking/npm/util 0.135s coverage: 1.2% of statements in ./... -? github.com/Azure/azure-container-networking/npm/util/errors [no test files] -? github.com/Azure/azure-container-networking/ovsctl [no test files] -=== RUN TestGetLastRebootTime ---- PASS: TestGetLastRebootTime (0.01s) -=== RUN TestGetOSDetails ---- PASS: TestGetOSDetails (0.00s) -=== RUN TestGetProcessNameByID -2021/04/30 23:31:29 [3689] [Azure-Utils] ps -p 3689 -o comm= ---- PASS: TestGetProcessNameByID (0.01s) -=== RUN TestReadFileByLines ---- PASS: TestReadFileByLines (0.00s) -=== RUN TestFileExists ---- PASS: TestFileExists (0.00s) -PASS -coverage: 1.2% of statements in ./... -ok github.com/Azure/azure-container-networking/platform 0.159s coverage: 1.2% of statements in ./... -? github.com/Azure/azure-container-networking/proto/nodenetworkservice/3.302.0.744 [no test files] -=== RUN TestPemConsumptionLinux ---- PASS: TestPemConsumptionLinux (0.65s) -PASS -coverage: 1.0% of statements in ./... -ok github.com/Azure/azure-container-networking/server/tls 0.774s coverage: 1.0% of statements in ./... -=== RUN TestKeyValuePairsAreReinstantiatedFromJSONFile ---- PASS: TestKeyValuePairsAreReinstantiatedFromJSONFile (0.00s) -=== RUN TestKeyValuePairsArePersistedToJSONFile ---- PASS: TestKeyValuePairsArePersistedToJSONFile (0.00s) -=== RUN TestKeyValuePairsAreWrittenAndReadCorrectly ---- PASS: TestKeyValuePairsAreWrittenAndReadCorrectly (0.00s) -=== RUN TestLockingStoreGivesExclusiveAccess ---- PASS: TestLockingStoreGivesExclusiveAccess (0.00s) -PASS -coverage: 1.3% of statements in ./... -ok github.com/Azure/azure-container-networking/store 0.184s coverage: 1.3% of statements in ./... -2021/04/30 23:31:31 [3741] [Listener] Started listening on localhost:3501. -2021/04/30 23:31:31 [3741] [Listener] Started listening on localhost:3500. -2021/04/30 23:31:31 [3741] [Azure-Utils] cp metadata_test.json /tmp/azuremetadata.json -2021/04/30 23:31:31 [3741] Telemetry service started -2021/04/30 23:31:31 [3741] [Telemetry] Buffer telemetry data and send it to host -=== RUN TestGetOSDetails ---- PASS: TestGetOSDetails (0.00s) -=== RUN TestGetSystemDetails ---- PASS: TestGetSystemDetails (0.00s) -=== RUN TestGetInterfaceDetails ---- PASS: TestGetInterfaceDetails (0.00s) -=== RUN TestGetReportState -[Telemetry] File not exist /var/run/AzureCNITelemetry.json--- PASS: TestGetReportState (0.00s) -=== RUN TestSendTelemetry ---- PASS: TestSendTelemetry (0.00s) -=== RUN TestCloseTelemetryConnection -2021/04/30 23:31:31 [3741] [Telemetry] server cancel event -2021/04/30 23:31:31 [3741] server close -2021/04/30 23:31:31 [3741] Telemetry Server accept error accept unix /var/run/azure-vnet-telemetry.sock: use of closed network connection ---- PASS: TestCloseTelemetryConnection (0.30s) -=== RUN TestServerCloseTelemetryConnection -2021/04/30 23:31:31 [3741] Telemetry service started -2021/04/30 23:31:31 [3741] [Telemetry] Buffer telemetry data and send it to host -2021/04/30 23:31:31 [3741] [Telemetry] server cancel event -2021/04/30 23:31:31 [3741] server close -2021/04/30 23:31:31 [3741] Telemetry Server accept error accept unix /var/run/azure-vnet-telemetry.sock: use of closed network connection ---- PASS: TestServerCloseTelemetryConnection (0.30s) -=== RUN TestClientCloseTelemetryConnection -2021/04/30 23:31:31 [3741] Telemetry service started -2021/04/30 23:31:31 [3741] [Telemetry] Buffer telemetry data and send it to host ---- PASS: TestClientCloseTelemetryConnection (0.30s) -=== RUN TestReadConfigFile -2021/04/30 23:31:32 [3741] [Telemetry] server cancel event -2021/04/30 23:31:32 [3741] server close -2021/04/30 23:31:32 [3741] Telemetry Server accept error accept unix /var/run/azure-vnet-telemetry.sock: use of closed network connection -2021/04/30 23:31:32 [3741] [Telemetry] Failed to read telemetry config: open a.config: no such file or directory -2021/04/30 23:31:32 [3741] [Telemetry] unmarshal failed with invalid character '/' looking for beginning of value ---- PASS: TestReadConfigFile (0.00s) -=== RUN TestStartTelemetryService -2021/04/30 23:31:32 [3741] [Azure-Utils] pkill -f azure-vnet-telemetry -2021/04/30 23:31:32 [3741] [Telemetry] Starting telemetry service process : args:[] -2021/04/30 23:31:32 [3741] [Telemetry] Failed to start telemetry service process :fork/exec : no such file or directory ---- PASS: TestStartTelemetryService (0.00s) -=== RUN TestWaitForTelemetrySocket ---- PASS: TestWaitForTelemetrySocket (0.01s) -=== RUN TestSetReportState ---- PASS: TestSetReportState (0.00s) -PASS -coverage: 2.7% of statements in ./... -2021/04/30 23:31:32 [3741] [Azure-Utils] rm /tmp/azuremetadata.json -2021/04/30 23:31:32 [3741] [Listener] Stopped listening on localhost:3501 -ok github.com/Azure/azure-container-networking/telemetry 1.068s coverage: 2.7% of statements in ./... -? github.com/Azure/azure-container-networking/test/nnsmockserver [no test files] -? github.com/Azure/azure-container-networking/test/nnsmockserver/nnsmock [no test files] -? github.com/Azure/azure-container-networking/testutils [no test files] -? github.com/Azure/azure-container-networking/tools/acncli [no test files] -? github.com/Azure/azure-container-networking/tools/acncli/api [no test files] -? github.com/Azure/azure-container-networking/tools/acncli/cmd [no test files] -? github.com/Azure/azure-container-networking/tools/acncli/cmd/cni [no test files] -? github.com/Azure/azure-container-networking/tools/acncli/cmd/npm [no test files] -? github.com/Azure/azure-container-networking/tools/acncli/cmd/npm/get [no test files] -? github.com/Azure/azure-container-networking/tools/acncli/installer [no test files] From 99aaf50897194e2743c1f57b579c14c526ec6c76 Mon Sep 17 00:00:00 2001 From: Mathew Merrick Date: Mon, 3 May 2021 22:57:00 +0000 Subject: [PATCH 15/19] exit code --- npm/ipsm/ipsm.go | 52 +++++++++++++++++++++++++-------------- npm/ipsm/ipsm_test.go | 6 ++--- npm/podController_test.go | 43 ++++++++++++++------------------ test/utils/utils.go | 37 ++++++++++++++++++++++++++++ 4 files changed, 91 insertions(+), 47 deletions(-) create mode 100644 test/utils/utils.go diff --git a/npm/ipsm/ipsm.go b/npm/ipsm/ipsm.go index 7e10a56ce9..c241f7a08e 100644 --- a/npm/ipsm/ipsm.go +++ b/npm/ipsm/ipsm.go @@ -103,7 +103,7 @@ func (ipsMgr *IpsetManager) CreateList(listName string) error { spec: []string{util.IpsetSetListFlag}, } log.Logf("Creating List: %+v", entry) - if err := ipsMgr.Run(entry); err != nil { + if errCode, err := ipsMgr.Run(entry); err != nil && errCode != 1 { metrics.SendErrorLogAndMetric(util.IpsmID, "Error: failed to create ipset list %s.", listName) return err } @@ -120,8 +120,8 @@ func (ipsMgr *IpsetManager) DeleteList(listName string) error { set: util.GetHashedName(listName), } - if err := ipsMgr.Run(entry); err != nil { - metrics.SendErrorLogAndMetric(util.IpsmID, "Error: failed to delete ipset %s %+v", listName, entry) + if errCode, err := ipsMgr.Run(entry); err != nil && errCode != 1 { + metrics.SendErrorLogAndMetric(util.IpsmID, "Error: failed to create ipset list %s.", listName) return err } @@ -169,8 +169,9 @@ func (ipsMgr *IpsetManager) AddToList(listName string, setName string) error { } // add set to list - if err := ipsMgr.Run(entry); err != nil { - return fmt.Errorf("Error: failed to create ipset rules. rule: %+v, error: %v", entry, err) + if errCode, err := ipsMgr.Run(entry); err != nil && errCode != 1 { + metrics.SendErrorLogAndMetric(util.IpsmID, "Error: failed to create ipset list %s.", listName) + return err } ipsMgr.ListMap[listName].elements[setName] = "" @@ -217,7 +218,7 @@ func (ipsMgr *IpsetManager) DeleteFromList(listName string, setName string) erro spec: []string{hashedSetName}, } - if err := ipsMgr.Run(entry); err != nil { + if _, err := ipsMgr.Run(entry); err != nil { metrics.SendErrorLogAndMetric(util.IpsmID, "Error: failed to delete ipset entry. %+v", entry) return err } @@ -253,7 +254,7 @@ func (ipsMgr *IpsetManager) CreateSet(setName string, spec []string) error { spec: spec, } log.Logf("Creating Set: %+v", entry) - if err := ipsMgr.Run(entry); err != nil { + if errCode, err := ipsMgr.Run(entry); err != nil && errCode != 1 { metrics.SendErrorLogAndMetric(util.IpsmID, "Error: failed to create ipset.") return err } @@ -279,7 +280,11 @@ func (ipsMgr *IpsetManager) DeleteSet(setName string) error { set: util.GetHashedName(setName), } - if err := ipsMgr.Run(entry); err != nil { + if errCode, err := ipsMgr.Run(entry); err != nil { + if errCode == 1 { + return nil + } + metrics.SendErrorLogAndMetric(util.IpsmID, "Error: failed to delete ipset %s. Entry: %+v", setName, entry) return err } @@ -343,7 +348,7 @@ func (ipsMgr *IpsetManager) AddToSet(setName, ip, spec, podKey string) error { } // todo: check err handling besides error code, corrupt state possible here - if err := ipsMgr.Run(entry); err != nil { + if errCode, err := ipsMgr.Run(entry); err != nil && errCode != 1 { metrics.SendErrorLogAndMetric(util.IpsmID, "Error: failed to create ipset rules. %+v", entry) return err } @@ -393,7 +398,11 @@ func (ipsMgr *IpsetManager) DeleteFromSet(setName, ip, podKey string) error { spec: append([]string{ip}), } - if err := ipsMgr.Run(entry); err != nil { + if errCode, err := ipsMgr.Run(entry); err != nil { + if errCode == 1 { + return nil + } + metrics.SendErrorLogAndMetric(util.IpsmID, "Error: failed to delete ipset entry. Entry: %+v", entry) return err } @@ -443,13 +452,13 @@ func (ipsMgr *IpsetManager) Destroy() error { entry := &ipsEntry{ operationFlag: util.IpsetFlushFlag, } - if err := ipsMgr.Run(entry); err != nil { + if _, err := ipsMgr.Run(entry); err != nil { metrics.SendErrorLogAndMetric(util.IpsmID, "Error: failed to flush ipset") return err } entry.operationFlag = util.IpsetDestroyFlag - if err := ipsMgr.Run(entry); err != nil { + if _, err := ipsMgr.Run(entry); err != nil { metrics.SendErrorLogAndMetric(util.IpsmID, "Error: failed to destroy ipset") return err } @@ -460,7 +469,7 @@ func (ipsMgr *IpsetManager) Destroy() error { } // Run execute an ipset command to update ipset. -func (ipsMgr *IpsetManager) Run(entry *ipsEntry) error { +func (ipsMgr *IpsetManager) Run(entry *ipsEntry) (int, error) { cmdName := util.Ipset cmdArgs := append([]string{entry.operationFlag, util.IpsetExistFlag, entry.set}, entry.spec...) cmdArgs = util.DropEmptyFields(cmdArgs) @@ -469,12 +478,17 @@ func (ipsMgr *IpsetManager) Run(entry *ipsEntry) error { cmd := ipsMgr.Exec.Command(cmdName, cmdArgs...) output, err := cmd.CombinedOutput() - if err != nil { - metrics.SendErrorLogAndMetric(util.IpsmID, "Error: There was an error running command: [%s %v] Stderr: [%v, %s]", cmdName, strings.Join(cmdArgs, " "), err, strings.TrimSuffix(string(output), "\n")) - return err + + if result, failed := err.(utilexec.ExitError); failed { + exitCode := result.ExitStatus() + if exitCode > 0 { + metrics.SendErrorLogAndMetric(util.IpsmID, "Error: There was an error running command: [%s %v] Stderr: [%v, %s]", cmdName, strings.Join(cmdArgs, " "), err, strings.TrimSuffix(string(output), "\n")) + } + + return exitCode, err } - return nil + return 0, nil } // Save saves ipset to file. @@ -575,7 +589,7 @@ func (ipsMgr *IpsetManager) DestroyNpmIpsets() error { set: ipsetName, } - if err := ipsMgr.Run(entry); err != nil { + if _, err := ipsMgr.Run(entry); err != nil { metrics.SendErrorLogAndMetric(util.IpsmID, "{DestroyNpmIpsets} Error: failed to flush ipset %s", ipsetName) } } @@ -583,7 +597,7 @@ func (ipsMgr *IpsetManager) DestroyNpmIpsets() error { for _, ipsetName := range ipsetLists { entry.operationFlag = util.IpsetDestroyFlag entry.set = ipsetName - if err := ipsMgr.Run(entry); err != nil { + if _, err := ipsMgr.Run(entry); err != nil { metrics.SendErrorLogAndMetric(util.IpsmID, "{DestroyNpmIpsets} Error: failed to destroy ipset %s", ipsetName) } } diff --git a/npm/ipsm/ipsm_test.go b/npm/ipsm/ipsm_test.go index 38c0941a29..7ef787a91b 100644 --- a/npm/ipsm/ipsm_test.go +++ b/npm/ipsm/ipsm_test.go @@ -489,7 +489,7 @@ func TestDestroy(t *testing.T) { set: util.GetHashedName(setName), } - if err := ipsMgr.Run(entry); err == nil { + if _, err := ipsMgr.Run(entry); err == nil { t.Errorf("TestDestroy failed @ ipsMgr.Destroy since %s still exist in kernel with err %+v", setName, err) } } else { @@ -500,7 +500,7 @@ func TestDestroy(t *testing.T) { spec: append([]string{testIP}), } - if err := ipsMgr.Run(entry); err == nil { + if _, err := ipsMgr.Run(entry); err == nil { t.Errorf("TestDestroy failed @ ipsMgr.Destroy since %s still exist in ipset with err %+v", testIP, err) } } @@ -523,7 +523,7 @@ func TestRun(t *testing.T) { set: "test-set", spec: append([]string{util.IpsetNetHashFlag}), } - if err := ipsMgr.Run(entry); err != nil { + if _, err := ipsMgr.Run(entry); err != nil { t.Errorf("TestRun failed @ ipsMgr.Run with err %+v", err) } } diff --git a/npm/podController_test.go b/npm/podController_test.go index bb6463c319..f5148f6975 100644 --- a/npm/podController_test.go +++ b/npm/podController_test.go @@ -10,6 +10,7 @@ import ( "github.com/Azure/azure-container-networking/npm/ipsm" "github.com/Azure/azure-container-networking/npm/util" + testingutils "github.com/Azure/azure-container-networking/test/utils" "github.com/stretchr/testify/require" corev1 "k8s.io/api/core/v1" utilexec "k8s.io/utils/exec" @@ -275,30 +276,20 @@ func TestAddPod(t *testing.T) { podObj := createPod("test-pod", "test-namespace", "0", "1.2.3.4", labels, NonHostNetwork, corev1.PodRunning) require := require.New(t) - var calls = []struct { - cmd []string - err error - }{ - {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("ns-test-namespace"), "nethash"}, err: nil}, - {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("ns-test-namespace"), "1.2.3.4"}, err: nil}, - {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("app"), "nethash"}, err: nil}, - {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("app"), "1.2.3.4"}, err: nil}, - {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("app:test-pod"), "nethash"}, err: nil}, - {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("app:test-pod"), "1.2.3.4"}, err: nil}, - {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("namedport:app:test-pod"), "hash:ip,port"}, err: nil}, - {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("namedport:app:test-pod"), "1.2.3.4,8080"}, err: nil}, + var calls = []testingutils.TestCmd{ + {Cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("ns-test-namespace"), "nethash"}, Err: nil}, + {Cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("ns-test-namespace"), "1.2.3.4"}, Err: nil}, + {Cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("app"), "nethash"}, Err: nil}, + {Cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("app"), "1.2.3.4"}, Err: nil}, + {Cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("app:test-pod"), "nethash"}, Err: nil}, + {Cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("app:test-pod"), "1.2.3.4"}, Err: nil}, + {Cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("namedport:app:test-pod"), "hash:ip,port"}, Err: nil}, + {Cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("namedport:app:test-pod"), "1.2.3.4,8080"}, Err: nil}, } - fcmd := fakeexec.FakeCmd{CombinedOutputScript: []fakeexec.FakeAction{}} - fexec := fakeexec.FakeExec{CommandScript: []fakeexec.FakeCommandAction{}} - - // expect happy path, each call returns no errors - for _, call := range calls { - fcmd.CombinedOutputScript = append(fcmd.CombinedOutputScript, func() ([]byte, []byte, error) { return nil, nil, call.err }) - fexec.CommandScript = append(fexec.CommandScript, func(cmd string, args ...string) utilexec.Cmd { return fakeexec.InitFakeCmd(&fcmd, cmd, args...) }) - } + fexec := testingutils.GetFakeExecWithScripts(calls) - f := newFixture(t, &fexec) + f := newFixture(t, fexec) f.podLister = append(f.podLister, podObj) f.kubeobjects = append(f.kubeobjects, podObj) stopCh := make(chan struct{}) @@ -312,10 +303,12 @@ func TestAddPod(t *testing.T) { checkPodTestResult("TestAddPod", f, testCases) checkNpmPodWithInput("TestAddPod", f, podObj) - require.Equal(len(calls), len(fcmd.CombinedOutputLog)) - for i, call := range calls { - require.Equalf(call.cmd, fcmd.CombinedOutputLog[i], "Call [%d] doesn't match expected", i) - } + require.Equal(len(calls), fexec.CommandCalls) + /* + for i, call := range calls { + require.Equalf(call.Cmd, fcmd.CombinedOutputLog[i], "Call [%d] doesn't match expected", i) + } + */ } func TestAddHostNetworkPod(t *testing.T) { diff --git a/test/utils/utils.go b/test/utils/utils.go new file mode 100644 index 0000000000..1ad08d0a79 --- /dev/null +++ b/test/utils/utils.go @@ -0,0 +1,37 @@ +package testingutils + +import ( + "k8s.io/utils/exec" + + testing "k8s.io/utils/exec/testing" +) + +type TestCmd struct { + Cmd []string + Err *testing.FakeExitError +} + +func GetFakeExecWithScripts(calls []TestCmd) *testing.FakeExec { + + fakeexec := &testing.FakeExec{ExactOrder: true, DisableScripts: false} + for _, call := range calls { + var err testing.FakeExitError + if call.Err != nil { + err = *call.Err + } + fakeCmd := &testing.FakeCmd{} + cmdAction := makeFakeCmd(fakeCmd, call.Cmd[0], call.Cmd[1:]...) + fakeCmd.CombinedOutputScript = append(fakeCmd.CombinedOutputScript, func() ([]byte, []byte, error) { return nil, nil, err }) + fakeexec.CommandScript = append(fakeexec.CommandScript, cmdAction) + } + return fakeexec +} + +func makeFakeCmd(fakeCmd *testing.FakeCmd, cmd string, args ...string) testing.FakeCommandAction { + c := cmd + a := args + return func(cmd string, args ...string) exec.Cmd { + command := testing.InitFakeCmd(fakeCmd, c, a...) + return command + } +} From efb6afc6db1f3b6ee0f165bb038308344b5100ee Mon Sep 17 00:00:00 2001 From: Mathew Merrick Date: Tue, 4 May 2021 18:26:16 +0000 Subject: [PATCH 16/19] helper funcs --- npm/ipsm/ipsm.go | 7 +- npm/ipsm/ipsm_test.go | 23 ++ npm/podController_test.go | 437 +++++++++++++------------------------- test/utils/utils.go | 45 ++-- 4 files changed, 206 insertions(+), 306 deletions(-) diff --git a/npm/ipsm/ipsm.go b/npm/ipsm/ipsm.go index c241f7a08e..b7e208768a 100644 --- a/npm/ipsm/ipsm.go +++ b/npm/ipsm/ipsm.go @@ -479,13 +479,14 @@ func (ipsMgr *IpsetManager) Run(entry *ipsEntry) (int, error) { cmd := ipsMgr.Exec.Command(cmdName, cmdArgs...) output, err := cmd.CombinedOutput() - if result, failed := err.(utilexec.ExitError); failed { + if result, isExitError := err.(utilexec.ExitError); isExitError { exitCode := result.ExitStatus() + errfmt := fmt.Errorf("Error: There was an error running command: [%s %v] Stderr: [%v, %s]", cmdName, strings.Join(cmdArgs, " "), err, strings.TrimSuffix(string(output), "\n")) if exitCode > 0 { - metrics.SendErrorLogAndMetric(util.IpsmID, "Error: There was an error running command: [%s %v] Stderr: [%v, %s]", cmdName, strings.Join(cmdArgs, " "), err, strings.TrimSuffix(string(output), "\n")) + metrics.SendErrorLogAndMetric(util.IpsmID, errfmt.Error()) } - return exitCode, err + return exitCode, errfmt } return 0, nil diff --git a/npm/ipsm/ipsm_test.go b/npm/ipsm/ipsm_test.go index 7ef787a91b..685e059533 100644 --- a/npm/ipsm/ipsm_test.go +++ b/npm/ipsm/ipsm_test.go @@ -12,6 +12,7 @@ import ( "github.com/Azure/azure-container-networking/npm/metrics" "github.com/Azure/azure-container-networking/npm/metrics/promutil" "github.com/Azure/azure-container-networking/npm/util" + testutils "github.com/Azure/azure-container-networking/test/utils" "github.com/stretchr/testify/require" "k8s.io/utils/exec" fakeexec "k8s.io/utils/exec/testing" @@ -528,6 +529,28 @@ func TestRun(t *testing.T) { } } +func TestRunError(t *testing.T) { + setname := "test-set" + + var calls = []testutils.TestCmd{ + {Cmd: []string{"ipset", "-N", "-exist", util.GetHashedName(setname), "nethash"}, Stderr: "test failure", Err: &fakeexec.FakeExitError{Status: 2}}, + } + + fexec, fcmd := testutils.GetFakeExecWithScripts(calls) + + ipsMgr := NewIpsetManager(fexec) + entry := &ipsEntry{ + operationFlag: util.IpsetCreationFlag, + set: util.GetHashedName(setname), + spec: append([]string{util.IpsetNetHashFlag}), + } + if _, err := ipsMgr.Run(entry); err != nil { + require.Error(t, err) + } + + testutils.VerifyCallsMatch(t, calls, fexec, fcmd) +} + func TestDestroyNpmIpsets(t *testing.T) { ipsMgr := NewIpsetManager(exec.New()) diff --git a/npm/podController_test.go b/npm/podController_test.go index f5148f6975..d61b3e2f35 100644 --- a/npm/podController_test.go +++ b/npm/podController_test.go @@ -10,11 +10,9 @@ import ( "github.com/Azure/azure-container-networking/npm/ipsm" "github.com/Azure/azure-container-networking/npm/util" - testingutils "github.com/Azure/azure-container-networking/test/utils" - "github.com/stretchr/testify/require" + testutils "github.com/Azure/azure-container-networking/test/utils" corev1 "k8s.io/api/core/v1" utilexec "k8s.io/utils/exec" - fakeexec "k8s.io/utils/exec/testing" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" @@ -210,43 +208,31 @@ func checkNpmPodWithInput(testName string, f *podFixture, inputPodObj *corev1.Po } func TestAddMultiplePods(t *testing.T) { - require := require.New(t) - labels := map[string]string{ "app": "test-pod", } podObj1 := createPod("test-pod-1", "test-namespace", "0", "1.2.3.4", labels, NonHostNetwork, corev1.PodRunning) podObj2 := createPod("test-pod-2", "test-namespace", "0", "1.2.3.5", labels, NonHostNetwork, corev1.PodRunning) - var calls = []struct { - cmd []string - err error - }{ - {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("ns-test-namespace"), "nethash"}, err: nil}, - {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("ns-test-namespace"), "1.2.3.4"}, err: nil}, - {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("app"), "nethash"}, err: nil}, - {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("app"), "1.2.3.4"}, err: nil}, - {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("app:test-pod"), "nethash"}, err: nil}, - {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("app:test-pod"), "1.2.3.4"}, err: nil}, - {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("namedport:app:test-pod-1"), "hash:ip,port"}, err: nil}, - {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("namedport:app:test-pod-1"), "1.2.3.4,8080"}, err: nil}, - {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("ns-test-namespace"), "1.2.3.5"}, err: nil}, - {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("app"), "1.2.3.5"}, err: nil}, - {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("app:test-pod"), "1.2.3.5"}, err: nil}, - {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("namedport:app:test-pod-2"), "hash:ip,port"}, err: nil}, - {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("namedport:app:test-pod-2"), "1.2.3.5,8080"}, err: nil}, - } - - fcmd := fakeexec.FakeCmd{CombinedOutputScript: []fakeexec.FakeAction{}} - fexec := fakeexec.FakeExec{CommandScript: []fakeexec.FakeCommandAction{}} - - // expect happy path, each call returns no errors - for _, call := range calls { - fcmd.CombinedOutputScript = append(fcmd.CombinedOutputScript, func() ([]byte, []byte, error) { return nil, nil, call.err }) - fexec.CommandScript = append(fexec.CommandScript, func(cmd string, args ...string) utilexec.Cmd { return fakeexec.InitFakeCmd(&fcmd, cmd, args...) }) - } - - f := newFixture(t, &fexec) + var calls = []testutils.TestCmd{ + {Cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("ns-test-namespace"), "nethash"}}, + {Cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("ns-test-namespace"), "1.2.3.4"}}, + {Cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("app"), "nethash"}}, + {Cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("app"), "1.2.3.4"}}, + {Cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("app:test-pod"), "nethash"}}, + {Cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("app:test-pod"), "1.2.3.4"}}, + {Cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("namedport:app:test-pod-1"), "hash:ip,port"}}, + {Cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("namedport:app:test-pod-1"), "1.2.3.4,8080"}}, + {Cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("ns-test-namespace"), "1.2.3.5"}}, + {Cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("app"), "1.2.3.5"}}, + {Cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("app:test-pod"), "1.2.3.5"}}, + {Cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("namedport:app:test-pod-2"), "hash:ip,port"}}, + {Cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("namedport:app:test-pod-2"), "1.2.3.5,8080"}}, + } + + fexec, fcmd := testutils.GetFakeExecWithScripts(calls) + + f := newFixture(t, fexec) f.podLister = append(f.podLister, podObj1, podObj2) f.kubeobjects = append(f.kubeobjects, podObj1, podObj2) stopCh := make(chan struct{}) @@ -263,10 +249,7 @@ func TestAddMultiplePods(t *testing.T) { checkNpmPodWithInput("TestAddMultiplePods", f, podObj1) checkNpmPodWithInput("TestAddMultiplePods", f, podObj2) - require.Equal(len(calls), len(fcmd.CombinedOutputLog)) - for i, call := range calls { - require.Equalf(call.cmd, fcmd.CombinedOutputLog[i], "Call [%d] doesn't match expected", i) - } + testutils.VerifyCallsMatch(t, calls, fexec, fcmd) } func TestAddPod(t *testing.T) { @@ -275,19 +258,18 @@ func TestAddPod(t *testing.T) { } podObj := createPod("test-pod", "test-namespace", "0", "1.2.3.4", labels, NonHostNetwork, corev1.PodRunning) - require := require.New(t) - var calls = []testingutils.TestCmd{ - {Cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("ns-test-namespace"), "nethash"}, Err: nil}, - {Cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("ns-test-namespace"), "1.2.3.4"}, Err: nil}, - {Cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("app"), "nethash"}, Err: nil}, - {Cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("app"), "1.2.3.4"}, Err: nil}, - {Cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("app:test-pod"), "nethash"}, Err: nil}, - {Cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("app:test-pod"), "1.2.3.4"}, Err: nil}, - {Cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("namedport:app:test-pod"), "hash:ip,port"}, Err: nil}, - {Cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("namedport:app:test-pod"), "1.2.3.4,8080"}, Err: nil}, + var calls = []testutils.TestCmd{ + {Cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("ns-test-namespace"), "nethash"}}, + {Cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("ns-test-namespace"), "1.2.3.4"}}, + {Cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("app"), "nethash"}}, + {Cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("app"), "1.2.3.4"}}, + {Cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("app:test-pod"), "nethash"}}, + {Cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("app:test-pod"), "1.2.3.4"}}, + {Cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("namedport:app:test-pod"), "hash:ip,port"}}, + {Cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("namedport:app:test-pod"), "1.2.3.4,8080"}}, } - fexec := testingutils.GetFakeExecWithScripts(calls) + fexec, fcmd := testutils.GetFakeExecWithScripts(calls) f := newFixture(t, fexec) f.podLister = append(f.podLister, podObj) @@ -303,12 +285,7 @@ func TestAddPod(t *testing.T) { checkPodTestResult("TestAddPod", f, testCases) checkNpmPodWithInput("TestAddPod", f, podObj) - require.Equal(len(calls), fexec.CommandCalls) - /* - for i, call := range calls { - require.Equalf(call.Cmd, fcmd.CombinedOutputLog[i], "Call [%d] doesn't match expected", i) - } - */ + testutils.VerifyCallsMatch(t, calls, fexec, fcmd) } func TestAddHostNetworkPod(t *testing.T) { @@ -318,22 +295,11 @@ func TestAddHostNetworkPod(t *testing.T) { podObj := createPod("test-pod", "test-namespace", "0", "1.2.3.4", labels, HostNetwork, corev1.PodRunning) podKey := getKey(podObj, t) - require := require.New(t) - var calls = []struct { - cmd []string - err error - }{} + var calls = []testutils.TestCmd{} - fcmd := fakeexec.FakeCmd{CombinedOutputScript: []fakeexec.FakeAction{}} - fexec := fakeexec.FakeExec{CommandScript: []fakeexec.FakeCommandAction{}} + fexec, fcmd := testutils.GetFakeExecWithScripts(calls) - // expect happy path, each call returns no errors - for _, call := range calls { - fcmd.CombinedOutputScript = append(fcmd.CombinedOutputScript, func() ([]byte, []byte, error) { return nil, nil, call.err }) - fexec.CommandScript = append(fexec.CommandScript, func(cmd string, args ...string) utilexec.Cmd { return fakeexec.InitFakeCmd(&fcmd, cmd, args...) }) - } - - f := newFixture(t, &fexec) + f := newFixture(t, fexec) f.podLister = append(f.podLister, podObj) f.kubeobjects = append(f.kubeobjects, podObj) stopCh := make(chan struct{}) @@ -350,10 +316,7 @@ func TestAddHostNetworkPod(t *testing.T) { t.Error("TestAddHostNetworkPod failed @ cached pod obj exists check") } - require.Equal(len(calls), len(fcmd.CombinedOutputLog)) - for i, call := range calls { - require.Equalf(call.cmd, fcmd.CombinedOutputLog[i], "Call [%d] doesn't match expected", i) - } + testutils.VerifyCallsMatch(t, calls, fexec, fcmd) } func TestDeletePod(t *testing.T) { @@ -363,42 +326,31 @@ func TestDeletePod(t *testing.T) { podObj := createPod("test-pod", "test-namespace", "0", "1.2.3.4", labels, NonHostNetwork, corev1.PodRunning) podKey := getKey(podObj, t) - require := require.New(t) - var calls = []struct { - cmd []string - err error - }{ + var calls = []testutils.TestCmd{ // add pod - {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("ns-test-namespace"), "nethash"}, err: nil}, - {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("ns-test-namespace"), "1.2.3.4"}, err: nil}, - {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("app"), "nethash"}, err: nil}, - {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("app"), "1.2.3.4"}, err: nil}, - {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("app:test-pod"), "nethash"}, err: nil}, - {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("app:test-pod"), "1.2.3.4"}, err: nil}, - {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("namedport:app:test-pod"), "hash:ip,port"}, err: nil}, - {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("namedport:app:test-pod"), "1.2.3.4,8080"}, err: nil}, + {Cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("ns-test-namespace"), "nethash"}}, + {Cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("ns-test-namespace"), "1.2.3.4"}}, + {Cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("app"), "nethash"}}, + {Cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("app"), "1.2.3.4"}}, + {Cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("app:test-pod"), "nethash"}}, + {Cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("app:test-pod"), "1.2.3.4"}}, + {Cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("namedport:app:test-pod"), "hash:ip,port"}}, + {Cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("namedport:app:test-pod"), "1.2.3.4,8080"}}, // delete pod - {cmd: []string{"ipset", "-D", "-exist", util.GetHashedName("ns-test-namespace"), "1.2.3.4"}, err: nil}, - {cmd: []string{"ipset", "-X", "-exist", util.GetHashedName("ns-test-namespace")}, err: nil}, - {cmd: []string{"ipset", "-D", "-exist", util.GetHashedName("app"), "1.2.3.4"}, err: nil}, - {cmd: []string{"ipset", "-X", "-exist", util.GetHashedName("app")}, err: nil}, - {cmd: []string{"ipset", "-D", "-exist", util.GetHashedName("app:test-pod"), "1.2.3.4"}, err: nil}, - {cmd: []string{"ipset", "-X", "-exist", util.GetHashedName("app:test-pod")}, err: nil}, - {cmd: []string{"ipset", "-D", "-exist", util.GetHashedName("namedport:app:test-pod"), "1.2.3.4,8080"}, err: nil}, - {cmd: []string{"ipset", "-X", "-exist", util.GetHashedName("namedport:app:test-pod")}, err: nil}, + {Cmd: []string{"ipset", "-D", "-exist", util.GetHashedName("ns-test-namespace"), "1.2.3.4"}}, + {Cmd: []string{"ipset", "-X", "-exist", util.GetHashedName("ns-test-namespace")}}, + {Cmd: []string{"ipset", "-D", "-exist", util.GetHashedName("app"), "1.2.3.4"}}, + {Cmd: []string{"ipset", "-X", "-exist", util.GetHashedName("app")}}, + {Cmd: []string{"ipset", "-D", "-exist", util.GetHashedName("app:test-pod"), "1.2.3.4"}}, + {Cmd: []string{"ipset", "-X", "-exist", util.GetHashedName("app:test-pod")}}, + {Cmd: []string{"ipset", "-D", "-exist", util.GetHashedName("namedport:app:test-pod"), "1.2.3.4,8080"}}, + {Cmd: []string{"ipset", "-X", "-exist", util.GetHashedName("namedport:app:test-pod")}}, } - fcmd := fakeexec.FakeCmd{CombinedOutputScript: []fakeexec.FakeAction{}} - fexec := fakeexec.FakeExec{CommandScript: []fakeexec.FakeCommandAction{}} - - // expect happy path, each call returns no errors - for _, call := range calls { - fcmd.CombinedOutputScript = append(fcmd.CombinedOutputScript, func() ([]byte, []byte, error) { return nil, nil, call.err }) - fexec.CommandScript = append(fexec.CommandScript, func(cmd string, args ...string) utilexec.Cmd { return fakeexec.InitFakeCmd(&fcmd, cmd, args...) }) - } + fexec, fcmd := testutils.GetFakeExecWithScripts(calls) - f := newFixture(t, &fexec) + f := newFixture(t, fexec) f.podLister = append(f.podLister, podObj) f.kubeobjects = append(f.kubeobjects, podObj) stopCh := make(chan struct{}) @@ -414,10 +366,8 @@ func TestDeletePod(t *testing.T) { if _, exists := f.npMgr.PodMap[podKey]; exists { t.Error("TestDeletePod failed @ cached pod obj exists check") } - require.Equal(len(calls), len(fcmd.CombinedOutputLog)) - for i, call := range calls { - require.Equalf(call.cmd, fcmd.CombinedOutputLog[i], "Call [%d] doesn't match expected", i) - } + + testutils.VerifyCallsMatch(t, calls, fexec, fcmd) } func TestDeleteHostNetworkPod(t *testing.T) { @@ -427,21 +377,11 @@ func TestDeleteHostNetworkPod(t *testing.T) { podObj := createPod("test-pod", "test-namespace", "0", "1.2.3.4", labels, HostNetwork, corev1.PodRunning) podKey := getKey(podObj, t) - require := require.New(t) - var calls = []struct { - cmd []string - err error - }{} + var calls = []testutils.TestCmd{} - fcmd := fakeexec.FakeCmd{CombinedOutputScript: []fakeexec.FakeAction{}} - fexec := fakeexec.FakeExec{CommandScript: []fakeexec.FakeCommandAction{}} + fexec, fcmd := testutils.GetFakeExecWithScripts(calls) - // expect happy path, each call returns no errors - for _, call := range calls { - fcmd.CombinedOutputScript = append(fcmd.CombinedOutputScript, func() ([]byte, []byte, error) { return nil, nil, call.err }) - fexec.CommandScript = append(fexec.CommandScript, func(cmd string, args ...string) utilexec.Cmd { return fakeexec.InitFakeCmd(&fcmd, cmd, args...) }) - } - f := newFixture(t, &fexec) + f := newFixture(t, fexec) f.podLister = append(f.podLister, podObj) f.kubeobjects = append(f.kubeobjects, podObj) stopCh := make(chan struct{}) @@ -457,10 +397,7 @@ func TestDeleteHostNetworkPod(t *testing.T) { t.Error("TestDeleteHostNetworkPod failed @ cached pod obj exists check") } - require.Equal(len(calls), len(fcmd.CombinedOutputLog)) - for i, call := range calls { - require.Equalf(call.cmd, fcmd.CombinedOutputLog[i], "Call [%d] doesn't match expected", i) - } + testutils.VerifyCallsMatch(t, calls, fexec, fcmd) } func TestDeletePodWithTombstone(t *testing.T) { @@ -469,22 +406,11 @@ func TestDeletePodWithTombstone(t *testing.T) { } podObj := createPod("test-pod", "test-namespace", "0", "1.2.3.4", labels, NonHostNetwork, corev1.PodRunning) - require := require.New(t) - var calls = []struct { - cmd []string - err error - }{} + var calls = []testutils.TestCmd{} - fcmd := fakeexec.FakeCmd{CombinedOutputScript: []fakeexec.FakeAction{}} - fexec := fakeexec.FakeExec{CommandScript: []fakeexec.FakeCommandAction{}} + fexec, fcmd := testutils.GetFakeExecWithScripts(calls) - // expect happy path, each call returns no errors - for _, call := range calls { - fcmd.CombinedOutputScript = append(fcmd.CombinedOutputScript, func() ([]byte, []byte, error) { return nil, nil, call.err }) - fexec.CommandScript = append(fexec.CommandScript, func(cmd string, args ...string) utilexec.Cmd { return fakeexec.InitFakeCmd(&fcmd, cmd, args...) }) - } - - f := newFixture(t, &fexec) + f := newFixture(t, fexec) stopCh := make(chan struct{}) defer close(stopCh) f.newPodController(stopCh) @@ -501,10 +427,7 @@ func TestDeletePodWithTombstone(t *testing.T) { } checkPodTestResult("TestDeletePodWithTombstone", f, testCases) - require.Equal(len(calls), len(fcmd.CombinedOutputLog)) - for i, call := range calls { - require.Equalf(call.cmd, fcmd.CombinedOutputLog[i], "Call [%d] doesn't match expected", i) - } + testutils.VerifyCallsMatch(t, calls, fexec, fcmd) } func TestDeletePodWithTombstoneAfterAddingPod(t *testing.T) { @@ -513,42 +436,31 @@ func TestDeletePodWithTombstoneAfterAddingPod(t *testing.T) { } podObj := createPod("test-pod", "test-namespace", "0", "1.2.3.4", labels, NonHostNetwork, corev1.PodRunning) - require := require.New(t) - var calls = []struct { - cmd []string - err error - }{ + var calls = []testutils.TestCmd{ // add pod - {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("ns-test-namespace"), "nethash"}, err: nil}, - {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("ns-test-namespace"), "1.2.3.4"}, err: nil}, - {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("app"), "nethash"}, err: nil}, - {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("app"), "1.2.3.4"}, err: nil}, - {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("app:test-pod"), "nethash"}, err: nil}, - {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("app:test-pod"), "1.2.3.4"}, err: nil}, - {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("namedport:app:test-pod"), "hash:ip,port"}, err: nil}, - {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("namedport:app:test-pod"), "1.2.3.4,8080"}, err: nil}, + {Cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("ns-test-namespace"), "nethash"}}, + {Cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("ns-test-namespace"), "1.2.3.4"}}, + {Cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("app"), "nethash"}}, + {Cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("app"), "1.2.3.4"}}, + {Cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("app:test-pod"), "nethash"}}, + {Cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("app:test-pod"), "1.2.3.4"}}, + {Cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("namedport:app:test-pod"), "hash:ip,port"}}, + {Cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("namedport:app:test-pod"), "1.2.3.4,8080"}}, // delete pod - {cmd: []string{"ipset", "-D", "-exist", util.GetHashedName("ns-test-namespace"), "1.2.3.4"}, err: nil}, - {cmd: []string{"ipset", "-X", "-exist", util.GetHashedName("ns-test-namespace")}, err: nil}, - {cmd: []string{"ipset", "-D", "-exist", util.GetHashedName("app"), "1.2.3.4"}, err: nil}, - {cmd: []string{"ipset", "-X", "-exist", util.GetHashedName("app")}, err: nil}, - {cmd: []string{"ipset", "-D", "-exist", util.GetHashedName("app:test-pod"), "1.2.3.4"}, err: nil}, - {cmd: []string{"ipset", "-X", "-exist", util.GetHashedName("app:test-pod")}, err: nil}, - {cmd: []string{"ipset", "-D", "-exist", util.GetHashedName("namedport:app:test-pod"), "1.2.3.4,8080"}, err: nil}, - {cmd: []string{"ipset", "-X", "-exist", util.GetHashedName("namedport:app:test-pod")}, err: nil}, + {Cmd: []string{"ipset", "-D", "-exist", util.GetHashedName("ns-test-namespace"), "1.2.3.4"}}, + {Cmd: []string{"ipset", "-X", "-exist", util.GetHashedName("ns-test-namespace")}}, + {Cmd: []string{"ipset", "-D", "-exist", util.GetHashedName("app"), "1.2.3.4"}}, + {Cmd: []string{"ipset", "-X", "-exist", util.GetHashedName("app")}}, + {Cmd: []string{"ipset", "-D", "-exist", util.GetHashedName("app:test-pod"), "1.2.3.4"}}, + {Cmd: []string{"ipset", "-X", "-exist", util.GetHashedName("app:test-pod")}}, + {Cmd: []string{"ipset", "-D", "-exist", util.GetHashedName("namedport:app:test-pod"), "1.2.3.4,8080"}}, + {Cmd: []string{"ipset", "-X", "-exist", util.GetHashedName("namedport:app:test-pod")}}, } - fcmd := fakeexec.FakeCmd{CombinedOutputScript: []fakeexec.FakeAction{}} - fexec := fakeexec.FakeExec{CommandScript: []fakeexec.FakeCommandAction{}} - - // expect happy path, each call returns no errors - for _, call := range calls { - fcmd.CombinedOutputScript = append(fcmd.CombinedOutputScript, func() ([]byte, []byte, error) { return nil, nil, call.err }) - fexec.CommandScript = append(fexec.CommandScript, func(cmd string, args ...string) utilexec.Cmd { return fakeexec.InitFakeCmd(&fcmd, cmd, args...) }) - } + fexec, fcmd := testutils.GetFakeExecWithScripts(calls) - f := newFixture(t, &fexec) + f := newFixture(t, fexec) f.podLister = append(f.podLister, podObj) f.kubeobjects = append(f.kubeobjects, podObj) stopCh := make(chan struct{}) @@ -561,10 +473,7 @@ func TestDeletePodWithTombstoneAfterAddingPod(t *testing.T) { } checkPodTestResult("TestDeletePodWithTombstoneAfterAddingPod", f, testCases) - require.Equal(len(calls), len(fcmd.CombinedOutputLog)) - for i, call := range calls { - require.Equalf(call.cmd, fcmd.CombinedOutputLog[i], "Call [%d] doesn't match expected", i) - } + testutils.VerifyCallsMatch(t, calls, fexec, fcmd) } func TestLabelUpdatePod(t *testing.T) { @@ -573,38 +482,27 @@ func TestLabelUpdatePod(t *testing.T) { } oldPodObj := createPod("test-pod", "test-namespace", "0", "1.2.3.4", labels, NonHostNetwork, corev1.PodRunning) - require := require.New(t) - var calls = []struct { - cmd []string - err error - }{ + var calls = []testutils.TestCmd{ // add pod - {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("ns-test-namespace"), "nethash"}, err: nil}, - {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("ns-test-namespace"), "1.2.3.4"}, err: nil}, - {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("app"), "nethash"}, err: nil}, - {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("app"), "1.2.3.4"}, err: nil}, - {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("app:test-pod"), "nethash"}, err: nil}, - {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("app:test-pod"), "1.2.3.4"}, err: nil}, - {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("namedport:app:test-pod"), "hash:ip,port"}, err: nil}, - {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("namedport:app:test-pod"), "1.2.3.4,8080"}, err: nil}, + {Cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("ns-test-namespace"), "nethash"}}, + {Cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("ns-test-namespace"), "1.2.3.4"}}, + {Cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("app"), "nethash"}}, + {Cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("app"), "1.2.3.4"}}, + {Cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("app:test-pod"), "nethash"}}, + {Cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("app:test-pod"), "1.2.3.4"}}, + {Cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("namedport:app:test-pod"), "hash:ip,port"}}, + {Cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("namedport:app:test-pod"), "1.2.3.4,8080"}}, // update pod - {cmd: []string{"ipset", "-D", "-exist", util.GetHashedName("app:test-pod"), "1.2.3.4"}, err: nil}, - {cmd: []string{"ipset", "-X", "-exist", util.GetHashedName("app:test-pod")}, err: nil}, - {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("app:new-test-pod"), "nethash"}, err: nil}, - {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("app:new-test-pod"), "1.2.3.4"}, err: nil}, + {Cmd: []string{"ipset", "-D", "-exist", util.GetHashedName("app:test-pod"), "1.2.3.4"}}, + {Cmd: []string{"ipset", "-X", "-exist", util.GetHashedName("app:test-pod")}}, + {Cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("app:new-test-pod"), "nethash"}}, + {Cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("app:new-test-pod"), "1.2.3.4"}}, } - fcmd := fakeexec.FakeCmd{CombinedOutputScript: []fakeexec.FakeAction{}} - fexec := fakeexec.FakeExec{CommandScript: []fakeexec.FakeCommandAction{}} - - // expect happy path, each call returns no errors - for _, call := range calls { - fcmd.CombinedOutputScript = append(fcmd.CombinedOutputScript, func() ([]byte, []byte, error) { return nil, nil, call.err }) - fexec.CommandScript = append(fexec.CommandScript, func(cmd string, args ...string) utilexec.Cmd { return fakeexec.InitFakeCmd(&fcmd, cmd, args...) }) - } + fexec, fcmd := testutils.GetFakeExecWithScripts(calls) - f := newFixture(t, &fexec) + f := newFixture(t, fexec) f.podLister = append(f.podLister, oldPodObj) f.kubeobjects = append(f.kubeobjects, oldPodObj) stopCh := make(chan struct{}) @@ -626,10 +524,7 @@ func TestLabelUpdatePod(t *testing.T) { checkPodTestResult("TestLabelUpdatePod", f, testCases) checkNpmPodWithInput("TestLabelUpdatePod", f, newPodObj) - require.Equal(len(calls), len(fcmd.CombinedOutputLog)) - for i, call := range calls { - require.Equalf(call.cmd, fcmd.CombinedOutputLog[i], "Call [%d] doesn't match expected", i) - } + testutils.VerifyCallsMatch(t, calls, fexec, fcmd) } func TestIPAddressUpdatePod(t *testing.T) { @@ -638,50 +533,39 @@ func TestIPAddressUpdatePod(t *testing.T) { } oldPodObj := createPod("test-pod", "test-namespace", "0", "1.2.3.4", labels, NonHostNetwork, corev1.PodRunning) - require := require.New(t) - var calls = []struct { - cmd []string - err error - }{ + var calls = []testutils.TestCmd{ // add pod - {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("ns-test-namespace"), "nethash"}, err: nil}, - {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("ns-test-namespace"), "1.2.3.4"}, err: nil}, - {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("app"), "nethash"}, err: nil}, - {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("app"), "1.2.3.4"}, err: nil}, - {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("app:test-pod"), "nethash"}, err: nil}, - {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("app:test-pod"), "1.2.3.4"}, err: nil}, - {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("namedport:app:test-pod"), "hash:ip,port"}, err: nil}, - {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("namedport:app:test-pod"), "1.2.3.4,8080"}, err: nil}, + {Cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("ns-test-namespace"), "nethash"}}, + {Cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("ns-test-namespace"), "1.2.3.4"}}, + {Cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("app"), "nethash"}}, + {Cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("app"), "1.2.3.4"}}, + {Cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("app:test-pod"), "nethash"}}, + {Cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("app:test-pod"), "1.2.3.4"}}, + {Cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("namedport:app:test-pod"), "hash:ip,port"}}, + {Cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("namedport:app:test-pod"), "1.2.3.4,8080"}}, // update pod - {cmd: []string{"ipset", "-D", "-exist", util.GetHashedName("ns-test-namespace"), "1.2.3.4"}, err: nil}, - {cmd: []string{"ipset", "-X", "-exist", util.GetHashedName("ns-test-namespace")}, err: nil}, - {cmd: []string{"ipset", "-D", "-exist", util.GetHashedName("app"), "1.2.3.4"}, err: nil}, - {cmd: []string{"ipset", "-X", "-exist", util.GetHashedName("app")}, err: nil}, - {cmd: []string{"ipset", "-D", "-exist", util.GetHashedName("app:test-pod"), "1.2.3.4"}, err: nil}, - {cmd: []string{"ipset", "-X", "-exist", util.GetHashedName("app:test-pod")}, err: nil}, - {cmd: []string{"ipset", "-D", "-exist", util.GetHashedName("namedport:app:test-pod"), "1.2.3.4,8080"}, err: nil}, - {cmd: []string{"ipset", "-X", "-exist", util.GetHashedName("namedport:app:test-pod")}, err: nil}, - {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("ns-test-namespace"), "nethash"}, err: nil}, - {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("ns-test-namespace"), "4.3.2.1"}, err: nil}, - {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("app"), "nethash"}, err: nil}, - {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("app"), "4.3.2.1"}, err: nil}, - {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("app:test-pod"), "nethash"}, err: nil}, - {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("app:test-pod"), "4.3.2.1"}, err: nil}, - {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("namedport:app:test-pod"), "hash:ip,port"}, err: nil}, - {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("namedport:app:test-pod"), "4.3.2.1,8080"}, err: nil}, - } - - fcmd := fakeexec.FakeCmd{CombinedOutputScript: []fakeexec.FakeAction{}} - fexec := fakeexec.FakeExec{CommandScript: []fakeexec.FakeCommandAction{}} - - // expect happy path, each call returns no errors - for _, call := range calls { - fcmd.CombinedOutputScript = append(fcmd.CombinedOutputScript, func() ([]byte, []byte, error) { return nil, nil, call.err }) - fexec.CommandScript = append(fexec.CommandScript, func(cmd string, args ...string) utilexec.Cmd { return fakeexec.InitFakeCmd(&fcmd, cmd, args...) }) - } - - f := newFixture(t, &fexec) + {Cmd: []string{"ipset", "-D", "-exist", util.GetHashedName("ns-test-namespace"), "1.2.3.4"}}, + {Cmd: []string{"ipset", "-X", "-exist", util.GetHashedName("ns-test-namespace")}}, + {Cmd: []string{"ipset", "-D", "-exist", util.GetHashedName("app"), "1.2.3.4"}}, + {Cmd: []string{"ipset", "-X", "-exist", util.GetHashedName("app")}}, + {Cmd: []string{"ipset", "-D", "-exist", util.GetHashedName("app:test-pod"), "1.2.3.4"}}, + {Cmd: []string{"ipset", "-X", "-exist", util.GetHashedName("app:test-pod")}}, + {Cmd: []string{"ipset", "-D", "-exist", util.GetHashedName("namedport:app:test-pod"), "1.2.3.4,8080"}}, + {Cmd: []string{"ipset", "-X", "-exist", util.GetHashedName("namedport:app:test-pod")}}, + {Cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("ns-test-namespace"), "nethash"}}, + {Cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("ns-test-namespace"), "4.3.2.1"}}, + {Cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("app"), "nethash"}}, + {Cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("app"), "4.3.2.1"}}, + {Cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("app:test-pod"), "nethash"}}, + {Cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("app:test-pod"), "4.3.2.1"}}, + {Cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("namedport:app:test-pod"), "hash:ip,port"}}, + {Cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("namedport:app:test-pod"), "4.3.2.1,8080"}}, + } + + fexec, fcmd := testutils.GetFakeExecWithScripts(calls) + + f := newFixture(t, fexec) f.podLister = append(f.podLister, oldPodObj) f.kubeobjects = append(f.kubeobjects, oldPodObj) stopCh := make(chan struct{}) @@ -702,10 +586,7 @@ func TestIPAddressUpdatePod(t *testing.T) { checkPodTestResult("TestIPAddressUpdatePod", f, testCases) checkNpmPodWithInput("TestIPAddressUpdatePod", f, newPodObj) - require.Equal(len(calls), len(fcmd.CombinedOutputLog)) - for i, call := range calls { - require.Equalf(call.cmd, fcmd.CombinedOutputLog[i], "Call [%d] doesn't match expected", i) - } + testutils.VerifyCallsMatch(t, calls, fexec, fcmd) } func TestPodStatusUpdatePod(t *testing.T) { @@ -715,42 +596,31 @@ func TestPodStatusUpdatePod(t *testing.T) { oldPodObj := createPod("test-pod", "test-namespace", "0", "1.2.3.4", labels, NonHostNetwork, corev1.PodRunning) podKey := getKey(oldPodObj, t) - require := require.New(t) - var calls = []struct { - cmd []string - err error - }{ + var calls = []testutils.TestCmd{ // add pod - {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("ns-test-namespace"), "nethash"}, err: nil}, - {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("ns-test-namespace"), "1.2.3.4"}, err: nil}, - {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("app"), "nethash"}, err: nil}, - {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("app"), "1.2.3.4"}, err: nil}, - {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("app:test-pod"), "nethash"}, err: nil}, - {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("app:test-pod"), "1.2.3.4"}, err: nil}, - {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("namedport:app:test-pod"), "hash:ip,port"}, err: nil}, - {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("namedport:app:test-pod"), "1.2.3.4,8080"}, err: nil}, + {Cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("ns-test-namespace"), "nethash"}}, + {Cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("ns-test-namespace"), "1.2.3.4"}}, + {Cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("app"), "nethash"}}, + {Cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("app"), "1.2.3.4"}}, + {Cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("app:test-pod"), "nethash"}}, + {Cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("app:test-pod"), "1.2.3.4"}}, + {Cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("namedport:app:test-pod"), "hash:ip,port"}}, + {Cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("namedport:app:test-pod"), "1.2.3.4,8080"}}, // update pod - {cmd: []string{"ipset", "-D", "-exist", util.GetHashedName("ns-test-namespace"), "1.2.3.4"}, err: nil}, - {cmd: []string{"ipset", "-X", "-exist", util.GetHashedName("ns-test-namespace")}, err: nil}, - {cmd: []string{"ipset", "-D", "-exist", util.GetHashedName("app"), "1.2.3.4"}, err: nil}, - {cmd: []string{"ipset", "-X", "-exist", util.GetHashedName("app")}, err: nil}, - {cmd: []string{"ipset", "-D", "-exist", util.GetHashedName("app:test-pod"), "1.2.3.4"}, err: nil}, - {cmd: []string{"ipset", "-X", "-exist", util.GetHashedName("app:test-pod")}, err: nil}, - {cmd: []string{"ipset", "-D", "-exist", util.GetHashedName("namedport:app:test-pod"), "1.2.3.4,8080"}, err: nil}, - {cmd: []string{"ipset", "-X", "-exist", util.GetHashedName("namedport:app:test-pod")}, err: nil}, + {Cmd: []string{"ipset", "-D", "-exist", util.GetHashedName("ns-test-namespace"), "1.2.3.4"}}, + {Cmd: []string{"ipset", "-X", "-exist", util.GetHashedName("ns-test-namespace")}}, + {Cmd: []string{"ipset", "-D", "-exist", util.GetHashedName("app"), "1.2.3.4"}}, + {Cmd: []string{"ipset", "-X", "-exist", util.GetHashedName("app")}}, + {Cmd: []string{"ipset", "-D", "-exist", util.GetHashedName("app:test-pod"), "1.2.3.4"}}, + {Cmd: []string{"ipset", "-X", "-exist", util.GetHashedName("app:test-pod")}}, + {Cmd: []string{"ipset", "-D", "-exist", util.GetHashedName("namedport:app:test-pod"), "1.2.3.4,8080"}}, + {Cmd: []string{"ipset", "-X", "-exist", util.GetHashedName("namedport:app:test-pod")}}, } - fcmd := fakeexec.FakeCmd{CombinedOutputScript: []fakeexec.FakeAction{}} - fexec := fakeexec.FakeExec{CommandScript: []fakeexec.FakeCommandAction{}} + fexec, fcmd := testutils.GetFakeExecWithScripts(calls) - // expect happy path, each call returns no errors - for _, call := range calls { - fcmd.CombinedOutputScript = append(fcmd.CombinedOutputScript, func() ([]byte, []byte, error) { return nil, nil, call.err }) - fexec.CommandScript = append(fexec.CommandScript, func(cmd string, args ...string) utilexec.Cmd { return fakeexec.InitFakeCmd(&fcmd, cmd, args...) }) - } - - f := newFixture(t, &fexec) + f := newFixture(t, fexec) f.podLister = append(f.podLister, oldPodObj) f.kubeobjects = append(f.kubeobjects, oldPodObj) stopCh := make(chan struct{}) @@ -774,10 +644,7 @@ func TestPodStatusUpdatePod(t *testing.T) { t.Error("TestPodStatusUpdatePod failed @ cached pod obj exists check") } - require.Equal(len(calls), len(fcmd.CombinedOutputLog)) - for i, call := range calls { - require.Equalf(call.cmd, fcmd.CombinedOutputLog[i], "Call [%d] doesn't match expected", i) - } + testutils.VerifyCallsMatch(t, calls, fexec, fcmd) } func TestHasValidPodIP(t *testing.T) { diff --git a/test/utils/utils.go b/test/utils/utils.go index 1ad08d0a79..af75b26dbd 100644 --- a/test/utils/utils.go +++ b/test/utils/utils.go @@ -1,37 +1,46 @@ package testingutils import ( + "testing" + + "github.com/stretchr/testify/require" "k8s.io/utils/exec" - testing "k8s.io/utils/exec/testing" + fakeexec "k8s.io/utils/exec/testing" ) type TestCmd struct { - Cmd []string - Err *testing.FakeExitError + Cmd []string + Stderr string + Err *fakeexec.FakeExitError } -func GetFakeExecWithScripts(calls []TestCmd) *testing.FakeExec { +func GetFakeExecWithScripts(calls []TestCmd) (*fakeexec.FakeExec, *fakeexec.FakeCmd) { + fexec := &fakeexec.FakeExec{ExactOrder: false, DisableScripts: false} + + fcmd := &fakeexec.FakeCmd{} - fakeexec := &testing.FakeExec{ExactOrder: true, DisableScripts: false} for _, call := range calls { - var err testing.FakeExitError if call.Err != nil { - err = *call.Err + err := call.Err + stderr := call.Stderr + fcmd.CombinedOutputScript = append(fcmd.CombinedOutputScript, func() ([]byte, []byte, error) { return []byte(stderr), nil, err }) + } else { + fcmd.CombinedOutputScript = append(fcmd.CombinedOutputScript, func() ([]byte, []byte, error) { return []byte{}, nil, nil }) } - fakeCmd := &testing.FakeCmd{} - cmdAction := makeFakeCmd(fakeCmd, call.Cmd[0], call.Cmd[1:]...) - fakeCmd.CombinedOutputScript = append(fakeCmd.CombinedOutputScript, func() ([]byte, []byte, error) { return nil, nil, err }) - fakeexec.CommandScript = append(fakeexec.CommandScript, cmdAction) } - return fakeexec + + for range calls { + fexec.CommandScript = append(fexec.CommandScript, func(cmd string, args ...string) exec.Cmd { return fakeexec.InitFakeCmd(fcmd, cmd, args...) }) + } + + return fexec, fcmd } -func makeFakeCmd(fakeCmd *testing.FakeCmd, cmd string, args ...string) testing.FakeCommandAction { - c := cmd - a := args - return func(cmd string, args ...string) exec.Cmd { - command := testing.InitFakeCmd(fakeCmd, c, a...) - return command +func VerifyCallsMatch(t *testing.T, calls []TestCmd, fexec *fakeexec.FakeExec, fcmd *fakeexec.FakeCmd) { + require.Equal(t, len(calls), fexec.CommandCalls) + + for i, call := range calls { + require.Equalf(t, call.Cmd, fcmd.CombinedOutputLog[i], "Call [%d] doesn't match expected", i) } } From f10b9f753bed68ecc7cb8b0c8367ebb864bad092 Mon Sep 17 00:00:00 2001 From: Mathew Merrick Date: Tue, 4 May 2021 18:44:47 +0000 Subject: [PATCH 17/19] delete --- npm/ipsm/ipsm.go | 31 ++++++++------- npm/ipsm/ipsm_test.go | 87 ++++++++++++++++++++++++++++++------------- test/utils/utils.go | 10 ++--- 3 files changed, 85 insertions(+), 43 deletions(-) diff --git a/npm/ipsm/ipsm.go b/npm/ipsm/ipsm.go index b7e208768a..8015206862 100644 --- a/npm/ipsm/ipsm.go +++ b/npm/ipsm/ipsm.go @@ -6,8 +6,10 @@ package ipsm import ( "fmt" "os" + "os/exec" "regexp" "strings" + "syscall" "github.com/Azure/azure-container-networking/log" "github.com/Azure/azure-container-networking/npm/metrics" @@ -120,8 +122,12 @@ func (ipsMgr *IpsetManager) DeleteList(listName string) error { set: util.GetHashedName(listName), } - if errCode, err := ipsMgr.Run(entry); err != nil && errCode != 1 { - metrics.SendErrorLogAndMetric(util.IpsmID, "Error: failed to create ipset list %s.", listName) + if errCode, err := ipsMgr.Run(entry); err != nil { + if errCode == 1 { + return nil + } + + metrics.SendErrorLogAndMetric(util.IpsmID, "Error: failed to delete ipset %s %+v", listName, entry) return err } @@ -170,8 +176,7 @@ func (ipsMgr *IpsetManager) AddToList(listName string, setName string) error { // add set to list if errCode, err := ipsMgr.Run(entry); err != nil && errCode != 1 { - metrics.SendErrorLogAndMetric(util.IpsmID, "Error: failed to create ipset list %s.", listName) - return err + return fmt.Errorf("Error: failed to create ipset rules. rule: %+v, error: %v", entry, err) } ipsMgr.ListMap[listName].elements[setName] = "" @@ -541,25 +546,25 @@ func (ipsMgr *IpsetManager) Restore(configFile string) error { // DestroyNpmIpsets destroys only ipsets created by NPM func (ipsMgr *IpsetManager) DestroyNpmIpsets() error { - cmdName := util.Ipset cmdArgs := util.IPsetCheckListFlag - cmd := ipsMgr.Exec.Command(cmdName, cmdArgs) - output, err := cmd.CombinedOutput() - if err != nil { - metrics.SendErrorLogAndMetric(util.IpsmID, "{DestroyNpmIpsets} Error: There was an error running command: [%s] Stderr: [%v, %s]", cmdName, err, strings.TrimSuffix(string(output), "\n")) + reply, err := ipsMgr.Exec.Command(cmdName, cmdArgs).CombinedOutput() + if msg, failed := err.(*exec.ExitError); failed { + errCode := msg.Sys().(syscall.WaitStatus).ExitStatus() + if errCode > 0 { + metrics.SendErrorLogAndMetric(util.IpsmID, "{DestroyNpmIpsets} Error: There was an error running command: [%s] Stderr: [%v, %s]", cmdName, err, strings.TrimSuffix(string(msg.Stderr), "\n")) + } + return err } - - // todo: verify destroy reply response - if output == nil { + if reply == nil { metrics.SendErrorLogAndMetric(util.IpsmID, "{DestroyNpmIpsets} Received empty string from ipset list while destroying azure-npm ipsets") return nil } re := regexp.MustCompile("Name: (" + util.AzureNpmPrefix + "\\d+)") - ipsetRegexSlice := re.FindAllSubmatch(output, -1) + ipsetRegexSlice := re.FindAllSubmatch(reply, -1) if len(ipsetRegexSlice) == 0 { log.Logf("No Azure-NPM IPsets are found in the Node.") diff --git a/npm/ipsm/ipsm_test.go b/npm/ipsm/ipsm_test.go index 685e059533..ec09c4b225 100644 --- a/npm/ipsm/ipsm_test.go +++ b/npm/ipsm/ipsm_test.go @@ -15,7 +15,6 @@ import ( testutils "github.com/Azure/azure-container-networking/test/utils" "github.com/stretchr/testify/require" "k8s.io/utils/exec" - fakeexec "k8s.io/utils/exec/testing" ) func TestSave(t *testing.T) { @@ -97,29 +96,23 @@ func TestAddToList(t *testing.T) { } func TestDeleteFromList(t *testing.T) { - require := require.New(t) - var calls = []struct { - cmd []string - err error - }{ - {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("test-set"), "nethash"}, err: nil}, - {cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("test-list"), "setlist"}, err: nil}, - {cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("test-list"), util.GetHashedName("test-set")}, err: nil}, - {cmd: []string{"ipset", "-D", "-exist", util.GetHashedName("test-list"), util.GetHashedName("test-set")}, err: nil}, - {cmd: []string{"ipset", "-X", "-exist", util.GetHashedName("test-list")}, err: nil}, - {cmd: []string{"ipset", "-X", "-exist", util.GetHashedName("test-set")}, err: nil}, + var calls = []testutils.TestCmd{ + {Cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("test-set"), "nethash"}}, + {Cmd: []string{"ipset", "list", "-exist", util.GetHashedName("test-set")}}, + {Cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("test-list"), "setlist"}}, + {Cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("test-list"), util.GetHashedName("test-set")}}, + {Cmd: []string{"ipset", "test", "-exist", util.GetHashedName("test-list"), util.GetHashedName("test-set")}}, + {Cmd: []string{"ipset", "-D", "-exist", util.GetHashedName("test-list"), util.GetHashedName("test-set")}}, + {Cmd: []string{"ipset", "-X", "-exist", util.GetHashedName("test-list")}}, + {Cmd: []string{"ipset", "test", "-exist", util.GetHashedName("test-list"), util.GetHashedName("test-set")}, Stderr: "ipset still exists", ExitCode: 2}, + {Cmd: []string{"ipset", "list", "-exist", util.GetHashedName("test-list")}, Stderr: "ipset still exists", ExitCode: 2}, + {Cmd: []string{"ipset", "-X", "-exist", util.GetHashedName("test-set")}}, + {Cmd: []string{"ipset", "list", "-exist", util.GetHashedName("test-set")}, Stderr: "ipset still exists", ExitCode: 2}, } - fcmd := fakeexec.FakeCmd{CombinedOutputScript: []fakeexec.FakeAction{}} - fexec := fakeexec.FakeExec{CommandScript: []fakeexec.FakeCommandAction{}} - - // expect happy path, each call returns no errors - for _, call := range calls { - fcmd.CombinedOutputScript = append(fcmd.CombinedOutputScript, func() ([]byte, []byte, error) { return nil, nil, call.err }) - fexec.CommandScript = append(fexec.CommandScript, func(cmd string, args ...string) exec.Cmd { return fakeexec.InitFakeCmd(&fcmd, cmd, args...) }) - } + fexec, fcmd := testutils.GetFakeExecWithScripts(calls) - ipsMgr := NewIpsetManager(&fexec) + ipsMgr := NewIpsetManager(fexec) // Create set and validate set is created. setName := "test-set" @@ -127,12 +120,31 @@ func TestDeleteFromList(t *testing.T) { t.Errorf("TestDeleteFromList failed @ ipsMgr.CreateSet") } + entry := &ipsEntry{ + operationFlag: util.IPsetCheckListFlag, + set: util.GetHashedName(setName), + } + + if _, err := ipsMgr.Run(entry); err != nil { + t.Errorf("TestDeleteFromList failed @ ipsMgr.CreateSet since %s not exist in kernel", setName) + } + // Create list, add set to list and validate set is in the list. listName := "test-list" if err := ipsMgr.AddToList(listName, setName); err != nil { t.Errorf("TestDeleteFromList failed @ ipsMgr.AddToList") } + entry = &ipsEntry{ + operationFlag: util.IpsetTestFlag, + set: util.GetHashedName(listName), + spec: append([]string{util.GetHashedName(setName)}), + } + + if _, err := ipsMgr.Run(entry); err != nil { + t.Errorf("TestDeleteFromList failed @ ipsMgr.AddToList since %s not exist in %s set", listName, setName) + } + // Delete set from list and validate set is not in list anymore. if err := ipsMgr.DeleteFromList(listName, setName); err != nil { t.Errorf("TestDeleteFromList failed @ ipsMgr.DeleteFromList %v", err) @@ -148,21 +160,46 @@ func TestDeleteFromList(t *testing.T) { t.Errorf("TestDeleteFromList failed @ ipsMgr.DeleteFromList %v", err) } + entry = &ipsEntry{ + operationFlag: util.IpsetTestFlag, + set: util.GetHashedName(listName), + spec: append([]string{util.GetHashedName(setName)}), + } + + if _, err := ipsMgr.Run(entry); err == nil { + t.Errorf("TestDeleteFromList failed @ ipsMgr.DeleteFromList since %s still exist in %s set", listName, setName) + } + // Delete List and validate list is not exist. if err := ipsMgr.DeleteSet(listName); err != nil { t.Errorf("TestDeleteSet failed @ ipsMgr.DeleteSet") } + entry = &ipsEntry{ + operationFlag: util.IPsetCheckListFlag, + set: util.GetHashedName(listName), + } + + if _, err := ipsMgr.Run(entry); err == nil { + t.Errorf("TestDeleteFromList failed @ ipsMgr.DeleteSet since %s still exist in kernel", listName) + } + // Delete set and validate set is not exist. if err := ipsMgr.DeleteSet(setName); err != nil { t.Errorf("TestDeleteSet failed @ ipsMgr.DeleteSet") } - require.Equal(len(calls), len(fcmd.CombinedOutputLog)) - for i, call := range calls { - require.Equalf(call.cmd, fcmd.CombinedOutputLog[i], "Call [%d] doesn't match expected", i) + entry = &ipsEntry{ + operationFlag: util.IPsetCheckListFlag, + set: util.GetHashedName(setName), + } + + if _, err := ipsMgr.Run(entry); err == nil { + t.Errorf("TestDeleteFromList failed @ ipsMgr.DeleteSet since %s still exist in kernel", setName) } + + testutils.VerifyCallsMatch(t, calls, fexec, fcmd) } func TestCreateSet(t *testing.T) { @@ -533,7 +570,7 @@ func TestRunError(t *testing.T) { setname := "test-set" var calls = []testutils.TestCmd{ - {Cmd: []string{"ipset", "-N", "-exist", util.GetHashedName(setname), "nethash"}, Stderr: "test failure", Err: &fakeexec.FakeExitError{Status: 2}}, + {Cmd: []string{"ipset", "-N", "-exist", util.GetHashedName(setname), "nethash"}, Stderr: "test failure", ExitCode: 2}, } fexec, fcmd := testutils.GetFakeExecWithScripts(calls) diff --git a/test/utils/utils.go b/test/utils/utils.go index af75b26dbd..0d33b491ea 100644 --- a/test/utils/utils.go +++ b/test/utils/utils.go @@ -10,9 +10,9 @@ import ( ) type TestCmd struct { - Cmd []string - Stderr string - Err *fakeexec.FakeExitError + Cmd []string + Stderr string + ExitCode int } func GetFakeExecWithScripts(calls []TestCmd) (*fakeexec.FakeExec, *fakeexec.FakeCmd) { @@ -21,9 +21,9 @@ func GetFakeExecWithScripts(calls []TestCmd) (*fakeexec.FakeExec, *fakeexec.Fake fcmd := &fakeexec.FakeCmd{} for _, call := range calls { - if call.Err != nil { - err := call.Err + if call.Stderr != "" || call.ExitCode != 0 { stderr := call.Stderr + err := &fakeexec.FakeExitError{Status: call.ExitCode} fcmd.CombinedOutputScript = append(fcmd.CombinedOutputScript, func() ([]byte, []byte, error) { return []byte(stderr), nil, err }) } else { fcmd.CombinedOutputScript = append(fcmd.CombinedOutputScript, func() ([]byte, []byte, error) { return []byte{}, nil, nil }) From ea60c83ea216c5be2e46a2b7456f75159a45b227 Mon Sep 17 00:00:00 2001 From: Mathew Merrick Date: Wed, 5 May 2021 19:24:38 +0000 Subject: [PATCH 18/19] address feedback --- npm/ipsm/ipsm.go | 18 +++++++++--------- npm/nameSpaceController.go | 2 +- npm/podController.go | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/npm/ipsm/ipsm.go b/npm/ipsm/ipsm.go index 7275f6b3e4..e74b776ee5 100644 --- a/npm/ipsm/ipsm.go +++ b/npm/ipsm/ipsm.go @@ -26,7 +26,7 @@ type ipsEntry struct { // IpsetManager stores ipset states. type IpsetManager struct { - Exec utilexec.Interface + exec utilexec.Interface ListMap map[string]*Ipset //tracks all set lists. SetMap map[string]*Ipset //label -> []ip } @@ -49,7 +49,7 @@ func NewIpset(setName string) *Ipset { // NewIpsetManager creates a new instance for IpsetManager object. func NewIpsetManager(exec utilexec.Interface) *IpsetManager { return &IpsetManager{ - Exec: exec, + exec: exec, ListMap: make(map[string]*Ipset), SetMap: make(map[string]*Ipset), } @@ -411,7 +411,7 @@ func (ipsMgr *IpsetManager) DeleteFromSet(setName, ip, podKey string) error { return nil } - metrics.SendErrorLogAndMetric(util.IpsmID, "Error: failed to delete ipset entry. Entry: %+v", entry) + metrics.SendErrorLogAndMetric(util.IpsmID, "Error: failed to delete ipset entry: [%+v] err: [%v]", entry, err) return err } @@ -484,7 +484,7 @@ func (ipsMgr *IpsetManager) Run(entry *ipsEntry) (int, error) { log.Logf("Executing ipset command %s %v", cmdName, cmdArgs) - cmd := ipsMgr.Exec.Command(cmdName, cmdArgs...) + cmd := ipsMgr.exec.Command(cmdName, cmdArgs...) output, err := cmd.CombinedOutput() if result, isExitError := err.(utilexec.ExitError); isExitError { @@ -506,10 +506,10 @@ func (ipsMgr *IpsetManager) Save(configFile string) error { configFile = util.IpsetConfigFile } - cmd := ipsMgr.Exec.Command(util.Ipset, util.IpsetSaveFlag, util.IpsetFileFlag, configFile) + cmd := ipsMgr.exec.Command(util.Ipset, util.IpsetSaveFlag, util.IpsetFileFlag, configFile) output, err := cmd.CombinedOutput() if err != nil { - metrics.SendErrorLogAndMetric(util.IpsmID, "Error: failed to save ipset to file with err %v, stderr: %v", err, string(output)) + metrics.SendErrorLogAndMetric(util.IpsmID, "Error: failed to save ipset: [%s] Stderr: [%v, %s]", cmd, err, strings.TrimSuffix(string(output), "\n")) return err } cmd.Wait() @@ -535,10 +535,10 @@ func (ipsMgr *IpsetManager) Restore(configFile string) error { } } - cmd := ipsMgr.Exec.Command(util.Ipset, util.IpsetRestoreFlag, util.IpsetFileFlag, configFile) + cmd := ipsMgr.exec.Command(util.Ipset, util.IpsetRestoreFlag, util.IpsetFileFlag, configFile) output, err := cmd.CombinedOutput() if err != nil { - metrics.SendErrorLogAndMetric(util.IpsmID, "Error: failed to to restore ipset from file with err %v, stderr %v", err, string(output)) + metrics.SendErrorLogAndMetric(util.IpsmID, "Error: failed to to restore ipset from file: [%s] Stderr: [%v, %s]", cmd, err, strings.TrimSuffix(string(output), "\n")) return err } @@ -552,7 +552,7 @@ func (ipsMgr *IpsetManager) DestroyNpmIpsets() error { cmdName := util.Ipset cmdArgs := util.IPsetCheckListFlag - reply, err := ipsMgr.Exec.Command(cmdName, cmdArgs).CombinedOutput() + reply, err := ipsMgr.exec.Command(cmdName, cmdArgs).CombinedOutput() if msg, failed := err.(*exec.ExitError); failed { errCode := msg.Sys().(syscall.WaitStatus).ExitStatus() if errCode > 0 { diff --git a/npm/nameSpaceController.go b/npm/nameSpaceController.go index 3e50e5f97b..fcdefb8eae 100644 --- a/npm/nameSpaceController.go +++ b/npm/nameSpaceController.go @@ -337,7 +337,7 @@ func (nsc *nameSpaceController) syncAddNameSpace(nsObj *corev1.Namespace) error return err } - npmNs, _ := newNs(corev1NsName, ipsMgr.Exec) + npmNs, _ := newNs(corev1NsName, nsc.npMgr.Exec) nsc.npMgr.NsMap[corev1NsName] = npmNs // Add the namespace to its label's ipset list. diff --git a/npm/podController.go b/npm/podController.go index 61e9806064..68b622f99e 100644 --- a/npm/podController.go +++ b/npm/podController.go @@ -439,7 +439,7 @@ func (c *podController) syncAddAndUpdatePod(newPodObj *corev1.Pod) error { } // Add namespace object into NsMap cache only when two ipset operations are successful. - npmNs, _ := newNs(newPodObjNs) + npmNs, _ := newNs(newPodObjNs, c.npMgr.Exec) c.npMgr.NsMap[newPodObjNs] = npmNs } From 1ac00c80ae2cfb91e74e5d4ad04bf413d26a0fd3 Mon Sep 17 00:00:00 2001 From: Mathew Merrick Date: Wed, 5 May 2021 21:11:45 +0000 Subject: [PATCH 19/19] update tests from master changes --- npm/podController_test.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/npm/podController_test.go b/npm/podController_test.go index d61b3e2f35..896ae5a221 100644 --- a/npm/podController_test.go +++ b/npm/podController_test.go @@ -216,6 +216,8 @@ func TestAddMultiplePods(t *testing.T) { var calls = []testutils.TestCmd{ {Cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("ns-test-namespace"), "nethash"}}, + {Cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("all-namespaces"), "setlist"}}, + {Cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("all-namespaces"), util.GetHashedName("ns-test-namespace")}}, {Cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("ns-test-namespace"), "1.2.3.4"}}, {Cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("app"), "nethash"}}, {Cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("app"), "1.2.3.4"}}, @@ -260,6 +262,8 @@ func TestAddPod(t *testing.T) { var calls = []testutils.TestCmd{ {Cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("ns-test-namespace"), "nethash"}}, + {Cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("all-namespaces"), "setlist"}}, + {Cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("all-namespaces"), util.GetHashedName("ns-test-namespace")}}, {Cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("ns-test-namespace"), "1.2.3.4"}}, {Cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("app"), "nethash"}}, {Cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("app"), "1.2.3.4"}}, @@ -329,6 +333,8 @@ func TestDeletePod(t *testing.T) { var calls = []testutils.TestCmd{ // add pod {Cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("ns-test-namespace"), "nethash"}}, + {Cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("all-namespaces"), "setlist"}}, + {Cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("all-namespaces"), util.GetHashedName("ns-test-namespace")}}, {Cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("ns-test-namespace"), "1.2.3.4"}}, {Cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("app"), "nethash"}}, {Cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("app"), "1.2.3.4"}}, @@ -439,6 +445,8 @@ func TestDeletePodWithTombstoneAfterAddingPod(t *testing.T) { var calls = []testutils.TestCmd{ // add pod {Cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("ns-test-namespace"), "nethash"}}, + {Cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("all-namespaces"), "setlist"}}, + {Cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("all-namespaces"), util.GetHashedName("ns-test-namespace")}}, {Cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("ns-test-namespace"), "1.2.3.4"}}, {Cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("app"), "nethash"}}, {Cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("app"), "1.2.3.4"}}, @@ -485,6 +493,8 @@ func TestLabelUpdatePod(t *testing.T) { var calls = []testutils.TestCmd{ // add pod {Cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("ns-test-namespace"), "nethash"}}, + {Cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("all-namespaces"), "setlist"}}, + {Cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("all-namespaces"), util.GetHashedName("ns-test-namespace")}}, {Cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("ns-test-namespace"), "1.2.3.4"}}, {Cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("app"), "nethash"}}, {Cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("app"), "1.2.3.4"}}, @@ -536,6 +546,8 @@ func TestIPAddressUpdatePod(t *testing.T) { var calls = []testutils.TestCmd{ // add pod {Cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("ns-test-namespace"), "nethash"}}, + {Cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("all-namespaces"), "setlist"}}, + {Cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("all-namespaces"), util.GetHashedName("ns-test-namespace")}}, {Cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("ns-test-namespace"), "1.2.3.4"}}, {Cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("app"), "nethash"}}, {Cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("app"), "1.2.3.4"}}, @@ -599,6 +611,8 @@ func TestPodStatusUpdatePod(t *testing.T) { var calls = []testutils.TestCmd{ // add pod {Cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("ns-test-namespace"), "nethash"}}, + {Cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("all-namespaces"), "setlist"}}, + {Cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("all-namespaces"), util.GetHashedName("ns-test-namespace")}}, {Cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("ns-test-namespace"), "1.2.3.4"}}, {Cmd: []string{"ipset", "-N", "-exist", util.GetHashedName("app"), "nethash"}}, {Cmd: []string{"ipset", "-A", "-exist", util.GetHashedName("app"), "1.2.3.4"}},