We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 80194af commit 635f23bCopy full SHA for 635f23b
1 file changed
pkg/utils/validation/validation_test.go
@@ -19,9 +19,23 @@ package validation
19
import (
20
"fmt"
21
"path/filepath"
22
+ "strings"
23
"testing"
24
)
25
26
+func FuzzIsSafePath(f *testing.F) {
27
+ // f.Add()
28
+ f.Fuzz(func(t *testing.T, input string) {
29
+ err := IsValidMountRoot(input)
30
+ if err == nil {
31
+ // valid input must start with "/"
32
+ if !strings.HasPrefix(input, string(filepath.Separator)) {
33
+ t.Errorf("testcase %s failed, expect the input starts with '/'", input)
34
+ }
35
36
+ })
37
+}
38
+
39
func TestIsSafePathWithSafePath(t *testing.T) {
40
41
type testCase struct {
0 commit comments