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() {
...
@@ -261,9 +261,11 @@ var _ = utils.SIGDescribe("CSI Volumes", func() {
Parameters
:
sc
.
Parameters
,
Parameters
:
sc
.
Parameters
,
ClaimSize
:
"1Gi"
,
ClaimSize
:
"1Gi"
,
ExpectedSize
:
"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
{
if
class
!=
nil
{
defer
cs
.
StorageV1
()
.
StorageClasses
()
.
Delete
(
class
.
Name
,
nil
)
defer
cs
.
StorageV1
()
.
StorageClasses
()
.
Delete
(
class
.
Name
,
nil
)
}
}
...
@@ -381,16 +383,16 @@ var _ = utils.SIGDescribe("CSI Volumes", func() {
...
@@ -381,16 +383,16 @@ var _ = utils.SIGDescribe("CSI Volumes", func() {
Parameters
:
sc
.
Parameters
,
Parameters
:
sc
.
Parameters
,
ClaimSize
:
"1Gi"
,
ClaimSize
:
"1Gi"
,
ExpectedSize
:
"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
// Provisioner and storage class name must match what's used in
// csi-storageclass.yaml, plus the test-specific suffix.
// csi-storageclass.yaml, plus the test-specific suffix.
Provisioner
:
sc
.
Provisioner
,
Provisioner
:
sc
.
Provisioner
,
StorageClassName
:
"csi-mock-sc-"
+
f
.
UniqueName
,
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
{
if
class
!=
nil
{
defer
cs
.
StorageV1
()
.
StorageClasses
()
.
Delete
(
class
.
Name
,
nil
)
defer
cs
.
StorageV1
()
.
StorageClasses
()
.
Delete
(
class
.
Name
,
nil
)
}
}
...
@@ -429,7 +431,7 @@ func testTopologyPositive(cs clientset.Interface, suffix, namespace string, dela
...
@@ -429,7 +431,7 @@ func testTopologyPositive(cs clientset.Interface, suffix, namespace string, dela
claim
.
Spec
.
StorageClassName
=
&
class
.
Name
claim
.
Spec
.
StorageClassName
=
&
class
.
Name
if
delayBinding
{
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"
)
Expect
(
node
)
.
ToNot
(
BeNil
(),
"Unexpected nil node found"
)
}
else
{
}
else
{
testsuites
.
TestDynamicProvisioning
(
test
,
cs
,
claim
,
class
)
testsuites
.
TestDynamicProvisioning
(
test
,
cs
,
claim
,
class
)
...
@@ -450,16 +452,22 @@ func testTopologyNegative(cs clientset.Interface, suffix, namespace string, dela
...
@@ -450,16 +452,22 @@ func testTopologyNegative(cs clientset.Interface, suffix, namespace string, dela
test
:=
createGCEPDStorageClassTest
()
test
:=
createGCEPDStorageClassTest
()
test
.
DelayBinding
=
delayBinding
test
.
DelayBinding
=
delayBinding
test
.
NodeSelector
=
map
[
string
]
string
{
v1
.
LabelZoneFailureDomain
:
podZone
}
nodeSelector
:=
map
[
string
]
string
{
v1
.
LabelZoneFailureDomain
:
podZone
}
test
.
ExpectUnschedulable
=
true
class
:=
newStorageClass
(
test
,
namespace
,
suffix
)
class
:=
newStorageClass
(
test
,
namespace
,
suffix
)
addSingleCSIZoneAllowedTopologyToStorageClass
(
cs
,
class
,
pvZone
)
addSingleCSIZoneAllowedTopologyToStorageClass
(
cs
,
class
,
pvZone
)
claim
:=
newClaim
(
test
,
namespace
,
suffix
)
claim
:=
newClaim
(
test
,
namespace
,
suffix
)
claim
.
Spec
.
StorageClassName
=
&
class
.
Name
claim
.
Spec
.
StorageClassName
=
&
class
.
Name
if
delayBinding
{
if
delayBinding
{
testsuites
.
TestBindingWaitForFirstConsumer
(
test
,
cs
,
claim
,
class
)
testsuites
.
TestBindingWaitForFirstConsumer
(
test
,
cs
,
claim
,
class
,
nodeSelector
,
true
/* expect unschedulable */
)
}
else
{
}
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
)
testsuites
.
TestDynamicProvisioning
(
test
,
cs
,
claim
,
class
)
}
}
}
}
...
@@ -500,7 +508,7 @@ func getVolumeHandle(cs clientset.Interface, claim *v1.PersistentVolumeClaim) st
...
@@ -500,7 +508,7 @@ func getVolumeHandle(cs clientset.Interface, claim *v1.PersistentVolumeClaim) st
return
pv
.
Spec
.
CSI
.
VolumeHandle
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
:=
newStorageClass
(
t
,
ns
,
""
)
class
,
err
:=
cs
.
StorageV1
()
.
StorageClasses
()
.
Create
(
class
)
class
,
err
:=
cs
.
StorageV1
()
.
StorageClasses
()
.
Create
(
class
)
framework
.
ExpectNoError
(
err
,
"Failed to create class : %v"
,
err
)
framework
.
ExpectNoError
(
err
,
"Failed to create class : %v"
,
err
)
...
@@ -514,6 +522,9 @@ func startPausePod(cs clientset.Interface, t testsuites.StorageClassTest, ns str
...
@@ -514,6 +522,9 @@ func startPausePod(cs clientset.Interface, t testsuites.StorageClassTest, ns str
GenerateName
:
"pvc-volume-tester-"
,
GenerateName
:
"pvc-volume-tester-"
,
},
},
Spec
:
v1
.
PodSpec
{
Spec
:
v1
.
PodSpec
{
NodeName
:
node
.
Name
,
NodeSelector
:
node
.
Selector
,
Affinity
:
node
.
Affinity
,
Containers
:
[]
v1
.
Container
{
Containers
:
[]
v1
.
Container
{
{
{
Name
:
"volume-tester"
,
Name
:
"volume-tester"
,
...
@@ -541,9 +552,6 @@ func startPausePod(cs clientset.Interface, t testsuites.StorageClassTest, ns str
...
@@ -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
)
pod
,
err
=
cs
.
CoreV1
()
.
Pods
(
ns
)
.
Create
(
pod
)
framework
.
ExpectNoError
(
err
,
"Failed to create pod: %v"
,
err
)
framework
.
ExpectNoError
(
err
,
"Failed to create pod: %v"
,
err
)
return
class
,
claim
,
pod
return
class
,
claim
,
pod
...
...
test/e2e/storage/drivers/csi.go
View file @
f9684998
...
@@ -84,7 +84,7 @@ var _ testsuites.SnapshottableTestDriver = &hostpathCSIDriver{}
...
@@ -84,7 +84,7 @@ var _ testsuites.SnapshottableTestDriver = &hostpathCSIDriver{}
// InitHostPathCSIDriver returns hostpathCSIDriver that implements TestDriver interface
// InitHostPathCSIDriver returns hostpathCSIDriver that implements TestDriver interface
func
InitHostPathCSIDriver
(
config
testsuites
.
TestConfig
)
testsuites
.
TestDriver
{
func
InitHostPathCSIDriver
(
config
testsuites
.
TestConfig
)
testsuites
.
TestDriver
{
return
initHostPathCSIDriver
(
"csi-hostpath"
,
config
,
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/driver-registrar/rbac.yaml"
,
"test/e2e/testing-manifests/storage-csi/external-attacher/rbac.yaml"
,
"test/e2e/testing-manifests/storage-csi/external-attacher/rbac.yaml"
,
"test/e2e/testing-manifests/storage-csi/external-provisioner/rbac.yaml"
,
"test/e2e/testing-manifests/storage-csi/external-provisioner/rbac.yaml"
,
...
@@ -259,7 +259,7 @@ func (m *mockCSIDriver) CleanupDriver() {
...
@@ -259,7 +259,7 @@ func (m *mockCSIDriver) CleanupDriver() {
// InitHostPathV0CSIDriver returns a variant of hostpathCSIDriver with different manifests.
// InitHostPathV0CSIDriver returns a variant of hostpathCSIDriver with different manifests.
func
InitHostPathV0CSIDriver
(
config
testsuites
.
TestConfig
)
testsuites
.
TestDriver
{
func
InitHostPathV0CSIDriver
(
config
testsuites
.
TestConfig
)
testsuites
.
TestDriver
{
return
initHostPathCSIDriver
(
"csi-hostpath-v0"
,
config
,
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/driver-registrar/rbac.yaml"
,
"test/e2e/testing-manifests/storage-csi/external-attacher/rbac.yaml"
,
"test/e2e/testing-manifests/storage-csi/external-attacher/rbac.yaml"
,
"test/e2e/testing-manifests/storage-csi/external-provisioner/rbac.yaml"
,
"test/e2e/testing-manifests/storage-csi/external-provisioner/rbac.yaml"
,
...
@@ -297,6 +297,7 @@ func InitGcePDCSIDriver(config testsuites.TestConfig) testsuites.TestDriver {
...
@@ -297,6 +297,7 @@ func InitGcePDCSIDriver(config testsuites.TestConfig) testsuites.TestDriver {
testsuites
.
CapPersistence
:
true
,
testsuites
.
CapPersistence
:
true
,
testsuites
.
CapFsGroup
:
true
,
testsuites
.
CapFsGroup
:
true
,
testsuites
.
CapExec
:
true
,
testsuites
.
CapExec
:
true
,
testsuites
.
CapMultiPODs
:
true
,
},
},
Config
:
config
,
Config
:
config
,
...
@@ -409,6 +410,7 @@ func InitGcePDExternalCSIDriver(config testsuites.TestConfig) testsuites.TestDri
...
@@ -409,6 +410,7 @@ func InitGcePDExternalCSIDriver(config testsuites.TestConfig) testsuites.TestDri
testsuites
.
CapPersistence
:
true
,
testsuites
.
CapPersistence
:
true
,
testsuites
.
CapFsGroup
:
true
,
testsuites
.
CapFsGroup
:
true
,
testsuites
.
CapExec
:
true
,
testsuites
.
CapExec
:
true
,
testsuites
.
CapMultiPODs
:
true
,
},
},
Config
:
config
,
Config
:
config
,
...
...
test/e2e/storage/regional_pd.go
View file @
f9684998
...
@@ -108,12 +108,14 @@ func testVolumeProvisioning(c clientset.Interface, ns string) {
...
@@ -108,12 +108,14 @@ func testVolumeProvisioning(c clientset.Interface, ns string) {
},
},
ClaimSize
:
"1.5Gi"
,
ClaimSize
:
"1.5Gi"
,
ExpectedSize
:
"2Gi"
,
ExpectedSize
:
"2Gi"
,
PvCheck
:
func
(
volume
*
v1
.
PersistentVolume
)
error
{
PvCheck
:
func
(
claim
*
v1
.
PersistentVolumeClaim
,
volume
*
v1
.
PersistentVolume
)
{
err
:=
checkGCEPD
(
volume
,
"pd-standard"
)
var
err
error
if
err
!=
nil
{
err
=
checkGCEPD
(
volume
,
"pd-standard"
)
return
err
Expect
(
err
)
.
NotTo
(
HaveOccurred
(),
"checkGCEPD"
)
}
err
=
verifyZonesInPV
(
volume
,
sets
.
NewString
(
cloudZones
...
),
true
/* match */
)
return
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) {
...
@@ -126,16 +128,16 @@ func testVolumeProvisioning(c clientset.Interface, ns string) {
},
},
ClaimSize
:
"1.5Gi"
,
ClaimSize
:
"1.5Gi"
,
ExpectedSize
:
"2Gi"
,
ExpectedSize
:
"2Gi"
,
PvCheck
:
func
(
volume
*
v1
.
PersistentVolume
)
error
{
PvCheck
:
func
(
claim
*
v1
.
PersistentVolumeClaim
,
volume
*
v1
.
PersistentVolume
)
{
err
:=
checkGCEPD
(
volume
,
"pd-standard"
)
var
err
error
if
err
!=
nil
{
err
=
checkGCEPD
(
volume
,
"pd-standard"
)
return
err
Expect
(
err
)
.
NotTo
(
HaveOccurred
(),
"checkGCEPD"
)
}
zones
,
err
:=
framework
.
GetClusterZones
(
c
)
zones
,
err
:=
framework
.
GetClusterZones
(
c
)
if
err
!=
nil
{
Expect
(
err
)
.
NotTo
(
HaveOccurred
(),
"GetClusterZones"
)
return
err
err
=
verifyZonesInPV
(
volume
,
zones
,
false
/* match */
)
}
Expect
(
err
)
.
NotTo
(
HaveOccurred
(),
"verifyZonesInPV"
)
return
verifyZonesInPV
(
volume
,
zones
,
false
/* match */
)
testsuites
.
PVWriteReadSingleNodeCheck
(
c
,
claim
,
volume
,
testsuites
.
NodeSelection
{})
},
},
},
},
}
}
...
@@ -317,7 +319,7 @@ func testRegionalDelayedBinding(c clientset.Interface, ns string, pvcCount int)
...
@@ -317,7 +319,7 @@ func testRegionalDelayedBinding(c clientset.Interface, ns string, pvcCount int)
claim
.
Spec
.
StorageClassName
=
&
class
.
Name
claim
.
Spec
.
StorageClassName
=
&
class
.
Name
claims
=
append
(
claims
,
claim
)
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
{
if
node
==
nil
{
framework
.
Failf
(
"unexpected nil node found"
)
framework
.
Failf
(
"unexpected nil node found"
)
}
}
...
@@ -374,7 +376,7 @@ func testRegionalAllowedTopologiesWithDelayedBinding(c clientset.Interface, ns s
...
@@ -374,7 +376,7 @@ func testRegionalAllowedTopologiesWithDelayedBinding(c clientset.Interface, ns s
claim
.
Spec
.
StorageClassName
=
&
class
.
Name
claim
.
Spec
.
StorageClassName
=
&
class
.
Name
claims
=
append
(
claims
,
claim
)
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
{
if
node
==
nil
{
framework
.
Failf
(
"unexpected nil node found"
)
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
...
@@ -91,7 +91,7 @@ func skipUnsupportedTest(suite TestSuite, driver TestDriver, pattern testpattern
var
isSupported
bool
var
isSupported
bool
// 1. Check if Whether SnapshotType is supported by driver from its interface
// 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
{
if
len
(
pattern
.
SnapshotType
)
>
0
{
switch
pattern
.
SnapshotType
{
switch
pattern
.
SnapshotType
{
case
testpatterns
.
DynamicCreatedSnapshot
:
case
testpatterns
.
DynamicCreatedSnapshot
:
...
@@ -102,31 +102,30 @@ func skipUnsupportedTest(suite TestSuite, driver TestDriver, pattern testpattern
...
@@ -102,31 +102,30 @@ func skipUnsupportedTest(suite TestSuite, driver TestDriver, pattern testpattern
if
!
isSupported
{
if
!
isSupported
{
framework
.
Skipf
(
"Driver %s doesn't support snapshot type %v -- skipping"
,
dInfo
.
Name
,
pattern
.
SnapshotType
)
framework
.
Skipf
(
"Driver %s doesn't support snapshot type %v -- skipping"
,
dInfo
.
Name
,
pattern
.
SnapshotType
)
}
}
return
}
else
{
}
// 2. Check if Whether volType is supported by driver from its interface
switch
pattern
.
VolType
{
// 2. Check if Whether volType is supported by driver from its interface
case
testpatterns
.
InlineVolume
:
switch
pattern
.
VolType
{
_
,
isSupported
=
driver
.
(
InlineVolumeTestDriver
)
case
testpatterns
.
InlineVolume
:
case
testpatterns
.
PreprovisionedPV
:
_
,
isSupported
=
driver
.
(
InlineVolumeTestDriver
)
_
,
isSupported
=
driver
.
(
PreprovisionedPVTestDriver
)
case
testpatterns
.
PreprovisionedPV
:
case
testpatterns
.
DynamicPV
:
_
,
isSupported
=
driver
.
(
PreprovisionedPVTestDriver
)
_
,
isSupported
=
driver
.
(
DynamicPVTestDriver
)
case
testpatterns
.
DynamicPV
:
default
:
_
,
isSupported
=
driver
.
(
DynamicPVTestDriver
)
isSupported
=
false
default
:
}
isSupported
=
false
}
if
!
isSupported
{
if
!
isSupported
{
framework
.
Skipf
(
"Driver %s doesn't support %v -- skipping"
,
dInfo
.
Name
,
pattern
.
VolType
)
framework
.
Skipf
(
"Driver %s doesn't support %v -- skipping"
,
dInfo
.
Name
,
pattern
.
VolType
)
}
}
// 3. Check if fsType is supported
// 3. Check if fsType is supported
if
!
dInfo
.
SupportedFsType
.
Has
(
pattern
.
FsType
)
{
if
!
dInfo
.
SupportedFsType
.
Has
(
pattern
.
FsType
)
{
framework
.
Skipf
(
"Driver %s doesn't support %v -- skipping"
,
dInfo
.
Name
,
pattern
.
FsType
)
framework
.
Skipf
(
"Driver %s doesn't support %v -- skipping"
,
dInfo
.
Name
,
pattern
.
FsType
)
}
}
if
pattern
.
FsType
==
"xfs"
&&
framework
.
NodeOSDistroIs
(
"gci"
)
{
if
pattern
.
FsType
==
"xfs"
&&
framework
.
NodeOSDistroIs
(
"gci"
)
{
framework
.
Skipf
(
"Distro doesn't support xfs -- skipping"
)
framework
.
Skipf
(
"Distro doesn't support xfs -- skipping"
)
}
}
}
// 4. Check with driver specific logic
// 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 {
...
@@ -80,6 +80,10 @@ func (s *snapshottableTestSuite) getTestSuiteInfo() TestSuiteInfo {
}
}
func
(
s
*
snapshottableTestSuite
)
skipUnsupportedTest
(
pattern
testpatterns
.
TestPattern
,
driver
TestDriver
)
{
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
)
{
func
createSnapshottableTestInput
(
driver
TestDriver
,
pattern
testpatterns
.
TestPattern
)
(
snapshottableTestResource
,
snapshottableTestInput
)
{
...
@@ -87,18 +91,17 @@ func createSnapshottableTestInput(driver TestDriver, pattern testpatterns.TestPa
...
@@ -87,18 +91,17 @@ func createSnapshottableTestInput(driver TestDriver, pattern testpatterns.TestPa
resource
:=
snapshottableTestResource
{}
resource
:=
snapshottableTestResource
{}
resource
.
setupResource
(
driver
,
pattern
)
resource
.
setupResource
(
driver
,
pattern
)
dInfo
:=
driver
.
GetDriverInfo
()
input
:=
snapshottableTestInput
{
input
:=
snapshottableTestInput
{
testCase
:
SnapshotClassTest
{},
testCase
:
SnapshotClassTest
{
cs
:
driver
.
GetDriverInfo
()
.
Config
.
Framework
.
ClientSet
,
NodeName
:
dInfo
.
Config
.
ClientNodeName
,
dc
:
driver
.
GetDriverInfo
()
.
Config
.
Framework
.
DynamicClient
,
},
pvc
:
resource
.
pvc
,
cs
:
dInfo
.
Config
.
Framework
.
ClientSet
,
sc
:
resource
.
sc
,
dc
:
dInfo
.
Config
.
Framework
.
DynamicClient
,
vsc
:
resource
.
vsc
,
pvc
:
resource
.
pvc
,
dInfo
:
driver
.
GetDriverInfo
(),
sc
:
resource
.
sc
,
}
vsc
:
resource
.
vsc
,
dInfo
:
dInfo
,
if
driver
.
GetDriverInfo
()
.
Config
.
ClientNodeName
!=
""
{
input
.
testCase
.
NodeName
=
driver
.
GetDriverInfo
()
.
Config
.
ClientNodeName
}
}
return
resource
,
input
return
resource
,
input
...
@@ -187,10 +190,7 @@ type snapshottableTestInput struct {
...
@@ -187,10 +190,7 @@ type snapshottableTestInput struct {
}
}
func
testSnapshot
(
input
*
snapshottableTestInput
)
{
func
testSnapshot
(
input
*
snapshottableTestInput
)
{
It
(
"should create snapshot with defaults"
,
func
()
{
It
(
"should create snapshot with defaults [Feature:VolumeSnapshotDataSource]"
,
func
()
{
if
input
.
dInfo
.
Name
==
"csi-hostpath-v0"
{
framework
.
Skipf
(
"skip test when using driver csi-hostpath-v0 - skipping"
)
}
TestCreateSnapshot
(
input
.
testCase
,
input
.
cs
,
input
.
dc
,
input
.
pvc
,
input
.
sc
,
input
.
vsc
)
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 (
...
@@ -97,6 +97,13 @@ const (
CapFsGroup
Capability
=
"fsGroup"
// volume ownership via fsGroup
CapFsGroup
Capability
=
"fsGroup"
// volume ownership via fsGroup
CapExec
Capability
=
"exec"
// exec a file in the volume
CapExec
Capability
=
"exec"
// exec a file in the volume
CapDataSource
Capability
=
"dataSource"
// support populate data from snapshot
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
// 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
...
@@ -226,7 +226,7 @@ func testZonalDelayedBinding(c clientset.Interface, ns string, specifyAllowedTop
claim
.
Spec
.
StorageClassName
=
&
class
.
Name
claim
.
Spec
.
StorageClassName
=
&
class
.
Name
claims
=
append
(
claims
,
claim
)
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
{
if
node
==
nil
{
framework
.
Failf
(
"unexpected nil node found"
)
framework
.
Failf
(
"unexpected nil node found"
)
}
}
...
@@ -273,8 +273,10 @@ var _ = utils.SIGDescribe("Dynamic Provisioning", func() {
...
@@ -273,8 +273,10 @@ var _ = utils.SIGDescribe("Dynamic Provisioning", func() {
},
},
ClaimSize
:
"1.5Gi"
,
ClaimSize
:
"1.5Gi"
,
ExpectedSize
:
"2Gi"
,
ExpectedSize
:
"2Gi"
,
PvCheck
:
func
(
volume
*
v1
.
PersistentVolume
)
error
{
PvCheck
:
func
(
claim
*
v1
.
PersistentVolumeClaim
,
volume
*
v1
.
PersistentVolume
)
{
return
checkGCEPD
(
volume
,
"pd-ssd"
)
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() {
...
@@ -286,8 +288,10 @@ var _ = utils.SIGDescribe("Dynamic Provisioning", func() {
},
},
ClaimSize
:
"1.5Gi"
,
ClaimSize
:
"1.5Gi"
,
ExpectedSize
:
"2Gi"
,
ExpectedSize
:
"2Gi"
,
PvCheck
:
func
(
volume
*
v1
.
PersistentVolume
)
error
{
PvCheck
:
func
(
claim
*
v1
.
PersistentVolumeClaim
,
volume
*
v1
.
PersistentVolume
)
{
return
checkGCEPD
(
volume
,
"pd-standard"
)
err
:=
checkGCEPD
(
volume
,
"pd-standard"
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
(),
"checkGCEPD pd-standard"
)
testsuites
.
PVWriteReadSingleNodeCheck
(
c
,
claim
,
volume
,
testsuites
.
NodeSelection
{})
},
},
},
},
// AWS
// AWS
...
@@ -301,8 +305,10 @@ var _ = utils.SIGDescribe("Dynamic Provisioning", func() {
...
@@ -301,8 +305,10 @@ var _ = utils.SIGDescribe("Dynamic Provisioning", func() {
},
},
ClaimSize
:
"1.5Gi"
,
ClaimSize
:
"1.5Gi"
,
ExpectedSize
:
"2Gi"
,
ExpectedSize
:
"2Gi"
,
PvCheck
:
func
(
volume
*
v1
.
PersistentVolume
)
error
{
PvCheck
:
func
(
claim
*
v1
.
PersistentVolumeClaim
,
volume
*
v1
.
PersistentVolume
)
{
return
checkAWSEBS
(
volume
,
"gp2"
,
false
)
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() {
...
@@ -315,8 +321,10 @@ var _ = utils.SIGDescribe("Dynamic Provisioning", func() {
},
},
ClaimSize
:
"3.5Gi"
,
ClaimSize
:
"3.5Gi"
,
ExpectedSize
:
"4Gi"
,
// 4 GiB is minimum for io1
ExpectedSize
:
"4Gi"
,
// 4 GiB is minimum for io1
PvCheck
:
func
(
volume
*
v1
.
PersistentVolume
)
error
{
PvCheck
:
func
(
claim
*
v1
.
PersistentVolumeClaim
,
volume
*
v1
.
PersistentVolume
)
{
return
checkAWSEBS
(
volume
,
"io1"
,
false
)
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() {
...
@@ -328,8 +336,10 @@ var _ = utils.SIGDescribe("Dynamic Provisioning", func() {
},
},
ClaimSize
:
"500Gi"
,
// minimum for sc1
ClaimSize
:
"500Gi"
,
// minimum for sc1
ExpectedSize
:
"500Gi"
,
ExpectedSize
:
"500Gi"
,
PvCheck
:
func
(
volume
*
v1
.
PersistentVolume
)
error
{
PvCheck
:
func
(
claim
*
v1
.
PersistentVolumeClaim
,
volume
*
v1
.
PersistentVolume
)
{
return
checkAWSEBS
(
volume
,
"sc1"
,
false
)
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() {
...
@@ -341,8 +351,10 @@ var _ = utils.SIGDescribe("Dynamic Provisioning", func() {
},
},
ClaimSize
:
"500Gi"
,
// minimum for st1
ClaimSize
:
"500Gi"
,
// minimum for st1
ExpectedSize
:
"500Gi"
,
ExpectedSize
:
"500Gi"
,
PvCheck
:
func
(
volume
*
v1
.
PersistentVolume
)
error
{
PvCheck
:
func
(
claim
*
v1
.
PersistentVolumeClaim
,
volume
*
v1
.
PersistentVolume
)
{
return
checkAWSEBS
(
volume
,
"st1"
,
false
)
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() {
...
@@ -354,8 +366,10 @@ var _ = utils.SIGDescribe("Dynamic Provisioning", func() {
},
},
ClaimSize
:
"1Gi"
,
ClaimSize
:
"1Gi"
,
ExpectedSize
:
"1Gi"
,
ExpectedSize
:
"1Gi"
,
PvCheck
:
func
(
volume
*
v1
.
PersistentVolume
)
error
{
PvCheck
:
func
(
claim
*
v1
.
PersistentVolumeClaim
,
volume
*
v1
.
PersistentVolume
)
{
return
checkAWSEBS
(
volume
,
"gp2"
,
true
)
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)
// OpenStack generic tests (works on all OpenStack deployments)
...
@@ -366,7 +380,9 @@ var _ = utils.SIGDescribe("Dynamic Provisioning", func() {
...
@@ -366,7 +380,9 @@ var _ = utils.SIGDescribe("Dynamic Provisioning", func() {
Parameters
:
map
[
string
]
string
{},
Parameters
:
map
[
string
]
string
{},
ClaimSize
:
"1.5Gi"
,
ClaimSize
:
"1.5Gi"
,
ExpectedSize
:
"2Gi"
,
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"
,
Name
:
"Cinder volume with empty volume type and zone on OpenStack"
,
...
@@ -378,7 +394,9 @@ var _ = utils.SIGDescribe("Dynamic Provisioning", func() {
...
@@ -378,7 +394,9 @@ var _ = utils.SIGDescribe("Dynamic Provisioning", func() {
},
},
ClaimSize
:
"1.5Gi"
,
ClaimSize
:
"1.5Gi"
,
ExpectedSize
:
"2Gi"
,
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
// vSphere generic test
{
{
...
@@ -388,7 +406,9 @@ var _ = utils.SIGDescribe("Dynamic Provisioning", func() {
...
@@ -388,7 +406,9 @@ var _ = utils.SIGDescribe("Dynamic Provisioning", func() {
Parameters
:
map
[
string
]
string
{},
Parameters
:
map
[
string
]
string
{},
ClaimSize
:
"1.5Gi"
,
ClaimSize
:
"1.5Gi"
,
ExpectedSize
:
"1.5Gi"
,
ExpectedSize
:
"1.5Gi"
,
PvCheck
:
nil
,
PvCheck
:
func
(
claim
*
v1
.
PersistentVolumeClaim
,
volume
*
v1
.
PersistentVolume
)
{
testsuites
.
PVWriteReadSingleNodeCheck
(
c
,
claim
,
volume
,
testsuites
.
NodeSelection
{})
},
},
},
// Azure
// Azure
{
{
...
@@ -398,7 +418,9 @@ var _ = utils.SIGDescribe("Dynamic Provisioning", func() {
...
@@ -398,7 +418,9 @@ var _ = utils.SIGDescribe("Dynamic Provisioning", func() {
Parameters
:
map
[
string
]
string
{},
Parameters
:
map
[
string
]
string
{},
ClaimSize
:
"1Gi"
,
ClaimSize
:
"1Gi"
,
ExpectedSize
:
"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() {
...
@@ -451,8 +473,10 @@ var _ = utils.SIGDescribe("Dynamic Provisioning", func() {
},
},
ClaimSize
:
"1Gi"
,
ClaimSize
:
"1Gi"
,
ExpectedSize
:
"1Gi"
,
ExpectedSize
:
"1Gi"
,
PvCheck
:
func
(
volume
*
v1
.
PersistentVolume
)
error
{
PvCheck
:
func
(
claim
*
v1
.
PersistentVolumeClaim
,
volume
*
v1
.
PersistentVolume
)
{
return
checkGCEPD
(
volume
,
"pd-standard"
)
err
:=
checkGCEPD
(
volume
,
"pd-standard"
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
(),
"checkGCEPD"
)
testsuites
.
PVWriteReadSingleNodeCheck
(
c
,
claim
,
volume
,
testsuites
.
NodeSelection
{})
},
},
}
}
class
:=
newStorageClass
(
test
,
ns
,
"reclaimpolicy"
)
class
:=
newStorageClass
(
test
,
ns
,
"reclaimpolicy"
)
...
@@ -793,12 +817,11 @@ var _ = utils.SIGDescribe("Dynamic Provisioning", func() {
...
@@ -793,12 +817,11 @@ var _ = utils.SIGDescribe("Dynamic Provisioning", func() {
serverUrl
:=
"https://"
+
pod
.
Status
.
PodIP
+
":8081"
serverUrl
:=
"https://"
+
pod
.
Status
.
PodIP
+
":8081"
By
(
"creating a StorageClass"
)
By
(
"creating a StorageClass"
)
test
:=
testsuites
.
StorageClassTest
{
test
:=
testsuites
.
StorageClassTest
{
Name
:
"Gluster Dynamic provisioner test"
,
Name
:
"Gluster Dynamic provisioner test"
,
Provisioner
:
"kubernetes.io/glusterfs"
,
Provisioner
:
"kubernetes.io/glusterfs"
,
ClaimSize
:
"2Gi"
,
ClaimSize
:
"2Gi"
,
ExpectedSize
:
"2Gi"
,
ExpectedSize
:
"2Gi"
,
Parameters
:
map
[
string
]
string
{
"resturl"
:
serverUrl
},
Parameters
:
map
[
string
]
string
{
"resturl"
:
serverUrl
},
SkipWriteReadCheck
:
true
,
}
}
suffix
:=
fmt
.
Sprintf
(
"glusterdptest"
)
suffix
:=
fmt
.
Sprintf
(
"glusterdptest"
)
class
:=
newStorageClass
(
test
,
ns
,
suffix
)
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