nethelper

package
v0.0.0-...-9474aff Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2022 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Overview

Package nethelper provides functionality to support test execution by handling requests from various tests coming via network in context of ARC TAST test. arc_eth0 on port 1235 is used as communication point. This helper currently supports the following commands:

  • drop_caches - drops system caches, returns OK/FAILED.
  • receive_payload - receives payload from client, returns OK, ACK and payload.
  • get_total_memory_kb - gets total memory in KB from DUT, returns OK/FAILED and value.

Usage pattern is following:

conn, err := nethelper.Start(ctx)
if err != nil {
	s.Fatal("Failed to start nethelper", err)
}
defer conn.Close(ctx)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

type Connection struct {
	// contains filtered or unexported fields
}

Connection describes running socket server context.

func Start

func Start(ctx context.Context, port int) (*Connection, error)

Start starts socket server and returns connection descriptor.

func (*Connection) AddTcTbf

func (c *Connection) AddTcTbf(ctx context.Context, rate float64, latency, burst int) error

AddTcTbf adds up traffic control token bucket filter queuing discipling for the connection using speed rate (mbit), token latency (ms), and burst bucket size (kb).

func (*Connection) Close

func (c *Connection) Close(ctx context.Context) error

Close cleans up the connection descriptor.

Jump to

Keyboard shortcuts

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