test

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2016 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Copyright 2016 The Rook Authors. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016 The Rook Authors. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016 The Rook Authors. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	SuccessfulMonStatusResponse = "{\"name\":\"mon0\",\"rank\":0,\"state\":\"leader\",\"election_epoch\":3,\"quorum\":[0],\"monmap\":{\"epoch\":1," +
		"\"fsid\":\"22ae0d50-c4bc-4cfb-9cf4-341acbe35302\",\"modified\":\"2016-09-16 04:21:51.635837\",\"created\":\"2016-09-16 04:21:51.635837\"," +
		"\"mons\":[{\"rank\":0,\"name\":\"mon0\",\"addr\":\"10.37.129.87:6790\"}]}}"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type MockConnection

type MockConnection struct {
	MockOpenIOContext func(pool string) (client.IOContext, error)
	MockMonCommand    func(args []byte) (buffer []byte, info string, err error)
}

/////////////////////////////////////////////////////////// implement the interface for connecting to the ceph cluster ///////////////////////////////////////////////////////////

func (*MockConnection) Connect

func (m *MockConnection) Connect() error

func (*MockConnection) MonCommand

func (m *MockConnection) MonCommand(args []byte) (buffer []byte, info string, err error)

func (*MockConnection) MonCommandWithInputBuffer

func (m *MockConnection) MonCommandWithInputBuffer(args, inputBuffer []byte) (buffer []byte, info string, err error)

func (*MockConnection) OpenIOContext

func (m *MockConnection) OpenIOContext(pool string) (client.IOContext, error)

func (*MockConnection) PingMonitor

func (m *MockConnection) PingMonitor(id string) (string, error)

func (*MockConnection) ReadConfigFile

func (m *MockConnection) ReadConfigFile(path string) error

func (*MockConnection) Shutdown

func (m *MockConnection) Shutdown()

type MockConnectionFactory

type MockConnectionFactory struct {
	Conn      *MockConnection
	Fsid      string
	SecretKey string
}

/////////////////////////////////////////////////////////// implement the interface for generating ceph connections ///////////////////////////////////////////////////////////

func (*MockConnectionFactory) NewConnWithClusterAndUser

func (m *MockConnectionFactory) NewConnWithClusterAndUser(clusterName string, userName string) (client.Connection, error)

func (*MockConnectionFactory) NewFsid

func (m *MockConnectionFactory) NewFsid() (string, error)

func (*MockConnectionFactory) NewSecretKey

func (m *MockConnectionFactory) NewSecretKey() (string, error)

type MockIOContext

type MockIOContext struct {
	MockGetImageNames func() (names []string, err error)
	MockGetImage      func(name string) client.Image
	MockCreateImage   func(name string, size uint64, order int, args ...uint64) (image client.Image, err error)
}

/////////////////////////////////////////////////////////// implement the interface for the ceph io context ///////////////////////////////////////////////////////////

func (*MockIOContext) CreateImage

func (m *MockIOContext) CreateImage(name string, size uint64, order int, args ...uint64) (image client.Image, err error)

func (*MockIOContext) GetImage

func (m *MockIOContext) GetImage(name string) client.Image

func (*MockIOContext) GetImageNames

func (m *MockIOContext) GetImageNames() (names []string, err error)

func (*MockIOContext) Pointer

func (m *MockIOContext) Pointer() uintptr

func (*MockIOContext) Read

func (m *MockIOContext) Read(oid string, data []byte, offset uint64) (int, error)

func (*MockIOContext) Write

func (m *MockIOContext) Write(oid string, data []byte, offset uint64) error

func (*MockIOContext) WriteFull

func (m *MockIOContext) WriteFull(oid string, data []byte) error

type MockImage

type MockImage struct {
	MockName string
	MockStat func() (info *client.ImageInfo, err error)
}

func (*MockImage) Close

func (i *MockImage) Close() error

func (*MockImage) Name

func (i *MockImage) Name() string

func (*MockImage) Open

func (i *MockImage) Open(args ...interface{}) error

func (*MockImage) Stat

func (i *MockImage) Stat() (info *client.ImageInfo, err error)

Jump to

Keyboard shortcuts

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