@@ -191,3 +191,44 @@ func TestAccCloudIngestionAssetsDataSource(t *testing.T) {
191191 },
192192 })
193193}
194+
195+ func TestAccTrustedOracleAppDataSource (t * testing.T ) {
196+ resource .ParallelTest (t , resource.TestCase {
197+ PreCheck : func () {
198+ if v := os .Getenv ("SYSDIG_SECURE_API_TOKEN" ); v == "" {
199+ t .Fatal ("SYSDIG_SECURE_API_TOKEN must be set for acceptance tests" )
200+ }
201+ },
202+ ProviderFactories : map [string ]func () (* schema.Provider , error ){
203+ "sysdig" : func () (* schema.Provider , error ) {
204+ return sysdig .Provider (), nil
205+ },
206+ },
207+ Steps : []resource.TestStep {
208+ {
209+ Config : `data "sysdig_secure_trusted_oracle_app" "invalid" { name = "invalid" }` ,
210+ ExpectError : regexp .MustCompile (`.*expected name to be one of.*` ),
211+ },
212+ {
213+ Config : `data "sysdig_secure_trusted_oracle_app" "config_posture" { name = "config_posture" }` ,
214+ Check : resource .ComposeTestCheckFunc (
215+ resource .TestCheckResourceAttr ("data.sysdig_secure_trusted_oracle_app.config_posture" , "name" , "config_posture" ),
216+ // not asserting the oci exported fields because not every backend environment is oci supported yet and thus will have empty values
217+ // resource.TestCheckResourceAttrSet("data.sysdig_secure_trusted_oracle_app.config_posture", "tenancy_ocid"), // uncomment to assert a non empty value
218+ // resource.TestCheckResourceAttrSet("data.sysdig_secure_trusted_oracle_app.config_posture", "group_ocid"), // uncomment to assert a non empty value
219+ // resource.TestCheckResourceAttrSet("data.sysdig_secure_trusted_oracle_app.config_posture", "user_ocid"), // uncomment to assert a non empty value
220+ ),
221+ },
222+ {
223+ Config : `data "sysdig_secure_trusted_oracle_app" "onboarding" { name = "onboarding" }` ,
224+ Check : resource .ComposeTestCheckFunc (
225+ resource .TestCheckResourceAttr ("data.sysdig_secure_trusted_oracle_app.onboarding" , "name" , "onboarding" ),
226+ // not asserting the oci exported fields because not every backend environment is oci supported yet and thus will have empty values
227+ // resource.TestCheckResourceAttrSet("data.sysdig_secure_trusted_oracle_app.onboarding", "tenancy_ocid"), // uncomment to assert a non empty value
228+ // resource.TestCheckResourceAttrSet("data.sysdig_secure_trusted_oracle_app.onboarding", "group_ocid"), // uncomment to assert a non empty value
229+ // resource.TestCheckResourceAttrSet("data.sysdig_secure_trusted_oracle_app.onboarding", "user_ocid"), // uncomment to assert a non empty value
230+ ),
231+ },
232+ },
233+ })
234+ }
0 commit comments