Skip to content

Commit c9f4e34

Browse files
committed
test: add validation for filesystem size granularity
1 parent 0044c26 commit c9f4e34

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

internal/services/file/filesystem_test.go

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,31 @@ func TestAccFileSystem_InvalidSizeGranularityFails(t *testing.T) {
106106
})
107107
}
108108

109+
func TestAccFileSystem_InvalidSizeGranularityFails(t *testing.T) {
110+
tt := acctest.NewTestTools(t)
111+
defer tt.Cleanup()
112+
113+
fileSystemName := "TestAccFileSystem_Basic"
114+
size := int64(25_000_000_000)
115+
116+
resource.ParallelTest(t, resource.TestCase{
117+
PreCheck: func() { acctest.PreCheck(t) },
118+
ProviderFactories: tt.ProviderFactories,
119+
CheckDestroy: filetestfuncs.CheckFileDestroy(tt),
120+
Steps: []resource.TestStep{
121+
{
122+
Config: fmt.Sprintf(`
123+
resource "scaleway_file_filesystem" "fs" {
124+
name = "%s"
125+
size = %d
126+
}
127+
`, fileSystemName, size),
128+
ExpectError: regexp.MustCompile("size does not respect constraint, size must be greater or equal to 100000000000"),
129+
},
130+
},
131+
})
132+
}
133+
109134
func testAccCheckFileSystemExists(tt *acctest.TestTools, n string) resource.TestCheckFunc {
110135
return func(s *terraform.State) error {
111136
rs, ok := s.RootModule().Resources[n]

0 commit comments

Comments
 (0)