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
d01c0153
Unverified
Commit
d01c0153
authored
May 11, 2019
by
Kubernetes Prow Robot
Committed by
GitHub
May 11, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #77777 from SataQiu/fix-golint-test-20190511
Fix golint failures of test/e2e/storage
parents
73c83a82
01d38fec
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
31 additions
and
36 deletions
+31
-36
.golint_failures
hack/.golint_failures
+0
-1
csi_mock_volume.go
test/e2e/storage/csi_mock_volume.go
+5
-6
detach_mounted.go
test/e2e/storage/detach_mounted.go
+1
-0
nfs_persistent_volume-disruptive.go
test/e2e/storage/nfs_persistent_volume-disruptive.go
+1
-5
pd.go
test/e2e/storage/pd.go
+1
-2
persistent_volumes-local.go
test/e2e/storage/persistent_volumes-local.go
+19
-18
volume_provisioning.go
test/e2e/storage/volume_provisioning.go
+3
-4
volumes.go
test/e2e/storage/volumes.go
+1
-0
No files found.
hack/.golint_failures
View file @
d01c0153
...
...
@@ -609,7 +609,6 @@ test/e2e/lifecycle/bootstrap
test/e2e/node
test/e2e/scalability
test/e2e/scheduling
test/e2e/storage
test/e2e/storage/drivers
test/e2e/storage/testsuites
test/e2e/storage/utils
...
...
test/e2e/storage/csi_mock_volume.go
View file @
d01c0153
...
...
@@ -756,12 +756,11 @@ func checkPodInfo(cs clientset.Interface, namespace, driverPodName, driverContai
return
fmt
.
Errorf
(
"number of found volume attributes does not match, expected %d, got %d"
,
len
(
expectedAttributes
),
foundAttributes
.
Len
())
}
return
nil
}
else
{
if
foundAttributes
.
Len
()
!=
0
{
return
fmt
.
Errorf
(
"some unexpected volume attributes were found: %+v"
,
foundAttributes
.
List
())
}
return
nil
}
if
foundAttributes
.
Len
()
!=
0
{
return
fmt
.
Errorf
(
"some unexpected volume attributes were found: %+v"
,
foundAttributes
.
List
())
}
return
nil
}
func
waitForCSIDriver
(
cs
clientset
.
Interface
,
driverName
string
)
error
{
...
...
@@ -774,7 +773,7 @@ func waitForCSIDriver(cs clientset.Interface, driverName string) error {
return
err
}
}
return
fmt
.
Errorf
(
"gave up after waiting %v for CSIDriver %q
.
"
,
timeout
,
driverName
)
return
fmt
.
Errorf
(
"gave up after waiting %v for CSIDriver %q"
,
timeout
,
driverName
)
}
func
destroyCSIDriver
(
cs
clientset
.
Interface
,
driverName
string
)
{
...
...
test/e2e/storage/detach_mounted.go
View file @
d01c0153
...
...
@@ -35,6 +35,7 @@ import (
)
var
(
// BusyBoxImage is the image URI of BusyBox.
BusyBoxImage
=
imageutils
.
GetE2EImage
(
imageutils
.
BusyBox
)
durationForStuckMount
=
110
*
time
.
Second
)
...
...
test/e2e/storage/nfs_persistent_volume-disruptive.go
View file @
d01c0153
...
...
@@ -39,10 +39,6 @@ type disruptiveTest struct {
runTest
testBody
}
const
(
MinNodes
=
2
)
var
_
=
utils
.
SIGDescribe
(
"NFSPersistentVolumes[Disruptive][Flaky]"
,
func
()
{
f
:=
framework
.
NewDefaultFramework
(
"disruptive-pv"
)
...
...
@@ -60,7 +56,7 @@ var _ = utils.SIGDescribe("NFSPersistentVolumes[Disruptive][Flaky]", func() {
ginkgo
.
BeforeEach
(
func
()
{
// To protect the NFS volume pod from the kubelet restart, we isolate it on its own node.
framework
.
SkipUnlessNodeCountIsAtLeast
(
M
inNodes
)
framework
.
SkipUnlessNodeCountIsAtLeast
(
m
inNodes
)
framework
.
SkipIfProviderIs
(
"local"
)
c
=
f
.
ClientSet
...
...
test/e2e/storage/pd.go
View file @
d01c0153
...
...
@@ -421,9 +421,8 @@ var _ = utils.SIGDescribe("Pod Disks", func() {
err
=
cs
.
CoreV1
()
.
Pods
(
ns
)
.
Evict
(
evictTarget
)
if
err
!=
nil
{
return
false
,
nil
}
else
{
return
true
,
nil
}
return
true
,
nil
})
framework
.
ExpectNoError
(
err
,
fmt
.
Sprintf
(
"failed to evict host0Pod after %v"
,
podEvictTimeout
))
}
...
...
test/e2e/storage/persistent_volumes-local.go
View file @
d01c0153
...
...
@@ -59,27 +59,30 @@ type localTestConfig struct {
type
localVolumeType
string
const
(
// default local volume type, aka a directory
//
DirectoryLocalVolumeType is the
default local volume type, aka a directory
DirectoryLocalVolumeType
localVolumeType
=
"dir"
// like DirectoryLocalVolumeType but it's a symbolic link to directory
// DirectoryLinkLocalVolumeType is like DirectoryLocalVolumeType,
// but it's a symbolic link to directory
DirectoryLinkLocalVolumeType
localVolumeType
=
"dir-link"
// like DirectoryLocalVolumeType but bind mounted
// DirectoryBindMountedLocalVolumeType is like DirectoryLocalVolumeType
// but bind mounted
DirectoryBindMountedLocalVolumeType
localVolumeType
=
"dir-bindmounted"
// like DirectoryLocalVolumeType but it's a symbolic link to self bind mounted directory
// DirectoryLinkBindMountedLocalVolumeType is like DirectoryLocalVolumeType,
// but it's a symbolic link to self bind mounted directory
// Note that bind mounting at symbolic link actually mounts at directory it
// links to.
DirectoryLinkBindMountedLocalVolumeType
localVolumeType
=
"dir-link-bindmounted"
// creates a tmpfs and mounts it
//
TmpfsLocalVolumeType
creates a tmpfs and mounts it
TmpfsLocalVolumeType
localVolumeType
=
"tmpfs"
// tests based on local ssd at /mnt/disks/by-uuid/
//
GCELocalSSDVolumeType
tests based on local ssd at /mnt/disks/by-uuid/
GCELocalSSDVolumeType
localVolumeType
=
"gce-localssd-scsi-fs"
//
C
reates a local file, formats it, and maps it as a block device.
//
BlockLocalVolumeType c
reates a local file, formats it, and maps it as a block device.
BlockLocalVolumeType
localVolumeType
=
"block"
//
Creates a local file serving as the backing for block device., formats it
,
// and mounts it to use as FS mode local volume.
//
BlockFsWithFormatLocalVolumeType creates a local file serving as the backing for block device
,
//
formats it,
and mounts it to use as FS mode local volume.
BlockFsWithFormatLocalVolumeType
localVolumeType
=
"blockfswithformat"
//
Creates a local file serving as the backing for block device. do not format it manually
,
// and mounts it to use as FS mode local volume.
//
BlockFsWithoutFormatLocalVolumeType creates a local file serving as the backing for block device
,
//
does not format it manually,
and mounts it to use as FS mode local volume.
BlockFsWithoutFormatLocalVolumeType
localVolumeType
=
"blockfswithoutformat"
)
...
...
@@ -1003,21 +1006,19 @@ func createWriteCmd(testDir string, testFile string, writeTestFileContent string
// Cleanup the file containing testFileContent.
deleteTestFileCmd
:=
fmt
.
Sprintf
(
"rm %s"
,
testFilePath
)
return
fmt
.
Sprintf
(
"%s && %s && %s && %s"
,
writeTestFileCmd
,
sudoCmd
,
writeBlockCmd
,
deleteTestFileCmd
)
}
else
{
testFilePath
:=
filepath
.
Join
(
testDir
,
testFile
)
return
fmt
.
Sprintf
(
"mkdir -p %s; echo %s > %s"
,
testDir
,
writeTestFileContent
,
testFilePath
)
}
testFilePath
:=
filepath
.
Join
(
testDir
,
testFile
)
return
fmt
.
Sprintf
(
"mkdir -p %s; echo %s > %s"
,
testDir
,
writeTestFileContent
,
testFilePath
)
}
func
createReadCmd
(
testFileDir
string
,
testFile
string
,
volumeType
localVolumeType
)
string
{
if
volumeType
==
BlockLocalVolumeType
{
// Create the command to read the beginning of the block device and print it in ascii.
return
fmt
.
Sprintf
(
"hexdump -n 100 -e '100
\"
%%_p
\"
' %s | head -1"
,
testFileDir
)
}
else
{
// Create the command to read (aka cat) a file.
testFilePath
:=
filepath
.
Join
(
testFileDir
,
testFile
)
return
fmt
.
Sprintf
(
"cat %s"
,
testFilePath
)
}
// Create the command to read (aka cat) a file.
testFilePath
:=
filepath
.
Join
(
testFileDir
,
testFile
)
return
fmt
.
Sprintf
(
"cat %s"
,
testFilePath
)
}
// Read testFile and evaluate whether it contains the testFileContent
...
...
test/e2e/storage/volume_provisioning.go
View file @
d01c0153
...
...
@@ -847,7 +847,7 @@ var _ = utils.SIGDescribe("Dynamic Provisioning", func() {
framework
.
SkipIfProviderIs
(
"gke"
)
ginkgo
.
By
(
"creating a Gluster DP server Pod"
)
pod
:=
startGlusterDpServerPod
(
c
,
ns
)
serverU
rl
:=
"http://"
+
pod
.
Status
.
PodIP
+
":8081"
serverU
RL
:=
"http://"
+
pod
.
Status
.
PodIP
+
":8081"
ginkgo
.
By
(
"creating a StorageClass"
)
test
:=
testsuites
.
StorageClassTest
{
Client
:
c
,
...
...
@@ -855,7 +855,7 @@ var _ = utils.SIGDescribe("Dynamic Provisioning", func() {
Provisioner
:
"kubernetes.io/glusterfs"
,
ClaimSize
:
"2Gi"
,
ExpectedSize
:
"2Gi"
,
Parameters
:
map
[
string
]
string
{
"resturl"
:
serverU
rl
},
Parameters
:
map
[
string
]
string
{
"resturl"
:
serverU
RL
},
}
suffix
:=
fmt
.
Sprintf
(
"glusterdptest"
)
test
.
Class
=
newStorageClass
(
test
,
ns
,
suffix
)
...
...
@@ -1206,9 +1206,8 @@ func waitForProvisionedVolumesDeleted(c clientset.Interface, scName string) ([]*
}
if
len
(
remainingPVs
)
>
0
{
return
false
,
nil
// Poll until no PVs remain
}
else
{
return
true
,
nil
// No PVs remain
}
return
true
,
nil
// No PVs remain
})
return
remainingPVs
,
err
}
...
...
test/e2e/storage/volumes.go
View file @
d01c0153
...
...
@@ -15,6 +15,7 @@ limitations under the License.
*/
// This test is volumes test for configmap.
package
storage
import
(
...
...
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