compatibility

package
v0.0.0-...-648dfe1 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: Apache-2.0, BSD-3-Clause, MIT Imports: 9 Imported by: 0

README

Application Compatibility Tests

This directory contains compatibility tests used to automate the process of determining third-party application compatibility with gVisor over time.

To reduce iteration time, these tests are not a part of our CI/CD pipeline.

Application versions

The images used for each stack are in images/compatibility/<application>. The application version under test is determined by the Dockerfile present in these directories.

Running

First load the required images (built from images/compatibility/...):

make load-compatibility_gitea
# or load every image at once. this can take a while:
make load-compatibility

Then run the native baseline and the gVisor target. The Docker daemon must be running locally, and gVisor must be present as the runsc runtime:

make test TARGETS="//test/compatibility:gitea_native //test/compatibility:gitea_runsc"

Website

Soon the results from these tests will be listed on gvisor.dev.

Documentation

Overview

Package compatibility provides shared helpers for gVisor application compatibility tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(url string) (int, string, error)

Get is a convenience wrapper for a plain GET.

func Poll

func Poll(ctx context.Context, t *testing.T, desc string, timeout, interval time.Duration, cond func() error)

Poll repeatedly calls cond until it returns nil, failing the test (via t.Fatalf) if it has not succeeded within timeout. It waits interval between attempts.

This is the preferred way to wait for a stack to become ready: poll for a readiness signal (a health endpoint, an accepted connection, etc).

desc is a short human-readable description of what is being waited for, used in the timeout message (e.g. "gitea API to be ready").

func WriteConfigFile

func WriteConfigFile(t *testing.T, name, content string) string

WriteConfigFile writes content to a file named name in a fresh temporary directory and returns the file's absolute path.

Types

type Request

type Request struct {
	Method      string // defaults to GET.
	URL         string
	Body        string
	ContentType string
	Host        string // overrides the Host header if non-empty.
	Username    string // enables HTTP basic auth if non-empty.
	Password    string
	Headers     map[string]string
	// Timeout overrides the default client timeout for this request.
	// Zero uses the default from httpClient.
	Timeout time.Duration
}

Request describes an HTTP request issued by a compatibility test.

func (Request) Do

func (r Request) Do() (int, string, error)

Do issues the request and returns the response status code and body. A transport-level failure is returned as an error; an HTTP error status is not an error.

func (Request) DoOrFatal

func (r Request) DoOrFatal(t *testing.T, wantStatus int) string

DoOrFatal issues the request, failing the test on a transport error or if the status code is not wantStatus, and returns the response body.

Jump to

Keyboard shortcuts

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