Skip to content

Commit

Permalink
Test case config refactored
Browse files Browse the repository at this point in the history
  • Loading branch information
dhirendersingh19 authored and Dhirender-Singh committed Sep 9, 2022
1 parent 99896d6 commit a0fd916
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions ibm/service/power/resource_ibm_pi_volume_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,27 +197,22 @@ func TestAccIBMPIVolumeGRS(t *testing.T) {
}

func testAccCheckIBMPIVolumeGRSConfig(name string) string {
return fmt.Sprintf(`
resource "ibm_pi_volume" "power_volume"{
pi_volume_size = 20
pi_volume_name = "%[1]s"
pi_volume_pool = "%[3]s"
pi_volume_shareable = true
pi_cloud_instance_id = "%[2]s"
pi_replication_enabled = true
}
`, name, acc.Pi_cloud_instance_id, acc.PiStoragePool)
return testAccCheckIBMPIVolumeGRSBasicConfig(name, acc.Pi_cloud_instance_id, acc.PiStoragePool, true)
}

func testAccCheckIBMPIVolumeGRSUpdateConfig(name string) string {
return testAccCheckIBMPIVolumeGRSBasicConfig(name, acc.Pi_cloud_instance_id, acc.PiStoragePool, false)
}

func testAccCheckIBMPIVolumeGRSBasicConfig(name, piCloudInstanceId, piStoragePool string, replicationEnabled bool) string {
return fmt.Sprintf(`
resource "ibm_pi_volume" "power_volume"{
pi_volume_size = 20
pi_volume_name = "%[1]s"
pi_volume_pool = "%[3]s"
pi_volume_shareable = true
pi_cloud_instance_id = "%[2]s"
pi_replication_enabled = false
pi_replication_enabled = %[4]v
}
`, name, acc.Pi_cloud_instance_id, acc.PiStoragePool)
`, name, piCloudInstanceId, piStoragePool, replicationEnabled)
}

0 comments on commit a0fd916

Please sign in to comment.