@@ -47,20 +47,58 @@ func (s *ResourceCoreDHCPOptionsTestSuite) SetupTest() {
4747 compartment_id = "${var.compartment_id}"
4848 display_name = "network_name"
4949 }
50- resource "baremetal_core_dhcp_options" "t" {
51- compartment_id = "${var.compartment_id}"
52- display_name = "display_name"
53- options {
54- type = "DomainNameServer"
55- custom_dns_servers = [ "8.8.8.8" ]
56- server_type = "CustomDnsServer"
57- }
58- vcn_id = "${baremetal_core_virtual_network.t.id}"
50+
51+ resource "baremetal_core_dhcp_options" "opt1" {
52+ compartment_id = "${var.compartment_id}"
53+ vcn_id = "${baremetal_core_virtual_network.t.id}"
54+ display_name = "display_name"
55+ options {
56+ type = "DomainNameServer"
57+ server_type = "VcnLocalPlusInternet"
58+ }
59+ }
60+
61+ resource "baremetal_core_dhcp_options" "opt2" {
62+ compartment_id = "${var.compartment_id}"
63+ vcn_id = "${baremetal_core_virtual_network.t.id}"
64+ display_name = "display_name"
65+ options {
66+ type = "DomainNameServer"
67+ server_type = "VcnLocalPlusInternet"
68+ }
69+ options {
70+ type = "SearchDomain"
71+ search_domain_names = [ "test.com" ]
72+ }
73+ }
74+
75+ resource "baremetal_core_dhcp_options" "opt3" {
76+ compartment_id = "${var.compartment_id}"
77+ vcn_id = "${baremetal_core_virtual_network.t.id}"
78+ display_name = "display_name"
79+ options {
80+ type = "DomainNameServer"
81+ server_type = "CustomDnsServer"
82+ custom_dns_servers = [ "8.8.4.4", "8.8.8.8" ]
83+ }
84+ }
85+
86+ resource "baremetal_core_dhcp_options" "opt4" {
87+ compartment_id = "${var.compartment_id}"
88+ vcn_id = "${baremetal_core_virtual_network.t.id}"
89+ display_name = "display_name"
90+ options {
91+ type = "DomainNameServer"
92+ server_type = "CustomDnsServer"
93+ custom_dns_servers = [ "8.8.4.4", "8.8.8.8" ]
94+ }
95+ options {
96+ type = "SearchDomain"
97+ search_domain_names = [ "test.com" ]
98+ }
5999 }
60100 `
61101 s .Config += testProviderConfig ()
62-
63- s .ResourceName = "baremetal_core_dhcp_options.t"
64102}
65103
66104func (s * ResourceCoreDHCPOptionsTestSuite ) TestCreateResourceCoreDHCPOptions () {
@@ -74,9 +112,21 @@ func (s *ResourceCoreDHCPOptionsTestSuite) TestCreateResourceCoreDHCPOptions() {
74112 Config : s .Config ,
75113 Check : resource .ComposeTestCheckFunc (
76114
77- resource .TestCheckResourceAttr (s .ResourceName , "display_name" , "display_name" ),
78- resource .TestCheckResourceAttr (s .ResourceName , "options.0.type" , "DomainNameServer" ),
79- resource .TestCheckResourceAttr (s .ResourceName , "options.0.server_type" , "CustomDnsServer" ),
115+ resource .TestCheckResourceAttr ("baremetal_core_dhcp_options.opt1" , "display_name" , "display_name" ),
116+
117+ resource .TestCheckResourceAttr ("baremetal_core_dhcp_options.opt1" , "options.0.type" , "DomainNameServer" ),
118+ resource .TestCheckResourceAttr ("baremetal_core_dhcp_options.opt1" , "options.0.server_type" , "VcnLocalPlusInternet" ),
119+
120+ resource .TestCheckResourceAttr ("baremetal_core_dhcp_options.opt2" , "options.0.type" , "DomainNameServer" ),
121+ resource .TestCheckResourceAttr ("baremetal_core_dhcp_options.opt2" , "options.0.server_type" , "VcnLocalPlusInternet" ),
122+ resource .TestCheckResourceAttr ("baremetal_core_dhcp_options.opt2" , "options.1.type" , "SearchDomain" ),
123+
124+ resource .TestCheckResourceAttr ("baremetal_core_dhcp_options.opt3" , "options.0.type" , "DomainNameServer" ),
125+ resource .TestCheckResourceAttr ("baremetal_core_dhcp_options.opt3" , "options.0.server_type" , "CustomDnsServer" ),
126+
127+ resource .TestCheckResourceAttr ("baremetal_core_dhcp_options.opt4" , "options.0.type" , "DomainNameServer" ),
128+ resource .TestCheckResourceAttr ("baremetal_core_dhcp_options.opt4" , "options.0.server_type" , "CustomDnsServer" ),
129+ resource .TestCheckResourceAttr ("baremetal_core_dhcp_options.opt4" , "options.1.type" , "SearchDomain" ),
80130 ),
81131 },
82132 },
0 commit comments