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
75546a01
Unverified
Commit
75546a01
authored
May 02, 2019
by
Kubernetes Prow Robot
Committed by
GitHub
May 02, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #75591 from bclau/tests/split-hosts-entries
tests: Splits hostname from DNS test
parents
a6e5cb26
06f11564
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
3 deletions
+37
-3
dns.go
test/e2e/network/dns.go
+37
-3
No files found.
test/e2e/network/dns.go
View file @
75546a01
...
@@ -219,7 +219,7 @@ var _ = SIGDescribe("DNS", func() {
...
@@ -219,7 +219,7 @@ var _ = SIGDescribe("DNS", func() {
validateDNSResults
(
f
,
pod
,
append
(
wheezyFileNames
,
jessieFileNames
...
))
validateDNSResults
(
f
,
pod
,
append
(
wheezyFileNames
,
jessieFileNames
...
))
})
})
It
(
"should provide DNS for pods for Hostname
and Subdomain
"
,
func
()
{
It
(
"should provide DNS for pods for Hostname
[LinuxOnly]
"
,
func
()
{
// Create a test headless service.
// Create a test headless service.
By
(
"Creating a test headless service"
)
By
(
"Creating a test headless service"
)
testServiceSelector
:=
map
[
string
]
string
{
testServiceSelector
:=
map
[
string
]
string
{
...
@@ -239,9 +239,43 @@ var _ = SIGDescribe("DNS", func() {
...
@@ -239,9 +239,43 @@ var _ = SIGDescribe("DNS", func() {
hostFQDN
:=
fmt
.
Sprintf
(
"%s.%s.%s.svc.%s"
,
podHostname
,
serviceName
,
f
.
Namespace
.
Name
,
framework
.
TestContext
.
ClusterDNSDomain
)
hostFQDN
:=
fmt
.
Sprintf
(
"%s.%s.%s.svc.%s"
,
podHostname
,
serviceName
,
f
.
Namespace
.
Name
,
framework
.
TestContext
.
ClusterDNSDomain
)
hostNames
:=
[]
string
{
hostFQDN
,
podHostname
}
hostNames
:=
[]
string
{
hostFQDN
,
podHostname
}
wheezyProbeCmd
,
wheezyFileNames
:=
createProbeCommand
(
nil
,
hostNames
,
""
,
"wheezy"
,
f
.
Namespace
.
Name
,
framework
.
TestContext
.
ClusterDNSDomain
)
jessieProbeCmd
,
jessieFileNames
:=
createProbeCommand
(
nil
,
hostNames
,
""
,
"jessie"
,
f
.
Namespace
.
Name
,
framework
.
TestContext
.
ClusterDNSDomain
)
By
(
"Running these commands on wheezy: "
+
wheezyProbeCmd
+
"
\n
"
)
By
(
"Running these commands on jessie: "
+
jessieProbeCmd
+
"
\n
"
)
// Run a pod which probes DNS and exposes the results by HTTP.
By
(
"creating a pod to probe DNS"
)
pod1
:=
createDNSPod
(
f
.
Namespace
.
Name
,
wheezyProbeCmd
,
jessieProbeCmd
,
dnsTestPodHostName
,
dnsTestServiceName
)
pod1
.
ObjectMeta
.
Labels
=
testServiceSelector
pod1
.
Spec
.
Hostname
=
podHostname
pod1
.
Spec
.
Subdomain
=
serviceName
validateDNSResults
(
f
,
pod1
,
append
(
wheezyFileNames
,
jessieFileNames
...
))
})
It
(
"should provide DNS for pods for Subdomain"
,
func
()
{
// Create a test headless service.
By
(
"Creating a test headless service"
)
testServiceSelector
:=
map
[
string
]
string
{
"dns-test-hostname-attribute"
:
"true"
,
}
serviceName
:=
"dns-test-service-2"
podHostname
:=
"dns-querier-2"
headlessService
:=
framework
.
CreateServiceSpec
(
serviceName
,
""
,
true
,
testServiceSelector
)
_
,
err
:=
f
.
ClientSet
.
CoreV1
()
.
Services
(
f
.
Namespace
.
Name
)
.
Create
(
headlessService
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
(),
"failed to create headless service: %s"
,
serviceName
)
defer
func
()
{
By
(
"deleting the test headless service"
)
defer
GinkgoRecover
()
f
.
ClientSet
.
CoreV1
()
.
Services
(
f
.
Namespace
.
Name
)
.
Delete
(
headlessService
.
Name
,
nil
)
}()
hostFQDN
:=
fmt
.
Sprintf
(
"%s.%s.%s.svc.%s"
,
podHostname
,
serviceName
,
f
.
Namespace
.
Name
,
framework
.
TestContext
.
ClusterDNSDomain
)
namesToResolve
:=
[]
string
{
hostFQDN
}
namesToResolve
:=
[]
string
{
hostFQDN
}
wheezyProbeCmd
,
wheezyFileNames
:=
createProbeCommand
(
namesToResolve
,
hostNames
,
""
,
"wheezy"
,
f
.
Namespace
.
Name
,
framework
.
TestContext
.
ClusterDNSDomain
)
wheezyProbeCmd
,
wheezyFileNames
:=
createProbeCommand
(
namesToResolve
,
nil
,
""
,
"wheezy"
,
f
.
Namespace
.
Name
,
framework
.
TestContext
.
ClusterDNSDomain
)
jessieProbeCmd
,
jessieFileNames
:=
createProbeCommand
(
namesToResolve
,
hostNames
,
""
,
"jessie"
,
f
.
Namespace
.
Name
,
framework
.
TestContext
.
ClusterDNSDomain
)
jessieProbeCmd
,
jessieFileNames
:=
createProbeCommand
(
namesToResolve
,
nil
,
""
,
"jessie"
,
f
.
Namespace
.
Name
,
framework
.
TestContext
.
ClusterDNSDomain
)
By
(
"Running these commands on wheezy: "
+
wheezyProbeCmd
+
"
\n
"
)
By
(
"Running these commands on wheezy: "
+
wheezyProbeCmd
+
"
\n
"
)
By
(
"Running these commands on jessie: "
+
jessieProbeCmd
+
"
\n
"
)
By
(
"Running these commands on jessie: "
+
jessieProbeCmd
+
"
\n
"
)
...
...
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