summaryrefslogtreecommitdiff
path: root/pkg/bindings/test
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/bindings/test')
-rw-r--r--pkg/bindings/test/networks_test.go45
1 files changed, 23 insertions, 22 deletions
diff --git a/pkg/bindings/test/networks_test.go b/pkg/bindings/test/networks_test.go
index b53fc4bd3..85ceeb998 100644
--- a/pkg/bindings/test/networks_test.go
+++ b/pkg/bindings/test/networks_test.go
@@ -6,6 +6,7 @@ import (
"net/http"
"time"
+ "github.com/containers/podman/v3/libpod/network/types"
"github.com/containers/podman/v3/pkg/bindings"
"github.com/containers/podman/v3/pkg/bindings/containers"
"github.com/containers/podman/v3/pkg/bindings/network"
@@ -41,10 +42,10 @@ var _ = Describe("Podman networks", func() {
It("podman prune unused networks with filters", func() {
name := "foobar"
- opts := network.CreateOptions{
- Name: &name,
+ net := types.Network{
+ Name: name,
}
- _, err = network.Create(connText, &opts)
+ _, err = network.Create(connText, &net)
Expect(err).To(BeNil())
// Invalid filters should return error
@@ -88,20 +89,20 @@ var _ = Describe("Podman networks", func() {
It("create network", func() {
// create a network with blank config should work
- _, err = network.Create(connText, &network.CreateOptions{})
+ _, err = network.Create(connText, nil)
Expect(err).To(BeNil())
name := "foobar"
- opts := network.CreateOptions{
- Name: &name,
+ net := types.Network{
+ Name: name,
}
- report, err := network.Create(connText, &opts)
+ report, err := network.Create(connText, &net)
Expect(err).To(BeNil())
- Expect(report.Filename).To(ContainSubstring(name))
+ Expect(report.Name).To(Equal(name))
// create network with same name should 500
- _, err = network.Create(connText, &opts)
+ _, err = network.Create(connText, &net)
Expect(err).ToNot(BeNil())
code, _ := bindings.CheckResponseCode(err)
Expect(code).To(BeNumerically("==", http.StatusInternalServerError))
@@ -109,24 +110,24 @@ var _ = Describe("Podman networks", func() {
It("inspect network", func() {
name := "foobar"
- opts := network.CreateOptions{
- Name: &name,
+ net := types.Network{
+ Name: name,
}
- _, err = network.Create(connText, &opts)
+ _, err = network.Create(connText, &net)
Expect(err).To(BeNil())
data, err := network.Inspect(connText, name, nil)
Expect(err).To(BeNil())
- Expect(data[0]["name"]).To(Equal(name))
+ Expect(data.Name).To(Equal(name))
})
It("list networks", func() {
// create a bunch of named networks and make verify with list
netNames := []string{"homer", "bart", "lisa", "maggie", "marge"}
for i := 0; i < 5; i++ {
- opts := network.CreateOptions{
- Name: &netNames[i],
+ net := types.Network{
+ Name: netNames[i],
}
- _, err = network.Create(connText, &opts)
+ _, err = network.Create(connText, &net)
Expect(err).To(BeNil())
}
list, err := network.List(connText, nil)
@@ -166,10 +167,10 @@ var _ = Describe("Podman networks", func() {
// Removing an unused network should work
name := "unused"
- opts := network.CreateOptions{
- Name: &name,
+ net := types.Network{
+ Name: name,
}
- _, err = network.Create(connText, &opts)
+ _, err = network.Create(connText, &net)
Expect(err).To(BeNil())
report, err := network.Remove(connText, name, nil)
Expect(err).To(BeNil())
@@ -177,10 +178,10 @@ var _ = Describe("Podman networks", func() {
// Removing a network that is being used without force should be 500
name = "used"
- opts = network.CreateOptions{
- Name: &name,
+ net = types.Network{
+ Name: name,
}
- _, err = network.Create(connText, &opts)
+ _, err = network.Create(connText, &net)
Expect(err).To(BeNil())
// Start container and wait