test

package
v0.35.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Copyright © 2019 Portworx

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

func ExecuteCli

func ExecuteCli(cli string) ([]string, []string, error)

Execute cli and return string lists of standard out, standard error, and error if any. Callers must managage global variables using Patch from pkg/tests

func GenVolName

func GenVolName(prefix string) string

genVolName generates a unique name for a volume appended to a prefix

func PxTestCreateAggrVolume

func PxTestCreateAggrVolume(t *testing.T, volName string, size uint64, aggrLevel uint32)

Helper function to create volume with "aggregation level" flag set

func PxTestCreateClone

func PxTestCreateClone(t *testing.T, volId string, cloneName string)

Takes a volume name and clone name

func PxTestCreateEncrypVolume

func PxTestCreateEncrypVolume(t *testing.T, volName string, size uint64)

Helper function to create volume with "encryption" flag set

func PxTestCreateIoProfVolume

func PxTestCreateIoProfVolume(t *testing.T, volName string, size uint64, IoProfile string)

Helper function to create volume with "io profile" flag set

func PxTestCreateJournalVolume

func PxTestCreateJournalVolume(t *testing.T, volName string, size uint64)

Helper function to create volume with "journal" flag set

func PxTestCreateSnapshot

func PxTestCreateSnapshot(t *testing.T, volId string, snapName string)

Takes a volume name and snapshot name

func PxTestCreateStickyVolume

func PxTestCreateStickyVolume(t *testing.T, volName string, size uint64)

Helper function to create volume with "sticky" flag set

func PxTestCreateVolume

func PxTestCreateVolume(t *testing.T, volName string, size uint64)

Takes a volume name and size. Returns the created volume id. For some reason our test container only recoganizes id and not name for some calls.

func PxTestCreateVolumeSnap added in v0.22.0

func PxTestCreateVolumeSnap(t *testing.T, volName string, policy string)

func PxTestCreateVolumeWithAccess

func PxTestCreateVolumeWithAccess(t *testing.T, volName string, size uint64, groups string, collaborators string)

Helper function to create volume with access (--groups and --collaborators) flag set

func PxTestCreateVolumeWithLabel

func PxTestCreateVolumeWithLabel(t *testing.T, volName string, size uint64, labels string)

Takes a volume name and size. Returns the created volume id.

func PxTestDeleteVolume

func PxTestDeleteVolume(t *testing.T, volName string)

Deletes specified volume

func PxTestGetAllVolumes

func PxTestGetAllVolumes(t *testing.T) []string

Returns a list of all volume ids TODO: We may need to bring this back to the TestXXX functions

depending on what it does, because the output would be
parse, and as a library function, it may be easier to
get a specific volume.

func PxTestGetVolumeWithLabels

func PxTestGetVolumeWithLabels(t *testing.T, selector string) (*bytes.Buffer, error)

func PxTestGetVolumeWithNameSelector

func PxTestGetVolumeWithNameSelector(t *testing.T, volName string, selector string)

func PxTestHasVolume

func PxTestHasVolume(id string) bool

Takes a volume id assert volume exists

func PxTestPatchVolumeAddCollaborators

func PxTestPatchVolumeAddCollaborators(t *testing.T, volName string, collaborators string)

func PxTestPatchVolumeAddGroups

func PxTestPatchVolumeAddGroups(t *testing.T, volName string, groups string)

func PxTestPatchVolumeAsyncIo added in v0.22.0

func PxTestPatchVolumeAsyncIo(t *testing.T, volName string, value string)

func PxTestPatchVolumeEarlyAck added in v0.22.0

func PxTestPatchVolumeEarlyAck(t *testing.T, volName string, value string)

func PxTestPatchVolumeHalevel

func PxTestPatchVolumeHalevel(t *testing.T, volName string, haLevel int)

func PxTestPatchVolumeHalevelWithNodes

func PxTestPatchVolumeHalevelWithNodes(t *testing.T, volName string, haLevel int64, node string)

func PxTestPatchVolumeIoProfile added in v0.22.0

func PxTestPatchVolumeIoProfile(t *testing.T, volName string, profile string)

func PxTestPatchVolumeNoDiscard added in v0.22.0

func PxTestPatchVolumeNoDiscard(t *testing.T, volName string, value string)

func PxTestPatchVolumeRemoveAllCollaborators

func PxTestPatchVolumeRemoveAllCollaborators(t *testing.T, volName string)

func PxTestPatchVolumeRemoveAllGroups

func PxTestPatchVolumeRemoveAllGroups(t *testing.T, volName string)

func PxTestPatchVolumeRemoveCollaborators

func PxTestPatchVolumeRemoveCollaborators(t *testing.T, volName string, collaborators string)

func PxTestPatchVolumeRemoveGroups

func PxTestPatchVolumeRemoveGroups(t *testing.T, volName string, groups string)

func PxTestPatchVolumeResize

func PxTestPatchVolumeResize(t *testing.T, volName string, size uint64)

func PxTestPatchVolumeShared

func PxTestPatchVolumeShared(t *testing.T, volName string, shared string)

func PxTestSetupCli

func PxTestSetupCli(args string) (*bytes.Buffer, *bytes.Buffer, tests.Restorer)

Returns a buffer for stdout, stderr, and a function. The function should be used as a defer to restore the state See status_test.go for an example

func PxTestVolumeInfo

func PxTestVolumeInfo(t *testing.T, id string) *api.Volume

Return volume information TODO: If necessary, we can do a `pxc volume list <id> -o json` then

      unmarshal the JSON to appropriate object
		 then return the &api.Volume inside of it.

func RunPx

func RunPx() error

runPx runs a command saved in os.Args and returns the error if any

Types

This section is empty.

Jump to

Keyboard shortcuts

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