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
97a2cbc6
Commit
97a2cbc6
authored
Aug 03, 2015
by
Dan Winship
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix some incorrect test debug output on error
parent
cb2252b5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
iptables_test.go
pkg/util/iptables/iptables_test.go
+8
-8
No files found.
pkg/util/iptables/iptables_test.go
View file @
97a2cbc6
...
@@ -184,10 +184,10 @@ func TestEnsureRuleAlreadyExists(t *testing.T) {
...
@@ -184,10 +184,10 @@ func TestEnsureRuleAlreadyExists(t *testing.T) {
t
.
Errorf
(
"expected exists = true"
)
t
.
Errorf
(
"expected exists = true"
)
}
}
if
fcmd
.
CombinedOutputCalls
!=
2
{
if
fcmd
.
CombinedOutputCalls
!=
2
{
t
.
Errorf
(
"expected 2 CombinedOutput() call, got %d"
,
fcmd
.
CombinedOutputCalls
)
t
.
Errorf
(
"expected 2 CombinedOutput() call
s
, got %d"
,
fcmd
.
CombinedOutputCalls
)
}
}
if
!
util
.
NewStringSet
(
fcmd
.
CombinedOutputLog
[
1
]
...
)
.
HasAll
(
"iptables"
,
"-t"
,
"nat"
,
"-C"
,
"OUTPUT"
,
"abc"
,
"123"
)
{
if
!
util
.
NewStringSet
(
fcmd
.
CombinedOutputLog
[
1
]
...
)
.
HasAll
(
"iptables"
,
"-t"
,
"nat"
,
"-C"
,
"OUTPUT"
,
"abc"
,
"123"
)
{
t
.
Errorf
(
"wrong CombinedOutput() log, got %s"
,
fcmd
.
CombinedOutputLog
[
0
])
t
.
Errorf
(
"wrong CombinedOutput() log, got %s"
,
fcmd
.
CombinedOutputLog
[
1
])
}
}
}
}
...
@@ -223,7 +223,7 @@ func TestEnsureRuleNew(t *testing.T) {
...
@@ -223,7 +223,7 @@ func TestEnsureRuleNew(t *testing.T) {
t
.
Errorf
(
"expected 3 CombinedOutput() calls, got %d"
,
fcmd
.
CombinedOutputCalls
)
t
.
Errorf
(
"expected 3 CombinedOutput() calls, got %d"
,
fcmd
.
CombinedOutputCalls
)
}
}
if
!
util
.
NewStringSet
(
fcmd
.
CombinedOutputLog
[
2
]
...
)
.
HasAll
(
"iptables"
,
"-t"
,
"nat"
,
"-A"
,
"OUTPUT"
,
"abc"
,
"123"
)
{
if
!
util
.
NewStringSet
(
fcmd
.
CombinedOutputLog
[
2
]
...
)
.
HasAll
(
"iptables"
,
"-t"
,
"nat"
,
"-A"
,
"OUTPUT"
,
"abc"
,
"123"
)
{
t
.
Errorf
(
"wrong CombinedOutput() log, got %s"
,
fcmd
.
CombinedOutputLog
[
1
])
t
.
Errorf
(
"wrong CombinedOutput() log, got %s"
,
fcmd
.
CombinedOutputLog
[
2
])
}
}
}
}
...
@@ -250,7 +250,7 @@ func TestEnsureRuleErrorChecking(t *testing.T) {
...
@@ -250,7 +250,7 @@ func TestEnsureRuleErrorChecking(t *testing.T) {
t
.
Errorf
(
"expected failure"
)
t
.
Errorf
(
"expected failure"
)
}
}
if
fcmd
.
CombinedOutputCalls
!=
2
{
if
fcmd
.
CombinedOutputCalls
!=
2
{
t
.
Errorf
(
"expected 2 CombinedOutput() call, got %d"
,
fcmd
.
CombinedOutputCalls
)
t
.
Errorf
(
"expected 2 CombinedOutput() call
s
, got %d"
,
fcmd
.
CombinedOutputCalls
)
}
}
}
}
...
@@ -307,10 +307,10 @@ func TestDeleteRuleAlreadyExists(t *testing.T) {
...
@@ -307,10 +307,10 @@ func TestDeleteRuleAlreadyExists(t *testing.T) {
t
.
Errorf
(
"expected success, got %v"
,
err
)
t
.
Errorf
(
"expected success, got %v"
,
err
)
}
}
if
fcmd
.
CombinedOutputCalls
!=
2
{
if
fcmd
.
CombinedOutputCalls
!=
2
{
t
.
Errorf
(
"expected 2 CombinedOutput() call, got %d"
,
fcmd
.
CombinedOutputCalls
)
t
.
Errorf
(
"expected 2 CombinedOutput() call
s
, got %d"
,
fcmd
.
CombinedOutputCalls
)
}
}
if
!
util
.
NewStringSet
(
fcmd
.
CombinedOutputLog
[
1
]
...
)
.
HasAll
(
"iptables"
,
"-t"
,
"nat"
,
"-C"
,
"OUTPUT"
,
"abc"
,
"123"
)
{
if
!
util
.
NewStringSet
(
fcmd
.
CombinedOutputLog
[
1
]
...
)
.
HasAll
(
"iptables"
,
"-t"
,
"nat"
,
"-C"
,
"OUTPUT"
,
"abc"
,
"123"
)
{
t
.
Errorf
(
"wrong CombinedOutput() log, got %s"
,
fcmd
.
CombinedOutputLog
[
0
])
t
.
Errorf
(
"wrong CombinedOutput() log, got %s"
,
fcmd
.
CombinedOutputLog
[
1
])
}
}
}
}
...
@@ -343,7 +343,7 @@ func TestDeleteRuleNew(t *testing.T) {
...
@@ -343,7 +343,7 @@ func TestDeleteRuleNew(t *testing.T) {
t
.
Errorf
(
"expected 3 CombinedOutput() calls, got %d"
,
fcmd
.
CombinedOutputCalls
)
t
.
Errorf
(
"expected 3 CombinedOutput() calls, got %d"
,
fcmd
.
CombinedOutputCalls
)
}
}
if
!
util
.
NewStringSet
(
fcmd
.
CombinedOutputLog
[
2
]
...
)
.
HasAll
(
"iptables"
,
"-t"
,
"nat"
,
"-D"
,
"OUTPUT"
,
"abc"
,
"123"
)
{
if
!
util
.
NewStringSet
(
fcmd
.
CombinedOutputLog
[
2
]
...
)
.
HasAll
(
"iptables"
,
"-t"
,
"nat"
,
"-D"
,
"OUTPUT"
,
"abc"
,
"123"
)
{
t
.
Errorf
(
"wrong CombinedOutput() log, got %s"
,
fcmd
.
CombinedOutputLog
[
1
])
t
.
Errorf
(
"wrong CombinedOutput() log, got %s"
,
fcmd
.
CombinedOutputLog
[
2
])
}
}
}
}
...
@@ -370,7 +370,7 @@ func TestDeleteRuleErrorChecking(t *testing.T) {
...
@@ -370,7 +370,7 @@ func TestDeleteRuleErrorChecking(t *testing.T) {
t
.
Errorf
(
"expected failure"
)
t
.
Errorf
(
"expected failure"
)
}
}
if
fcmd
.
CombinedOutputCalls
!=
2
{
if
fcmd
.
CombinedOutputCalls
!=
2
{
t
.
Errorf
(
"expected 2 CombinedOutput() call, got %d"
,
fcmd
.
CombinedOutputCalls
)
t
.
Errorf
(
"expected 2 CombinedOutput() call
s
, got %d"
,
fcmd
.
CombinedOutputCalls
)
}
}
}
}
...
...
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