adds some code
This commit is contained in:
20
pkg/validators/validators_test.go
Normal file
20
pkg/validators/validators_test.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package validators
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"jagacloud/node-agent/pkg/compute/libvirt"
|
||||
"jagacloud/node-agent/pkg/config"
|
||||
)
|
||||
|
||||
func TestPoolExists(t *testing.T) {
|
||||
cfg := config.Config{StoragePools: []config.StoragePool{{Name: "local"}}}
|
||||
err := CheckStoragePoolsVM([]libvirt.DiskSpec{{Pool: "local"}}, cfg)
|
||||
if err != nil {
|
||||
t.Fatalf("expected pool to be valid: %v", err)
|
||||
}
|
||||
err = CheckStoragePoolsVM([]libvirt.DiskSpec{{Pool: "missing"}}, cfg)
|
||||
if err == nil {
|
||||
t.Fatalf("expected error for missing pool")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user