mirror of
https://github.com/kemko/nomad.git
synced 2026-01-07 19:05:42 +03:00
nomad: fixing tests
This commit is contained in:
@@ -53,6 +53,7 @@ func Node() *structs.Node {
|
||||
|
||||
func Job() *structs.Job {
|
||||
job := &structs.Job{
|
||||
Region: "global",
|
||||
ID: structs.GenerateUUID(),
|
||||
Name: "my-job",
|
||||
Type: structs.JobTypeService,
|
||||
|
||||
@@ -44,8 +44,9 @@ func TestAllocsFit_PortsOvercommitted(t *testing.T) {
|
||||
Resources: &Resources{
|
||||
Networks: []*NetworkResource{
|
||||
&NetworkResource{
|
||||
CIDR: "10.0.0.0/8",
|
||||
MBits: 100,
|
||||
Device: "eth0",
|
||||
CIDR: "10.0.0.0/8",
|
||||
MBits: 100,
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -56,6 +57,7 @@ func TestAllocsFit_PortsOvercommitted(t *testing.T) {
|
||||
"web": &Resources{
|
||||
Networks: []*NetworkResource{
|
||||
&NetworkResource{
|
||||
Device: "eth0",
|
||||
IP: "10.0.0.1",
|
||||
MBits: 50,
|
||||
ReservedPorts: []int{8000},
|
||||
@@ -66,12 +68,12 @@ func TestAllocsFit_PortsOvercommitted(t *testing.T) {
|
||||
}
|
||||
|
||||
// Should fit one allocation
|
||||
fit, _, _, err := AllocsFit(n, []*Allocation{a1}, nil)
|
||||
fit, dim, _, err := AllocsFit(n, []*Allocation{a1}, nil)
|
||||
if err != nil {
|
||||
t.Fatalf("err: %v", err)
|
||||
}
|
||||
if !fit {
|
||||
t.Fatalf("Bad")
|
||||
t.Fatalf("Bad: %s", dim)
|
||||
}
|
||||
|
||||
// Should not fit second allocation
|
||||
@@ -93,8 +95,9 @@ func TestAllocsFit(t *testing.T) {
|
||||
IOPS: 100,
|
||||
Networks: []*NetworkResource{
|
||||
&NetworkResource{
|
||||
CIDR: "10.0.0.0/8",
|
||||
MBits: 100,
|
||||
Device: "eth0",
|
||||
CIDR: "10.0.0.0/8",
|
||||
MBits: 100,
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -105,6 +108,7 @@ func TestAllocsFit(t *testing.T) {
|
||||
IOPS: 50,
|
||||
Networks: []*NetworkResource{
|
||||
&NetworkResource{
|
||||
Device: "eth0",
|
||||
IP: "10.0.0.1",
|
||||
MBits: 50,
|
||||
ReservedPorts: []int{80},
|
||||
@@ -121,6 +125,7 @@ func TestAllocsFit(t *testing.T) {
|
||||
IOPS: 50,
|
||||
Networks: []*NetworkResource{
|
||||
&NetworkResource{
|
||||
Device: "eth0",
|
||||
IP: "10.0.0.1",
|
||||
MBits: 50,
|
||||
ReservedPorts: []int{8000},
|
||||
|
||||
Reference in New Issue
Block a user