2020-06-25 10:51:20 +02:00
|
|
|
package mobycli
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
. "github.com/onsi/gomega"
|
|
|
|
"github.com/stretchr/testify/suite"
|
2020-06-29 17:57:06 +02:00
|
|
|
|
2020-07-29 16:05:13 +02:00
|
|
|
"github.com/docker/api/context/store"
|
2020-06-29 17:57:06 +02:00
|
|
|
"github.com/docker/api/tests/framework"
|
2020-06-25 10:51:20 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
type MobyExecSuite struct {
|
|
|
|
framework.CliSuite
|
|
|
|
}
|
|
|
|
|
|
|
|
func (sut *MobyExecSuite) TestDelegateContextTypeToMoby() {
|
2020-07-29 16:05:13 +02:00
|
|
|
|
|
|
|
isDelegated := func(val string) bool {
|
|
|
|
for _, ctx := range delegatedContextTypes {
|
|
|
|
if ctx == val {
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
|
|
|
allCtx := []string{store.AciContextType, store.EcsContextType, store.AwsContextType, store.DefaultContextType}
|
|
|
|
for _, ctx := range allCtx {
|
|
|
|
if isDelegated(ctx) {
|
|
|
|
Expect(mustDelegateToMoby(ctx)).To(BeTrue())
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
Expect(mustDelegateToMoby(ctx)).To(BeFalse())
|
|
|
|
}
|
2020-06-25 10:51:20 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func TestExec(t *testing.T) {
|
|
|
|
RegisterTestingT(t)
|
|
|
|
suite.Run(t, new(MobyExecSuite))
|
|
|
|
}
|