@@ -14,6 +14,7 @@ func TestAccSumologicHTTPSource_create(t *testing.T) {
1414 var httpSource HTTPSource
1515 var httpTraceSource HTTPSource
1616 var kinesisLogSource HTTPSource
17+ var httpOtlpSource HTTPSource
1718 var collector Collector
1819 cName := acctest .RandomWithPrefix ("tf-acc-test" )
1920 cDescription := acctest .RandomWithPrefix ("tf-acc-test" )
@@ -27,16 +28,20 @@ func TestAccSumologicHTTPSource_create(t *testing.T) {
2728 kName := acctest .RandomWithPrefix ("tf-acc-test" )
2829 kDescription := acctest .RandomWithPrefix ("tf-acc-test" )
2930 kCategory := acctest .RandomWithPrefix ("tf-acc-test" )
31+ oName := acctest .RandomWithPrefix ("tf-acc-test" )
32+ oDescription := acctest .RandomWithPrefix ("tf-acc-test" )
33+ oCategory := acctest .RandomWithPrefix ("tf-acc-test" )
3034 resourceName := "sumologic_http_source.http"
3135 tracingResourceName := "sumologic_http_source.traces"
3236 kinesisResourceName := "sumologic_http_source.kinesisLog"
37+ otlpResourceName := "sumologic_http_source.otlp"
3338 resource .Test (t , resource.TestCase {
3439 PreCheck : func () { testAccPreCheck (t ) },
3540 Providers : testAccProviders ,
3641 CheckDestroy : testAccCheckHTTPSourceDestroy ,
3742 Steps : []resource.TestStep {
3843 {
39- Config : testAccSumologicHTTPSourceConfig (cName , cDescription , cCategory , sName , sDescription , sCategory , tName , tDescription , tCategory , kName , kDescription , kCategory ),
44+ Config : testAccSumologicHTTPSourceConfig (cName , cDescription , cCategory , sName , sDescription , sCategory , tName , tDescription , tCategory , kName , kDescription , kCategory , oName , oDescription , oCategory ),
4045 Check : resource .ComposeTestCheckFunc (
4146 testAccCheckHTTPSourceExists (resourceName , & httpSource ),
4247 testAccCheckHTTPSourceValues (& httpSource , sName , sDescription , sCategory ),
@@ -46,6 +51,8 @@ func TestAccSumologicHTTPSource_create(t *testing.T) {
4651 testAccCheckHTTPSourceValues (& httpTraceSource , tName , tDescription , tCategory ),
4752 testAccCheckHTTPSourceExists (kinesisResourceName , & kinesisLogSource ),
4853 testAccCheckHTTPSourceValues (& kinesisLogSource , kName , kDescription , kCategory ),
54+ testAccCheckHTTPSourceExists (otlpResourceName , & httpOtlpSource ),
55+ testAccCheckHTTPSourceValues (& httpOtlpSource , oName , oDescription , oCategory ),
4956 resource .TestCheckResourceAttrSet (resourceName , "id" ),
5057 resource .TestCheckResourceAttrSet (resourceName , "url" ),
5158 resource .TestCheckResourceAttr (resourceName , "name" , sName ),
@@ -64,6 +71,12 @@ func TestAccSumologicHTTPSource_create(t *testing.T) {
6471 resource .TestCheckResourceAttr (kinesisResourceName , "description" , kDescription ),
6572 resource .TestCheckResourceAttr (kinesisResourceName , "category" , kCategory ),
6673 resource .TestCheckResourceAttr (kinesisResourceName , "content_type" , "KinesisLog" ),
74+ resource .TestCheckResourceAttrSet (otlpResourceName , "id" ),
75+ resource .TestCheckResourceAttrSet (otlpResourceName , "url" ),
76+ resource .TestCheckResourceAttr (otlpResourceName , "name" , oName ),
77+ resource .TestCheckResourceAttr (otlpResourceName , "description" , oDescription ),
78+ resource .TestCheckResourceAttr (otlpResourceName , "category" , oCategory ),
79+ resource .TestCheckResourceAttr (otlpResourceName , "content_type" , "Otlp" ),
6780 ),
6881 },
6982 },
@@ -74,6 +87,7 @@ func TestAccSumologicHTTPSource_update(t *testing.T) {
7487 var httpSource HTTPSource
7588 var httpTraceSource HTTPSource
7689 var kinesisLogSource HTTPSource
90+ var httpOtlpSource HTTPSource
7791 cName := acctest .RandomWithPrefix ("tf-acc-test" )
7892 cDescription := acctest .RandomWithPrefix ("tf-acc-test" )
7993 cCategory := acctest .RandomWithPrefix ("tf-acc-test" )
@@ -86,26 +100,32 @@ func TestAccSumologicHTTPSource_update(t *testing.T) {
86100 kName := acctest .RandomWithPrefix ("tf-acc-test" )
87101 kDescription := acctest .RandomWithPrefix ("tf-acc-test" )
88102 kCategory := acctest .RandomWithPrefix ("tf-acc-test" )
103+ oName := acctest .RandomWithPrefix ("tf-acc-test" )
104+ oDescription := acctest .RandomWithPrefix ("tf-acc-test" )
105+ oCategory := acctest .RandomWithPrefix ("tf-acc-test" )
89106 sNameUpdated := acctest .RandomWithPrefix ("tf-acc-test" )
90107 sDescriptionUpdated := acctest .RandomWithPrefix ("tf-acc-test" )
91108 sCategoryUpdated := acctest .RandomWithPrefix ("tf-acc-test" )
92109 resourceName := "sumologic_http_source.http"
93110 tracingResourceName := "sumologic_http_source.traces"
94111 kinesisResourceName := "sumologic_http_source.kinesisLog"
112+ otlpResourceName := "sumologic_http_source.otlp"
95113 resource .Test (t , resource.TestCase {
96114 PreCheck : func () { testAccPreCheck (t ) },
97115 Providers : testAccProviders ,
98116 CheckDestroy : testAccCheckHTTPSourceDestroy ,
99117 Steps : []resource.TestStep {
100118 {
101- Config : testAccSumologicHTTPSourceConfig (cName , cDescription , cCategory , sName , sDescription , sCategory , tName , tDescription , tCategory , kName , kDescription , kCategory ),
119+ Config : testAccSumologicHTTPSourceConfig (cName , cDescription , cCategory , sName , sDescription , sCategory , tName , tDescription , tCategory , kName , kDescription , kCategory , oName , oDescription , oCategory ),
102120 Check : resource .ComposeTestCheckFunc (
103121 testAccCheckHTTPSourceExists (resourceName , & httpSource ),
104122 testAccCheckHTTPSourceValues (& httpSource , sName , sDescription , sCategory ),
105123 testAccCheckHTTPSourceExists (tracingResourceName , & httpTraceSource ),
106124 testAccCheckHTTPSourceValues (& httpTraceSource , tName , tDescription , tCategory ),
107125 testAccCheckHTTPSourceExists (kinesisResourceName , & kinesisLogSource ),
108126 testAccCheckHTTPSourceValues (& kinesisLogSource , kName , kDescription , kCategory ),
127+ testAccCheckHTTPSourceExists (otlpResourceName , & httpOtlpSource ),
128+ testAccCheckHTTPSourceValues (& httpOtlpSource , oName , oDescription , oCategory ),
109129 resource .TestCheckResourceAttrSet (resourceName , "id" ),
110130 resource .TestCheckResourceAttrSet (resourceName , "url" ),
111131 resource .TestCheckResourceAttr (resourceName , "name" , sName ),
@@ -124,10 +144,16 @@ func TestAccSumologicHTTPSource_update(t *testing.T) {
124144 resource .TestCheckResourceAttr (kinesisResourceName , "description" , kDescription ),
125145 resource .TestCheckResourceAttr (kinesisResourceName , "category" , kCategory ),
126146 resource .TestCheckResourceAttr (kinesisResourceName , "content_type" , "KinesisLog" ),
147+ resource .TestCheckResourceAttrSet (otlpResourceName , "id" ),
148+ resource .TestCheckResourceAttrSet (otlpResourceName , "url" ),
149+ resource .TestCheckResourceAttr (otlpResourceName , "name" , oName ),
150+ resource .TestCheckResourceAttr (otlpResourceName , "description" , oDescription ),
151+ resource .TestCheckResourceAttr (otlpResourceName , "category" , oCategory ),
152+ resource .TestCheckResourceAttr (otlpResourceName , "content_type" , "Otlp" ),
127153 ),
128154 },
129155 {
130- Config : testAccSumologicHTTPSourceConfig (cName , cDescription , cCategory , sNameUpdated , sDescriptionUpdated , sCategoryUpdated , tName , tDescription , tCategory , kName , kDescription , kCategory ),
156+ Config : testAccSumologicHTTPSourceConfig (cName , cDescription , cCategory , sNameUpdated , sDescriptionUpdated , sCategoryUpdated , tName , tDescription , tCategory , kName , kDescription , kCategory , oName , oDescription , oCategory ),
131157 Check : resource .ComposeTestCheckFunc (
132158 testAccCheckHTTPSourceExists (resourceName , & httpSource ),
133159 testAccCheckHTTPSourceValues (& httpSource , sNameUpdated , sDescriptionUpdated , sCategoryUpdated ),
@@ -138,6 +164,7 @@ func TestAccSumologicHTTPSource_update(t *testing.T) {
138164 resource .TestCheckResourceAttr (resourceName , "category" , sCategoryUpdated ),
139165 resource .TestCheckResourceAttr (tracingResourceName , "content_type" , "Zipkin" ),
140166 resource .TestCheckResourceAttr (kinesisResourceName , "content_type" , "KinesisLog" ),
167+ resource .TestCheckResourceAttr (otlpResourceName , "content_type" , "Otlp" ),
141168 ),
142169 },
143170 },
@@ -225,7 +252,7 @@ func testAccCheckHTTPSourceValues(httpSource *HTTPSource, name, description, cat
225252 }
226253}
227254
228- func testAccSumologicHTTPSourceConfig (cName , cDescription , cCategory , sName , sDescription , sCategory , tName , tDescription , tCategory , kName , kDescription , kCategory string ) string {
255+ func testAccSumologicHTTPSourceConfig (cName , cDescription , cCategory , sName , sDescription , sCategory , tName , tDescription , tCategory , kName , kDescription , kCategory , oName , oDescription , oCategory string ) string {
229256 return fmt .Sprintf (`
230257resource "sumologic_collector" "test" {
231258 name = "%s"
@@ -256,5 +283,13 @@ resource "sumologic_http_source" "kinesisLog" {
256283 content_type = "KinesisLog"
257284 collector_id = "${sumologic_collector.test.id}"
258285}
259- ` , cName , cDescription , cCategory , sName , sDescription , sCategory , tName , tDescription , tCategory , kName , kDescription , kCategory )
286+
287+ resource "sumologic_http_source" "otlp" {
288+ name = "%s"
289+ description = "%s"
290+ category = "%s"
291+ content_type = "Otlp"
292+ collector_id = "${sumologic_collector.test.id}"
293+ }
294+ ` , cName , cDescription , cCategory , sName , sDescription , sCategory , tName , tDescription , tCategory , kName , kDescription , kCategory , oName , oDescription , oCategory )
260295}
0 commit comments