Skip to content

Commit 043b4b5

Browse files
committed
Add a test case where the validation fails due to incompatible engine_version
1 parent bd43654 commit 043b4b5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

internal/service/opensearch/package_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"fmt"
99
"testing"
1010

11+
"github.com/YakDriver/regexache"
1112
awstypes "github.com/aws/aws-sdk-go-v2/service/opensearch/types"
1213
"github.com/hashicorp/terraform-plugin-testing/helper/resource"
1314
"github.com/hashicorp/terraform-plugin-testing/terraform"
@@ -87,6 +88,11 @@ func TestAccOpenSearchPackage_packageTypeZipPlugin(t *testing.T) {
8788
"package_source", // This isn't returned by the API
8889
},
8990
},
91+
{
92+
// If engin_version is different from specified in the plugin zip file, it should return an error
93+
Config: testAccPackageConfig_packageTypeZipPlugin(pkgName, "OpenSearch_2.11"),
94+
ExpectError: regexache.MustCompile(`doesn't matches with the provided EngineVersion`),
95+
},
9096
},
9197
})
9298
}

0 commit comments

Comments
 (0)