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
7a1195fd
Commit
7a1195fd
authored
Oct 30, 2017
by
jianglingxia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
if judgement always true in e2e
parent
12e5db56
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
26 deletions
+10
-26
volumes.go
test/e2e/common/volumes.go
+5
-17
flexvolume.go
test/e2e/storage/flexvolume.go
+5
-9
No files found.
test/e2e/common/volumes.go
View file @
7a1195fd
...
@@ -56,9 +56,7 @@ import (
...
@@ -56,9 +56,7 @@ import (
var
_
=
Describe
(
"[sig-storage] GCP Volumes"
,
func
()
{
var
_
=
Describe
(
"[sig-storage] GCP Volumes"
,
func
()
{
f
:=
framework
.
NewDefaultFramework
(
"gcp-volume"
)
f
:=
framework
.
NewDefaultFramework
(
"gcp-volume"
)
// If 'false', the test won't clear its volumes upon completion. Useful for debugging,
// note that namespace deletion is handled by delete-namespace flag
// note that namespace deletion is handled by delete-namespace flag
clean
:=
true
// filled in BeforeEach
// filled in BeforeEach
var
namespace
*
v1
.
Namespace
var
namespace
*
v1
.
Namespace
var
c
clientset
.
Interface
var
c
clientset
.
Interface
...
@@ -76,11 +74,7 @@ var _ = Describe("[sig-storage] GCP Volumes", func() {
...
@@ -76,11 +74,7 @@ var _ = Describe("[sig-storage] GCP Volumes", func() {
Describe
(
"NFSv4"
,
func
()
{
Describe
(
"NFSv4"
,
func
()
{
It
(
"should be mountable for NFSv4"
,
func
()
{
It
(
"should be mountable for NFSv4"
,
func
()
{
config
,
_
,
serverIP
:=
framework
.
NewNFSServer
(
c
,
namespace
.
Name
,
[]
string
{})
config
,
_
,
serverIP
:=
framework
.
NewNFSServer
(
c
,
namespace
.
Name
,
[]
string
{})
defer
func
()
{
defer
framework
.
VolumeTestCleanup
(
f
,
config
)
if
clean
{
framework
.
VolumeTestCleanup
(
f
,
config
)
}
}()
tests
:=
[]
framework
.
VolumeTest
{
tests
:=
[]
framework
.
VolumeTest
{
{
{
...
@@ -104,11 +98,7 @@ var _ = Describe("[sig-storage] GCP Volumes", func() {
...
@@ -104,11 +98,7 @@ var _ = Describe("[sig-storage] GCP Volumes", func() {
Describe
(
"NFSv3"
,
func
()
{
Describe
(
"NFSv3"
,
func
()
{
It
(
"should be mountable for NFSv3"
,
func
()
{
It
(
"should be mountable for NFSv3"
,
func
()
{
config
,
_
,
serverIP
:=
framework
.
NewNFSServer
(
c
,
namespace
.
Name
,
[]
string
{})
config
,
_
,
serverIP
:=
framework
.
NewNFSServer
(
c
,
namespace
.
Name
,
[]
string
{})
defer
func
()
{
defer
framework
.
VolumeTestCleanup
(
f
,
config
)
if
clean
{
framework
.
VolumeTestCleanup
(
f
,
config
)
}
}()
tests
:=
[]
framework
.
VolumeTest
{
tests
:=
[]
framework
.
VolumeTest
{
{
{
...
@@ -137,11 +127,9 @@ var _ = Describe("[sig-storage] GCP Volumes", func() {
...
@@ -137,11 +127,9 @@ var _ = Describe("[sig-storage] GCP Volumes", func() {
config
,
_
,
_
:=
framework
.
NewGlusterfsServer
(
c
,
namespace
.
Name
)
config
,
_
,
_
:=
framework
.
NewGlusterfsServer
(
c
,
namespace
.
Name
)
name
:=
config
.
Prefix
+
"-server"
name
:=
config
.
Prefix
+
"-server"
defer
func
()
{
defer
func
()
{
if
clean
{
framework
.
VolumeTestCleanup
(
f
,
config
)
framework
.
VolumeTestCleanup
(
f
,
config
)
err
:=
c
.
CoreV1
()
.
Endpoints
(
namespace
.
Name
)
.
Delete
(
name
,
nil
)
err
:=
c
.
CoreV1
()
.
Endpoints
(
namespace
.
Name
)
.
Delete
(
name
,
nil
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
(),
"defer: Gluster delete endpoints failed"
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
(),
"defer: Gluster delete endpoints failed"
)
}
}()
}()
tests
:=
[]
framework
.
VolumeTest
{
tests
:=
[]
framework
.
VolumeTest
{
...
...
test/e2e/storage/flexvolume.go
View file @
7a1195fd
...
@@ -43,7 +43,7 @@ const (
...
@@ -43,7 +43,7 @@ const (
// testFlexVolume tests that a client pod using a given flexvolume driver
// testFlexVolume tests that a client pod using a given flexvolume driver
// successfully mounts it and runs
// successfully mounts it and runs
func
testFlexVolume
(
driver
string
,
cs
clientset
.
Interface
,
config
framework
.
VolumeTestConfig
,
f
*
framework
.
Framework
,
clean
bool
)
{
func
testFlexVolume
(
driver
string
,
cs
clientset
.
Interface
,
config
framework
.
VolumeTestConfig
,
f
*
framework
.
Framework
)
{
tests
:=
[]
framework
.
VolumeTest
{
tests
:=
[]
framework
.
VolumeTest
{
{
{
Volume
:
v1
.
VolumeSource
{
Volume
:
v1
.
VolumeSource
{
...
@@ -58,9 +58,7 @@ func testFlexVolume(driver string, cs clientset.Interface, config framework.Volu
...
@@ -58,9 +58,7 @@ func testFlexVolume(driver string, cs clientset.Interface, config framework.Volu
}
}
framework
.
TestVolumeClient
(
cs
,
config
,
nil
,
tests
)
framework
.
TestVolumeClient
(
cs
,
config
,
nil
,
tests
)
if
clean
{
framework
.
VolumeTestCleanup
(
f
,
config
)
framework
.
VolumeTestCleanup
(
f
,
config
)
}
}
}
// installFlex installs the driver found at filePath on the node, and restarts
// installFlex installs the driver found at filePath on the node, and restarts
...
@@ -141,9 +139,7 @@ func sshAndLog(cmd, host string) {
...
@@ -141,9 +139,7 @@ func sshAndLog(cmd, host string) {
var
_
=
SIGDescribe
(
"Flexvolumes [Disruptive] [Feature:FlexVolume]"
,
func
()
{
var
_
=
SIGDescribe
(
"Flexvolumes [Disruptive] [Feature:FlexVolume]"
,
func
()
{
f
:=
framework
.
NewDefaultFramework
(
"flexvolume"
)
f
:=
framework
.
NewDefaultFramework
(
"flexvolume"
)
// If 'false', the test won't clear its volumes upon completion. Useful for debugging,
// note that namespace deletion is handled by delete-namespace flag
// note that namespace deletion is handled by delete-namespace flag
clean
:=
true
var
cs
clientset
.
Interface
var
cs
clientset
.
Interface
var
ns
*
v1
.
Namespace
var
ns
*
v1
.
Namespace
...
@@ -176,7 +172,7 @@ var _ = SIGDescribe("Flexvolumes [Disruptive] [Feature:FlexVolume]", func() {
...
@@ -176,7 +172,7 @@ var _ = SIGDescribe("Flexvolumes [Disruptive] [Feature:FlexVolume]", func() {
By
(
fmt
.
Sprintf
(
"installing flexvolume %s on node %s as %s"
,
path
.
Join
(
driverDir
,
driver
),
node
.
Name
,
driverInstallAs
))
By
(
fmt
.
Sprintf
(
"installing flexvolume %s on node %s as %s"
,
path
.
Join
(
driverDir
,
driver
),
node
.
Name
,
driverInstallAs
))
installFlex
(
&
node
,
"k8s"
,
driverInstallAs
,
path
.
Join
(
driverDir
,
driver
),
true
/* restart */
)
installFlex
(
&
node
,
"k8s"
,
driverInstallAs
,
path
.
Join
(
driverDir
,
driver
),
true
/* restart */
)
testFlexVolume
(
driverInstallAs
,
cs
,
config
,
f
,
clean
)
testFlexVolume
(
driverInstallAs
,
cs
,
config
,
f
)
By
(
"waiting for flex client pod to terminate"
)
By
(
"waiting for flex client pod to terminate"
)
if
err
:=
f
.
WaitForPodTerminated
(
config
.
Prefix
+
"-client"
,
""
);
!
apierrs
.
IsNotFound
(
err
)
{
if
err
:=
f
.
WaitForPodTerminated
(
config
.
Prefix
+
"-client"
,
""
);
!
apierrs
.
IsNotFound
(
err
)
{
...
@@ -196,7 +192,7 @@ var _ = SIGDescribe("Flexvolumes [Disruptive] [Feature:FlexVolume]", func() {
...
@@ -196,7 +192,7 @@ var _ = SIGDescribe("Flexvolumes [Disruptive] [Feature:FlexVolume]", func() {
By
(
fmt
.
Sprintf
(
"installing flexvolume %s on master as %s"
,
path
.
Join
(
driverDir
,
driver
),
driverInstallAs
))
By
(
fmt
.
Sprintf
(
"installing flexvolume %s on master as %s"
,
path
.
Join
(
driverDir
,
driver
),
driverInstallAs
))
installFlex
(
nil
,
"k8s"
,
driverInstallAs
,
path
.
Join
(
driverDir
,
driver
),
true
/* restart */
)
installFlex
(
nil
,
"k8s"
,
driverInstallAs
,
path
.
Join
(
driverDir
,
driver
),
true
/* restart */
)
testFlexVolume
(
driverInstallAs
,
cs
,
config
,
f
,
clean
)
testFlexVolume
(
driverInstallAs
,
cs
,
config
,
f
)
By
(
"waiting for flex client pod to terminate"
)
By
(
"waiting for flex client pod to terminate"
)
if
err
:=
f
.
WaitForPodTerminated
(
config
.
Prefix
+
"-client"
,
""
);
!
apierrs
.
IsNotFound
(
err
)
{
if
err
:=
f
.
WaitForPodTerminated
(
config
.
Prefix
+
"-client"
,
""
);
!
apierrs
.
IsNotFound
(
err
)
{
...
@@ -216,7 +212,7 @@ var _ = SIGDescribe("Flexvolumes [Disruptive] [Feature:FlexVolume]", func() {
...
@@ -216,7 +212,7 @@ var _ = SIGDescribe("Flexvolumes [Disruptive] [Feature:FlexVolume]", func() {
By
(
fmt
.
Sprintf
(
"installing flexvolume %s on node %s as %s"
,
path
.
Join
(
driverDir
,
driver
),
node
.
Name
,
driverInstallAs
))
By
(
fmt
.
Sprintf
(
"installing flexvolume %s on node %s as %s"
,
path
.
Join
(
driverDir
,
driver
),
node
.
Name
,
driverInstallAs
))
installFlex
(
&
node
,
"k8s"
,
driverInstallAs
,
path
.
Join
(
driverDir
,
driver
),
false
/* restart */
)
installFlex
(
&
node
,
"k8s"
,
driverInstallAs
,
path
.
Join
(
driverDir
,
driver
),
false
/* restart */
)
testFlexVolume
(
driverInstallAs
,
cs
,
config
,
f
,
clean
)
testFlexVolume
(
driverInstallAs
,
cs
,
config
,
f
)
By
(
"waiting for flex client pod to terminate"
)
By
(
"waiting for flex client pod to terminate"
)
if
err
:=
f
.
WaitForPodTerminated
(
config
.
Prefix
+
"-client"
,
""
);
!
apierrs
.
IsNotFound
(
err
)
{
if
err
:=
f
.
WaitForPodTerminated
(
config
.
Prefix
+
"-client"
,
""
);
!
apierrs
.
IsNotFound
(
err
)
{
...
...
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