Documentation ¶
Index ¶
- Variables
- func Debug(t *testing.T, driverName string, config []byte, tests ...APITestFunc)
- func DebugGroup(t *testing.T, driverName string, config []byte, tests ...APITestFunc)
- func LogAsJSON(i interface{}, t *testing.T)
- func Run(t *testing.T, driverName string, config []byte, tests ...APITestFunc)
- func RunGroup(t *testing.T, driverName string, config []byte, tests ...APITestFunc)
- type APITestFunc
- type InstanceIDTest
- type InstanceTest
- type LocalDevicesTest
- type NextDeviceTest
Constants ¶
This section is empty.
Variables ¶
var TestExecutors = func( config gofig.Config, client types.Client, t *testing.T) { reply, err := client.API().Executors(nil) if err != nil { t.Fatal(err) } assertLSXLinux(t, reply["lsx-linux"]) assertLSXDarwin(t, reply["lsx-darwin"]) }
TestExecutors tests the GET /executors route.
var TestGetExecutorDarwin = func( config gofig.Config, client types.Client, t *testing.T) { reply, err := client.API().ExecutorGet(nil, "lsx-darwin") if err != nil { t.Fatal(err) } defer reply.Close() buf, err := ioutil.ReadAll(reply) if err != nil { t.Fatal(err) } assert.EqualValues(t, lsxDarwinInfo.Size, len(buf)) }
TestGetExecutorDarwin tests the GET /executors/lsx-darwin route.
var TestGetExecutorLinux = func( config gofig.Config, client types.Client, t *testing.T) { reply, err := client.API().ExecutorGet(nil, "lsx-linux") if err != nil { t.Fatal(err) } defer reply.Close() buf, err := ioutil.ReadAll(reply) if err != nil { t.Fatal(err) } assert.EqualValues(t, lsxLinuxInfo.Size, len(buf)) }
TestGetExecutorLinux tests the GET /executors/lsx-linux route.
var TestHeadExecutorDarwin = func( config gofig.Config, client types.Client, t *testing.T) { reply, err := client.API().ExecutorHead(nil, "lsx-darwin") if err != nil { t.Fatal(err) } assertLSXDarwin(t, reply) }
TestHeadExecutorDarwin tests the HEAD /executors/lsx-darwin route.
var TestHeadExecutorLinux = func( config gofig.Config, client types.Client, t *testing.T) { reply, err := client.API().ExecutorHead(nil, "lsx-linux") if err != nil { t.Fatal(err) } assertLSXLinux(t, reply) }
TestHeadExecutorLinux tests the HEAD /executors/lsx-linux route.
var TestRoot = func(config gofig.Config, client types.Client, t *testing.T) { reply, err := client.API().Root(nil) if err != nil { t.Fatal(err) } assert.Equal(t, len(reply), 5) }
TestRoot tests the GET / route.
Functions ¶
func Debug ¶
func Debug( t *testing.T, driverName string, config []byte, tests ...APITestFunc)
Debug is the same as Run except with additional logging.
func DebugGroup ¶
func DebugGroup( t *testing.T, driverName string, config []byte, tests ...APITestFunc)
DebugGroup is the same as RunGroup except with additional logging.
Types ¶
type APITestFunc ¶
APITestFunc is a function that wraps a block of test logic for testing the API. An APITestFunc is executed four times:
1 - tcp 2 - tcp+tls 3 - sock 4 - sock+tls
type InstanceIDTest ¶
type InstanceIDTest struct { // Driver is the name of the driver/executor for which to get the instance // ID. Driver string // Expected is the expected instance ID value. Expected *types.InstanceID }
InstanceIDTest is the test harness for testing the instance ID.
type InstanceTest ¶
type InstanceTest struct { // Driver is the name of the driver/executor for which to inspect the // instance. Driver string // Expected is the expected instance. Expected *types.Instance }
InstanceTest is the test harness for testing instance inspection.
type LocalDevicesTest ¶
type LocalDevicesTest struct { // Driver is the name of the driver/executor for which to get the local // devices. Driver string // Expected is the expected local devices. Expected *types.LocalDevices }
LocalDevicesTest is the test harness for testing getting the local devices.
type NextDeviceTest ¶
type NextDeviceTest struct { // Driver is the name of the driver/executor for which to get the next // device. Driver string // Expected is the expected next device. Expected string }
NextDeviceTest is the test harness for testing getting the next device.