forked from runfinch/finch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
container_test.go
87 lines (77 loc) · 2.01 KB
/
container_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Package container runs tests related to container development.
package container
import (
"testing"
"github.com/onsi/ginkgo/v2"
"github.com/onsi/gomega"
"github.com/runfinch/common-tests/command"
"github.com/runfinch/common-tests/tests"
"github.com/runfinch/finch/e2e"
)
//nolint:paralleltest // TestContainer is like TestMain for the container-related tests.
func TestContainer(t *testing.T) {
const description = "Finch Container Development E2E Tests"
o, err := e2e.CreateOption()
if err != nil {
t.Fatal(err)
}
ginkgo.SynchronizedBeforeSuite(func() []byte {
command.New(o, "vm", "init").WithTimeoutInSeconds(600).Run()
tests.SetupLocalRegistry(o)
return nil
}, func(bytes []byte) {})
ginkgo.SynchronizedAfterSuite(func() {
command.New(o, "vm", "stop").WithTimeoutInSeconds(90).Run()
command.New(o, "vm", "remove").WithTimeoutInSeconds(60).Run()
}, func() {})
ginkgo.Describe(description, func() {
tests.Pull(o)
tests.Rm(o)
tests.Rmi(o)
tests.Run(&tests.RunOption{BaseOpt: o, CGMode: tests.Unified, DefaultHostGatewayIP: "192.168.5.2"})
tests.Start(o)
tests.Stop(o)
tests.Cp(o)
tests.Tag(o)
tests.Save(o)
tests.Load(o)
tests.Build(o)
tests.Push(o)
tests.Images(o)
tests.ComposeBuild(o)
tests.ComposeDown(o)
tests.ComposeKill(o)
tests.ComposePs(o)
tests.ComposePull(o)
tests.ComposeLogs(o)
tests.Create(o)
tests.Port(o)
tests.Kill(o)
tests.Stats(o)
tests.BuilderPrune(o)
tests.Exec(o)
tests.Logs(o)
tests.Login(o)
tests.Logout(o)
tests.VolumeCreate(o)
tests.VolumeInspect(o)
tests.VolumeLs(o)
tests.VolumeRm(o)
tests.VolumePrune(o)
tests.ImageHistory(o)
tests.ImageInspect(o)
tests.ImagePrune(o)
tests.Info(o)
tests.Events(o)
tests.Inspect(o)
tests.NetworkCreate(o)
tests.NetworkInspect(o)
tests.NetworkLs(o)
tests.NetworkRm(o)
testCosign(o)
})
gomega.RegisterFailHandler(ginkgo.Fail)
ginkgo.RunSpecs(t, description)
}