Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions pkg/utils/validation/validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,23 @@ package validation
import (
"fmt"
"path/filepath"
"strings"
"testing"
)

func FuzzIsSafePath(f *testing.F) {
// f.Add()
f.Fuzz(func(t *testing.T, input string) {
err := IsValidMountRoot(input)
if err == nil {
// valid input must start with "/"
if !strings.HasPrefix(input, string(filepath.Separator)) {
t.Errorf("testcase %s failed, expect the input starts with '/'", input)
}
}
})
}

func TestIsSafePathWithSafePath(t *testing.T) {

type testCase struct {
Expand Down
Loading