From 4febe557692aeec8ca9d9b9cdc732772ba7d5876 Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Wed, 20 Oct 2021 15:55:22 +0200 Subject: netavark IPAM assignment Add a new boltdb to handle IPAM assignment. The db structure is the following: Each network has their own bucket with the network name as bucket key. Inside the network bucket there is an ID bucket which maps the container ID (key) to a json array of ip addresses (value). The network bucket also has a bucket for each subnet, the subnet is used as key. Inside the subnet bucket an ip is used as key and the container ID as value. The db should be stored on a tmpfs to ensure we always have a clean state after a reboot. Signed-off-by: Paul Holzinger --- libpod/network/netavark/run_test.go | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'libpod/network/netavark/run_test.go') diff --git a/libpod/network/netavark/run_test.go b/libpod/network/netavark/run_test.go index 6c3b4d970..84db89b49 100644 --- a/libpod/network/netavark/run_test.go +++ b/libpod/network/netavark/run_test.go @@ -14,8 +14,6 @@ package netavark_test // }) import ( - "bytes" - "fmt" "io/ioutil" "net" "os" @@ -39,7 +37,6 @@ var _ = Describe("run netavark", func() { var ( libpodNet types.ContainerNetwork confDir string - logBuffer bytes.Buffer netNSTest ns.NetNS netNSContainer ns.NetNS ) @@ -60,8 +57,11 @@ var _ = Describe("run netavark", func() { } BeforeEach(func() { + // set the logrus settings logrus.SetLevel(logrus.TraceLevel) + // disable extra quotes so we can easily copy the netavark command logrus.SetFormatter(&logrus.TextFormatter{DisableQuote: true}) + logrus.SetOutput(os.Stderr) // The tests need root privileges. // Technically we could work around that by using user namespaces and // the rootless cni code but this is to much work to get it right for a unit test. @@ -74,8 +74,6 @@ var _ = Describe("run netavark", func() { if err != nil { Fail("Failed to create tmpdir") } - logBuffer = bytes.Buffer{} - logrus.SetOutput(&logBuffer) netNSTest, err = netns.NewNS() if err != nil { @@ -106,8 +104,6 @@ var _ = Describe("run netavark", func() { netns.UnmountNS(netNSContainer) netNSContainer.Close() - - fmt.Println(logBuffer.String()) }) It("test basic setup", func() { -- cgit v1.2.3-54-g00ecf