testconfig

package
v0.0.0-...-64dc4c4 Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// DualNICBoundaryClockString matches the Discovery clock mode in Environement
	DiscoveryString = "Discovery"

	// NoneString matches empty environment variable
	NoneString = ""
	// StartString Stringer value for the start status
	StartString = "Start"
	// InitStatusString Stringer value for the init status
	InitStatusString = "init"
	// ConfiguredStatusString Stringer value for the configured status
	ConfiguredStatusString = "configured"
	// DiscoverySuccessStatusString Stringer value for the Discovery Success status
	DiscoverySuccessStatusString = "discoverySuccess"
	// DiscoveryFailureStatusString Stringer value for the Discovery failure status
	DiscoveryFailureStatusString = "discoveryFailure"
	PtpLinuxDaemonNamespace      = "openshift-ptp"

	// OrdinaryClockString matches the OC clock mode in Environement
	OrdinaryClockString = "OC"
	// BoundaryClockString matches the BC clock mode in Environement
	BoundaryClockString = "BC"
	// DualNICBoundaryClockString matches the DualNICBC clock mode in Environement
	DualNICBoundaryClockString = "DualNICBC"

	SCHED_OTHER = "SCHED_OTHER"
	SCHED_FIFO  = "SCHED_FIFO"
)
View Source
const (
	AlgoOCString                       = "OC"
	AlgoBCString                       = "BC"
	AlgoBCWithSlavesString             = "BCWithSlaves"
	AlgoDualNicBCString                = "DualNicBC"
	AlgoDualNicBCWithSlavesString      = "DualNicBCWithSlaves"
	AlgoOCExtGMString                  = "OCExtGM"
	AlgoBCExtGMString                  = "BCExtGM"
	AlgoDualNicBCExtGMString           = "DualNicBCExtGM"
	AlgoBCWithSlavesExtGMString        = "BCWithSlavesExtGM"
	AlgoDualNicBCWithSlavesExtGMString = "DualNicBCWithSlavesExtGM"
)
View Source
const BasePtp4lConfig = `[global]
tx_timestamp_timeout 50
ptp_dst_mac 01:1B:19:00:00:00
p2p_dst_mac 01:80:C2:00:00:0E
domainNumber 24
logging_level 7`
View Source
const FirstSolution = 0
View Source
const NumTestClockRoles = 7

Variables

This section is empty.

Functions

func AddInterface

func AddInterface(ptpConfig, iface string, masterOnly int) (updatedPtpConfig string)

helper function to add an interface to the ptp4l config

func CreatePtpConfigBC

func CreatePtpConfigBC(policyName, nodeName, ifMasterName, ifSlaveName string, phc2sys bool) (err error)

func CreatePtpConfigGrandMaster

func CreatePtpConfigGrandMaster(nodeName, ifName string) error

func CreatePtpConfigOC

func CreatePtpConfigOC(profileName, nodeName, ifSlaveName string, phc2sys bool, label string) (err error)

func CreatePtpConfigurations

func CreatePtpConfigurations() error

Create ptpconfigs

func PtpConfigBC

func PtpConfigBC(isExtGM bool) error

func PtpConfigDualNicBC

func PtpConfigDualNicBC(isExtGM bool) error

func PtpConfigOC

func PtpConfigOC(isExtGM bool) error

func Reset

func Reset()

resets the test configuration

Types

type ConfigStatus

type ConfigStatus int64
const (
	// Start starting status when object is created
	Start ConfigStatus = iota
	// InitStatus the configuration environment variable was read
	InitStatus
	// ConfiguredStatus for OC/BC/DuallinkBC modes this is set after the ptp clock is configured
	ConfiguredStatus
	// DiscoverySuccessStatus for all modes, indicates a successful discovery
	DiscoverySuccessStatus
	// DiscoveryFailureStatus for all modes, indicates a discovery failure
	DiscoveryFailureStatus
)

func (ConfigStatus) String

func (status ConfigStatus) String() string

type PTPMode

type PTPMode int64
const (
	// OrdinaryClock OrdinaryClock mode
	OrdinaryClock PTPMode = iota
	// BoundaryClock Boundary Clock mode
	BoundaryClock
	// DualNICBoundaryClock DualNIC Boundary Clock mode
	DualNICBoundaryClock
	// Discovery Discovery mode
	Discovery
	// None initial empty mode
	None
)

func StringToMode

func StringToMode(aString string) PTPMode

func (PTPMode) String

func (mode PTPMode) String() string

type TestConfig

type TestConfig struct {
	PtpModeDesired    PTPMode
	PtpModeDiscovered PTPMode
	Status            ConfigStatus
	DiscoveredGrandMasterPtpConfig,
	DiscoveredSlave1PtpConfig,
	DiscoveredSlave2PtpConfig,
	DiscoveredClockUnderTestPtpConfig,
	DiscoveredClockUnderTestSecondaryPtpConfig *ptpDiscoveryRes
	DiscoveredClockUnderTestPod *v1core.Pod
	L2Config                    l2lib.L2Info
	FoundSolutions              map[string]bool
	PtpEventsIsSidecarReady     bool
}
var GlobalConfig TestConfig

func GetDesiredConfig

func GetDesiredConfig(forceUpdate bool) TestConfig

Gets te desired configuration from the environment

func GetFullDiscoveredConfig

func GetFullDiscoveredConfig(namespace string, forceUpdate bool) TestConfig

Gets the discovered configuration

func (*TestConfig) String

func (obj *TestConfig) String() (out string)

type TestIfClockRoles

type TestIfClockRoles int

indicates the clock roles in the algotithms

const (
	Grandmaster TestIfClockRoles = iota
	Slave1
	Slave2
	BC1Master
	BC1Slave
	BC2Master
	BC2Slave
)

Jump to

Keyboard shortcuts

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