ndntestenv

package
v0.0.0-...-1e60831 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: NIST-PD-fallback Imports: 13 Imported by: 0

Documentation

Overview

Package ndntestenv contains helper functions to validate NDN packets in test code.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NameEqual

func NameEqual(a *assert.Assertions, expected, actual any, msgAndArgs ...any) bool

NameEqual asserts that actual name equals expected name. Name arguments can be string, Name, object with Name() method, or object with Name field.

func NameIsPrefix

func NameIsPrefix(a *assert.Assertions, prefix, name any, msgAndArgs ...any) bool

NameIsPrefix asserts that name starts with prefix. Name arguments can be string, Name, object with Name() method, or object with Name field.

Types

type Bridge

type Bridge struct {
	FwA, FwB     l3.Forwarder
	FaceA, FaceB l3.FwFace
	// contains filtered or unexported fields
}

Bridge links two l3.Forwarder and emulates a lossy link.

func NewBridge

func NewBridge(cfg BridgeConfig) (br *Bridge)

NewBridge creates a Bridge.

func (*Bridge) Close

func (br *Bridge) Close() error

Close detaches the link from forwarders.

type BridgeConfig

type BridgeConfig struct {
	FwA     l3.Forwarder
	FwB     l3.Forwarder
	RelayAB BridgeRelayConfig
	RelayBA BridgeRelayConfig
}

BridgeConfig contains Bridge parameters.

type BridgeRelayConfig

type BridgeRelayConfig struct {
	Loss     float64 // between 0.0 and 1.0
	MinDelay time.Duration
	MaxDelay time.Duration
}

BridgeRelayConfig contains Bridge link loss.

type L3FaceTester

type L3FaceTester struct {
	Count            int
	LossTolerance    float64
	InterestInterval time.Duration
	CloseDelay       time.Duration
}

L3FaceTester tests L3Face or Transport.

func (*L3FaceTester) CheckL3Face

func (c *L3FaceTester) CheckL3Face(t testing.TB, faceA, faceB l3.Face)

CheckL3Face tests a pair of connected L3Face.

func (*L3FaceTester) CheckTransport

func (c *L3FaceTester) CheckTransport(t testing.TB, trA, trB l3.Transport)

CheckTransport tests a pair of connected Transport.

type SignVerifyRecord

type SignVerifyRecord struct {
	PktA ndn.SignableVerifiable
	PktB ndn.SignableVerifiable
}

SignVerifyRecord contains signed packets.

type SignVerifyTester

type SignVerifyTester struct {
	PvtA, PvtB ndn.Signer
	PubA, PubB ndn.Verifier
	SameAB     bool
}

SignVerifyTester tests Signer and Verifier.

func (SignVerifyTester) Check

func (c SignVerifyTester) Check(t testing.TB, makePacket func(name ndn.Name) ndn.SignableVerifiable) (record SignVerifyRecord)

Check runs the test with given makePacket function.

func (SignVerifyTester) CheckData

func (c SignVerifyTester) CheckData(t testing.TB) (record SignVerifyRecord)

CheckData runs the test with Data packets.

func (SignVerifyTester) CheckInterest

func (c SignVerifyTester) CheckInterest(t testing.TB) (record SignVerifyRecord)

CheckInterest runs the test with non-parameterized Interest packets.

func (SignVerifyTester) CheckInterestParameterized

func (c SignVerifyTester) CheckInterestParameterized(t testing.TB) (record SignVerifyRecord)

CheckInterestParameterized runs the test with parameterized Interest packets.

Directories

Path Synopsis
Command tiny verifies that part of NDNgo library is compatible with TinyGo compiler.
Command tiny verifies that part of NDNgo library is compatible with TinyGo compiler.

Jump to

Keyboard shortcuts

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