test(storage): add out-of-bounds chown coverage for go code and script

This commit is contained in:
RichardDorian
2026-07-08 19:36:29 +02:00
parent 06bedebce3
commit 513b200f5c
2 changed files with 66 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
package storage
import (
"testing"
. "github.com/onsi/gomega"
)
func TestResolveChownIDRejectsOutOfBoundsValues(t *testing.T) {
RegisterTestingT(t)
for _, chownFlag := range []string{"-1", "65536", "100000", "231072", "abc", "1.5", ""} {
_, err := ResolveChownID(chownFlag)
Expect(err).To(HaveOccurred(), "expected %q to be rejected", chownFlag)
Expect(err.Error()).To(ContainSubstring("Unsupported chown permissions"))
}
}