mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
44 lines
786 B
Go
44 lines
786 B
Go
|
// +build !windows
|
||
|
|
||
|
package config
|
||
|
|
||
|
import (
|
||
|
"testing"
|
||
|
|
||
|
"github.com/docker/docker/api/types"
|
||
|
)
|
||
|
|
||
|
func TestCommonUnixValidateConfigurationErrors(t *testing.T) {
|
||
|
testCases := []struct {
|
||
|
config *Config
|
||
|
}{
|
||
|
// Can't override the stock runtime
|
||
|
{
|
||
|
config: &Config{
|
||
|
CommonUnixConfig: CommonUnixConfig{
|
||
|
Runtimes: map[string]types.Runtime{
|
||
|
StockRuntimeName: {},
|
||
|
},
|
||
|
},
|
||
|
},
|
||
|
},
|
||
|
// Default runtime should be present in runtimes
|
||
|
{
|
||
|
config: &Config{
|
||
|
CommonUnixConfig: CommonUnixConfig{
|
||
|
Runtimes: map[string]types.Runtime{
|
||
|
"foo": {},
|
||
|
},
|
||
|
DefaultRuntime: "bar",
|
||
|
},
|
||
|
},
|
||
|
},
|
||
|
}
|
||
|
for _, tc := range testCases {
|
||
|
err := Validate(tc.config)
|
||
|
if err == nil {
|
||
|
t.Fatalf("expected error, got nil for config %v", tc.config)
|
||
|
}
|
||
|
}
|
||
|
}
|