Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
f9684998
Unverified
Commit
f9684998
authored
Feb 12, 2019
by
Kubernetes Prow Robot
Committed by
GitHub
Feb 12, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #72002 from pohly/storage-volume-testsuites-concurrency
E2E storage: more tests for different pod/node combinations
parents
64ce2e59
ecc0c4e4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
141 additions
and
100 deletions
+141
-100
csi_volumes.go
test/e2e/storage/csi_volumes.go
+23
-15
csi.go
test/e2e/storage/drivers/csi.go
+4
-2
regional_pd.go
test/e2e/storage/regional_pd.go
+19
-17
base.go
test/e2e/storage/testsuites/base.go
+23
-24
provisioning.go
test/e2e/storage/testsuites/provisioning.go
+0
-0
snapshottable.go
test/e2e/storage/testsuites/snapshottable.go
+15
-15
testdriver.go
test/e2e/storage/testsuites/testdriver.go
+7
-0
volume_provisioning.go
test/e2e/storage/volume_provisioning.go
+50
-27
No files found.
test/e2e/storage/csi_volumes.go
View file @
f9684998
...
...
@@ -261,9 +261,11 @@ var _ = utils.SIGDescribe("CSI Volumes", func() {
Parameters
:
sc
.
Parameters
,
ClaimSize
:
"1Gi"
,
ExpectedSize
:
"1Gi"
,
NodeName
:
nodeName
,
}
class
,
claim
,
pod
:=
startPausePod
(
cs
,
scTest
,
ns
.
Name
)
nodeSelection
:=
testsuites
.
NodeSelection
{
Name
:
nodeName
,
}
class
,
claim
,
pod
:=
startPausePod
(
cs
,
scTest
,
nodeSelection
,
ns
.
Name
)
if
class
!=
nil
{
defer
cs
.
StorageV1
()
.
StorageClasses
()
.
Delete
(
class
.
Name
,
nil
)
}
...
...
@@ -381,16 +383,16 @@ var _ = utils.SIGDescribe("CSI Volumes", func() {
Parameters
:
sc
.
Parameters
,
ClaimSize
:
"1Gi"
,
ExpectedSize
:
"1Gi"
,
// The mock driver only works when everything runs on a single node.
NodeName
:
nodeName
,
// Provisioner and storage class name must match what's used in
// csi-storageclass.yaml, plus the test-specific suffix.
Provisioner
:
sc
.
Provisioner
,
StorageClassName
:
"csi-mock-sc-"
+
f
.
UniqueName
,
// Mock driver does not provide any persistency.
SkipWriteReadCheck
:
true
,
}
class
,
claim
,
pod
:=
startPausePod
(
cs
,
scTest
,
ns
.
Name
)
nodeSelection
:=
testsuites
.
NodeSelection
{
// The mock driver only works when everything runs on a single node.
Name
:
nodeName
,
}
class
,
claim
,
pod
:=
startPausePod
(
cs
,
scTest
,
nodeSelection
,
ns
.
Name
)
if
class
!=
nil
{
defer
cs
.
StorageV1
()
.
StorageClasses
()
.
Delete
(
class
.
Name
,
nil
)
}
...
...
@@ -429,7 +431,7 @@ func testTopologyPositive(cs clientset.Interface, suffix, namespace string, dela
claim
.
Spec
.
StorageClassName
=
&
class
.
Name
if
delayBinding
{
_
,
node
:=
testsuites
.
TestBindingWaitForFirstConsumer
(
test
,
cs
,
claim
,
class
)
_
,
node
:=
testsuites
.
TestBindingWaitForFirstConsumer
(
test
,
cs
,
claim
,
class
,
nil
/* node selector */
,
false
/* expect unschedulable */
)
Expect
(
node
)
.
ToNot
(
BeNil
(),
"Unexpected nil node found"
)
}
else
{
testsuites
.
TestDynamicProvisioning
(
test
,
cs
,
claim
,
class
)
...
...
@@ -450,16 +452,22 @@ func testTopologyNegative(cs clientset.Interface, suffix, namespace string, dela
test
:=
createGCEPDStorageClassTest
()
test
.
DelayBinding
=
delayBinding
test
.
NodeSelector
=
map
[
string
]
string
{
v1
.
LabelZoneFailureDomain
:
podZone
}
test
.
ExpectUnschedulable
=
true
nodeSelector
:=
map
[
string
]
string
{
v1
.
LabelZoneFailureDomain
:
podZone
}
class
:=
newStorageClass
(
test
,
namespace
,
suffix
)
addSingleCSIZoneAllowedTopologyToStorageClass
(
cs
,
class
,
pvZone
)
claim
:=
newClaim
(
test
,
namespace
,
suffix
)
claim
.
Spec
.
StorageClassName
=
&
class
.
Name
if
delayBinding
{
testsuites
.
TestBindingWaitForFirstConsumer
(
test
,
cs
,
claim
,
class
)
testsuites
.
TestBindingWaitForFirstConsumer
(
test
,
cs
,
claim
,
class
,
nodeSelector
,
true
/* expect unschedulable */
)
}
else
{
test
.
PvCheck
=
func
(
claim
*
v1
.
PersistentVolumeClaim
,
volume
*
v1
.
PersistentVolume
)
{
// Ensure that a pod cannot be scheduled in an unsuitable zone.
pod
:=
testsuites
.
StartInPodWithVolume
(
cs
,
namespace
,
claim
.
Name
,
"pvc-tester-unschedulable"
,
"sleep 100000"
,
testsuites
.
NodeSelection
{
Selector
:
nodeSelector
})
defer
testsuites
.
StopPod
(
cs
,
pod
)
framework
.
ExpectNoError
(
framework
.
WaitForPodNameUnschedulableInNamespace
(
cs
,
pod
.
Name
,
pod
.
Namespace
),
"pod should be unschedulable"
)
}
testsuites
.
TestDynamicProvisioning
(
test
,
cs
,
claim
,
class
)
}
}
...
...
@@ -500,7 +508,7 @@ func getVolumeHandle(cs clientset.Interface, claim *v1.PersistentVolumeClaim) st
return
pv
.
Spec
.
CSI
.
VolumeHandle
}
func
startPausePod
(
cs
clientset
.
Interface
,
t
testsuites
.
StorageClassTest
,
ns
string
)
(
*
storagev1
.
StorageClass
,
*
v1
.
PersistentVolumeClaim
,
*
v1
.
Pod
)
{
func
startPausePod
(
cs
clientset
.
Interface
,
t
testsuites
.
StorageClassTest
,
n
ode
testsuites
.
NodeSelection
,
n
s
string
)
(
*
storagev1
.
StorageClass
,
*
v1
.
PersistentVolumeClaim
,
*
v1
.
Pod
)
{
class
:=
newStorageClass
(
t
,
ns
,
""
)
class
,
err
:=
cs
.
StorageV1
()
.
StorageClasses
()
.
Create
(
class
)
framework
.
ExpectNoError
(
err
,
"Failed to create class : %v"
,
err
)
...
...
@@ -514,6 +522,9 @@ func startPausePod(cs clientset.Interface, t testsuites.StorageClassTest, ns str
GenerateName
:
"pvc-volume-tester-"
,
},
Spec
:
v1
.
PodSpec
{
NodeName
:
node
.
Name
,
NodeSelector
:
node
.
Selector
,
Affinity
:
node
.
Affinity
,
Containers
:
[]
v1
.
Container
{
{
Name
:
"volume-tester"
,
...
...
@@ -541,9 +552,6 @@ func startPausePod(cs clientset.Interface, t testsuites.StorageClassTest, ns str
},
}
if
len
(
t
.
NodeName
)
!=
0
{
pod
.
Spec
.
NodeName
=
t
.
NodeName
}
pod
,
err
=
cs
.
CoreV1
()
.
Pods
(
ns
)
.
Create
(
pod
)
framework
.
ExpectNoError
(
err
,
"Failed to create pod: %v"
,
err
)
return
class
,
claim
,
pod
...
...
test/e2e/storage/drivers/csi.go
View file @
f9684998
...
...
@@ -84,7 +84,7 @@ var _ testsuites.SnapshottableTestDriver = &hostpathCSIDriver{}
// InitHostPathCSIDriver returns hostpathCSIDriver that implements TestDriver interface
func
InitHostPathCSIDriver
(
config
testsuites
.
TestConfig
)
testsuites
.
TestDriver
{
return
initHostPathCSIDriver
(
"csi-hostpath"
,
config
,
map
[
testsuites
.
Capability
]
bool
{
testsuites
.
CapPersistence
:
true
,
testsuites
.
CapDataSource
:
true
},
map
[
testsuites
.
Capability
]
bool
{
testsuites
.
CapPersistence
:
true
,
testsuites
.
CapDataSource
:
true
,
testsuites
.
CapMultiPODs
:
true
},
"test/e2e/testing-manifests/storage-csi/driver-registrar/rbac.yaml"
,
"test/e2e/testing-manifests/storage-csi/external-attacher/rbac.yaml"
,
"test/e2e/testing-manifests/storage-csi/external-provisioner/rbac.yaml"
,
...
...
@@ -259,7 +259,7 @@ func (m *mockCSIDriver) CleanupDriver() {
// InitHostPathV0CSIDriver returns a variant of hostpathCSIDriver with different manifests.
func
InitHostPathV0CSIDriver
(
config
testsuites
.
TestConfig
)
testsuites
.
TestDriver
{
return
initHostPathCSIDriver
(
"csi-hostpath-v0"
,
config
,
map
[
testsuites
.
Capability
]
bool
{
testsuites
.
CapPersistence
:
true
},
map
[
testsuites
.
Capability
]
bool
{
testsuites
.
CapPersistence
:
true
,
testsuites
.
CapMultiPODs
:
true
},
"test/e2e/testing-manifests/storage-csi/driver-registrar/rbac.yaml"
,
"test/e2e/testing-manifests/storage-csi/external-attacher/rbac.yaml"
,
"test/e2e/testing-manifests/storage-csi/external-provisioner/rbac.yaml"
,
...
...
@@ -297,6 +297,7 @@ func InitGcePDCSIDriver(config testsuites.TestConfig) testsuites.TestDriver {
testsuites
.
CapPersistence
:
true
,
testsuites
.
CapFsGroup
:
true
,
testsuites
.
CapExec
:
true
,
testsuites
.
CapMultiPODs
:
true
,
},
Config
:
config
,
...
...
@@ -409,6 +410,7 @@ func InitGcePDExternalCSIDriver(config testsuites.TestConfig) testsuites.TestDri
testsuites
.
CapPersistence
:
true
,
testsuites
.
CapFsGroup
:
true
,
testsuites
.
CapExec
:
true
,
testsuites
.
CapMultiPODs
:
true
,
},
Config
:
config
,
...
...
test/e2e/storage/regional_pd.go
View file @
f9684998
...
...
@@ -108,12 +108,14 @@ func testVolumeProvisioning(c clientset.Interface, ns string) {
},
ClaimSize
:
"1.5Gi"
,
ExpectedSize
:
"2Gi"
,
PvCheck
:
func
(
volume
*
v1
.
PersistentVolume
)
error
{
err
:=
checkGCEPD
(
volume
,
"pd-standard"
)
if
err
!=
nil
{
return
err
}
return
verifyZonesInPV
(
volume
,
sets
.
NewString
(
cloudZones
...
),
true
/* match */
)
PvCheck
:
func
(
claim
*
v1
.
PersistentVolumeClaim
,
volume
*
v1
.
PersistentVolume
)
{
var
err
error
err
=
checkGCEPD
(
volume
,
"pd-standard"
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
(),
"checkGCEPD"
)
err
=
verifyZonesInPV
(
volume
,
sets
.
NewString
(
cloudZones
...
),
true
/* match */
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
(),
"verifyZonesInPV"
)
testsuites
.
PVWriteReadSingleNodeCheck
(
c
,
claim
,
volume
,
testsuites
.
NodeSelection
{})
},
},
{
...
...
@@ -126,16 +128,16 @@ func testVolumeProvisioning(c clientset.Interface, ns string) {
},
ClaimSize
:
"1.5Gi"
,
ExpectedSize
:
"2Gi"
,
PvCheck
:
func
(
volume
*
v1
.
PersistentVolume
)
error
{
err
:=
checkGCEPD
(
volume
,
"pd-standard"
)
if
err
!=
nil
{
return
err
}
PvCheck
:
func
(
claim
*
v1
.
PersistentVolumeClaim
,
volume
*
v1
.
PersistentVolume
)
{
var
err
error
err
=
checkGCEPD
(
volume
,
"pd-standard"
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
(),
"checkGCEPD"
)
zones
,
err
:=
framework
.
GetClusterZones
(
c
)
if
err
!=
nil
{
return
err
}
return
verifyZonesInPV
(
volume
,
zones
,
false
/* match */
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
(),
"GetClusterZones"
)
err
=
verifyZonesInPV
(
volume
,
zones
,
false
/* match */
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
(),
"verifyZonesInPV"
)
testsuites
.
PVWriteReadSingleNodeCheck
(
c
,
claim
,
volume
,
testsuites
.
NodeSelection
{})
},
},
}
...
...
@@ -317,7 +319,7 @@ func testRegionalDelayedBinding(c clientset.Interface, ns string, pvcCount int)
claim
.
Spec
.
StorageClassName
=
&
class
.
Name
claims
=
append
(
claims
,
claim
)
}
pvs
,
node
:=
testsuites
.
TestBindingWaitForFirstConsumerMultiPVC
(
test
,
c
,
claims
,
class
)
pvs
,
node
:=
testsuites
.
TestBindingWaitForFirstConsumerMultiPVC
(
test
,
c
,
claims
,
class
,
nil
/* node selector */
,
false
/* expect unschedulable */
)
if
node
==
nil
{
framework
.
Failf
(
"unexpected nil node found"
)
}
...
...
@@ -374,7 +376,7 @@ func testRegionalAllowedTopologiesWithDelayedBinding(c clientset.Interface, ns s
claim
.
Spec
.
StorageClassName
=
&
class
.
Name
claims
=
append
(
claims
,
claim
)
}
pvs
,
node
:=
testsuites
.
TestBindingWaitForFirstConsumerMultiPVC
(
test
,
c
,
claims
,
class
)
pvs
,
node
:=
testsuites
.
TestBindingWaitForFirstConsumerMultiPVC
(
test
,
c
,
claims
,
class
,
nil
/* node selector */
,
false
/* expect unschedulable */
)
if
node
==
nil
{
framework
.
Failf
(
"unexpected nil node found"
)
}
...
...
test/e2e/storage/testsuites/base.go
View file @
f9684998
...
...
@@ -91,7 +91,7 @@ func skipUnsupportedTest(suite TestSuite, driver TestDriver, pattern testpattern
var
isSupported
bool
// 1. Check if Whether SnapshotType is supported by driver from its interface
// if isSupported,
so it must be a snapshot test case, we just return.
// if isSupported,
we still execute the driver and suite tests
if
len
(
pattern
.
SnapshotType
)
>
0
{
switch
pattern
.
SnapshotType
{
case
testpatterns
.
DynamicCreatedSnapshot
:
...
...
@@ -102,31 +102,30 @@ func skipUnsupportedTest(suite TestSuite, driver TestDriver, pattern testpattern
if
!
isSupported
{
framework
.
Skipf
(
"Driver %s doesn't support snapshot type %v -- skipping"
,
dInfo
.
Name
,
pattern
.
SnapshotType
)
}
return
}
// 2. Check if Whether volType is supported by driver from its interface
switch
pattern
.
VolType
{
case
testpatterns
.
InlineVolume
:
_
,
isSupported
=
driver
.
(
InlineVolumeTestDriver
)
case
testpatterns
.
PreprovisionedPV
:
_
,
isSupported
=
driver
.
(
PreprovisionedPVTestDriver
)
case
testpatterns
.
DynamicPV
:
_
,
isSupported
=
driver
.
(
DynamicPVTestDriver
)
default
:
isSupported
=
false
}
}
else
{
// 2. Check if Whether volType is supported by driver from its interface
switch
pattern
.
VolType
{
case
testpatterns
.
InlineVolume
:
_
,
isSupported
=
driver
.
(
InlineVolumeTestDriver
)
case
testpatterns
.
PreprovisionedPV
:
_
,
isSupported
=
driver
.
(
PreprovisionedPVTestDriver
)
case
testpatterns
.
DynamicPV
:
_
,
isSupported
=
driver
.
(
DynamicPVTestDriver
)
default
:
isSupported
=
false
}
if
!
isSupported
{
framework
.
Skipf
(
"Driver %s doesn't support %v -- skipping"
,
dInfo
.
Name
,
pattern
.
VolType
)
}
if
!
isSupported
{
framework
.
Skipf
(
"Driver %s doesn't support %v -- skipping"
,
dInfo
.
Name
,
pattern
.
VolType
)
}
// 3. Check if fsType is supported
if
!
dInfo
.
SupportedFsType
.
Has
(
pattern
.
FsType
)
{
framework
.
Skipf
(
"Driver %s doesn't support %v -- skipping"
,
dInfo
.
Name
,
pattern
.
FsType
)
}
if
pattern
.
FsType
==
"xfs"
&&
framework
.
NodeOSDistroIs
(
"gci"
)
{
framework
.
Skipf
(
"Distro doesn't support xfs -- skipping"
)
// 3. Check if fsType is supported
if
!
dInfo
.
SupportedFsType
.
Has
(
pattern
.
FsType
)
{
framework
.
Skipf
(
"Driver %s doesn't support %v -- skipping"
,
dInfo
.
Name
,
pattern
.
FsType
)
}
if
pattern
.
FsType
==
"xfs"
&&
framework
.
NodeOSDistroIs
(
"gci"
)
{
framework
.
Skipf
(
"Distro doesn't support xfs -- skipping"
)
}
}
// 4. Check with driver specific logic
...
...
test/e2e/storage/testsuites/provisioning.go
View file @
f9684998
This diff is collapsed.
Click to expand it.
test/e2e/storage/testsuites/snapshottable.go
View file @
f9684998
...
...
@@ -80,6 +80,10 @@ func (s *snapshottableTestSuite) getTestSuiteInfo() TestSuiteInfo {
}
func
(
s
*
snapshottableTestSuite
)
skipUnsupportedTest
(
pattern
testpatterns
.
TestPattern
,
driver
TestDriver
)
{
dInfo
:=
driver
.
GetDriverInfo
()
if
!
dInfo
.
Capabilities
[
CapDataSource
]
{
framework
.
Skipf
(
"Driver %q does not support snapshots - skipping"
,
dInfo
.
Name
)
}
}
func
createSnapshottableTestInput
(
driver
TestDriver
,
pattern
testpatterns
.
TestPattern
)
(
snapshottableTestResource
,
snapshottableTestInput
)
{
...
...
@@ -87,18 +91,17 @@ func createSnapshottableTestInput(driver TestDriver, pattern testpatterns.TestPa
resource
:=
snapshottableTestResource
{}
resource
.
setupResource
(
driver
,
pattern
)
dInfo
:=
driver
.
GetDriverInfo
()
input
:=
snapshottableTestInput
{
testCase
:
SnapshotClassTest
{},
cs
:
driver
.
GetDriverInfo
()
.
Config
.
Framework
.
ClientSet
,
dc
:
driver
.
GetDriverInfo
()
.
Config
.
Framework
.
DynamicClient
,
pvc
:
resource
.
pvc
,
sc
:
resource
.
sc
,
vsc
:
resource
.
vsc
,
dInfo
:
driver
.
GetDriverInfo
(),
}
if
driver
.
GetDriverInfo
()
.
Config
.
ClientNodeName
!=
""
{
input
.
testCase
.
NodeName
=
driver
.
GetDriverInfo
()
.
Config
.
ClientNodeName
testCase
:
SnapshotClassTest
{
NodeName
:
dInfo
.
Config
.
ClientNodeName
,
},
cs
:
dInfo
.
Config
.
Framework
.
ClientSet
,
dc
:
dInfo
.
Config
.
Framework
.
DynamicClient
,
pvc
:
resource
.
pvc
,
sc
:
resource
.
sc
,
vsc
:
resource
.
vsc
,
dInfo
:
dInfo
,
}
return
resource
,
input
...
...
@@ -187,10 +190,7 @@ type snapshottableTestInput struct {
}
func
testSnapshot
(
input
*
snapshottableTestInput
)
{
It
(
"should create snapshot with defaults"
,
func
()
{
if
input
.
dInfo
.
Name
==
"csi-hostpath-v0"
{
framework
.
Skipf
(
"skip test when using driver csi-hostpath-v0 - skipping"
)
}
It
(
"should create snapshot with defaults [Feature:VolumeSnapshotDataSource]"
,
func
()
{
TestCreateSnapshot
(
input
.
testCase
,
input
.
cs
,
input
.
dc
,
input
.
pvc
,
input
.
sc
,
input
.
vsc
)
})
}
...
...
test/e2e/storage/testsuites/testdriver.go
View file @
f9684998
...
...
@@ -97,6 +97,13 @@ const (
CapFsGroup
Capability
=
"fsGroup"
// volume ownership via fsGroup
CapExec
Capability
=
"exec"
// exec a file in the volume
CapDataSource
Capability
=
"dataSource"
// support populate data from snapshot
// multiple pods on a node can use the same volume concurrently;
// for CSI, see:
// - https://github.com/container-storage-interface/spec/pull/150
// - https://github.com/container-storage-interface/spec/issues/178
// - NodeStageVolume in the spec
CapMultiPODs
Capability
=
"multipods"
)
// DriverInfo represents a combination of parameters to be used in implementation of TestDriver
...
...
test/e2e/storage/volume_provisioning.go
View file @
f9684998
...
...
@@ -226,7 +226,7 @@ func testZonalDelayedBinding(c clientset.Interface, ns string, specifyAllowedTop
claim
.
Spec
.
StorageClassName
=
&
class
.
Name
claims
=
append
(
claims
,
claim
)
}
pvs
,
node
:=
testsuites
.
TestBindingWaitForFirstConsumerMultiPVC
(
test
,
c
,
claims
,
class
)
pvs
,
node
:=
testsuites
.
TestBindingWaitForFirstConsumerMultiPVC
(
test
,
c
,
claims
,
class
,
nil
/* node selector */
,
false
/* expect unschedulable */
)
if
node
==
nil
{
framework
.
Failf
(
"unexpected nil node found"
)
}
...
...
@@ -273,8 +273,10 @@ var _ = utils.SIGDescribe("Dynamic Provisioning", func() {
},
ClaimSize
:
"1.5Gi"
,
ExpectedSize
:
"2Gi"
,
PvCheck
:
func
(
volume
*
v1
.
PersistentVolume
)
error
{
return
checkGCEPD
(
volume
,
"pd-ssd"
)
PvCheck
:
func
(
claim
*
v1
.
PersistentVolumeClaim
,
volume
*
v1
.
PersistentVolume
)
{
err
:=
checkGCEPD
(
volume
,
"pd-ssd"
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
(),
"checkGCEPD pd-ssd"
)
testsuites
.
PVWriteReadSingleNodeCheck
(
c
,
claim
,
volume
,
testsuites
.
NodeSelection
{})
},
},
{
...
...
@@ -286,8 +288,10 @@ var _ = utils.SIGDescribe("Dynamic Provisioning", func() {
},
ClaimSize
:
"1.5Gi"
,
ExpectedSize
:
"2Gi"
,
PvCheck
:
func
(
volume
*
v1
.
PersistentVolume
)
error
{
return
checkGCEPD
(
volume
,
"pd-standard"
)
PvCheck
:
func
(
claim
*
v1
.
PersistentVolumeClaim
,
volume
*
v1
.
PersistentVolume
)
{
err
:=
checkGCEPD
(
volume
,
"pd-standard"
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
(),
"checkGCEPD pd-standard"
)
testsuites
.
PVWriteReadSingleNodeCheck
(
c
,
claim
,
volume
,
testsuites
.
NodeSelection
{})
},
},
// AWS
...
...
@@ -301,8 +305,10 @@ var _ = utils.SIGDescribe("Dynamic Provisioning", func() {
},
ClaimSize
:
"1.5Gi"
,
ExpectedSize
:
"2Gi"
,
PvCheck
:
func
(
volume
*
v1
.
PersistentVolume
)
error
{
return
checkAWSEBS
(
volume
,
"gp2"
,
false
)
PvCheck
:
func
(
claim
*
v1
.
PersistentVolumeClaim
,
volume
*
v1
.
PersistentVolume
)
{
err
:=
checkAWSEBS
(
volume
,
"gp2"
,
false
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
(),
"checkAWSEBS gp2"
)
testsuites
.
PVWriteReadSingleNodeCheck
(
c
,
claim
,
volume
,
testsuites
.
NodeSelection
{})
},
},
{
...
...
@@ -315,8 +321,10 @@ var _ = utils.SIGDescribe("Dynamic Provisioning", func() {
},
ClaimSize
:
"3.5Gi"
,
ExpectedSize
:
"4Gi"
,
// 4 GiB is minimum for io1
PvCheck
:
func
(
volume
*
v1
.
PersistentVolume
)
error
{
return
checkAWSEBS
(
volume
,
"io1"
,
false
)
PvCheck
:
func
(
claim
*
v1
.
PersistentVolumeClaim
,
volume
*
v1
.
PersistentVolume
)
{
err
:=
checkAWSEBS
(
volume
,
"io1"
,
false
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
(),
"checkAWSEBS io1"
)
testsuites
.
PVWriteReadSingleNodeCheck
(
c
,
claim
,
volume
,
testsuites
.
NodeSelection
{})
},
},
{
...
...
@@ -328,8 +336,10 @@ var _ = utils.SIGDescribe("Dynamic Provisioning", func() {
},
ClaimSize
:
"500Gi"
,
// minimum for sc1
ExpectedSize
:
"500Gi"
,
PvCheck
:
func
(
volume
*
v1
.
PersistentVolume
)
error
{
return
checkAWSEBS
(
volume
,
"sc1"
,
false
)
PvCheck
:
func
(
claim
*
v1
.
PersistentVolumeClaim
,
volume
*
v1
.
PersistentVolume
)
{
err
:=
checkAWSEBS
(
volume
,
"sc1"
,
false
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
(),
"checkAWSEBS sc1"
)
testsuites
.
PVWriteReadSingleNodeCheck
(
c
,
claim
,
volume
,
testsuites
.
NodeSelection
{})
},
},
{
...
...
@@ -341,8 +351,10 @@ var _ = utils.SIGDescribe("Dynamic Provisioning", func() {
},
ClaimSize
:
"500Gi"
,
// minimum for st1
ExpectedSize
:
"500Gi"
,
PvCheck
:
func
(
volume
*
v1
.
PersistentVolume
)
error
{
return
checkAWSEBS
(
volume
,
"st1"
,
false
)
PvCheck
:
func
(
claim
*
v1
.
PersistentVolumeClaim
,
volume
*
v1
.
PersistentVolume
)
{
err
:=
checkAWSEBS
(
volume
,
"st1"
,
false
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
(),
"checkAWSEBS st1"
)
testsuites
.
PVWriteReadSingleNodeCheck
(
c
,
claim
,
volume
,
testsuites
.
NodeSelection
{})
},
},
{
...
...
@@ -354,8 +366,10 @@ var _ = utils.SIGDescribe("Dynamic Provisioning", func() {
},
ClaimSize
:
"1Gi"
,
ExpectedSize
:
"1Gi"
,
PvCheck
:
func
(
volume
*
v1
.
PersistentVolume
)
error
{
return
checkAWSEBS
(
volume
,
"gp2"
,
true
)
PvCheck
:
func
(
claim
*
v1
.
PersistentVolumeClaim
,
volume
*
v1
.
PersistentVolume
)
{
err
:=
checkAWSEBS
(
volume
,
"gp2"
,
true
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
(),
"checkAWSEBS gp2 encrypted"
)
testsuites
.
PVWriteReadSingleNodeCheck
(
c
,
claim
,
volume
,
testsuites
.
NodeSelection
{})
},
},
// OpenStack generic tests (works on all OpenStack deployments)
...
...
@@ -366,7 +380,9 @@ var _ = utils.SIGDescribe("Dynamic Provisioning", func() {
Parameters
:
map
[
string
]
string
{},
ClaimSize
:
"1.5Gi"
,
ExpectedSize
:
"2Gi"
,
PvCheck
:
nil
,
// there is currently nothing to check on OpenStack
PvCheck
:
func
(
claim
*
v1
.
PersistentVolumeClaim
,
volume
*
v1
.
PersistentVolume
)
{
testsuites
.
PVWriteReadSingleNodeCheck
(
c
,
claim
,
volume
,
testsuites
.
NodeSelection
{})
},
},
{
Name
:
"Cinder volume with empty volume type and zone on OpenStack"
,
...
...
@@ -378,7 +394,9 @@ var _ = utils.SIGDescribe("Dynamic Provisioning", func() {
},
ClaimSize
:
"1.5Gi"
,
ExpectedSize
:
"2Gi"
,
PvCheck
:
nil
,
// there is currently nothing to check on OpenStack
PvCheck
:
func
(
claim
*
v1
.
PersistentVolumeClaim
,
volume
*
v1
.
PersistentVolume
)
{
testsuites
.
PVWriteReadSingleNodeCheck
(
c
,
claim
,
volume
,
testsuites
.
NodeSelection
{})
},
},
// vSphere generic test
{
...
...
@@ -388,7 +406,9 @@ var _ = utils.SIGDescribe("Dynamic Provisioning", func() {
Parameters
:
map
[
string
]
string
{},
ClaimSize
:
"1.5Gi"
,
ExpectedSize
:
"1.5Gi"
,
PvCheck
:
nil
,
PvCheck
:
func
(
claim
*
v1
.
PersistentVolumeClaim
,
volume
*
v1
.
PersistentVolume
)
{
testsuites
.
PVWriteReadSingleNodeCheck
(
c
,
claim
,
volume
,
testsuites
.
NodeSelection
{})
},
},
// Azure
{
...
...
@@ -398,7 +418,9 @@ var _ = utils.SIGDescribe("Dynamic Provisioning", func() {
Parameters
:
map
[
string
]
string
{},
ClaimSize
:
"1Gi"
,
ExpectedSize
:
"1Gi"
,
PvCheck
:
nil
,
PvCheck
:
func
(
claim
*
v1
.
PersistentVolumeClaim
,
volume
*
v1
.
PersistentVolume
)
{
testsuites
.
PVWriteReadSingleNodeCheck
(
c
,
claim
,
volume
,
testsuites
.
NodeSelection
{})
},
},
}
...
...
@@ -451,8 +473,10 @@ var _ = utils.SIGDescribe("Dynamic Provisioning", func() {
},
ClaimSize
:
"1Gi"
,
ExpectedSize
:
"1Gi"
,
PvCheck
:
func
(
volume
*
v1
.
PersistentVolume
)
error
{
return
checkGCEPD
(
volume
,
"pd-standard"
)
PvCheck
:
func
(
claim
*
v1
.
PersistentVolumeClaim
,
volume
*
v1
.
PersistentVolume
)
{
err
:=
checkGCEPD
(
volume
,
"pd-standard"
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
(),
"checkGCEPD"
)
testsuites
.
PVWriteReadSingleNodeCheck
(
c
,
claim
,
volume
,
testsuites
.
NodeSelection
{})
},
}
class
:=
newStorageClass
(
test
,
ns
,
"reclaimpolicy"
)
...
...
@@ -793,12 +817,11 @@ var _ = utils.SIGDescribe("Dynamic Provisioning", func() {
serverUrl
:=
"https://"
+
pod
.
Status
.
PodIP
+
":8081"
By
(
"creating a StorageClass"
)
test
:=
testsuites
.
StorageClassTest
{
Name
:
"Gluster Dynamic provisioner test"
,
Provisioner
:
"kubernetes.io/glusterfs"
,
ClaimSize
:
"2Gi"
,
ExpectedSize
:
"2Gi"
,
Parameters
:
map
[
string
]
string
{
"resturl"
:
serverUrl
},
SkipWriteReadCheck
:
true
,
Name
:
"Gluster Dynamic provisioner test"
,
Provisioner
:
"kubernetes.io/glusterfs"
,
ClaimSize
:
"2Gi"
,
ExpectedSize
:
"2Gi"
,
Parameters
:
map
[
string
]
string
{
"resturl"
:
serverUrl
},
}
suffix
:=
fmt
.
Sprintf
(
"glusterdptest"
)
class
:=
newStorageClass
(
test
,
ns
,
suffix
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment