Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions tests/e2e/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,38 @@ type testTool interface {
inspectPAndGet(string) (string, error)
}

type testMethod func(tool testTool) error

type containerVolume struct {
Source string
Dest string
}

type containerTestArgs struct {
Name string
Image string
Devmapper bool
Seccomp bool
UID int
GID int
Groups []int64
Memory string
Cli string
Volumes []containerVolume
StaticNet bool
SideContainers []string
Skippable bool
TestFunc testMethod
ExpectOut string
}

const (
testCtr = "TestCtr"
testCrictl = "TestCrictl"
testDocker = "TestDocker"
testNerdctl = "TestNerdctl"
)

var errToolDoesNotSupport = errors.New("Operation not support")

func commonNewContainerCmd(a containerTestArgs) string {
Expand Down
2 changes: 0 additions & 2 deletions tests/e2e/crictl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ import (
. "github.com/onsi/gomega"
)

const testCrictl = "TestCrictl"

var _ = Describe("Crictl", Ordered, ContinueOnFailure, func() {
var tool *crictlInfo

Expand Down
2 changes: 0 additions & 2 deletions tests/e2e/ctr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ import (
. "github.com/onsi/gomega"
)

const testCtr = "TestCtr"

var _ = Describe("Ctr", Ordered, ContinueOnFailure, func() {
var tool *ctrInfo

Expand Down
2 changes: 0 additions & 2 deletions tests/e2e/docker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ import (
. "github.com/onsi/gomega"
)

const testDocker = "TestDocker"

var _ = Describe("Docker", Ordered, ContinueOnFailure, func() {
var tool *dockerInfo

Expand Down
2 changes: 0 additions & 2 deletions tests/e2e/nerdctl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ import (
. "github.com/onsi/gomega"
)

const testNerdctl = "TestNerdctl"

var _ = Describe("Nerdctl", Ordered, ContinueOnFailure, func() {
var tool *nerdctlInfo

Expand Down
166 changes: 0 additions & 166 deletions tests/e2e/setup_test.go

This file was deleted.

28 changes: 28 additions & 0 deletions tests/e2e/test_functions.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,34 @@ import (

var matchTest testMethod

func testVerifyRm(tool testTool) error {
containerID := tool.getContainerID()
exists, err := tool.searchContainer(containerID)
if exists || err != nil {
return fmt.Errorf("Container %s is not removed: %v", containerID, err)
}
err = verifyNoStaleFiles(containerID)
if err != nil {
return fmt.Errorf("Failed to remove all stale files: %v", err)
}

return nil
}

func testCleanup(tool testTool) error {
err := tool.stopContainer()
if err != nil {
return fmt.Errorf("Failed to stop container: %v", err)
}

err = tool.rmContainer()
if err != nil {
return fmt.Errorf("Failed to remove container: %v", err)
}

return testVerifyRm(tool)
}

func blockMountTest(tool testTool) error {
args := tool.getTestArgs()
output, err := tool.logContainer()
Expand Down
Loading