fuzzer

package
v0.0.0-...-87875e3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 7, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Funcs = fuzzer.MergeFuzzerFuncs(
	func(codecs serializer.CodecFactory) []interface{} {
		return []interface{}{
			func(u *apis.URL, c fuzz.Continue) {
				u.Scheme = randStringAtoZ(c.Rand)
				u.Host = randStringAtoZ(c.Rand)
				u.User = url.UserPassword(
					randStringAtoZ(c.Rand),
					randStringAtoZ(c.Rand),
				)
				u.RawPath = url.PathEscape(c.RandString())
				u.RawQuery = url.QueryEscape(c.RandString())
			},
		}
	},
)

Funcs includes fuzzing funcs for knative.dev/serving types

For other examples see https://github.com/kubernetes/apimachinery/blob/master/pkg/apis/meta/fuzzer/fuzzer.go

Functions

func FuzzConditions

func FuzzConditions(accessor apis.ConditionsAccessor, c fuzz.Continue)

FuzzConditions fuzzes the values for the conditions. It doesn't add any new condition types

Consumers should initialize their conditions prior to fuzzing them. For example:

func(s *SomeStatus, c fuzz.Continue) {
  c.FuzzNoCustom(s) // fuzz the status object

  // Clear the random fuzzed condition
  s.Status.SetConditions(nil)

  // Fuzz the known conditions except their type value
  s.InitializeConditions()
  fuzz.Conditions(&s.Status, c)
}

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL