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
b6701153
Unverified
Commit
b6701153
authored
Jan 28, 2019
by
Kubernetes Prow Robot
Committed by
GitHub
Jan 28, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #70823 from mkimuram/issue/70822
Fix volumes e2e test to check fsType
parents
c0e80056
b152d435
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
35 additions
and
16 deletions
+35
-16
aws_util.go
pkg/volume/awsebs/aws_util.go
+3
-1
volumes.go
test/e2e/common/volumes.go
+3
-3
volume_util.go
test/e2e/framework/volume_util.go
+7
-1
csi.go
test/e2e/storage/drivers/csi.go
+12
-0
in_tree.go
test/e2e/storage/drivers/in_tree.go
+0
-6
flexvolume.go
test/e2e/storage/flexvolume.go
+1
-1
base.go
test/e2e/storage/testsuites/base.go
+5
-2
volumes.go
test/e2e/storage/testsuites/volumes.go
+3
-1
volumes.go
test/e2e/storage/volumes.go
+1
-1
No files found.
pkg/volume/awsebs/aws_util.go
View file @
b6701153
...
@@ -120,9 +120,11 @@ func (util *AWSDiskUtil) CreateVolume(c *awsElasticBlockStoreProvisioner, node *
...
@@ -120,9 +120,11 @@ func (util *AWSDiskUtil) CreateVolume(c *awsElasticBlockStoreProvisioner, node *
}
}
fstype
:=
""
fstype
:=
""
if
v
,
ok
:=
c
.
options
.
Parameters
[
volume
.
VolumeParameterFSType
];
ok
{
for
k
,
v
:=
range
c
.
options
.
Parameters
{
if
strings
.
ToLower
(
k
)
==
volume
.
VolumeParameterFSType
{
fstype
=
v
fstype
=
v
}
}
}
return
name
,
volumeOptions
.
CapacityGB
,
labels
,
fstype
,
nil
return
name
,
volumeOptions
.
CapacityGB
,
labels
,
fstype
,
nil
}
}
...
...
test/e2e/common/volumes.go
View file @
b6701153
...
@@ -91,7 +91,7 @@ var _ = Describe("[sig-storage] GCP Volumes", func() {
...
@@ -91,7 +91,7 @@ var _ = Describe("[sig-storage] GCP Volumes", func() {
}
}
// Must match content of test/images/volumes-tester/nfs/index.html
// Must match content of test/images/volumes-tester/nfs/index.html
framework
.
TestVolumeClient
(
c
,
config
,
nil
,
tests
)
framework
.
TestVolumeClient
(
c
,
config
,
nil
,
""
/* fsType */
,
tests
)
})
})
})
})
...
@@ -114,7 +114,7 @@ var _ = Describe("[sig-storage] GCP Volumes", func() {
...
@@ -114,7 +114,7 @@ var _ = Describe("[sig-storage] GCP Volumes", func() {
},
},
}
}
// Must match content of test/images/volume-tester/nfs/index.html
// Must match content of test/images/volume-tester/nfs/index.html
framework
.
TestVolumeClient
(
c
,
config
,
nil
,
tests
)
framework
.
TestVolumeClient
(
c
,
config
,
nil
,
""
/* fsType */
,
tests
)
})
})
})
})
...
@@ -147,7 +147,7 @@ var _ = Describe("[sig-storage] GCP Volumes", func() {
...
@@ -147,7 +147,7 @@ var _ = Describe("[sig-storage] GCP Volumes", func() {
ExpectedContent
:
"Hello from GlusterFS!"
,
ExpectedContent
:
"Hello from GlusterFS!"
,
},
},
}
}
framework
.
TestVolumeClient
(
c
,
config
,
nil
,
tests
)
framework
.
TestVolumeClient
(
c
,
config
,
nil
,
""
/* fsType */
,
tests
)
})
})
})
})
})
})
test/e2e/framework/volume_util.go
View file @
b6701153
...
@@ -401,7 +401,7 @@ func VolumeTestCleanup(f *Framework, config VolumeTestConfig) {
...
@@ -401,7 +401,7 @@ func VolumeTestCleanup(f *Framework, config VolumeTestConfig) {
// and check that the pod sees expected data, e.g. from the server pod.
// and check that the pod sees expected data, e.g. from the server pod.
// Multiple VolumeTests can be specified to mount multiple volumes to a single
// Multiple VolumeTests can be specified to mount multiple volumes to a single
// pod.
// pod.
func
TestVolumeClient
(
client
clientset
.
Interface
,
config
VolumeTestConfig
,
fsGroup
*
int64
,
tests
[]
VolumeTest
)
{
func
TestVolumeClient
(
client
clientset
.
Interface
,
config
VolumeTestConfig
,
fsGroup
*
int64
,
fsType
string
,
tests
[]
VolumeTest
)
{
By
(
fmt
.
Sprint
(
"starting "
,
config
.
Prefix
,
" client"
))
By
(
fmt
.
Sprint
(
"starting "
,
config
.
Prefix
,
" client"
))
var
gracePeriod
int64
=
1
var
gracePeriod
int64
=
1
clientPod
:=
&
v1
.
Pod
{
clientPod
:=
&
v1
.
Pod
{
...
@@ -476,6 +476,12 @@ func TestVolumeClient(client clientset.Interface, config VolumeTestConfig, fsGro
...
@@ -476,6 +476,12 @@ func TestVolumeClient(client clientset.Interface, config VolumeTestConfig, fsGro
_
,
err
=
LookForStringInPodExec
(
config
.
Namespace
,
clientPod
.
Name
,
[]
string
{
"ls"
,
"-ld"
,
"/opt/0"
},
strconv
.
Itoa
(
int
(
*
fsGroup
)),
time
.
Minute
)
_
,
err
=
LookForStringInPodExec
(
config
.
Namespace
,
clientPod
.
Name
,
[]
string
{
"ls"
,
"-ld"
,
"/opt/0"
},
strconv
.
Itoa
(
int
(
*
fsGroup
)),
time
.
Minute
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
(),
"failed: getting the right privileges in the file %v"
,
int
(
*
fsGroup
))
Expect
(
err
)
.
NotTo
(
HaveOccurred
(),
"failed: getting the right privileges in the file %v"
,
int
(
*
fsGroup
))
}
}
if
fsType
!=
""
{
By
(
"Checking fsType is correct."
)
_
,
err
=
LookForStringInPodExec
(
config
.
Namespace
,
clientPod
.
Name
,
[]
string
{
"grep"
,
" /opt/0 "
,
"/proc/mounts"
},
fsType
,
time
.
Minute
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
(),
"failed: getting the right fsType %s"
,
fsType
)
}
}
}
// Insert index.html with given content into given volume. It does so by
// Insert index.html with given content into given volume. It does so by
...
...
test/e2e/storage/drivers/csi.go
View file @
b6701153
...
@@ -304,6 +304,9 @@ func (g *gcePDCSIDriver) SkipUnsupportedTest(pattern testpatterns.TestPattern) {
...
@@ -304,6 +304,9 @@ func (g *gcePDCSIDriver) SkipUnsupportedTest(pattern testpatterns.TestPattern) {
// tests to fail.
// tests to fail.
framework
.
SkipIfMultizone
(
f
.
ClientSet
)
framework
.
SkipIfMultizone
(
f
.
ClientSet
)
}
}
if
pattern
.
FsType
==
"xfs"
{
framework
.
SkipUnlessNodeOSDistroIs
(
"ubuntu"
,
"custom"
)
}
}
}
func
(
g
*
gcePDCSIDriver
)
GetDynamicProvisionStorageClass
(
fsType
string
)
*
storagev1
.
StorageClass
{
func
(
g
*
gcePDCSIDriver
)
GetDynamicProvisionStorageClass
(
fsType
string
)
*
storagev1
.
StorageClass
{
...
@@ -312,6 +315,9 @@ func (g *gcePDCSIDriver) GetDynamicProvisionStorageClass(fsType string) *storage
...
@@ -312,6 +315,9 @@ func (g *gcePDCSIDriver) GetDynamicProvisionStorageClass(fsType string) *storage
suffix
:=
fmt
.
Sprintf
(
"%s-sc"
,
g
.
driverInfo
.
Name
)
suffix
:=
fmt
.
Sprintf
(
"%s-sc"
,
g
.
driverInfo
.
Name
)
parameters
:=
map
[
string
]
string
{
"type"
:
"pd-standard"
}
parameters
:=
map
[
string
]
string
{
"type"
:
"pd-standard"
}
if
fsType
!=
""
{
parameters
[
"csi.storage.k8s.io/fstype"
]
=
fsType
}
return
testsuites
.
GetStorageClass
(
provisioner
,
parameters
,
nil
,
ns
,
suffix
)
return
testsuites
.
GetStorageClass
(
provisioner
,
parameters
,
nil
,
ns
,
suffix
)
}
}
...
@@ -404,6 +410,9 @@ func (g *gcePDExternalCSIDriver) GetDriverInfo() *testsuites.DriverInfo {
...
@@ -404,6 +410,9 @@ func (g *gcePDExternalCSIDriver) GetDriverInfo() *testsuites.DriverInfo {
func
(
g
*
gcePDExternalCSIDriver
)
SkipUnsupportedTest
(
pattern
testpatterns
.
TestPattern
)
{
func
(
g
*
gcePDExternalCSIDriver
)
SkipUnsupportedTest
(
pattern
testpatterns
.
TestPattern
)
{
framework
.
SkipUnlessProviderIs
(
"gce"
,
"gke"
)
framework
.
SkipUnlessProviderIs
(
"gce"
,
"gke"
)
framework
.
SkipIfMultizone
(
g
.
driverInfo
.
Config
.
Framework
.
ClientSet
)
framework
.
SkipIfMultizone
(
g
.
driverInfo
.
Config
.
Framework
.
ClientSet
)
if
pattern
.
FsType
==
"xfs"
{
framework
.
SkipUnlessNodeOSDistroIs
(
"ubuntu"
,
"custom"
)
}
}
}
func
(
g
*
gcePDExternalCSIDriver
)
GetDynamicProvisionStorageClass
(
fsType
string
)
*
storagev1
.
StorageClass
{
func
(
g
*
gcePDExternalCSIDriver
)
GetDynamicProvisionStorageClass
(
fsType
string
)
*
storagev1
.
StorageClass
{
...
@@ -412,6 +421,9 @@ func (g *gcePDExternalCSIDriver) GetDynamicProvisionStorageClass(fsType string)
...
@@ -412,6 +421,9 @@ func (g *gcePDExternalCSIDriver) GetDynamicProvisionStorageClass(fsType string)
suffix
:=
fmt
.
Sprintf
(
"%s-sc"
,
g
.
driverInfo
.
Name
)
suffix
:=
fmt
.
Sprintf
(
"%s-sc"
,
g
.
driverInfo
.
Name
)
parameters
:=
map
[
string
]
string
{
"type"
:
"pd-standard"
}
parameters
:=
map
[
string
]
string
{
"type"
:
"pd-standard"
}
if
fsType
!=
""
{
parameters
[
"csi.storage.k8s.io/fstype"
]
=
fsType
}
return
testsuites
.
GetStorageClass
(
provisioner
,
parameters
,
nil
,
ns
,
suffix
)
return
testsuites
.
GetStorageClass
(
provisioner
,
parameters
,
nil
,
ns
,
suffix
)
}
}
...
...
test/e2e/storage/drivers/in_tree.go
View file @
b6701153
...
@@ -259,9 +259,6 @@ func (g *glusterFSDriver) GetDriverInfo() *testsuites.DriverInfo {
...
@@ -259,9 +259,6 @@ func (g *glusterFSDriver) GetDriverInfo() *testsuites.DriverInfo {
func
(
g
*
glusterFSDriver
)
SkipUnsupportedTest
(
pattern
testpatterns
.
TestPattern
)
{
func
(
g
*
glusterFSDriver
)
SkipUnsupportedTest
(
pattern
testpatterns
.
TestPattern
)
{
framework
.
SkipUnlessNodeOSDistroIs
(
"gci"
,
"ubuntu"
,
"custom"
)
framework
.
SkipUnlessNodeOSDistroIs
(
"gci"
,
"ubuntu"
,
"custom"
)
if
pattern
.
FsType
==
"xfs"
{
framework
.
SkipUnlessNodeOSDistroIs
(
"ubuntu"
,
"custom"
)
}
}
}
func
(
g
*
glusterFSDriver
)
GetVolumeSource
(
readOnly
bool
,
fsType
string
,
testResource
interface
{})
*
v1
.
VolumeSource
{
func
(
g
*
glusterFSDriver
)
GetVolumeSource
(
readOnly
bool
,
fsType
string
,
testResource
interface
{})
*
v1
.
VolumeSource
{
...
@@ -1178,9 +1175,6 @@ func (g *gcePdDriver) GetDriverInfo() *testsuites.DriverInfo {
...
@@ -1178,9 +1175,6 @@ func (g *gcePdDriver) GetDriverInfo() *testsuites.DriverInfo {
func
(
g
*
gcePdDriver
)
SkipUnsupportedTest
(
pattern
testpatterns
.
TestPattern
)
{
func
(
g
*
gcePdDriver
)
SkipUnsupportedTest
(
pattern
testpatterns
.
TestPattern
)
{
framework
.
SkipUnlessProviderIs
(
"gce"
,
"gke"
)
framework
.
SkipUnlessProviderIs
(
"gce"
,
"gke"
)
if
pattern
.
FsType
==
"xfs"
{
framework
.
SkipUnlessNodeOSDistroIs
(
"ubuntu"
,
"custom"
)
}
}
}
func
(
g
*
gcePdDriver
)
GetVolumeSource
(
readOnly
bool
,
fsType
string
,
testResource
interface
{})
*
v1
.
VolumeSource
{
func
(
g
*
gcePdDriver
)
GetVolumeSource
(
readOnly
bool
,
fsType
string
,
testResource
interface
{})
*
v1
.
VolumeSource
{
...
...
test/e2e/storage/flexvolume.go
View file @
b6701153
...
@@ -63,7 +63,7 @@ func testFlexVolume(driver string, cs clientset.Interface, config framework.Volu
...
@@ -63,7 +63,7 @@ func testFlexVolume(driver string, cs clientset.Interface, config framework.Volu
ExpectedContent
:
"Hello from flexvolume!"
,
ExpectedContent
:
"Hello from flexvolume!"
,
},
},
}
}
framework
.
TestVolumeClient
(
cs
,
config
,
nil
,
tests
)
framework
.
TestVolumeClient
(
cs
,
config
,
nil
,
""
/* fsType */
,
tests
)
framework
.
VolumeTestCleanup
(
f
,
config
)
framework
.
VolumeTestCleanup
(
f
,
config
)
}
}
...
...
test/e2e/storage/testsuites/base.go
View file @
b6701153
...
@@ -80,7 +80,7 @@ func RunTestSuite(f *framework.Framework, driver TestDriver, tsInits []func() Te
...
@@ -80,7 +80,7 @@ func RunTestSuite(f *framework.Framework, driver TestDriver, tsInits []func() Te
// is not suitable to be tested.
// is not suitable to be tested.
// Whether it needs to be skipped is checked by following steps:
// Whether it needs to be skipped is checked by following steps:
// 1. Check if Whether volType is supported by driver from its interface
// 1. Check if Whether volType is supported by driver from its interface
// 2. Check if fsType is supported
by driver
// 2. Check if fsType is supported
// 3. Check with driver specific logic
// 3. Check with driver specific logic
// 4. Check with testSuite specific logic
// 4. Check with testSuite specific logic
func
skipUnsupportedTest
(
suite
TestSuite
,
driver
TestDriver
,
pattern
testpatterns
.
TestPattern
)
{
func
skipUnsupportedTest
(
suite
TestSuite
,
driver
TestDriver
,
pattern
testpatterns
.
TestPattern
)
{
...
@@ -103,10 +103,13 @@ func skipUnsupportedTest(suite TestSuite, driver TestDriver, pattern testpattern
...
@@ -103,10 +103,13 @@ func skipUnsupportedTest(suite TestSuite, driver TestDriver, pattern testpattern
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
)
}
}
// 2. Check if fsType is supported
by driver
// 2. 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"
)
{
framework
.
Skipf
(
"Distro doesn't support xfs -- skipping"
)
}
// 3. Check with driver specific logic
// 3. Check with driver specific logic
driver
.
SkipUnsupportedTest
(
pattern
)
driver
.
SkipUnsupportedTest
(
pattern
)
...
...
test/e2e/storage/testsuites/volumes.go
View file @
b6701153
...
@@ -111,6 +111,7 @@ func createVolumesTestInput(pattern testpatterns.TestPattern, resource genericVo
...
@@ -111,6 +111,7 @@ func createVolumesTestInput(pattern testpatterns.TestPattern, resource genericVo
config
:
&
dInfo
.
Config
,
config
:
&
dInfo
.
Config
,
fsGroup
:
fsGroup
,
fsGroup
:
fsGroup
,
resource
:
resource
,
resource
:
resource
,
fsType
:
pattern
.
FsType
,
tests
:
[]
framework
.
VolumeTest
{
tests
:
[]
framework
.
VolumeTest
{
{
{
Volume
:
*
volSource
,
Volume
:
*
volSource
,
...
@@ -160,6 +161,7 @@ type volumesTestInput struct {
...
@@ -160,6 +161,7 @@ type volumesTestInput struct {
name
string
name
string
config
*
TestConfig
config
*
TestConfig
fsGroup
*
int64
fsGroup
*
int64
fsType
string
tests
[]
framework
.
VolumeTest
tests
[]
framework
.
VolumeTest
resource
genericVolumeTestResource
resource
genericVolumeTestResource
}
}
...
@@ -175,7 +177,7 @@ func testVolumes(input *volumesTestInput) {
...
@@ -175,7 +177,7 @@ func testVolumes(input *volumesTestInput) {
volumeTest
:=
input
.
tests
volumeTest
:=
input
.
tests
config
:=
convertTestConfig
(
input
.
config
)
config
:=
convertTestConfig
(
input
.
config
)
framework
.
InjectHtml
(
cs
,
config
,
volumeTest
[
0
]
.
Volume
,
volumeTest
[
0
]
.
ExpectedContent
)
framework
.
InjectHtml
(
cs
,
config
,
volumeTest
[
0
]
.
Volume
,
volumeTest
[
0
]
.
ExpectedContent
)
framework
.
TestVolumeClient
(
cs
,
config
,
input
.
fsGroup
,
input
.
tests
)
framework
.
TestVolumeClient
(
cs
,
config
,
input
.
fsGroup
,
input
.
fsType
,
input
.
tests
)
})
})
It
(
"should allow exec of files on the volume"
,
func
()
{
It
(
"should allow exec of files on the volume"
,
func
()
{
f
:=
input
.
f
f
:=
input
.
f
...
...
test/e2e/storage/volumes.go
View file @
b6701153
...
@@ -106,7 +106,7 @@ var _ = utils.SIGDescribe("Volumes", func() {
...
@@ -106,7 +106,7 @@ var _ = utils.SIGDescribe("Volumes", func() {
ExpectedContent
:
"this is the second file"
,
ExpectedContent
:
"this is the second file"
,
},
},
}
}
framework
.
TestVolumeClient
(
cs
,
config
,
nil
,
tests
)
framework
.
TestVolumeClient
(
cs
,
config
,
nil
,
""
/* fsType */
,
tests
)
})
})
})
})
})
})
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