Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Wksctl
Commits
5d534963
Commit
5d534963
authored
5 years ago
by
Jerry Jackson
Browse files
Options
Download
Email Patches
Plain Diff
switch to standard exec.Cmd
parent
5e581848
WKP-468-verify-log-level
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/integration/test/apply_test.go
+7
-9
test/integration/test/apply_test.go
with
7 additions
and
9 deletions
+7
-9
test/integration/test/apply_test.go
+
7
-
9
View file @
5d534963
...
...
@@ -272,22 +272,20 @@ func testKubectl(t *testing.T, kubeconfig string) {
}
func
testDebugLogging
(
t
*
testing
.
T
,
kubeconfig
string
)
{
exe
:=
run
.
NewExecutor
()
//
exe := run.NewExecutor()
run
,
err
:=
exe
.
RunV
(
kubectl
,
fmt
.
Sprintf
(
"--kubeconfig=%s"
,
kubeconfig
),
"get"
,
"pods"
,
"-l"
,
"name=wks-controller"
,
"--namespace"
,
"weavek8sops"
,
"-o"
,
"jsonpath={.items[].spec.containers[].command}"
)
out
,
err
:=
exec
.
Command
(
"./kubectl"
,
fmt
.
Sprintf
(
"--kubeconfig=%s"
,
kubeconfig
),
"get"
,
"pods"
,
"-l"
,
"name=wks-controller"
,
"--namespace"
,
"weavek8sops"
,
"-o"
,
"jsonpath={.items[].spec.containers[].command}"
)
.
CombinedOutput
()
log
.
Printf
(
"OUT: %s
\n
"
,
out
)
assert
.
NoError
(
t
,
err
)
assert
.
Equal
(
t
,
0
,
run
.
ExitCode
())
verbose
:=
false
if
run
.
Contains
(
"--verbose"
)
{
if
strings
.
Contains
(
out
,
"--verbose"
)
{
verbose
=
true
}
run
,
err
=
exe
.
RunV
(
kubectl
,
fmt
.
Sprintf
(
"--kubeconfig=%s"
,
kubeconfig
),
"logs"
,
"-l"
,
"name=wks-controller"
)
out
,
err
=
exe
c
.
Command
(
"./
kubectl
"
,
fmt
.
Sprintf
(
"--kubeconfig=%s"
,
kubeconfig
),
"logs"
,
"-l"
,
"name=wks-controller"
)
.
CombinedOutput
()
assert
.
NoError
(
t
,
err
)
assert
.
Equal
(
t
,
0
,
run
.
ExitCode
())
if
verbose
{
assert
.
True
(
t
,
run
.
Contains
(
"level=debug"
))
}
else
{
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
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
Menu
Projects
Groups
Snippets
Help