fuzz

package
v0.0.0-...-bf59ace Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Copyright 2024 Red Hat, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CAPI2MAPIMachineRoundTripFuzzTest

func CAPI2MAPIMachineRoundTripFuzzTest(scheme *runtime.Scheme, infra *configv1.Infrastructure, infraCluster, infraMachine client.Object, mapiConverter MAPI2CAPIMachineConverterConstructor, capiConverter CAPI2MAPIMachineConverterConstructor, fuzzerFuncs ...fuzzer.FuzzerFuncs)

CAPI2MAPIMachineRoundTripFuzzTest is a generic test that can be used to test roundtrip conversion between CAPI and MAPI Machine objects. It leverages fuzz testing to generate random CAPI objects and then converts them to MAPI objects and back to CAPI objects. The test then compares the original CAPI object with the final CAPI object to ensure that the conversion is lossless. Any lossy conversions must be accounted for within the fuzz functions passed in.

func CAPI2MAPIMachineSetRoundTripFuzzTest

func CAPI2MAPIMachineSetRoundTripFuzzTest(scheme *runtime.Scheme, infra *configv1.Infrastructure, infraCluster, infraMachineTemplate client.Object, mapiConverter MAPI2CAPIMachineSetConverterConstructor, capiConverter CAPI2MAPIMachineSetConverterConstructor, fuzzerFuncs ...fuzzer.FuzzerFuncs)

CAPI2MAPIMachineSetRoundTripFuzzTest is a generic test that can be used to test roundtrip conversion between CAPI and MAPI MachineSet objects. It leverages fuzz testing to generate random CAPI objects and then converts them to MAPI objects and back to CAPI objects. The test then compares the original CAPI object with the final CAPI object to ensure that the conversion is lossless. Any lossy conversions must be accounted for within the fuzz functions passed in.

func CAPIMachineFuzzerFuncs

func CAPIMachineFuzzerFuncs(providerIDFuzz StringFuzzer, infraKind, infraAPIVersion, clusterName string) fuzzer.FuzzerFuncs

CAPIMachineFuzzerFuncs returns a set of fuzzer functions that can be used to fuzz MachineSpec objects.

func CAPIMachineSetFuzzerFuncs

func CAPIMachineSetFuzzerFuncs(infraTemplateKind, infraAPIVersion, clusterName string) fuzzer.FuzzerFuncs

CAPIMachineSetFuzzerFuncs returns a set of fuzzer functions that can be used to fuzz MachineSetSpec objects.

func MAPI2CAPIMachineRoundTripFuzzTest

func MAPI2CAPIMachineRoundTripFuzzTest(scheme *runtime.Scheme, infra *configv1.Infrastructure, infraCluster client.Object, mapiConverter MAPI2CAPIMachineConverterConstructor, capiConverter CAPI2MAPIMachineConverterConstructor, fuzzerFuncs ...fuzzer.FuzzerFuncs)

MAPI2CAPIMachineRoundTripFuzzTest is a generic test that can be used to test roundtrip conversion between MAPI and CAPI Machine objects. It leverages fuzz testing to generate random MAPI objects and then converts them to CAPI objects and back to MAPI objects. The test then compares the original MAPI object with the final MAPI object to ensure that the conversion is lossless. Any lossy conversions must be accounted for within the fuzz functions passed in.

func MAPI2CAPIMachineSetRoundTripFuzzTest

func MAPI2CAPIMachineSetRoundTripFuzzTest(scheme *runtime.Scheme, infra *configv1.Infrastructure, infraCluster client.Object, mapiConverter MAPI2CAPIMachineSetConverterConstructor, capiConverter CAPI2MAPIMachineSetConverterConstructor, fuzzerFuncs ...fuzzer.FuzzerFuncs)

MAPI2CAPIMachineSetRoundTripFuzzTest is a generic test that can be used to test roundtrip conversion between MAPI and CAPI MachineSet objects. It leverages fuzz testing to generate random MAPI objects and then converts them to CAPI objects and back to MAPI objects. The test then compares the original MAPI object with the final MAPI object to ensure that the conversion is lossless. Any lossy conversions must be accounted for within the fuzz functions passed in.

func MAPIMachineFuzzerFuncs

func MAPIMachineFuzzerFuncs(providerSpec runtime.Object, providerIDFuzz StringFuzzer) fuzzer.FuzzerFuncs

MAPIMachineFuzzerFuncs returns a set of fuzzer functions that can be used to fuzz MachineSpec objects. The providerSpec should be a pointer to a providerSpec type for the platform being tested. This will be fuzzed and then injected into the MachineSpec as a RawExtension. The providerIDFuzz function should be a function that returns a valid providerID for the platform being tested.

func MAPIMachineSetFuzzerFuncs

func MAPIMachineSetFuzzerFuncs() fuzzer.FuzzerFuncs

MAPIMachineSetFuzzerFuncs returns a set of fuzzer functions that can be used to fuzz MachineSetSpec objects. This function relies on the MachineSpec fuzzer functions to fuzz the MachineTemplateSpec.

func ObjectMetaFuzzerFuncs

func ObjectMetaFuzzerFuncs(namespace string) fuzzer.FuzzerFuncs

ObjectMetaFuzzerFuncs returns a set of fuzzer functions that can be used to fuzz ObjectMeta objects. The namespace is forced to the provided namespace as the conversion always sets specific namespaces. Fields that are not required for conversion are cleared.

Types

type CAPI2MAPIMachineConverterConstructor

type CAPI2MAPIMachineConverterConstructor func(*capiv1.Machine, client.Object, client.Object) capi2mapi.MachineAndInfrastructureMachine

CAPI2MAPIMachineConverterConstructor is a function that constructs a CAPI to MAPI Machine converter. Since the CAPI to MAPI conversion relies on different types, it is expected that the constructor is wrapped in a closure that handles type assertions to fit the interface.

type CAPI2MAPIMachineSetConverterConstructor

type CAPI2MAPIMachineSetConverterConstructor func(*capiv1.MachineSet, client.Object, client.Object) capi2mapi.MachineSetAndMachineTemplate

CAPI2MAPIMachineSetConverterConstructor is a function that constructs a CAPI to MAPI MachineSet converter. Since the CAPI to MAPI conversion relies on different types, it is expected that the constructor is wrapped in a closure that handles type assertions to fit the interface.

type MAPI2CAPIMachineConverterConstructor

type MAPI2CAPIMachineConverterConstructor func(*mapiv1.Machine, *configv1.Infrastructure) mapi2capi.Machine

MAPI2CAPIMachineConverterConstructor is a function that constructs a MAPI to CAPI Machine converter.

type MAPI2CAPIMachineSetConverterConstructor

type MAPI2CAPIMachineSetConverterConstructor func(*mapiv1.MachineSet, *configv1.Infrastructure) mapi2capi.MachineSet

MAPI2CAPIMachineSetConverterConstructor is a function that constructs a MAPI to CAPI MachineSet converter.

type StringFuzzer

type StringFuzzer func(fuzz.Continue) string

StringFuzzer is a function that returns a random string.

Jump to

Keyboard shortcuts

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