@@ -15,14 +15,16 @@ import (
1515
1616var (
1717 vmClusterRecommendedNetworkSingularDataSourceRepresentation = map [string ]interface {}{
18- "compartment_id" : Representation {repType : Required , create : `${var.compartment_id}` },
19- "display_name" : Representation {repType : Required , create : `testVmClusterNw` },
20- "exadata_infrastructure_id" : Representation {repType : Required , create : `${oci_database_exadata_infrastructure.test_exadata_infrastructure.id}` },
21- "networks" : []RepresentationGroup {{Required , vmClusterRecommendedNetworkClientNetworksRepresentation }, {Required , vmClusterRecommendedNetworkbackupNetworksRepresentation }},
22- "defined_tags" : Representation {repType : Optional , create : `${map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "value")}` , update : `${map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "updatedValue")}` },
23- "dns" : Representation {repType : Optional , create : []string {`192.168.10.10` }},
24- "freeform_tags" : Representation {repType : Optional , create : map [string ]string {"Department" : "Finance" }, update : map [string ]string {"Department" : "Accounting" }},
25- "ntp" : Representation {repType : Optional , create : []string {`192.168.10.20` }},
18+ "compartment_id" : Representation {repType : Required , create : `${var.compartment_id}` },
19+ "display_name" : Representation {repType : Required , create : `testVmClusterNw` },
20+ "exadata_infrastructure_id" : Representation {repType : Required , create : `${oci_database_exadata_infrastructure.test_exadata_infrastructure.id}` },
21+ "networks" : []RepresentationGroup {{Required , vmClusterRecommendedNetworkClientNetworksRepresentation }, {Required , vmClusterRecommendedNetworkbackupNetworksRepresentation }},
22+ "defined_tags" : Representation {repType : Optional , create : `${map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "value")}` , update : `${map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "updatedValue")}` },
23+ "dns" : Representation {repType : Optional , create : []string {`192.168.10.10` }},
24+ "freeform_tags" : Representation {repType : Optional , create : map [string ]string {"Department" : "Finance" }, update : map [string ]string {"Department" : "Accounting" }},
25+ "ntp" : Representation {repType : Optional , create : []string {`192.168.10.20` }},
26+ "scan_listener_port_tcp" : Representation {repType : Optional , create : `1521` },
27+ "scan_listener_port_tcp_ssl" : Representation {repType : Optional , create : `2484` },
2628 }
2729 vmClusterRecommendedNetworkClientNetworksRepresentation = map [string ]interface {}{
2830 "cidr" : Representation {repType : Required , create : `192.168.19.2/16` },
@@ -73,13 +75,31 @@ func TestDatabaseVmClusterRecommendedNetworkResource_basic(t *testing.T) {
7375 // verify singular datasource
7476 {
7577 Config : config + VmClusterRecommendedNetworkDataSourceDependencies +
76- generateDataSourceFromRepresentationMap ("oci_database_vm_cluster_recommended_network" , "test_vm_cluster_recommended_network" , Required , Create , vmClusterRecommendedNetworkSingularDataSourceRepresentation ) +
78+ generateDataSourceFromRepresentationMap ("oci_database_vm_cluster_recommended_network" , "test_vm_cluster_recommended_network" , Optional , Create , vmClusterRecommendedNetworkSingularDataSourceRepresentation ) +
7779 compartmentIdVariableStr ,
7880 Check : ComposeAggregateTestCheckFuncWrapper (
7981 resource .TestCheckResourceAttr (singularDatasourceName , "compartment_id" , compartmentId ),
8082 resource .TestCheckResourceAttr (singularDatasourceName , "display_name" , "testVmClusterNw" ),
8183 resource .TestCheckResourceAttrSet (singularDatasourceName , "exadata_infrastructure_id" ),
84+ resource .TestCheckResourceAttr (singularDatasourceName , "freeform_tags.%" , "1" ),
8285 resource .TestCheckResourceAttr (singularDatasourceName , "networks.#" , "2" ),
86+ resource .TestCheckResourceAttr (singularDatasourceName , "networks.0.cidr" , "192.168.19.2/16" ),
87+ resource .TestCheckResourceAttr (singularDatasourceName , "networks.0.domain" , "oracle.com" ),
88+ resource .TestCheckResourceAttr (singularDatasourceName , "networks.0.gateway" , "192.168.20.1" ),
89+ resource .TestCheckResourceAttr (singularDatasourceName , "networks.0.netmask" , "255.255.0.0" ),
90+ resource .TestCheckResourceAttr (singularDatasourceName , "networks.0.network_type" , "CLIENT" ),
91+ resource .TestCheckResourceAttr (singularDatasourceName , "networks.0.prefix" , "myprefix1" ),
92+ resource .TestCheckResourceAttrSet (singularDatasourceName , "networks.0.vlan_id" ),
93+ resource .TestCheckResourceAttr (singularDatasourceName , "ntp.#" , "1" ),
94+ resource .TestCheckResourceAttr (singularDatasourceName , "scan_listener_port_tcp" , "1521" ),
95+ resource .TestCheckResourceAttr (singularDatasourceName , "scan_listener_port_tcp_ssl" , "2484" ),
96+
97+ resource .TestCheckResourceAttr (singularDatasourceName , "compartment_id" , compartmentId ),
98+ resource .TestCheckResourceAttr (singularDatasourceName , "defined_tags.%" , "1" ),
99+ resource .TestCheckResourceAttr (singularDatasourceName , "display_name" , "testVmClusterNw" ),
100+ resource .TestCheckResourceAttr (singularDatasourceName , "dns.#" , "1" ),
101+ resource .TestCheckResourceAttr (singularDatasourceName , "freeform_tags.%" , "1" ),
102+ resource .TestCheckResourceAttr (singularDatasourceName , "ntp.#" , "1" ),
83103 resource .TestCheckResourceAttr (singularDatasourceName , "scans.#" , "1" ),
84104 ),
85105 },
0 commit comments