Skip to content

Commit

Permalink
Merge branch 'v4-temp-design-2.0-structure' of github.com:nutanix/ter…
Browse files Browse the repository at this point in the history
…raform-provider-nutanix into v4-temp-design-2.0-structure
  • Loading branch information
abhimutant committed Dec 11, 2024
2 parents 723d869 + 7ceb413 commit 088bf33
Show file tree
Hide file tree
Showing 25 changed files with 76 additions and 76 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

const datasourceNameImagePlacementPolicy = "data.nutanix_image_placement_policy_v2.test"

func TestAccNutanixImagePlacementV2DataSource_Basic(t *testing.T) {
func TestAccV2NutanixImagePlacementDatasource_Basic(t *testing.T) {
r := acctest.RandInt()
name := fmt.Sprintf("test-ipp-%d", r)
desc := "test ipp description"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

const datasourceNameImagePlacements = "data.nutanix_image_placement_policies_v2.test"

func TestAccNutanixImagePlacementsV2DataSource_Basic(t *testing.T) {
func TestAccV2NutanixImagePlacementsDatasource_Basic(t *testing.T) {
r := acctest.RandInt()
name := fmt.Sprintf("test-ipp-%d", r)
desc := "test ipp description"
Expand All @@ -29,7 +29,7 @@ func TestAccNutanixImagePlacementsV2DataSource_Basic(t *testing.T) {
})
}

func TestAccNutanixImagePlacementsV2DataSource_WithFilters(t *testing.T) {
func TestAccV2NutanixImagePlacementsDatasource_WithFilters(t *testing.T) {
r := acctest.RandInt()
name := fmt.Sprintf("test-ipp-%d", r)
desc := "test ipp description"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

const datasourceNameImage = "data.nutanix_image_v2.test"

func TestAccNutanixImageV2DataSource_Basic(t *testing.T) {
func TestAccV2NutanixImageDatasource_Basic(t *testing.T) {
r := acctest.RandInt()
name := fmt.Sprintf("test-image-%d", r)
desc := "test image description"
Expand Down
4 changes: 2 additions & 2 deletions nutanix/services/vmmv2/data_source_nutanix_images_v2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

const datasourceNameImages = "data.nutanix_images_v2.test"

func TestAccNutanixImagesV2DataSource_Basic(t *testing.T) {
func TestAccV2NutanixImagesDatasource_Basic(t *testing.T) {
r := acctest.RandInt()
name := fmt.Sprintf("test-image-%d", r)
desc := "test image description"
Expand All @@ -30,7 +30,7 @@ func TestAccNutanixImagesV2DataSource_Basic(t *testing.T) {
})
}

func TestAccNutanixImagesV2DataSource_WithFilters(t *testing.T) {
func TestAccV2NutanixImagesDatasource_WithFilters(t *testing.T) {
r := acctest.RandInt()
name := fmt.Sprintf("test-image-%d", r)
desc := "test image description"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

const datasourceNameNGTConfiguration = "data.nutanix_ngt_configuration_v2.test"

func TestAccNutanixNGTConfigurationV2Datasource_GetNGTConfigurationForVM(t *testing.T) {
func TestAccV2NutanixNGTConfigurationDatasource_GetNGTConfigurationForVM(t *testing.T) {
resource.Test(t, resource.TestCase{
PreCheck: func() { acc.TestAccFoundationPreCheck(t) },
Providers: acc.TestAccProviders,
Expand All @@ -34,7 +34,7 @@ func TestAccNutanixNGTConfigurationV2Datasource_GetNGTConfigurationForVM(t *test
})
}

func TestAccNutanixNGTConfigurationV4Datasource_GetNGTConfigurationForVM_NGTNotInstalled(t *testing.T) {
func TestAccV2NutanixNGTConfigurationV4Datasource_GetNGTConfigurationForVM_NGTNotInstalled(t *testing.T) {
resource.Test(t, resource.TestCase{
PreCheck: func() { acc.TestAccFoundationPreCheck(t) },
Providers: acc.TestAccProviders,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

const datasourceNameTemplate = "data.nutanix_template_v2.test"

func TestAccNutanixTemplateV2Datasource_Basic(t *testing.T) {
func TestAccV2NutanixTemplateDatasource_Basic(t *testing.T) {
r := acctest.RandInt()
name := fmt.Sprintf("tf-test-vm-%d", r)
desc := "test vm description"
Expand All @@ -22,7 +22,7 @@ func TestAccNutanixTemplateV2Datasource_Basic(t *testing.T) {
Providers: acc.TestAccProviders,
Steps: []resource.TestStep{
{
Config: testTemplateV2DatasourceConfig(name, desc, templateName, templateDesc),
Config: testTemplateDatasourceConfig(name, desc, templateName, templateDesc),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttrSet(datasourceNameTemplate, "ext_id"),
resource.TestCheckResourceAttr(datasourceNameTemplate, "template_name", templateName),
Expand All @@ -40,7 +40,7 @@ func TestAccNutanixTemplateV2Datasource_Basic(t *testing.T) {
})
}

func testTemplateV2DatasourceConfig(name, desc, tempName, tempDesc string) string {
func testTemplateDatasourceConfig(name, desc, tempName, tempDesc string) string {
return fmt.Sprintf(`
data "nutanix_clusters_v2" "clusters" {}
Expand Down
12 changes: 6 additions & 6 deletions nutanix/services/vmmv2/data_source_nutanix_templates_v2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

const datasourceNameTemplates = "data.nutanix_templates_v2.test"

func TestAccNutanixTemplateV2Datasource_ListAllTemplates(t *testing.T) {
func TestAccV2NutanixTemplateDatasource_ListAllTemplates(t *testing.T) {
r := acctest.RandInt()
name := fmt.Sprintf("tf-test-vm-%d", r)
desc := "test vm description"
Expand All @@ -22,7 +22,7 @@ func TestAccNutanixTemplateV2Datasource_ListAllTemplates(t *testing.T) {
Providers: acc.TestAccProviders,
Steps: []resource.TestStep{
{
Config: testTemplatesV2DatasourceConfig(name, desc, templateName, templateDesc),
Config: testTemplatesDatasourceConfig(name, desc, templateName, templateDesc),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttrSet(datasourceNameTemplates, "templates.#"),
),
Expand All @@ -31,7 +31,7 @@ func TestAccNutanixTemplateV2Datasource_ListAllTemplates(t *testing.T) {
})
}

func TestAccNutanixTemplateV2Datasource_ListAllTemplatesWithFilter(t *testing.T) {
func TestAccV2NutanixTemplateDatasource_ListAllTemplatesWithFilter(t *testing.T) {
r := acctest.RandInt()
name := fmt.Sprintf("tf-test-vm-%d", r)
desc := "test vm description"
Expand All @@ -42,7 +42,7 @@ func TestAccNutanixTemplateV2Datasource_ListAllTemplatesWithFilter(t *testing.T)
Providers: acc.TestAccProviders,
Steps: []resource.TestStep{
{
Config: testTemplatesV2DatasourceFilterConfig(name, desc, templateName, templateDesc),
Config: testTemplatesDatasourceFilterConfig(name, desc, templateName, templateDesc),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttrSet(datasourceNameTemplates, "templates.#"),
resource.TestCheckResourceAttrSet(datasourceNameTemplates, "templates.0.ext_id"),
Expand All @@ -61,7 +61,7 @@ func TestAccNutanixTemplateV2Datasource_ListAllTemplatesWithFilter(t *testing.T)
})
}

func testTemplatesV2DatasourceConfig(name, desc, tempName, tempDesc string) string {
func testTemplatesDatasourceConfig(name, desc, tempName, tempDesc string) string {
return fmt.Sprintf(`
data "nutanix_clusters_v2" "clusters" {}
Expand Down Expand Up @@ -101,7 +101,7 @@ func testTemplatesV2DatasourceConfig(name, desc, tempName, tempDesc string) stri
`, name, desc, tempName, tempDesc)
}

func testTemplatesV2DatasourceFilterConfig(name, desc, tempName, tempDesc string) string {
func testTemplatesDatasourceFilterConfig(name, desc, tempName, tempDesc string) string {
return fmt.Sprintf(`
data "nutanix_clusters_v2" "clusters" {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

const datasourceNameVMs = "data.nutanix_virtual_machine_v2.test"

func TestAccNutanixVmsV2DataSource_Basic(t *testing.T) {
func TestAccV2NutanixVmsDatasource_Basic(t *testing.T) {
r := acctest.RandInt()
name := fmt.Sprintf("tf-test-vm-%d", r)
desc := "test vm description"
Expand All @@ -37,7 +37,7 @@ func TestAccNutanixVmsV2DataSource_Basic(t *testing.T) {
})
}

func TestAccNutanixVmsV2DataSource_WithConfig(t *testing.T) {
func TestAccV2NutanixVmsDatasource_WithConfig(t *testing.T) {
r := acctest.RandInt()
name := fmt.Sprintf("tf-test-vm-%d", r)
desc := "test vm description"
Expand Down Expand Up @@ -68,7 +68,7 @@ func TestAccNutanixVmsV2DataSource_WithConfig(t *testing.T) {
})
}

func TestAccNutanixVmsV2DataSource_WithCdromConfig(t *testing.T) {
func TestAccV2NutanixVmsDatasource_WithCdromConfig(t *testing.T) {
r := acctest.RandInt()
name := fmt.Sprintf("tf-test-vm-%d", r)
desc := "test vm description"
Expand Down Expand Up @@ -102,7 +102,7 @@ func TestAccNutanixVmsV2DataSource_WithCdromConfig(t *testing.T) {
})
}

func TestAccNutanixVmsV2DataSource_WithCdromBackingInfo(t *testing.T) {
func TestAccV2NutanixVmsDatasource_WithCdromBackingInfo(t *testing.T) {
r := acctest.RandInt()
name := fmt.Sprintf("tf-test-vm-%d", r)
desc := "test vm description"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

const datasourceNameVM = "data.nutanix_virtual_machines_v2.test"

func TestAccNutanixVmsV2DataSource_List(t *testing.T) {
func TestAccV2NutanixVmsDatasource_List(t *testing.T) {
resource.Test(t, resource.TestCase{
PreCheck: func() { acc.TestAccPreCheck(t) },
Providers: acc.TestAccProviders,
Expand All @@ -24,7 +24,7 @@ func TestAccNutanixVmsV2DataSource_List(t *testing.T) {
})
}

func TestAccNutanixVmsV2DataSource_ListWithFilters(t *testing.T) {
func TestAccV2NutanixVmsDatasource_ListWithFilters(t *testing.T) {
resource.Test(t, resource.TestCase{
PreCheck: func() { acc.TestAccPreCheck(t) },
Providers: acc.TestAccProviders,
Expand All @@ -40,7 +40,7 @@ func TestAccNutanixVmsV2DataSource_ListWithFilters(t *testing.T) {
})
}

func TestAccNutanixVmsV2DataSource_ListWithFilterName(t *testing.T) {
func TestAccV2NutanixVmsDatasource_ListWithFilterName(t *testing.T) {
resource.Test(t, resource.TestCase{
PreCheck: func() { acc.TestAccPreCheck(t) },
Providers: acc.TestAccProviders,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

const resourceNameImagePlacementPolicy = "nutanix_image_placement_policy_v2.test"

func TestAccNutanixImagesPlacementPolicyV2Resource_Basic(t *testing.T) {
func TestAccV2NutanixImagesPlacementPolicyResource_Basic(t *testing.T) {
r := acctest.RandInt()
name := fmt.Sprintf("test-ipp-%d", r)
desc := "test ipp description"
Expand All @@ -35,7 +35,7 @@ func TestAccNutanixImagesPlacementPolicyV2Resource_Basic(t *testing.T) {
})
}

func TestAccNutanixImagesPlacementPolicyV2Resource_SuspendAndResume(t *testing.T) {
func TestAccV2NutanixImagesPlacementPolicyResource_SuspendAndResume(t *testing.T) {
r := acctest.RandInt()
name := fmt.Sprintf("test-ipp-%d", r)
desc := "test ipp description"
Expand Down
10 changes: 5 additions & 5 deletions nutanix/services/vmmv2/resource_nutanix_image_v2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

const resourceNameImage = "nutanix_images_v2.test"

func TestAccNutanixImagesV2Resource_Basic(t *testing.T) {
func TestAccV2NutanixImagesResource_Basic(t *testing.T) {
r := acctest.RandInt()
name := fmt.Sprintf("test-image-%d", r)
desc := "test image description"
Expand All @@ -36,7 +36,7 @@ func TestAccNutanixImagesV2Resource_Basic(t *testing.T) {
})
}

func TestAccNutanixImagesV2Resource_WithUpdate(t *testing.T) {
func TestAccV2NutanixImagesResource_WithUpdate(t *testing.T) {
r := acctest.RandInt()
name := fmt.Sprintf("test-image-%d", r)
updatedName := fmt.Sprintf("test-image-updated-%d", r)
Expand Down Expand Up @@ -76,7 +76,7 @@ func TestAccNutanixImagesV2Resource_WithUpdate(t *testing.T) {
})
}

func TestAccNutanixImagesV2Resource_WithDisk(t *testing.T) {
func TestAccV2NutanixImagesResource_WithDisk(t *testing.T) {
r := acctest.RandInt()
name := fmt.Sprintf("test-image-%d", r)
desc := "test image description"
Expand All @@ -101,7 +101,7 @@ func TestAccNutanixImagesV2Resource_WithDisk(t *testing.T) {
})
}

func TestAccNutanixImagesV2Resource_WithVMDiskSource(t *testing.T) {
func TestAccV2NutanixImagesResource_WithVMDiskSource(t *testing.T) {
r := acctest.RandInt()
name := fmt.Sprintf("test-image-%d", r)
desc := "test image description"
Expand All @@ -126,7 +126,7 @@ func TestAccNutanixImagesV2Resource_WithVMDiskSource(t *testing.T) {
})
}

func TestAccNutanixImagesV2Resource_WithClusterExts(t *testing.T) {
func TestAccV2NutanixImagesResource_WithClusterExts(t *testing.T) {
r := acctest.RandInt()
name := fmt.Sprintf("test-image-%d", r)
desc := "test image description"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const (
timeSleep = 2 * time.Minute
)

func TestAccNutanixNGTInsertIsoV2Resource_InsertNGTIsoIntoVmHaveNGT(t *testing.T) {
func TestAccV2NutanixNGTInsertIsoResource_InsertNGTIsoIntoVmHaveNGT(t *testing.T) {
r := acctest.RandInt()
vmName := fmt.Sprintf("tf-test-vm-ngt-%d", r)

Expand Down Expand Up @@ -74,7 +74,7 @@ func TestAccNutanixNGTInsertIsoV2Resource_InsertNGTIsoIntoVmHaveNGT(t *testing.T
})
}

func TestAccNutanixNGTInsertIsoV2Resource_InsertNGTIsoIntoVmHaveNGTIsConfigFalse(t *testing.T) {
func TestAccV2NutanixNGTInsertIsoResource_InsertNGTIsoIntoVmHaveNGTIsConfigFalse(t *testing.T) {
r := acctest.RandInt()
vmName := fmt.Sprintf("tf-test-vm-ngt-%d", r)

Expand Down Expand Up @@ -132,7 +132,7 @@ func TestAccNutanixNGTInsertIsoV2Resource_InsertNGTIsoIntoVmHaveNGTIsConfigFalse
})
}

func TestAccNutanixNGTInsertIsoV2Resource_InsertNGTIsoIntoVmDoseNotHaveNGT(t *testing.T) {
func TestAccV2NutanixNGTInsertIsoResource_InsertNGTIsoIntoVmDoseNotHaveNGT(t *testing.T) {
r := acctest.RandInt()
vmName := fmt.Sprintf("tf-test-vm-ngt-%d", r)

Expand Down Expand Up @@ -167,7 +167,7 @@ func TestAccNutanixNGTInsertIsoV2Resource_InsertNGTIsoIntoVmDoseNotHaveNGT(t *te
})
}

func TestAccNutanixNGTInsertIsoV2Resource_InsertNGTIsoIntoVmDoseNotHaveNGTIsConfigFalse(t *testing.T) {
func TestAccV2NutanixNGTInsertIsoResource_InsertNGTIsoIntoVmDoseNotHaveNGTIsConfigFalse(t *testing.T) {
r := acctest.RandInt()
vmName := fmt.Sprintf("tf-test-vm-ngt-%d", r)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const (
resourceNameNGTInstallation = "nutanix_ngt_installation_v2.test"
)

func TestAccNutanixNGTInstallationV2Resource_InstallNGTWithRebootPreferenceSetToIMMEDIATE(t *testing.T) {
func TestAccV2NutanixNGTInstallationResource_InstallNGTWithRebootPreferenceSetToIMMEDIATE(t *testing.T) {
r := acctest.RandInt()
vmName := fmt.Sprintf("tf-test-vm-ngt-%d", r)

Expand Down Expand Up @@ -67,7 +67,7 @@ func TestAccNutanixNGTInstallationV2Resource_InstallNGTWithRebootPreferenceSetTo
})
}

func TestAccNutanixNGTInstallationV2Resource_InstallNGTWithRebootPreferenceSetToLATER(t *testing.T) {
func TestAccV2NutanixNGTInstallationResource_InstallNGTWithRebootPreferenceSetToLATER(t *testing.T) {
r := acctest.RandInt()
vmName := fmt.Sprintf("tf-test-vm-ngt-%d", r)

Expand Down Expand Up @@ -101,7 +101,7 @@ func TestAccNutanixNGTInstallationV2Resource_InstallNGTWithRebootPreferenceSetTo
})
}

func TestAccNutanixNGTInstallationV2Resource_InstallNGTWithRebootPreferenceSetToSKIP(t *testing.T) {
func TestAccV2NutanixNGTInstallationResource_InstallNGTWithRebootPreferenceSetToSKIP(t *testing.T) {
r := acctest.RandInt()
vmName := fmt.Sprintf("tf-test-vm-ngt-%d", r)

Expand Down Expand Up @@ -133,7 +133,7 @@ func TestAccNutanixNGTInstallationV2Resource_InstallNGTWithRebootPreferenceSetTo
})
}

func TestAccNutanixNGTInstallationV2Resource_WithNoVmExtId(t *testing.T) {
func TestAccV2NutanixNGTInstallationResource_WithNoVmExtId(t *testing.T) {
resource.Test(t, resource.TestCase{
PreCheck: func() { acc.TestAccPreCheck(t) },
Providers: acc.TestAccProviders,
Expand All @@ -146,7 +146,7 @@ func TestAccNutanixNGTInstallationV2Resource_WithNoVmExtId(t *testing.T) {
})
}

func TestAccNutanixNGTInstallationV2Resource_UpdateNGT(t *testing.T) {
func TestAccV2NutanixNGTInstallationResource_UpdateNGT(t *testing.T) {
r := acctest.RandInt()
vmName := fmt.Sprintf("tf-test-vm-ngt-%d", r)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

const resourceNameNGTUpgrade = "nutanix_ngt_upgrade_v2.test"

func TestAccNutanixNGTUpgradeV2Resource_UpgradeNGTWithRebootPreferenceSetToIMMEDIATE(t *testing.T) {
func TestAccV2NutanixNGTUpgradeResource_UpgradeNGTWithRebootPreferenceSetToIMMEDIATE(t *testing.T) {
t.Skip("This test case is skip since NGT upgrade is failing from v4 api: https://jira.nutanix.com/browse/ENG-665842")
r := acctest.RandInt()
vmName := fmt.Sprintf("tf-test-vm-ngt-%d", r)
Expand Down Expand Up @@ -69,7 +69,7 @@ func TestAccNutanixNGTUpgradeV2Resource_UpgradeNGTWithRebootPreferenceSetToIMMED
})
}

func TestAccNutanixNGTUpgradeV2Resource_UpgradeNGTWithRebootPreferenceSetToLATER(t *testing.T) {
func TestAccV2NutanixNGTUpgradeResource_UpgradeNGTWithRebootPreferenceSetToLATER(t *testing.T) {
t.Skip("This test case is skip since NGT upgrade is failing from v4 api: https://jira.nutanix.com/browse/ENG-665842")
r := acctest.RandInt()
vmName := fmt.Sprintf("tf-test-vm-ngt-%d", r)
Expand Down Expand Up @@ -126,7 +126,7 @@ func TestAccNutanixNGTUpgradeV2Resource_UpgradeNGTWithRebootPreferenceSetToLATER
})
}

func TestAccNutanixNGTUpgradeV2Resource_UpgradeNGTWithRebootPreferenceSetToSKIP(t *testing.T) {
func TestAccV2NutanixNGTUpgradeResource_UpgradeNGTWithRebootPreferenceSetToSKIP(t *testing.T) {
t.Skip("This test case is skip since NGT upgrade is failing from v4 api: https://jira.nutanix.com/browse/ENG-665842")
r := acctest.RandInt()
vmName := fmt.Sprintf("tf-test-vm-ngt-%d", r)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

const resourceNameTemplateDeploy = "nutanix_deploy_templates_v2.test"

func TestAccNutanixTemplateDeployV2Resource_Basic(t *testing.T) {
func TestAccV2NutanixTemplateDeployResource_Basic(t *testing.T) {
r := acctest.RandInt()
name := fmt.Sprintf("tf-test-vm-%d", r)
desc := "test vm description"
Expand Down
Loading

0 comments on commit 088bf33

Please sign in to comment.