-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
67 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,6 +49,7 @@ func TestAcc_DevOpsInstance(t *testing.T) { | |
resource.TestCheckResourceAttr(resourceName, "disk_size", "100"), | ||
resource.TestCheckResourceAttr(resourceName, "availability_zone", "east-14"), | ||
resource.TestCheckResourceAttr(resourceName, "description", "tfacc-memo"), | ||
resource.TestCheckResourceAttr(resourceName, "to", "[email protected]"), | ||
resource.TestCheckResourceAttr(resourceName, "gitlab_url", "https://"+randName+".jp-east-1.gitlab.devops.nifcloud.com"), | ||
resource.TestCheckResourceAttr(resourceName, "registry_url", "https://registry-"+randName+".jp-east-1.gitlab.devops.nifcloud.com"), | ||
), | ||
|
@@ -65,6 +66,7 @@ func TestAcc_DevOpsInstance(t *testing.T) { | |
resource.TestCheckResourceAttr(resourceName, "disk_size", "300"), | ||
resource.TestCheckResourceAttr(resourceName, "availability_zone", "east-14"), | ||
resource.TestCheckResourceAttr(resourceName, "description", "tfacc-memo-upd"), | ||
resource.TestCheckResourceAttr(resourceName, "to", "[email protected]"), | ||
resource.TestCheckResourceAttr(resourceName, "gitlab_url", "https://"+randName+".jp-east-1.gitlab.devops.nifcloud.com"), | ||
resource.TestCheckResourceAttr(resourceName, "registry_url", "https://registry-"+randName+".jp-east-1.gitlab.devops.nifcloud.com"), | ||
), | ||
|
@@ -152,6 +154,10 @@ func testAccCheckDevOpsInstanceValues(instance *types.Instance, rName string) re | |
return fmt.Errorf("bad description state, expected \"tfacc-memo\", got: %#v", nifcloud.ToString(instance.Description)) | ||
} | ||
|
||
if nifcloud.ToString(instance.To) != "[email protected]" { | ||
return fmt.Errorf("bad to state, expected \"[email protected]\", got: %#v", nifcloud.ToString(instance.To)) | ||
} | ||
|
||
if nifcloud.ToString(instance.GitlabUrl) != "https://"+rName+".jp-east-1.gitlab.devops.nifcloud.com" { | ||
return fmt.Errorf("bad gitlab_url state, expected \"https://%s.jp-east-1.gitlab.devops.nifcloud.com\", got: %#v", rName, nifcloud.ToString(instance.GitlabUrl)) | ||
} | ||
|
@@ -194,6 +200,10 @@ func testAccCheckDevOpsInstanceValuesUpdated(instance *types.Instance, rName str | |
return fmt.Errorf("bad description state, expected \"tfacc-memo-upd\", got: %#v", nifcloud.ToString(instance.Description)) | ||
} | ||
|
||
if nifcloud.ToString(instance.To) != "[email protected]" { | ||
return fmt.Errorf("bad to state, expected \"[email protected]\", got: %#v", nifcloud.ToString(instance.To)) | ||
} | ||
|
||
if nifcloud.ToString(instance.GitlabUrl) != "https://"+rName+".jp-east-1.gitlab.devops.nifcloud.com" { | ||
return fmt.Errorf("bad gitlab_url state, expected \"https://%s.jp-east-1.gitlab.devops.nifcloud.com\", got: %#v", rName, nifcloud.ToString(instance.GitlabUrl)) | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ resource "nifcloud_devops_instance" "basic" { | |
availability_zone = "east-14" | ||
description = "tfacc-memo-upd" | ||
initial_root_password = "initialroo00ootpassword" | ||
to = "[email protected]" | ||
to = "email-upd@example.com" | ||
} | ||
|
||
resource "nifcloud_devops_firewall_group" "basic" { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,19 +14,19 @@ func TestExpandCreateInstanceInput(t *testing.T) { | |
rd := schema.TestResourceDataRaw(t, newSchema(), map[string]interface{}{ | ||
"instance_id": "test_id", | ||
"instance_type": "c-large", | ||
"firewall_group_name": "test_name", | ||
"parameter_group_name": "test_name", | ||
"firewall_group_name": "test_name_fg", | ||
"parameter_group_name": "test_name_pg", | ||
"disk_size": 100, | ||
"availability_zone": "east-11", | ||
"description": "test_description", | ||
"initial_root_password": "test_password", | ||
"network_id": "test_id", | ||
"network_id": "test_id_nw", | ||
"private_address": "192.168.1.1/24", | ||
"object_storage_account": "test_account", | ||
"object_storage_region": "test_region", | ||
"lfs_bucket_name": "test_name", | ||
"packages_bucket_name": "test_name", | ||
"container_registry_bucket_name": "test_name", | ||
"lfs_bucket_name": "test_name_lfs", | ||
"packages_bucket_name": "test_name_pkg", | ||
"container_registry_bucket_name": "test_name_cr", | ||
"to": "[email protected]", | ||
}) | ||
|
||
|
@@ -41,23 +41,23 @@ func TestExpandCreateInstanceInput(t *testing.T) { | |
want: &devops.CreateInstanceInput{ | ||
InstanceId: nifcloud.String("test_id"), | ||
InstanceType: types.InstanceTypeOfCreateInstanceRequest("c-large"), | ||
FirewallGroupName: nifcloud.String("test_name"), | ||
ParameterGroupName: nifcloud.String("test_name"), | ||
FirewallGroupName: nifcloud.String("test_name_fg"), | ||
ParameterGroupName: nifcloud.String("test_name_pg"), | ||
DiskSize: nifcloud.Int32(int32(100)), | ||
AvailabilityZone: types.AvailabilityZoneOfCreateInstanceRequest("east-11"), | ||
Description: nifcloud.String("test_description"), | ||
InitialRootPassword: nifcloud.String("test_password"), | ||
NetworkConfig: &types.RequestNetworkConfig{ | ||
NetworkId: nifcloud.String("test_id"), | ||
NetworkId: nifcloud.String("test_id_nw"), | ||
PrivateAddress: nifcloud.String("192.168.1.1/24"), | ||
}, | ||
ObjectStorageConfig: &types.RequestObjectStorageConfig{ | ||
Account: nifcloud.String("test_account"), | ||
Region: types.RegionOfobjectStorageConfigForCreateInstance("test_region"), | ||
RequestBucketUseObjects: &types.RequestBucketUseObjects{ | ||
Lfs: nifcloud.String("test_name"), | ||
Packages: nifcloud.String("test_name"), | ||
ContainerRegistry: nifcloud.String("test_name"), | ||
Lfs: nifcloud.String("test_name_lfs"), | ||
Packages: nifcloud.String("test_name_pkg"), | ||
ContainerRegistry: nifcloud.String("test_name_cr"), | ||
}, | ||
}, | ||
}, | ||
|
@@ -76,19 +76,19 @@ func TestExpandUpdateInstanceInput(t *testing.T) { | |
rd := schema.TestResourceDataRaw(t, newSchema(), map[string]interface{}{ | ||
"instance_id": "test_id", | ||
"instance_type": "c-large", | ||
"firewall_group_name": "test_name", | ||
"parameter_group_name": "test_name", | ||
"firewall_group_name": "test_name_fg", | ||
"parameter_group_name": "test_name_pg", | ||
"disk_size": 100, | ||
"availability_zone": "east-11", | ||
"description": "test_description", | ||
"initial_root_password": "test_password", | ||
"network_id": "test_id", | ||
"network_id": "test_id_nw", | ||
"private_address": "192.168.1.1/24", | ||
"object_storage_account": "test_account", | ||
"object_storage_region": "test_region", | ||
"lfs_bucket_name": "test_name", | ||
"packages_bucket_name": "test_name", | ||
"container_registry_bucket_name": "test_name", | ||
"lfs_bucket_name": "test_name_lfs", | ||
"packages_bucket_name": "test_name_pkg", | ||
"container_registry_bucket_name": "test_name_cr", | ||
"to": "[email protected]", | ||
}) | ||
rd.SetId("test_id") | ||
|
@@ -104,7 +104,7 @@ func TestExpandUpdateInstanceInput(t *testing.T) { | |
want: &devops.UpdateInstanceInput{ | ||
InstanceId: nifcloud.String("test_id"), | ||
InstanceType: types.InstanceTypeOfUpdateInstanceRequest("c-large"), | ||
FirewallGroupName: nifcloud.String("test_name"), | ||
FirewallGroupName: nifcloud.String("test_name_fg"), | ||
Description: nifcloud.String("test_description"), | ||
}, | ||
}, | ||
|
@@ -200,19 +200,19 @@ func TestExpandSetupAlertInput(t *testing.T) { | |
rd := schema.TestResourceDataRaw(t, newSchema(), map[string]interface{}{ | ||
"instance_id": "test_id", | ||
"instance_type": "c-large", | ||
"firewall_group_name": "test_name", | ||
"parameter_group_name": "test_name", | ||
"firewall_group_name": "test_name_fg", | ||
"parameter_group_name": "test_name_pg", | ||
"disk_size": 100, | ||
"availability_zone": "east-11", | ||
"description": "test_description", | ||
"initial_root_password": "test_password", | ||
"network_id": "test_id", | ||
"network_id": "test_id_nw", | ||
"private_address": "192.168.1.1/24", | ||
"object_storage_account": "test_account", | ||
"object_storage_region": "test_region", | ||
"lfs_bucket_name": "test_name", | ||
"packages_bucket_name": "test_name", | ||
"container_registry_bucket_name": "test_name", | ||
"lfs_bucket_name": "test_name_lfs", | ||
"packages_bucket_name": "test_name_pkg", | ||
"container_registry_bucket_name": "test_name_cr", | ||
"to": "[email protected]", | ||
}) | ||
rd.SetId("test_id") | ||
|
@@ -244,37 +244,37 @@ func TestExpandUpdateNetworkInterfaceInput(t *testing.T) { | |
rd := schema.TestResourceDataRaw(t, newSchema(), map[string]interface{}{ | ||
"instance_id": "test_id", | ||
"instance_type": "c-large", | ||
"firewall_group_name": "test_name", | ||
"parameter_group_name": "test_name", | ||
"firewall_group_name": "test_name_fg", | ||
"parameter_group_name": "test_name_pg", | ||
"disk_size": 100, | ||
"availability_zone": "east-11", | ||
"description": "test_description", | ||
"initial_root_password": "test_password", | ||
"network_id": "test_id", | ||
"network_id": "test_id_nw", | ||
"private_address": "192.168.1.1/24", | ||
"object_storage_account": "test_account", | ||
"object_storage_region": "test_region", | ||
"lfs_bucket_name": "test_name", | ||
"packages_bucket_name": "test_name", | ||
"container_registry_bucket_name": "test_name", | ||
"lfs_bucket_name": "test_name_lfs", | ||
"packages_bucket_name": "test_name_pkg", | ||
"container_registry_bucket_name": "test_name_cr", | ||
"to": "[email protected]", | ||
}) | ||
rd.SetId("test_id") | ||
|
||
noNetworkConfigRd := schema.TestResourceDataRaw(t, newSchema(), map[string]interface{}{ | ||
"instance_id": "test_id", | ||
"instance_type": "c-large", | ||
"firewall_group_name": "test_name", | ||
"parameter_group_name": "test_name", | ||
"firewall_group_name": "test_name_fg", | ||
"parameter_group_name": "test_name_pg", | ||
"disk_size": 100, | ||
"availability_zone": "east-11", | ||
"description": "test_description", | ||
"initial_root_password": "test_password", | ||
"object_storage_account": "test_account", | ||
"object_storage_region": "test_region", | ||
"lfs_bucket_name": "test_name", | ||
"packages_bucket_name": "test_name", | ||
"container_registry_bucket_name": "test_name", | ||
"lfs_bucket_name": "test_name_lfs", | ||
"packages_bucket_name": "test_name_pkg", | ||
"container_registry_bucket_name": "test_name_cr", | ||
"to": "[email protected]", | ||
}) | ||
noNetworkConfigRd.SetId("test_id") | ||
|
@@ -290,7 +290,7 @@ func TestExpandUpdateNetworkInterfaceInput(t *testing.T) { | |
want: &devops.UpdateNetworkInterfaceInput{ | ||
InstanceId: nifcloud.String("test_id"), | ||
NetworkConfig: &types.RequestNetworkConfig{ | ||
NetworkId: nifcloud.String("test_id"), | ||
NetworkId: nifcloud.String("test_id_nw"), | ||
PrivateAddress: nifcloud.String("192.168.1.1/24"), | ||
}, | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,21 +17,21 @@ func TestFlatten(t *testing.T) { | |
wantRd := schema.TestResourceDataRaw(t, newSchema(), map[string]interface{}{ | ||
"instance_id": "test_id", | ||
"instance_type": "c-large", | ||
"firewall_group_name": "test_name", | ||
"parameter_group_name": "test_name", | ||
"firewall_group_name": "test_name_fg", | ||
"parameter_group_name": "test_name_pg", | ||
"disk_size": 100, | ||
"availability_zone": "east-11", | ||
"description": "test_description", | ||
"network_id": "test_id", | ||
"network_id": "test_id_nw", | ||
"private_address": "192.168.1.1/24", | ||
"gitlab_url": "test_url", | ||
"registry_url": "test_url", | ||
"gitlab_url": "test_url_gl", | ||
"registry_url": "test_url_cr", | ||
"public_ip_address": "198.51.100.1", | ||
"object_storage_account": "test_account", | ||
"object_storage_region": "test_region", | ||
"lfs_bucket_name": "test_name", | ||
"packages_bucket_name": "test_name", | ||
"container_registry_bucket_name": "test_name", | ||
"lfs_bucket_name": "test_name_lfs", | ||
"packages_bucket_name": "test_name_pkg", | ||
"container_registry_bucket_name": "test_name_cr", | ||
"to": "[email protected]", | ||
}) | ||
wantRd.SetId("test_id") | ||
|
@@ -55,27 +55,27 @@ func TestFlatten(t *testing.T) { | |
Instance: &types.Instance{ | ||
InstanceId: nifcloud.String("test_id"), | ||
InstanceType: nifcloud.String("c-large"), | ||
FirewallGroupName: nifcloud.String("test_name"), | ||
ParameterGroupName: nifcloud.String("test_name"), | ||
FirewallGroupName: nifcloud.String("test_name_fg"), | ||
ParameterGroupName: nifcloud.String("test_name_pg"), | ||
DiskSize: nifcloud.Int32(int32(100)), | ||
AvailabilityZone: nifcloud.String("east-11"), | ||
Description: nifcloud.String("test_description"), | ||
NetworkConfig: &types.NetworkConfig{ | ||
NetworkId: nifcloud.String("test_id"), | ||
NetworkId: nifcloud.String("test_id_nw"), | ||
PrivateAddress: nifcloud.String("192.168.1.1/24"), | ||
}, | ||
ObjectStorageConfig: &types.ObjectStorageConfig{ | ||
Account: nifcloud.String("test_account"), | ||
Region: nifcloud.String("test_region"), | ||
BucketUseObjects: &types.BucketUseObjects{ | ||
Lfs: nifcloud.String("test_name"), | ||
Packages: nifcloud.String("test_name"), | ||
ContainerRegistry: nifcloud.String("test_name"), | ||
Lfs: nifcloud.String("test_name_lfs"), | ||
Packages: nifcloud.String("test_name_pkg"), | ||
ContainerRegistry: nifcloud.String("test_name_cr"), | ||
}, | ||
}, | ||
To: nifcloud.String("[email protected]"), | ||
GitlabUrl: nifcloud.String("test_url"), | ||
RegistryUrl: nifcloud.String("test_url"), | ||
GitlabUrl: nifcloud.String("test_url_gl"), | ||
RegistryUrl: nifcloud.String("test_url_cr"), | ||
PublicIpAddress: nifcloud.String("198.51.100.1"), | ||
}, | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters