mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
* fn: size restricted tmpfs /tmp and read-only / support *) read-only Root Fs Support *) removed CPUShares from docker API. This was unused. *) docker.Prepare() refactoring *) added docker.configureTmpFs() for size limited tmpfs on /tmp *) tmpfs size support in routes and resource tracker *) fix fn-test-utils to handle sparse files better in create file * test typo fix
45 lines
782 B
Go
45 lines
782 B
Go
package models
|
|
|
|
import (
|
|
"github.com/fnproject/fn/api/id"
|
|
"testing"
|
|
)
|
|
|
|
func TestRouteSimple(t *testing.T) {
|
|
|
|
route1 := &Route{
|
|
AppID: id.New().String(),
|
|
Path: "/some",
|
|
Image: "foo",
|
|
Memory: 128,
|
|
CPUs: 100,
|
|
Type: "sync",
|
|
Format: "http",
|
|
Timeout: 10,
|
|
IdleTimeout: 10,
|
|
TmpFsSize: 10,
|
|
}
|
|
|
|
err := route1.Validate()
|
|
if err != nil {
|
|
t.Fatal("should not have failed, got: ", err)
|
|
}
|
|
|
|
route2 := &Route{
|
|
AppID: id.New().String(),
|
|
Path: "/some",
|
|
Image: "foo",
|
|
Memory: 128,
|
|
CPUs: 100,
|
|
Type: "sync",
|
|
Format: "nonsense",
|
|
Timeout: 10,
|
|
IdleTimeout: 10,
|
|
}
|
|
|
|
err = route2.Validate()
|
|
if err == nil {
|
|
t.Fatalf("should have failed route: %#v", route2)
|
|
}
|
|
}
|