From a0fd916c12282135440089c683149b597f1f2ec4 Mon Sep 17 00:00:00 2001 From: dhirendersingh19 Date: Fri, 9 Sep 2022 11:40:56 +0530 Subject: [PATCH] Test case config refactored --- .../power/resource_ibm_pi_volume_test.go | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/ibm/service/power/resource_ibm_pi_volume_test.go b/ibm/service/power/resource_ibm_pi_volume_test.go index f85a184018..3ea6a23723 100644 --- a/ibm/service/power/resource_ibm_pi_volume_test.go +++ b/ibm/service/power/resource_ibm_pi_volume_test.go @@ -197,19 +197,14 @@ 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 @@ -217,7 +212,7 @@ func testAccCheckIBMPIVolumeGRSUpdateConfig(name string) string { 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) }