Skip to content

Commit

Permalink
containerd: clean up network host integration test
Browse files Browse the repository at this point in the history
Use already provided s.GardenBackend instead of creating custom backend.
Remove println used for debugging.

Signed-off-by: Muntasir Chowdhury <mchowdhury@pivotal.io>
  • Loading branch information
muntac committed May 25, 2021
1 parent 6387ec1 commit e07b07e
Showing 1 changed file with 3 additions and 24 deletions.
27 changes: 3 additions & 24 deletions worker/runtime/integration/integration_test.go
Expand Up @@ -435,38 +435,19 @@ func (s *IntegrationSuite) TestContainerAllowsHostAccess() {
}

func (s *IntegrationSuite) TestContainerNetworkHosts() {
namespace := "test-restricted-networks"
requestTimeout := 3 * time.Second

network, err := runtime.NewCNINetwork()

s.NoError(err)

networkOpt := runtime.WithNetwork(network)
customBackend, err := runtime.NewGardenBackend(
libcontainerd.New(
s.containerdSocket(),
namespace,
requestTimeout,
),
networkOpt,
)
s.NoError(err)

s.NoError(customBackend.Start())
s.NoError(s.gardenBackend.Start())

handle := uuid()

container, err := customBackend.Create(garden.ContainerSpec{
container, err := s.gardenBackend.Create(garden.ContainerSpec{
Handle: handle,
RootFSPath: "raw://" + s.rootfs,
Privileged: true,
})
s.NoError(err)

defer func() {
s.NoError(customBackend.Destroy(handle))
customBackend.Stop()
s.NoError(s.gardenBackend.Destroy(handle))
}()

buf := new(buffer)
Expand All @@ -487,8 +468,6 @@ func (s *IntegrationSuite) TestContainerNetworkHosts() {
exitCode, err := proc.Wait()
s.NoError(err)

fmt.Println(buf.String())

s.Equal(exitCode, 0)
s.Contains(buf.String(), handle)
}
Expand Down

0 comments on commit e07b07e

Please sign in to comment.