zfs

package
v1.12.0-RC2 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Copyright 2020 The OpenEBS Authors.

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 2020 The OpenEBS Authors.

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 2020 The OpenEBS Authors.

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

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TestConfig added in v1.12.0

type TestConfig struct {
	ZFSCommand          ZFSCommandError
	HealthyReplicas     int
	ProvisionedReplicas int
}

TestConfig holds the the test configuration based on this configuration zfs utility commands will return error

type VolumeMocker

type VolumeMocker struct {
	PoolName    string
	Compression string
	// TestConfig holds the Volume test related information
	TestConfig TestConfig
}

VolumeMocker contains the volume information which will helpful to execute zfs command

func (*VolumeMocker) GetProperty

func (volumeMocker *VolumeMocker) GetProperty(cmd string) ([]byte, error)

GetProperty mocks the zfs get command and returns the error based on the output TODO: Having GetProperty as a method will help to return desired value set for ZFS properties by the TestCase(As of now we are not setting in test configuration)

func (*VolumeMocker) GetStats added in v1.12.0

func (volumeMocker *VolumeMocker) GetStats(cmd string) ([]byte, error)

GetStats mocks the zfs stats command and returns the error based on the output

func (*VolumeMocker) ListProperty added in v1.12.0

func (volumeMocker *VolumeMocker) ListProperty(cmd string) ([]byte, error)

ListProperty mocks the zfs list command

type ZFSCommandError added in v1.12.0

type ZFSCommandError struct {
	ZFSStatsError bool
	ZFSGetError   bool
	ZFSListError  bool
}

ZfsCommandError used to inject the errors in various ZFS commands It will help to mock the zfs command behaviour

Jump to

Keyboard shortcuts

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