@@ -41,10 +41,16 @@ func TestAccVcdTmEdgeCluster(t *testing.T) {
41
41
configText2 := templateFill (preRequisites + testAccVcdTmEdgeClusterQosStep2 , params )
42
42
params ["FuncName" ] = t .Name () + "-step3"
43
43
configText3 := templateFill (preRequisites + testAccVcdTmEdgeClusterQosStep3 , params )
44
+ params ["FuncName" ] = t .Name () + "-step4"
45
+ configText4 := templateFill (preRequisites + testAccVcdTmEdgeClusterQosStep4 , params )
46
+ params ["FuncName" ] = t .Name () + "-step5"
47
+ configText5 := templateFill (preRequisites + testAccVcdTmEdgeClusterQosStep5 , params )
44
48
45
49
debugPrintf ("#[DEBUG] CONFIGURATION step1: %s\n " , configText1 )
46
50
debugPrintf ("#[DEBUG] CONFIGURATION step2: %s\n " , configText2 )
47
- debugPrintf ("#[DEBUG] CONFIGURATION step4: %s\n " , configText3 )
51
+ debugPrintf ("#[DEBUG] CONFIGURATION step3: %s\n " , configText3 )
52
+ debugPrintf ("#[DEBUG] CONFIGURATION step4: %s\n " , configText4 )
53
+ debugPrintf ("#[DEBUG] CONFIGURATION step5: %s\n " , configText5 )
48
54
if vcdShortTest {
49
55
t .Skip (acceptanceTestsSkipped )
50
56
return
@@ -107,7 +113,7 @@ func TestAccVcdTmEdgeCluster(t *testing.T) {
107
113
ResourceName : "vcd_tm_edge_cluster_qos.demo" ,
108
114
ImportState : true ,
109
115
ImportStateVerify : true ,
110
- ImportStateId : testConfig .Tm .NsxtEdgeCluster ,
116
+ ImportStateId : testConfig .Tm .Region + ImportSeparator + params [ "EdgeClusterName" ].( string ) ,
111
117
},
112
118
{
113
119
// Ensuring that the resource is removed (therefore QoS settings must be unset)
@@ -125,6 +131,26 @@ func TestAccVcdTmEdgeCluster(t *testing.T) {
125
131
resource .TestCheckResourceAttr ("data.vcd_tm_edge_cluster_qos.demo2" , "ingress_burst_size_bytes" , "" ),
126
132
),
127
133
},
134
+ {
135
+ // Ensuring that the resource is removed (therefore QoS settings must be unset)
136
+ Config : configText4 ,
137
+ Check : resource .ComposeTestCheckFunc (
138
+ resource .TestCheckResourceAttr ("vcd_tm_edge_cluster_qos.demo" , "egress_committed_bandwidth_mbps" , "7" ),
139
+ resource .TestCheckResourceAttr ("vcd_tm_edge_cluster_qos.demo" , "egress_burst_size_bytes" , "8" ),
140
+ resource .TestCheckResourceAttr ("vcd_tm_edge_cluster_qos.demo" , "ingress_committed_bandwidth_mbps" , "" ),
141
+ resource .TestCheckResourceAttr ("vcd_tm_edge_cluster_qos.demo" , "ingress_burst_size_bytes" , "" ),
142
+ ),
143
+ },
144
+ {
145
+ // Ensuring that the resource is removed (therefore QoS settings must be unset)
146
+ Config : configText5 ,
147
+ Check : resource .ComposeTestCheckFunc (
148
+ resource .TestCheckResourceAttr ("vcd_tm_edge_cluster_qos.demo" , "egress_committed_bandwidth_mbps" , "" ),
149
+ resource .TestCheckResourceAttr ("vcd_tm_edge_cluster_qos.demo" , "egress_burst_size_bytes" , "" ),
150
+ resource .TestCheckResourceAttr ("vcd_tm_edge_cluster_qos.demo" , "ingress_committed_bandwidth_mbps" , "5" ),
151
+ resource .TestCheckResourceAttr ("vcd_tm_edge_cluster_qos.demo" , "ingress_burst_size_bytes" , "6" ),
152
+ ),
153
+ },
128
154
},
129
155
})
130
156
@@ -167,3 +193,25 @@ data "vcd_tm_edge_cluster_qos" "demo2" {
167
193
edge_cluster_id = data.vcd_tm_edge_cluster.demo.id
168
194
}
169
195
`
196
+
197
+ // egress only
198
+ const testAccVcdTmEdgeClusterQosStep4 = testAccVcdTmEdgeClusterQosStep1 + `
199
+ resource "vcd_tm_edge_cluster_qos" "demo" {
200
+ edge_cluster_id = data.vcd_tm_edge_cluster.demo.id
201
+
202
+ egress_committed_bandwidth_mbps = 7
203
+ egress_burst_size_bytes = 8
204
+
205
+ }
206
+ `
207
+
208
+ // ingress only
209
+ const testAccVcdTmEdgeClusterQosStep5 = testAccVcdTmEdgeClusterQosStep1 + `
210
+ resource "vcd_tm_edge_cluster_qos" "demo" {
211
+ edge_cluster_id = data.vcd_tm_edge_cluster.demo.id
212
+
213
+ ingress_committed_bandwidth_mbps = 5
214
+ ingress_burst_size_bytes = 6
215
+
216
+ }
217
+ `
0 commit comments