servodserver

package
v0.0.0-...-f4b31ea Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2025 License: BSD-3-Clause Imports: 36 Imported by: 0

Documentation

Overview

Package servodserver implements servod_service.proto (see proto for details)

Package servodserver implements servod_service.proto (see proto for details)

Index

Constants

View Source
const (
	SatlabRPCServer = "satlab_rpcserver:6003"
)

Variables

This section is empty.

Functions

func SaveServoLog

func SaveServoLog(ctx context.Context, servoHost, dockerContainer string, servoPorts []int32,
	sshClient *ssh.Client, dst string, l *log.Logger) error

SaveServoLog save logs from servo and servo host. TODO: Change the interface to get connection directly instead of passing the servoHost.

Types

type ServodService

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

ServodService implementation of servod_service.proto

func NewServodService

func NewServodService(ctx context.Context, logger *log.Logger, commandexecutor commandexecutor.CommandExecutorInterface) (*ServodService, func(), error)

NewServodService creates a new servod service.

func (*ServodService) CallServod

CallServod runs a servod command through an XML-RPC call. It runs the command inside the servod Docker container if the servod_docker_container_name parameter is provided in the request. Otherwise, it runs the command directly inside the host that the servo is physically connected to. Allowed methods: doc, get, set, and hwinit.

func (*ServodService) ExecCmd

ExecCmd executes a system command that is provided through the command parameter in the request. It allows the user to execute arbitrary commands that can't be handled by calling servod (e.g. update firmware through "futility", remote file copy through "scp"). It executes the command inside the servod Docker container if the servod_docker_container_name parameter is provided in the request. Otherwise, it executes the command directly inside the host that the servo is physically connected to.

func (*ServodService) LogCheckPoint

LogCheckPoint will create checkpoint certain files so that some files can be saved partially when SaveLogs is called. For example, /var/log/messages in a labstation can be very big and include information from a few days ago. Getting the checkpoint of the current /var/log/messages will allow SaveLogs to save the portion only relevant to the current testing session.

func (*ServodService) RunCli

func (s *ServodService) RunCli(cs model.CliSubcommand, a model.CliArgs, stdin io.Reader, routeToStd bool) (bytes.Buffer, bytes.Buffer, error)

RunCli runs servod service as execution by CLI.

func (*ServodService) SaveLogs

SaveLogs will save servod related logs on the host that this service is running. Logs include:

/var/log/message from the servod host.
/var/log/servod_<port>/ latest.DEBUG from servod host.
/var/log/servod_<port>.STARTUP.log from servod host.
The output of  "dmesg -H"  from the servod host.
The extraction of the MCU console logs from latest.DEBUG

func (*ServodService) StartServer

func (s *ServodService) StartServer(port int32) error

StartServer starts servod server on requested port

func (*ServodService) StartServo

func (s *ServodService) StartServo(a model.CliArgs) error

func (*ServodService) StartServod

StartServod runs a servod Docker container and starts the servod daemon inside the container if servod is containerized. Otherwise, it simply starts the servod daemon.

func (*ServodService) StopServod

StopServod stops the servod daemon inside the container and stops the servod Docker container if servod is containerized. Otherwise, it simply stops the servod daemon.

Jump to

Keyboard shortcuts

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