@@ -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 },
@@ -86,26 +99,32 @@ func TestAccSumologicHTTPSource_update(t *testing.T) {
8699 kName := acctest .RandomWithPrefix ("tf-acc-test" )
87100 kDescription := acctest .RandomWithPrefix ("tf-acc-test" )
88101 kCategory := acctest .RandomWithPrefix ("tf-acc-test" )
102+ oName := acctest .RandomWithPrefix ("tf-acc-test" )
103+ oDescription := acctest .RandomWithPrefix ("tf-acc-test" )
104+ oCategory := acctest .RandomWithPrefix ("tf-acc-test" )
89105 sNameUpdated := acctest .RandomWithPrefix ("tf-acc-test" )
90106 sDescriptionUpdated := acctest .RandomWithPrefix ("tf-acc-test" )
91107 sCategoryUpdated := acctest .RandomWithPrefix ("tf-acc-test" )
92108 resourceName := "sumologic_http_source.http"
93109 tracingResourceName := "sumologic_http_source.traces"
94110 kinesisResourceName := "sumologic_http_source.kinesisLog"
111+ otlpResourceName := "sumologic_http_source.otlp"
95112 resource .Test (t , resource.TestCase {
96113 PreCheck : func () { testAccPreCheck (t ) },
97114 Providers : testAccProviders ,
98115 CheckDestroy : testAccCheckHTTPSourceDestroy ,
99116 Steps : []resource.TestStep {
100117 {
101- Config : testAccSumologicHTTPSourceConfig (cName , cDescription , cCategory , sName , sDescription , sCategory , tName , tDescription , tCategory , kName , kDescription , kCategory ),
118+ Config : testAccSumologicHTTPSourceConfig (cName , cDescription , cCategory , sName , sDescription , sCategory , tName , tDescription , tCategory , kName , kDescription , kCategory , oName , oDescription , oCategory ),
102119 Check : resource .ComposeTestCheckFunc (
103120 testAccCheckHTTPSourceExists (resourceName , & httpSource ),
104121 testAccCheckHTTPSourceValues (& httpSource , sName , sDescription , sCategory ),
105122 testAccCheckHTTPSourceExists (tracingResourceName , & httpTraceSource ),
106123 testAccCheckHTTPSourceValues (& httpTraceSource , tName , tDescription , tCategory ),
107124 testAccCheckHTTPSourceExists (kinesisResourceName , & kinesisLogSource ),
108125 testAccCheckHTTPSourceValues (& kinesisLogSource , kName , kDescription , kCategory ),
126+ testAccCheckHTTPSourceExists (otlpResourceName , & httpOtlpSource ),
127+ testAccCheckHTTPSourceValues (& httpOtlpSource , oName , oDescription , oCategory ),
109128 resource .TestCheckResourceAttrSet (resourceName , "id" ),
110129 resource .TestCheckResourceAttrSet (resourceName , "url" ),
111130 resource .TestCheckResourceAttr (resourceName , "name" , sName ),
@@ -124,10 +143,16 @@ func TestAccSumologicHTTPSource_update(t *testing.T) {
124143 resource .TestCheckResourceAttr (kinesisResourceName , "description" , kDescription ),
125144 resource .TestCheckResourceAttr (kinesisResourceName , "category" , kCategory ),
126145 resource .TestCheckResourceAttr (kinesisResourceName , "content_type" , "KinesisLog" ),
146+ resource .TestCheckResourceAttrSet (otlpResourceName , "id" ),
147+ resource .TestCheckResourceAttrSet (otlpResourceName , "url" ),
148+ resource .TestCheckResourceAttr (otlpResourceName , "name" , oName ),
149+ resource .TestCheckResourceAttr (otlpResourceName , "description" , oDescription ),
150+ resource .TestCheckResourceAttr (otlpResourceName , "category" , oCategory ),
151+ resource .TestCheckResourceAttr (otlpResourceName , "content_type" , "Otlp" ),
127152 ),
128153 },
129154 {
130- Config : testAccSumologicHTTPSourceConfig (cName , cDescription , cCategory , sNameUpdated , sDescriptionUpdated , sCategoryUpdated , tName , tDescription , tCategory , kName , kDescription , kCategory ),
155+ Config : testAccSumologicHTTPSourceConfig (cName , cDescription , cCategory , sNameUpdated , sDescriptionUpdated , sCategoryUpdated , tName , tDescription , tCategory , kName , kDescription , kCategory , oName , oDescription , oCategory ),
131156 Check : resource .ComposeTestCheckFunc (
132157 testAccCheckHTTPSourceExists (resourceName , & httpSource ),
133158 testAccCheckHTTPSourceValues (& httpSource , sNameUpdated , sDescriptionUpdated , sCategoryUpdated ),
@@ -138,6 +163,7 @@ func TestAccSumologicHTTPSource_update(t *testing.T) {
138163 resource .TestCheckResourceAttr (resourceName , "category" , sCategoryUpdated ),
139164 resource .TestCheckResourceAttr (tracingResourceName , "content_type" , "Zipkin" ),
140165 resource .TestCheckResourceAttr (kinesisResourceName , "content_type" , "KinesisLog" ),
166+ resource .TestCheckResourceAttr (otlpResourceName , "content_type" , "Otlp" ),
141167 ),
142168 },
143169 },
@@ -256,5 +282,13 @@ resource "sumologic_http_source" "kinesisLog" {
256282 content_type = "KinesisLog"
257283 collector_id = "${sumologic_collector.test.id}"
258284}
259- ` , cName , cDescription , cCategory , sName , sDescription , sCategory , tName , tDescription , tCategory , kName , kDescription , kCategory )
285+
286+ resource "sumologic_http_source" "otlp" {
287+ name = "%s"
288+ description = "%s"
289+ category = "%s"
290+ content_type = "Otlp"
291+ collector_id = "${sumologic_collector.test.id}"
292+ }
293+ ` , cName , cDescription , cCategory , sName , sDescription , sCategory , tName , tDescription , tCategory , kName , kDescription , kCategory , oName , oDescription , oCategory )
260294}
0 commit comments