2018-11-17 05:24:32 -05:00
|
|
|
package common
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
2019-06-14 04:55:10 -04:00
|
|
|
|
2020-11-11 13:21:37 -05:00
|
|
|
"github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate"
|
2018-11-17 05:24:32 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestHWConfigPrepare(t *testing.T) {
|
|
|
|
c := new(HWConfig)
|
2019-06-14 04:55:10 -04:00
|
|
|
if errs := c.Prepare(interpolate.NewContext()); len(errs) > 0 {
|
2018-11-17 05:24:32 -05: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)
|
|
|
|
}
|
|
|
|
}
|