@@ -20,10 +20,8 @@ type ResourceCoreSecurityListTestSuite struct {
2020	Providers     map [string ]terraform.ResourceProvider 
2121	TimeCreated   baremetal.Time 
2222	Config        string 
23+ 	SLConfig      string 
2324	ResourceName  string 
24- 	Res           * baremetal.SecurityList 
25- 	DeletingRes   * baremetal.SecurityList 
26- 	DeletedRes    * baremetal.SecurityList 
2725}
2826
2927func  extraWait (ew  crud.ExtraWaitPostCreateDelete ) {
@@ -68,7 +66,8 @@ resource "baremetal_core_route_table" "RouteForComplete" {
6866        network_entity_id = "${baremetal_core_internet_gateway.CompleteIG.id}" 
6967    } 
7068} 
71- 
69+ ` 
70+ 	s .SLConfig  =  ` 
7271resource "baremetal_core_security_list" "t" { 
7372    compartment_id = "${var.compartment_id}" 
7473    display_name = "Public" 
@@ -104,9 +103,11 @@ func (s *ResourceCoreSecurityListTestSuite) TestCreateResourceCoreSecurityList()
104103			{
105104				ImportState :       true ,
106105				ImportStateVerify : true ,
107- 				Config :            s .Config ,
106+ 				Config :            s .Config   +   s . SLConfig ,
108107				Check : resource .ComposeTestCheckFunc (
109108					resource .TestCheckResourceAttr (s .ResourceName , "display_name" , "Public" ),
109+ 					resource .TestCheckResourceAttr (s .ResourceName , "egress_security_rules.#" , "1" ),
110+ 					resource .TestCheckResourceAttr (s .ResourceName , "ingress_security_rules.#" , "2" ),
110111					resource .TestCheckResourceAttr (s .ResourceName , "egress_security_rules.0.stateless" , "false" ),
111112					resource .TestCheckResourceAttr (s .ResourceName , "ingress_security_rules.0.tcp_options.0.max" , "80" ),
112113				),
@@ -115,6 +116,37 @@ func (s *ResourceCoreSecurityListTestSuite) TestCreateResourceCoreSecurityList()
115116	})
116117}
117118
119+ func  (s  * ResourceCoreSecurityListTestSuite ) TestCreateResourceCoreSecurityListRemoveRules () {
120+ 
121+ 	resource .UnitTest (s .T (), resource.TestCase {
122+ 		Providers : s .Providers ,
123+ 		Steps : []resource.TestStep {
124+ 			{
125+ 				ImportState :       true ,
126+ 				ImportStateVerify : true ,
127+ 				Config :            s .Config  +  s .SLConfig ,
128+ 			},
129+ 			{
130+ 				Config : s .Config  +  ` 
131+ 					resource "baremetal_core_security_list" "t" { 
132+ 					    compartment_id = "${var.compartment_id}" 
133+ 					    display_name = "Public" 
134+ 					    vcn_id = "${baremetal_core_virtual_network.t.id}" 
135+ 					    egress_security_rules = [] 
136+ 					    ingress_security_rules = [] 
137+ 					} 
138+ 				` ,
139+ 				Check : resource .ComposeTestCheckFunc (
140+ 					resource .TestCheckResourceAttr (s .ResourceName , "display_name" , "Public" ),
141+ 					resource .TestCheckResourceAttr (s .ResourceName , "egress_security_rules.#" , "0" ),
142+ 					resource .TestCheckResourceAttr (s .ResourceName , "ingress_security_rules.#" , "0" ),
143+ 				),
144+ 			},
145+ 		},
146+ 	})
147+ }
148+ 
149+ 
118150func  (s  * ResourceCoreSecurityListTestSuite ) TestDeleteSecurityList () {
119151
120152	resource .UnitTest (s .T (), resource.TestCase {
0 commit comments