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
e638a415
Commit
e638a415
authored
Oct 27, 2015
by
gmarek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Port remaining e2e tests to framework
parent
0150d87a
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
39 additions
and
100 deletions
+39
-100
docker_containers.go
test/e2e/docker_containers.go
+3
-15
examples.go
test/e2e/examples.go
+10
-17
host_path.go
test/e2e/host_path.go
+5
-20
kubectl.go
test/e2e/kubectl.go
+3
-14
persistent_volumes.go
test/e2e/persistent_volumes.go
+3
-14
service.go
test/e2e/service.go
+9
-5
volumes.go
test/e2e/volumes.go
+6
-15
No files found.
test/e2e/docker_containers.go
View file @
e638a415
...
...
@@ -17,33 +17,21 @@ limitations under the License.
package
e2e
import
(
"time"
"k8s.io/kubernetes/pkg/api"
client
"k8s.io/kubernetes/pkg/client/unversioned"
"k8s.io/kubernetes/pkg/util"
.
"github.com/onsi/ginkgo"
.
"github.com/onsi/gomega"
)
var
_
=
Describe
(
"Docker Containers"
,
func
()
{
framework
:=
NewFramework
(
"containers"
)
var
c
*
client
.
Client
var
ns
string
BeforeEach
(
func
()
{
var
err
error
c
,
err
=
loadClient
()
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
ns_
,
err
:=
createTestingNS
(
"containers"
,
c
)
ns
=
ns_
.
Name
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
})
AfterEach
(
func
()
{
if
err
:=
deleteNS
(
c
,
ns
,
5
*
time
.
Minute
/* namespace deletion timeout */
);
err
!=
nil
{
Failf
(
"Couldn't delete ns %s"
,
err
)
}
c
=
framework
.
Client
ns
=
framework
.
Namespace
.
Name
})
It
(
"should use the image defaults if command and args are blank [Conformance]"
,
func
()
{
...
...
test/e2e/examples.go
View file @
e638a415
...
...
@@ -48,23 +48,12 @@ except:
print 'err'`
var
_
=
Describe
(
"Examples e2e"
,
func
()
{
framework
:=
NewFramework
(
"examples"
)
var
c
*
client
.
Client
var
ns
string
var
testingNs
*
api
.
Namespace
BeforeEach
(
func
()
{
var
err
error
c
,
err
=
loadClient
()
expectNoError
(
err
)
testingNs
,
err
=
createTestingNS
(
"examples"
,
c
)
ns
=
testingNs
.
Name
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
})
AfterEach
(
func
()
{
By
(
fmt
.
Sprintf
(
"Destroying namespace for this suite %v"
,
ns
))
if
err
:=
deleteNS
(
c
,
ns
,
5
*
time
.
Minute
/* namespace deletion timeout */
);
err
!=
nil
{
Failf
(
"Couldn't delete ns %s"
,
err
)
}
c
=
framework
.
Client
ns
=
framework
.
Namespace
.
Name
})
Describe
(
"[Skipped][Example]Redis"
,
func
()
{
...
...
@@ -476,10 +465,14 @@ var _ = Describe("Examples e2e", func() {
for
i
:=
range
namespaces
{
var
err
error
namespaces
[
i
],
err
=
createTestingNS
(
fmt
.
Sprintf
(
"dnsexample%d"
,
i
),
c
)
if
namespaces
[
i
]
!=
nil
{
defer
deleteNS
(
c
,
namespaces
[
i
]
.
Name
,
5
*
time
.
Minute
/* namespace deletion timeout */
)
if
testContext
.
DeleteNamespace
{
if
namespaces
[
i
]
!=
nil
{
defer
deleteNS
(
c
,
namespaces
[
i
]
.
Name
,
5
*
time
.
Minute
/* namespace deletion timeout */
)
}
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
}
else
{
Logf
(
"Found DeleteNamespace=false, skipping namespace deletion!"
)
}
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
}
for
_
,
ns
:=
range
namespaces
{
...
...
test/e2e/host_path.go
View file @
e638a415
...
...
@@ -20,7 +20,6 @@ import (
"fmt"
"os"
"path"
"time"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/latest"
...
...
@@ -28,37 +27,23 @@ import (
client
"k8s.io/kubernetes/pkg/client/unversioned"
.
"github.com/onsi/ginkgo"
.
"github.com/onsi/gomega"
)
//TODO : Consolidate this code with the code for emptyDir.
//This will require some smart.
var
_
=
Describe
(
"hostPath"
,
func
()
{
var
(
c
*
client
.
Client
namespace
*
api
.
Namespace
)
framework
:=
NewFramework
(
"hostpath"
)
var
c
*
client
.
Client
var
namespace
*
api
.
Namespace
BeforeEach
(
func
()
{
var
err
error
c
,
err
=
loadClient
()
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
By
(
"Building a namespace api object"
)
namespace
,
err
=
createTestingNS
(
"hostpath"
,
c
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
c
=
framework
.
Client
namespace
=
framework
.
Namespace
//cleanup before running the test.
_
=
os
.
Remove
(
"/tmp/test-file"
)
})
AfterEach
(
func
()
{
By
(
fmt
.
Sprintf
(
"Destroying namespace for this suite %v"
,
namespace
.
Name
))
if
err
:=
deleteNS
(
c
,
namespace
.
Name
,
5
*
time
.
Minute
/* namespace deletion timeout */
);
err
!=
nil
{
Failf
(
"Couldn't delete ns %s"
,
err
)
}
})
It
(
"should give a volume the correct mode [Conformance]"
,
func
()
{
volumePath
:=
"/test-volume"
source
:=
&
api
.
HostPathVolumeSource
{
...
...
test/e2e/kubectl.go
View file @
e638a415
...
...
@@ -76,23 +76,12 @@ var proxyRegexp = regexp.MustCompile("Starting to serve on 127.0.0.1:([0-9]+)")
var
_
=
Describe
(
"Kubectl client"
,
func
()
{
defer
GinkgoRecover
()
framework
:=
NewFramework
(
"kubectl"
)
var
c
*
client
.
Client
var
ns
string
var
testingNs
*
api
.
Namespace
BeforeEach
(
func
()
{
var
err
error
c
,
err
=
loadClient
()
expectNoError
(
err
)
testingNs
,
err
=
createTestingNS
(
"kubectl"
,
c
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
ns
=
testingNs
.
Name
})
AfterEach
(
func
()
{
By
(
fmt
.
Sprintf
(
"Destroying namespace for this suite %v"
,
ns
))
if
err
:=
deleteNS
(
c
,
ns
,
5
*
time
.
Minute
/* namespace deletion timeout */
);
err
!=
nil
{
Failf
(
"Couldn't delete ns %s"
,
err
)
}
c
=
framework
.
Client
ns
=
framework
.
Namespace
.
Name
})
Describe
(
"Update Demo"
,
func
()
{
...
...
test/e2e/persistent_volumes.go
View file @
e638a415
...
...
@@ -17,7 +17,6 @@ limitations under the License.
package
e2e
import
(
"fmt"
"time"
.
"github.com/onsi/ginkgo"
...
...
@@ -33,23 +32,13 @@ import (
// the test needs privileged containers, which are disabled by default.
// Run the test with "go run hack/e2e.go ... --ginkgo.focus=PersistentVolume"
var
_
=
Describe
(
"[Skipped] persistentVolumes"
,
func
()
{
framework
:=
NewFramework
(
"pv"
)
var
c
*
client
.
Client
var
ns
string
BeforeEach
(
func
()
{
var
err
error
c
,
err
=
loadClient
()
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
ns_
,
err
:=
createTestingNS
(
"pv"
,
c
)
ns
=
ns_
.
Name
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
})
AfterEach
(
func
()
{
By
(
fmt
.
Sprintf
(
"Destroying namespace for this suite %v"
,
ns
))
if
err
:=
deleteNS
(
c
,
ns
,
5
*
time
.
Minute
/* namespace deletion timeout */
);
err
!=
nil
{
Failf
(
"Couldn't delete ns %s"
,
err
)
}
c
=
framework
.
Client
ns
=
framework
.
Namespace
.
Name
})
It
(
"PersistentVolume"
,
func
()
{
...
...
test/e2e/service.go
View file @
e638a415
...
...
@@ -54,13 +54,17 @@ var _ = Describe("Services", func() {
})
AfterEach
(
func
()
{
for
_
,
ns
:=
range
extraNamespaces
{
By
(
fmt
.
Sprintf
(
"Destroying namespace %v"
,
ns
))
if
err
:=
deleteNS
(
c
,
ns
,
5
*
time
.
Minute
/* namespace deletion timeout */
);
err
!=
nil
{
Failf
(
"Couldn't delete namespace %s: %s"
,
ns
,
err
)
if
testContext
.
DeleteNamespace
{
for
_
,
ns
:=
range
extraNamespaces
{
By
(
fmt
.
Sprintf
(
"Destroying namespace %v"
,
ns
))
if
err
:=
deleteNS
(
c
,
ns
,
5
*
time
.
Minute
/* namespace deletion timeout */
);
err
!=
nil
{
Failf
(
"Couldn't delete namespace %s: %s"
,
ns
,
err
)
}
}
extraNamespaces
=
nil
}
else
{
Logf
(
"Found DeleteNamespace=false, skipping namespace deletion!"
)
}
extraNamespaces
=
nil
})
// TODO: We get coverage of TCP/UDP and multi-port services through the DNS test. We should have a simpler test for multi-port TCP here.
...
...
test/e2e/volumes.go
View file @
e638a415
...
...
@@ -219,27 +219,18 @@ func testVolumeClient(client *client.Client, config VolumeTestConfig, volume api
}
var
_
=
Describe
(
"Volumes"
,
func
()
{
clean
:=
true
// If 'false', the test won't clear its namespace (and pods and services) upon completion. Useful for debugging.
framework
:=
NewFramework
(
"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
clean
:=
true
// filled in BeforeEach
var
c
*
client
.
Client
var
namespace
*
api
.
Namespace
BeforeEach
(
func
()
{
var
err
error
c
,
err
=
loadClient
()
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
By
(
"Building a namespace api object"
)
namespace
,
err
=
createTestingNS
(
"volume"
,
c
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
})
AfterEach
(
func
()
{
if
clean
{
if
err
:=
deleteNS
(
c
,
namespace
.
Name
,
5
*
time
.
Minute
/* namespace deletion timeout */
);
err
!=
nil
{
Failf
(
"Couldn't delete ns %s"
,
err
)
}
}
c
=
framework
.
Client
namespace
=
framework
.
Namespace
})
////////////////////////////////////////////////////////////////////////
...
...
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