Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Storagepool tier datasource #259

Merged
Merged
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fixed issue with test
ABHISHEK-SINHA10 committed Dec 11, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 4d5bf5951cb83ee89724dde345b6278fd3d72f7e
13 changes: 6 additions & 7 deletions powerscale/provider/storagepool_tier_datasource_test.go
Original file line number Diff line number Diff line change
@@ -34,7 +34,7 @@ func TestAccStoragepoolTierDatasourceGetAll(t *testing.T) {
Steps: []resource.TestStep{
//Read testing
{
Config: ProviderConfig + StoragepoolTierDatasourceAllConfig,
Config: ProviderConfig + StoragepoolTierDatasourceAllWithResourceConfig,
Check: resource.ComposeAggregateTestCheckFunc(
resource.TestCheckResourceAttrSet("data.powerscale_storagepool_tier.all_test", "storagepool_tiers.#"),
),
@@ -70,29 +70,28 @@ func TestAccStoragepoolTierDatasourceErrorCopy(t *testing.T) {
PreConfig: func() {
FunctionMocker = mockey.Mock(helper.CopyFields).Return(fmt.Errorf("mock error")).Build()
},
Config: ProviderConfig + StoragepoolTierDatasourceAllWithResourceConfig,
Config: ProviderConfig + StoragepoolTierDatasourceAllConfig,
ExpectError: regexp.MustCompile("mock error"),
},
},
})
}

var StoragepoolTierDatasourceAllConfig = StoragepoolTierResourceConfigForDatasource + `
var StoragepoolTierDatasourceAllWithResourceConfig = StoragepoolTierResourceConfigForDatasource + `

data "powerscale_storagepool_tier" "all_test" {

depends_on = [powerscale_storagepool_tier.example]
}
`

var StoragepoolTierResourceConfigForDatasource = `
resource "powerscale_storagepool_tier" "example" {
name = "TestSPT"
name = "Sample_terraform_tier_1"
transfer_limit_pct = 20
}
}
`

var StoragepoolTierDatasourceAllWithResourceConfig = `
var StoragepoolTierDatasourceAllConfig = `
data "powerscale_storagepool_tier" "all_test" {

}