mirror of
https://github.com/dokku/dokku.git
synced 2026-08-29 10:08:53 +02:00
test(storage): add out-of-bounds chown coverage for go code and script
This commit is contained in:
17
plugins/storage/subcommands_test.go
Normal file
17
plugins/storage/subcommands_test.go
Normal 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"))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user