1- package storage
1+ package storage_test
22
33import (
44 "context"
55 "testing"
66
77 "github.com/hashicorp/terraform-plugin-framework/attr"
88 "github.com/hashicorp/terraform-plugin-framework/types"
9+
10+ "github.com/lxc/terraform-provider-incus/internal/storage"
911)
1012
1113func TestStoragePoolPreserveUserConfig_Source (t * testing.T ) {
1214 userSource := "/dev/disk/by-id/test-disk"
1315 apiSource := "pool1"
1416
15- model := StoragePoolModel {
17+ model := storage. StoragePoolModel {
1618 Config : types .MapValueMust (types .StringType , map [string ]attr.Value {
1719 "source" : types .StringValue (userSource ),
1820 }),
@@ -37,7 +39,7 @@ func TestStoragePoolPreserveUserConfig_NonZFSDriver(t *testing.T) {
3739 userSource := "/dev/disk/by-id/test-disk"
3840 apiSource := "pool1"
3941
40- model := StoragePoolModel {
42+ model := storage. StoragePoolModel {
4143 Config : types .MapValueMust (types .StringType , map [string ]attr.Value {
4244 "source" : types .StringValue (userSource ),
4345 }),
@@ -69,7 +71,7 @@ func TestStoragePoolConfigValueChanged(t *testing.T) {
6971 "source" : types .StringValue ("/dev/disk/by-id/disk-b" ),
7072 })
7173
72- if ! configValueChanged (ctx , stateConfig , planConfig , "source" ) {
74+ if ! storage . ConfigValueChanged (ctx , stateConfig , planConfig , "source" ) {
7375 t .Fatal ("expected source change to be detected" )
7476 }
7577}
@@ -85,7 +87,7 @@ func TestStoragePoolConfigValueChanged_Unchanged(t *testing.T) {
8587 "source" : types .StringValue ("/dev/disk/by-id/disk-a" ),
8688 })
8789
88- if configValueChanged (ctx , stateConfig , planConfig , "source" ) {
90+ if storage . ConfigValueChanged (ctx , stateConfig , planConfig , "source" ) {
8991 t .Fatal ("expected unchanged source not to be detected as changed" )
9092 }
9193}
0 commit comments