Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
d31f1f4f
Unverified
Commit
d31f1f4f
authored
Nov 19, 2018
by
Anton Evangelatov
Committed by
GitHub
Nov 19, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd/swarm/swarm-smoke: update smoke tests to fit the new scheme for the k8s cluster (#18104)
parent
6b6c4d1c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
12 deletions
+15
-12
main.go
cmd/swarm/swarm-smoke/main.go
+2
-2
upload_and_sync.go
cmd/swarm/swarm-smoke/upload_and_sync.go
+13
-10
No files found.
cmd/swarm/swarm-smoke/main.go
View file @
d31f1f4f
...
...
@@ -45,8 +45,8 @@ func main() {
app
.
Flags
=
[]
cli
.
Flag
{
cli
.
StringFlag
{
Name
:
"cluster-endpoint"
,
Value
:
"
testing
"
,
Usage
:
"cluster to point to (
local, open or testing
)"
,
Value
:
"
prod
"
,
Usage
:
"cluster to point to (
prod or a given namespace
)"
,
Destination
:
&
cluster
,
},
cli
.
IntFlag
{
...
...
cmd/swarm/swarm-smoke/upload_and_sync.go
View file @
d31f1f4f
...
...
@@ -20,6 +20,7 @@ import (
"bytes"
"crypto/md5"
crand
"crypto/rand"
"crypto/tls"
"errors"
"fmt"
"io"
...
...
@@ -32,6 +33,7 @@ import (
"time"
"github.com/ethereum/go-ethereum/log"
colorable
"github.com/mattn/go-colorable"
"github.com/pborman/uuid"
cli
"gopkg.in/urfave/cli.v1"
...
...
@@ -39,18 +41,13 @@ import (
func
generateEndpoints
(
scheme
string
,
cluster
string
,
from
int
,
to
int
)
{
if
cluster
==
"prod"
{
cluster
=
""
}
else
if
cluster
==
"local"
{
for
port
:=
from
;
port
<=
to
;
port
++
{
endpoints
=
append
(
endpoints
,
fmt
.
Sprintf
(
"%s://
localhost:%v
"
,
scheme
,
port
))
endpoints
=
append
(
endpoints
,
fmt
.
Sprintf
(
"%s://
%v.swarm-gateways.net
"
,
scheme
,
port
))
}
return
}
else
{
cluster
=
cluster
+
"."
}
for
port
:=
from
;
port
<=
to
;
port
++
{
endpoints
=
append
(
endpoints
,
fmt
.
Sprintf
(
"%s://%v.%sswarm-gateways.net"
,
scheme
,
port
,
cluster
))
for
port
:=
from
;
port
<=
to
;
port
++
{
endpoints
=
append
(
endpoints
,
fmt
.
Sprintf
(
"%s://swarm-%v-%s.stg.swarm-gateways.net"
,
scheme
,
port
,
cluster
))
}
}
if
includeLocalhost
{
...
...
@@ -59,6 +56,9 @@ func generateEndpoints(scheme string, cluster string, from int, to int) {
}
func
cliUploadAndSync
(
c
*
cli
.
Context
)
error
{
log
.
PrintOrigins
(
true
)
log
.
Root
()
.
SetHandler
(
log
.
LvlFilterHandler
(
log
.
Lvl
(
verbosity
),
log
.
StreamHandler
(
colorable
.
NewColorableStderr
(),
log
.
TerminalFormat
(
true
))))
defer
func
(
now
time
.
Time
)
{
log
.
Info
(
"total time"
,
"time"
,
time
.
Since
(
now
),
"size (kb)"
,
filesize
)
}(
time
.
Now
())
generateEndpoints
(
scheme
,
cluster
,
from
,
to
)
...
...
@@ -112,7 +112,10 @@ func fetch(hash string, endpoint string, original []byte, ruid string) error {
time
.
Sleep
(
3
*
time
.
Second
)
log
.
Trace
(
"http get request"
,
"ruid"
,
ruid
,
"api"
,
endpoint
,
"hash"
,
hash
)
res
,
err
:=
http
.
Get
(
endpoint
+
"/bzz:/"
+
hash
+
"/"
)
client
:=
&
http
.
Client
{
Transport
:
&
http
.
Transport
{
TLSClientConfig
:
&
tls
.
Config
{
InsecureSkipVerify
:
true
},
}}
res
,
err
:=
client
.
Get
(
endpoint
+
"/bzz:/"
+
hash
+
"/"
)
if
err
!=
nil
{
log
.
Warn
(
err
.
Error
(),
"ruid"
,
ruid
)
return
err
...
...
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