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
0768fa56
Unverified
Commit
0768fa56
authored
Oct 29, 2018
by
k8s-ci-robot
Committed by
GitHub
Oct 29, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #70188 from rajansandeep/ipv6tests
Extend DNS ConfigMap tests to support IPv6
parents
5cf90790
9e8bd5cc
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
185 additions
and
77 deletions
+185
-77
dns_common.go
test/e2e/network/dns_common.go
+15
-5
dns_configmap.go
test/e2e/network/dns_configmap.go
+170
-72
No files found.
test/e2e/network/dns_common.go
View file @
0768fa56
...
@@ -112,14 +112,15 @@ func (t *dnsTestCommon) runDig(dnsName, target string) []string {
...
@@ -112,14 +112,15 @@ func (t *dnsTestCommon) runDig(dnsName, target string) []string {
cmd
=
append
(
cmd
,
"@"
+
t
.
dnsPod
.
Status
.
PodIP
)
cmd
=
append
(
cmd
,
"@"
+
t
.
dnsPod
.
Status
.
PodIP
)
case
"kube-dns"
:
case
"kube-dns"
:
cmd
=
append
(
cmd
,
"@"
+
t
.
dnsPod
.
Status
.
PodIP
,
"-p"
,
"10053"
)
cmd
=
append
(
cmd
,
"@"
+
t
.
dnsPod
.
Status
.
PodIP
,
"-p"
,
"10053"
)
case
"ptr-record"
:
cmd
=
append
(
cmd
,
"-x"
)
case
"cluster-dns"
:
case
"cluster-dns"
:
case
"cluster-dns-ipv6"
:
cmd
=
append
(
cmd
,
"AAAA"
)
break
break
default
:
default
:
panic
(
fmt
.
Errorf
(
"invalid target: "
+
target
))
panic
(
fmt
.
Errorf
(
"invalid target: "
+
target
))
}
}
if
strings
.
HasSuffix
(
dnsName
,
"in-addr.arpa"
)
||
strings
.
HasSuffix
(
dnsName
,
"in-addr.arpa."
)
{
cmd
=
append
(
cmd
,
[]
string
{
"-t"
,
"ptr"
}
...
)
}
cmd
=
append
(
cmd
,
dnsName
)
cmd
=
append
(
cmd
,
dnsName
)
stdout
,
stderr
,
err
:=
t
.
f
.
ExecWithOptions
(
framework
.
ExecOptions
{
stdout
,
stderr
,
err
:=
t
.
f
.
ExecWithOptions
(
framework
.
ExecOptions
{
...
@@ -327,7 +328,7 @@ func (t *dnsTestCommon) createDNSServer(aRecords map[string]string) {
...
@@ -327,7 +328,7 @@ func (t *dnsTestCommon) createDNSServer(aRecords map[string]string) {
t
.
createDNSPodFromObj
(
generateDNSServerPod
(
aRecords
))
t
.
createDNSPodFromObj
(
generateDNSServerPod
(
aRecords
))
}
}
func
(
t
*
dnsTestCommon
)
createDNSServerWithPtrRecord
()
{
func
(
t
*
dnsTestCommon
)
createDNSServerWithPtrRecord
(
isIPv6
bool
)
{
pod
:=
&
v1
.
Pod
{
pod
:=
&
v1
.
Pod
{
TypeMeta
:
metav1
.
TypeMeta
{
TypeMeta
:
metav1
.
TypeMeta
{
Kind
:
"Pod"
,
Kind
:
"Pod"
,
...
@@ -345,7 +346,6 @@ func (t *dnsTestCommon) createDNSServerWithPtrRecord() {
...
@@ -345,7 +346,6 @@ func (t *dnsTestCommon) createDNSServerWithPtrRecord() {
"-u"
,
"root"
,
"-u"
,
"root"
,
"-k"
,
"-k"
,
"--log-facility"
,
"-"
,
"--log-facility"
,
"-"
,
"--host-record=my.test,192.0.2.123"
,
"-q"
,
"-q"
,
},
},
},
},
...
@@ -354,6 +354,16 @@ func (t *dnsTestCommon) createDNSServerWithPtrRecord() {
...
@@ -354,6 +354,16 @@ func (t *dnsTestCommon) createDNSServerWithPtrRecord() {
},
},
}
}
if
isIPv6
{
pod
.
Spec
.
Containers
[
0
]
.
Command
=
append
(
pod
.
Spec
.
Containers
[
0
]
.
Command
,
fmt
.
Sprintf
(
"--host-record=my.test,2001:db8::29"
))
}
else
{
pod
.
Spec
.
Containers
[
0
]
.
Command
=
append
(
pod
.
Spec
.
Containers
[
0
]
.
Command
,
fmt
.
Sprintf
(
"--host-record=my.test,192.0.2.123"
))
}
t
.
createDNSPodFromObj
(
pod
)
t
.
createDNSPodFromObj
(
pod
)
}
}
...
...
test/e2e/network/dns_configmap.go
View file @
0768fa56
This diff is collapsed.
Click to expand it.
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