mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
29 lines
639 B
Go
29 lines
639 B
Go
![]() |
package image
|
||
|
|
||
|
import (
|
||
|
"runtime"
|
||
|
"testing"
|
||
|
)
|
||
|
|
||
|
func TestValidateOSCompatibility(t *testing.T) {
|
||
|
err := ValidateOSCompatibility(runtime.GOOS, runtime.GOARCH, getOSVersion(), nil)
|
||
|
if err != nil {
|
||
|
t.Error(err)
|
||
|
}
|
||
|
|
||
|
err = ValidateOSCompatibility("DOS", runtime.GOARCH, getOSVersion(), nil)
|
||
|
if err == nil {
|
||
|
t.Error("expected OS compat error")
|
||
|
}
|
||
|
|
||
|
err = ValidateOSCompatibility(runtime.GOOS, "pdp-11", getOSVersion(), nil)
|
||
|
if err == nil {
|
||
|
t.Error("expected architecture compat error")
|
||
|
}
|
||
|
|
||
|
err = ValidateOSCompatibility(runtime.GOOS, runtime.GOARCH, "98 SE", nil)
|
||
|
if err == nil {
|
||
|
t.Error("expected OS version compat error")
|
||
|
}
|
||
|
}
|