test/

directory
v0.0.0-...-9e0e42b Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: Apache-2.0, MIT

README

Tests

The tests defined under this path are verifying functionality beyond what unit tests can cover, e.g. integration and end to end tests. Due to their nature, they may need extra setup in the test machine and extra configuration to run.

  • syscalls: system call tests use a local runner, and do not require additional configuration in the machine.
  • integration: defines integration tests that uses docker run to test functionality.
  • image: basic end to end test for popular images. These require the same setup as integration tests.
  • root: tests that require to be run as root. These require the same setup as integration tests.
  • util: utilities library to support the tests.

For the above noted cases, the relevant runtime must be installed via runsc install before running. Just note that they require specific configuration to work. This is handled automatically by the test scripts in the scripts directory and they can be used to run tests locally on your machine. They are also used to run these tests in kokoro.

Example:

To run image and integration tests, run:

make docker-tests

To run root tests, run:

make sudo TARGETS=test/root:root_test

There are a few other interesting variations for image and integration tests:

  • overlay: sets writable overlay inside the sentry
  • hostnet: configures host network pass-thru, instead of netstack
  • kvm: runsc the test using the KVM platform, instead of systrap

The test will build runsc, configure it with your local docker, restart dockerd, and run tests. The location for runsc logs is printed to the output.

Directories

Path Synopsis
benchmarks
base
Package base holds utility methods common to the base tests.
Package base holds utility methods common to the base tests.
database
Package database holds benchmarks around database applications.
Package database holds benchmarks around database applications.
fs/fsbench
Package fsbench provides utility functions for filesystem benchmarks.
Package fsbench provides utility functions for filesystem benchmarks.
harness
Package harness holds utility code for running benchmarks on Docker.
Package harness holds utility code for running benchmarks on Docker.
media
Package media holds benchmarks around media processing applications.
Package media holds benchmarks around media processing applications.
ml
Package ml holds benchmarks around machine learning performance.
Package ml holds benchmarks around machine learning performance.
network
Package network holds benchmarks around raw network performance.
Package network holds benchmarks around raw network performance.
tcp
Binary tcp_proxy is a simple TCP proxy.
Binary tcp_proxy is a simple TCP proxy.
tools
Package tools holds tooling to couple command formatting and output parsers together.
Package tools holds tooling to couple command formatting and output parsers together.
cmd
test_app
Binary test_app is like a swiss knife for tests that need to run anything inside the sandbox.
Binary test_app is like a swiss knife for tests that need to run anything inside the sandbox.
Package integration is empty.
Package integration is empty.
Package fsstress is empty.
Package fsstress is empty.
gpu
ollama
Package ollama provides an Ollama API client.
Package ollama provides an Ollama API client.
stablediffusion
Package stablediffusion provides utilities to generate images with Stable Diffusion.
Package stablediffusion provides utilities to generate images with Stable Diffusion.
Package image is empty.
Package image is empty.
Package iptables contains a set of iptables tests implemented as TestCases
Package iptables contains a set of iptables tests implemented as TestCases
runner
Package main runs iptables tests from within a docker container.
Package main runs iptables tests from within a docker container.
Package kubernetes contains utilities for gVisor tests.
Package kubernetes contains utilities for gVisor tests.
benchmarks/httpbench
Package httpbench provides a library for benchmarking an HTTP server.
Package httpbench provides a library for benchmarking an HTTP server.
benchmarks/profiling
Package profiling helps with getting profiles from running benchmarks.
Package profiling helps with getting profiles from running benchmarks.
benchmetric
Package benchmetric provides utilities for benchmark metrics.
Package benchmetric provides utilities for benchmark metrics.
k8sctx
Package k8sctx is used to manage the lifecycle of a Kubernetes test or benchmark running in one or more Kubernetes clusters.
Package k8sctx is used to manage the lifecycle of a Kubernetes test or benchmark running in one or more Kubernetes clusters.
testcluster
Package testcluster wraps the Kubernetes library for common test operations.
Package testcluster wraps the Kubernetes library for common test operations.
Package metricclient provides utility functions to start, stop, and talk to a metric server.
Package metricclient provides utility functions to start, stop, and talk to a metric server.
Package metricsviz charts profiling metrics data and renders them to HTML.
Package metricsviz charts profiling metrics data and renders them to HTML.
metricsviz_cli
metricsviz_cli visualizes metrics from profiling metrics logs.
metricsviz_cli visualizes metrics from profiling metrics logs.
packetimpact
dut
Package dut provides common definitions and utilities to be shared by DUTs.
Package dut provides common definitions and utilities to be shared by DUTs.
dut/linux
Package linux provides utilities specific to bringing up linux DUTs.
Package linux provides utilities specific to bringing up linux DUTs.
dut/native
The native binary is used to bring up a native linux DUT.
The native binary is used to bring up a native linux DUT.
dut/runsc
The devid binary is used to get the device ID in the runsc container.
The devid binary is used to get the device ID in the runsc container.
internal/testing
Package testing provides common testing functionalities.
Package testing provides common testing functionalities.
netdevs/netlink
Package netlink has routines to get interfaces information through netlink.
Package netlink has routines to get interfaces information through netlink.
runner
The runner binary is used as the test runner for PacketImpact tests.
The runner binary is used as the test runner for PacketImpact tests.
testbench
Package testbench has utilities to send and receive packets, and also command the DUT to run POSIX functions.
Package testbench has utilities to send and receive packets, and also command the DUT to run POSIX functions.
Package root is used for tests that requires sysadmin privileges run.
Package root is used for tests that requires sysadmin privileges run.
rtnetlink
linux
tcp_serv creates a TCP server socket, reads data from stdin, and sends that data to the socket.
tcp_serv creates a TCP server socket, reads data from stdin, and sends that data to the socket.
Binary syscall_test_runner runs the syscall test suites in gVisor containers and on the host platform.
Binary syscall_test_runner runs the syscall test suites in gVisor containers and on the host platform.
fuse
Binary main starts a fuse server that forwards filesystem operations from /tmp to /fuse.
Binary main starts a fuse server that forwards filesystem operations from /tmp to /fuse.
gtest
Package gtest contains helpers for running google-test tests from Go.
Package gtest contains helpers for running google-test tests from Go.
runtimes
proctor
Binary proctor runs the test for a particular runtime.
Binary proctor runs the test for a particular runtime.
proctor/lib
Package lib contains proctor functions.
Package lib contains proctor functions.
runner
Binary runner runs the runtime tests in a Docker container.
Binary runner runs the runtime tests in a Docker container.
runner/lib
Package lib provides utilities for runner.
Package lib provides utilities for runner.
secbench
secbenchdef
Package secbenchdef contains struct definitions for secbench benchmarks.
Package secbenchdef contains struct definitions for secbench benchmarks.
Package secfuzz allows fuzz-based testing of seccomp-bpf programs.
Package secfuzz allows fuzz-based testing of seccomp-bpf programs.
Package trace is empty.
Package trace is empty.
config
Package config providides helper functions to configure trace sessions.
Package config providides helper functions to configure trace sessions.
Package uds contains helpers for testing external UDS functionality.
Package uds contains helpers for testing external UDS functionality.

Jump to

Keyboard shortcuts

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