Skip to content

Commit 380b3b7

Browse files
committed
test: add validation for filesystem size granularity
1 parent 7073523 commit 380b3b7

File tree

3 files changed

+90
-746
lines changed

3 files changed

+90
-746
lines changed

internal/services/file/filesystem_test.go

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,31 @@ func TestAccFileSystem_SizeTooSmallFails(t *testing.T) {
8181
})
8282
}
8383

84+
func TestAccFileSystem_InvalidSizeGranularityFails(t *testing.T) {
85+
tt := acctest.NewTestTools(t)
86+
defer tt.Cleanup()
87+
88+
fileSystemName := "TestAccFileSystem_Basic"
89+
size := int64(25_000_000_000)
90+
91+
resource.ParallelTest(t, resource.TestCase{
92+
PreCheck: func() { acctest.PreCheck(t) },
93+
ProviderFactories: tt.ProviderFactories,
94+
CheckDestroy: filetestfuncs.CheckFileDestroy(tt),
95+
Steps: []resource.TestStep{
96+
{
97+
Config: fmt.Sprintf(`
98+
resource "scaleway_file_filesystem" "fs" {
99+
name = "%s"
100+
size = %d
101+
}
102+
`, fileSystemName, size),
103+
ExpectError: regexp.MustCompile("size does not respect constraint, size must be greater or equal to 100000000000"),
104+
},
105+
},
106+
})
107+
}
108+
84109
func testAccCheckFileSystemExists(tt *acctest.TestTools, n string) resource.TestCheckFunc {
85110
return func(s *terraform.State) error {
86111
rs, ok := s.RootModule().Resources[n]

0 commit comments

Comments
 (0)