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
b266aa15
Commit
b266aa15
authored
Dec 09, 2015
by
k8s-merge-robot
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #18120 from pwittrock/etcd
Auto commit by PR queue bot
parents
8d46df01
91e9ff5e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
14 deletions
+25
-14
gcloud.go
test/e2e_node/gcloud/gcloud.go
+19
-10
run_e2e.go
test/e2e_node/runner/run_e2e.go
+6
-4
No files found.
test/e2e_node/gcloud/gcloud.go
View file @
b266aa15
...
...
@@ -37,7 +37,9 @@ var freePortRegexp = regexp.MustCompile(".+:([0-9]+)")
type
TearDown
func
()
type
GCloudClient
interface
{
CopyAndWaitTillHealthy
(
sudo
bool
,
remotePort
string
,
timeout
time
.
Duration
,
healthUrl
string
,
bin
string
,
args
...
string
)
(
*
CmdHandle
,
error
)
CopyAndWaitTillHealthy
(
sudo
bool
,
copyBin
bool
,
remotePort
string
,
timeout
time
.
Duration
,
healthUrl
string
,
bin
string
,
args
...
string
)
(
*
CmdHandle
,
error
)
}
type
gCloudClientImpl
struct
{
...
...
@@ -99,7 +101,9 @@ func (gc *gCloudClientImpl) CopyToHost(from string, to string) ([]byte, error) {
return
exec
.
Command
(
"gcloud"
,
args
...
)
.
CombinedOutput
()
}
func
(
gc
*
gCloudClientImpl
)
CopyAndRun
(
sudo
bool
,
remotePort
string
,
bin
string
,
args
...
string
)
*
CmdHandle
{
func
(
gc
*
gCloudClientImpl
)
CopyAndRun
(
sudo
bool
,
copyBin
bool
,
remotePort
string
,
bin
string
,
args
...
string
)
*
CmdHandle
{
h
:=
&
CmdHandle
{}
h
.
Output
=
make
(
chan
RunResult
)
...
...
@@ -108,7 +112,10 @@ func (gc *gCloudClientImpl) CopyAndRun(sudo bool, remotePort string, bin string,
// Define where we will copy the temp binary
tDir
:=
fmt
.
Sprintf
(
"/tmp/gcloud-e2e-%d"
,
rand
.
Int31
())
_
,
f
:=
filepath
.
Split
(
bin
)
cmd
:=
filepath
.
Join
(
tDir
,
f
)
cmd
:=
f
if
copyBin
{
cmd
=
filepath
.
Join
(
tDir
,
f
)
}
h
.
LPort
=
getLocalPort
()
h
.
TearDown
=
func
()
{
...
...
@@ -133,11 +140,13 @@ func (gc *gCloudClientImpl) CopyAndRun(sudo bool, remotePort string, bin string,
}
// Copy the binary
out
,
err
=
gc
.
CopyToHost
(
bin
,
tDir
)
if
err
!=
nil
{
glog
.
Errorf
(
"copy-files failed %v"
,
err
)
h
.
Output
<-
RunResult
{
out
,
err
,
fmt
.
Sprintf
(
"copy-files %s %s"
,
bin
,
tDir
)}
return
h
if
copyBin
{
out
,
err
=
gc
.
CopyToHost
(
bin
,
tDir
)
if
err
!=
nil
{
glog
.
Errorf
(
"copy-files failed %v"
,
err
)
h
.
Output
<-
RunResult
{
out
,
err
,
fmt
.
Sprintf
(
"copy-files %s %s"
,
bin
,
tDir
)}
return
h
}
}
// Do the setup
...
...
@@ -154,9 +163,9 @@ func (gc *gCloudClientImpl) CopyAndRun(sudo bool, remotePort string, bin string,
}
func
(
gc
*
gCloudClientImpl
)
CopyAndWaitTillHealthy
(
sudo
bool
,
sudo
bool
,
copyBin
bool
,
remotePort
string
,
timeout
time
.
Duration
,
healthUrl
string
,
bin
string
,
args
...
string
)
(
*
CmdHandle
,
error
)
{
h
:=
gc
.
CopyAndRun
(
sudo
,
remotePort
,
bin
,
args
...
)
h
:=
gc
.
CopyAndRun
(
sudo
,
copyBin
,
remotePort
,
bin
,
args
...
)
eTime
:=
time
.
Now
()
.
Add
(
timeout
)
done
:=
false
for
eTime
.
After
(
time
.
Now
())
&&
!
done
{
...
...
test/e2e_node/runner/run_e2e.go
View file @
b266aa15
...
...
@@ -14,6 +14,8 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// To run the e2e tests against one or more hosts on gce: $ go run run_e2e.go --hosts <comma separated hosts>
// Requires gcloud compute ssh access to the hosts
package
main
import
(
...
...
@@ -114,8 +116,8 @@ func WaitForUser() {
func
runTests
(
host
string
)
([]
byte
,
error
)
{
c
:=
gcloud
.
NewGCloudClient
(
host
,
*
zone
)
// TODO(pwittrock): Come up with something better for bootstrapping the environment.
e
tcdBin
:=
filepath
.
Join
(
kubeRoot
,
"third_party/etcd/etcd"
)
eh
,
err
:=
c
.
CopyAndWaitTillHealthy
(
false
,
"4001"
,
healthyTimeoutDuration
,
"v2/keys/"
,
etcdBin
)
e
h
,
err
:=
c
.
CopyAndWaitTillHealthy
(
false
,
false
,
"4001"
,
healthyTimeoutDuration
,
"v2/keys/"
,
"etcd"
,
"--data-dir"
,
"./"
)
defer
func
()
{
eh
.
TearDown
()
}()
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"Host %s failed to run command %v"
,
host
,
err
)
...
...
@@ -123,7 +125,7 @@ func runTests(host string) ([]byte, error) {
apiBin
:=
filepath
.
Join
(
kubeRoot
,
*
kubeOutputRelPath
,
"kube-apiserver"
)
ah
,
err
:=
c
.
CopyAndWaitTillHealthy
(
true
,
"8080"
,
healthyTimeoutDuration
,
"healthz"
,
apiBin
,
"--service-cluster-ip-range"
,
true
,
true
,
"8080"
,
healthyTimeoutDuration
,
"healthz"
,
apiBin
,
"--service-cluster-ip-range"
,
"10.0.0.1/24"
,
"--insecure-bind-address"
,
"0.0.0.0"
,
"--etcd-servers"
,
"http://localhost:4001"
,
"--cluster-name"
,
"kubernetes"
,
"--v"
,
"2"
,
"--kubelet-port"
,
"10250"
)
defer
func
()
{
ah
.
TearDown
()
}()
...
...
@@ -133,7 +135,7 @@ func runTests(host string) ([]byte, error) {
kubeletBin
:=
filepath
.
Join
(
kubeRoot
,
*
kubeOutputRelPath
,
"kubelet"
)
kh
,
err
:=
c
.
CopyAndWaitTillHealthy
(
true
,
"4194
"
,
healthyTimeoutDuration
,
"healthz"
,
kubeletBin
,
"--api-servers"
,
"http://localhost:8080"
,
true
,
true
,
"10255
"
,
healthyTimeoutDuration
,
"healthz"
,
kubeletBin
,
"--api-servers"
,
"http://localhost:8080"
,
"--logtostderr"
,
"--address"
,
"0.0.0.0"
,
"--port"
,
"10250"
)
defer
func
()
{
kh
.
TearDown
()
}()
if
err
!=
nil
{
...
...
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