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
b8aa87ed
Commit
b8aa87ed
authored
Nov 07, 2014
by
Daniel Smith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add handy -cfg and -ctl options to make it easy to run a kubecfg or kubectl…
Add handy -cfg and -ctl options to make it easy to run a kubecfg or kubectl command against your e2e cluster.
parent
9bb0d33a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
6 deletions
+15
-6
e2e.go
hack/e2e.go
+15
-6
No files found.
hack/e2e.go
View file @
b8aa87ed
...
@@ -40,6 +40,9 @@ var (
...
@@ -40,6 +40,9 @@ var (
tests
=
flag
.
String
(
"tests"
,
""
,
"Run only tests in hack/e2e-suite matching this glob. Ignored if -test is set."
)
tests
=
flag
.
String
(
"tests"
,
""
,
"Run only tests in hack/e2e-suite matching this glob. Ignored if -test is set."
)
root
=
flag
.
String
(
"root"
,
absOrDie
(
filepath
.
Clean
(
filepath
.
Join
(
path
.
Base
(
os
.
Args
[
0
]),
".."
))),
"Root directory of kubernetes repository."
)
root
=
flag
.
String
(
"root"
,
absOrDie
(
filepath
.
Clean
(
filepath
.
Join
(
path
.
Base
(
os
.
Args
[
0
]),
".."
))),
"Root directory of kubernetes repository."
)
verbose
=
flag
.
Bool
(
"v"
,
false
,
"If true, print all command output."
)
verbose
=
flag
.
Bool
(
"v"
,
false
,
"If true, print all command output."
)
cfgCmd
=
flag
.
String
(
"cfg"
,
""
,
"If nonempty, pass this as an argument, and call kubecfg. Implies -v."
)
ctlCmd
=
flag
.
String
(
"ctl"
,
""
,
"If nonempty, pass this as an argument, and call kubectl. Implies -v. (-test, -cfg, -ctl are mutually exclusive)"
)
)
)
var
signals
=
make
(
chan
os
.
Signal
,
100
)
var
signals
=
make
(
chan
os
.
Signal
,
100
)
...
@@ -87,18 +90,24 @@ func main() {
...
@@ -87,18 +90,24 @@ func main() {
}
}
}
}
failed
,
passed
:=
[]
string
{},
[]
string
{}
failure
:=
false
if
*
tests
!=
""
{
switch
{
failed
,
passed
=
Test
()
case
*
cfgCmd
!=
""
:
failure
=
!
runBash
(
"'kubecfg "
+*
cfgCmd
+
"'"
,
"$KUBECFG "
+*
cfgCmd
)
case
*
ctlCmd
!=
""
:
failure
=
!
runBash
(
"'kubectl "
+*
ctlCmd
+
"'"
,
"$KUBECFG "
+*
ctlCmd
)
case
*
tests
!=
""
:
failed
,
passed
:=
Test
()
log
.
Printf
(
"Passed tests: %v"
,
passed
)
log
.
Printf
(
"Failed tests: %v"
,
failed
)
failure
=
len
(
failed
)
>
0
}
}
if
*
down
{
if
*
down
{
TearDown
()
TearDown
()
}
}
log
.
Printf
(
"Passed tests: %v"
,
passed
)
if
failure
{
log
.
Printf
(
"Failed tests: %v"
,
failed
)
if
len
(
failed
)
>
0
{
os
.
Exit
(
1
)
os
.
Exit
(
1
)
}
}
}
}
...
...
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