summaryrefslogtreecommitdiff
path: root/libpod/network/netavark/run_test.go
diff options
context:
space:
mode:
authorPaul Holzinger <pholzing@redhat.com>2021-10-20 15:55:22 +0200
committerPaul Holzinger <pholzing@redhat.com>2021-11-11 16:25:19 +0100
commit4febe557692aeec8ca9d9b9cdc732772ba7d5876 (patch)
tree0d8bd9c4d3809ca099315fb2437ece00690260be /libpod/network/netavark/run_test.go
parenteaae29462880aa0fb17e8d448cc79519e070e64f (diff)
downloadpodman-4febe557692aeec8ca9d9b9cdc732772ba7d5876.tar.gz
podman-4febe557692aeec8ca9d9b9cdc732772ba7d5876.tar.bz2
podman-4febe557692aeec8ca9d9b9cdc732772ba7d5876.zip
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 <pholzing@redhat.com>
Diffstat (limited to 'libpod/network/netavark/run_test.go')
-rw-r--r--libpod/network/netavark/run_test.go10
1 files changed, 3 insertions, 7 deletions
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() {