2018-11-17 04:24:32 -06:00
|
|
|
package common
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
2019-06-14 10:55:10 +02:00
|
|
|
|
|
|
|
"github.com/hashicorp/packer/template/interpolate"
|
2018-11-17 04:24:32 -06:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestHWConfigPrepare(t *testing.T) {
|
|
|
|
c := new(HWConfig)
|
2019-06-14 10:55:10 +02:00
|
|
|
if errs := c.Prepare(interpolate.NewContext()); len(errs) > 0 {
|
2018-11-17 04:24:32 -06:00
|
|
|
t.Fatalf("err: %#v", errs)
|
|
|
|
}
|
|
|
|
|
|
|
|
if c.CpuCount < 1 {
|
|
|
|
t.Errorf("bad cpu count: %d", c.CpuCount)
|
|
|
|
}
|
|
|
|
|
|
|
|
if c.MemorySize < 64 {
|
|
|
|
t.Errorf("bad memory size: %d", c.MemorySize)
|
|
|
|
}
|
|
|
|
}
|