servetest

package
v1.75.0 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package servetest provides infrastructure for running loopback tests of "rclone serve backend:" against the backend integration tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEphemeralPort added in v1.70.0

func GetEphemeralPort(t *testing.T) string

GetEphemeralPort opens a listening port on localhost:0, closes it, and returns the address as "localhost:port".

func Run

func Run(t *testing.T, name string, start StartFn)

Run runs the server then runs the unit tests for the remote against it. The backing Fs is a fresh local directory.

func RunWithBackend added in v1.75.0

func RunWithBackend(t *testing.T, name string, start StartFn, backingRemote string)

RunWithBackend behaves like Run but uses the supplied remote (e.g. "TestS3Minio:") as the backing Fs that the server wraps, instead of a fresh local directory. When backingRemote is empty it is equivalent to Run.

AuthProxy is only run when backingRemote is empty: the test proxy in proxy_code.go hardcodes type=local, so it cannot be used with a non-local backing.

func TestRc added in v1.70.0

func TestRc(t *testing.T, in rc.Params)

TestRc tests the rc interface for the servers

in should contain any options necessary however this code will add "fs", "addr".

Types

type StartFn

type StartFn func(f fs.Fs) (configmap.Simple, func())

StartFn describes the callback which should start the server with the Fs passed in. It should return a config for the backend used to connect to the server and a clean up function

Jump to

Keyboard shortcuts

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