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
bd1f7ebd
Commit
bd1f7ebd
authored
Oct 02, 2018
by
Elad
Committed by
Anton Evangelatov
Oct 02, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd/swarm: fix appveyor build (#17808)
parent
26a37c53
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
7 deletions
+24
-7
export_test.go
cmd/swarm/export_test.go
+4
-2
run_test.go
cmd/swarm/run_test.go
+3
-0
upload_test.go
cmd/swarm/upload_test.go
+17
-5
No files found.
cmd/swarm/export_test.go
View file @
bd1f7ebd
...
@@ -14,8 +14,6 @@
...
@@ -14,8 +14,6 @@
// You should have received a copy of the GNU General Public License
// You should have received a copy of the GNU General Public License
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
// +build !windows
package
main
package
main
import
(
import
(
...
@@ -26,6 +24,7 @@ import (
...
@@ -26,6 +24,7 @@ import (
"io/ioutil"
"io/ioutil"
"net/http"
"net/http"
"os"
"os"
"runtime"
"strings"
"strings"
"testing"
"testing"
...
@@ -40,6 +39,9 @@ import (
...
@@ -40,6 +39,9 @@ import (
// 5. imports the exported datastore
// 5. imports the exported datastore
// 6. fetches the uploaded random file from the second node
// 6. fetches the uploaded random file from the second node
func
TestCLISwarmExportImport
(
t
*
testing
.
T
)
{
func
TestCLISwarmExportImport
(
t
*
testing
.
T
)
{
if
runtime
.
GOOS
==
"windows"
{
t
.
Skip
()
}
cluster
:=
newTestCluster
(
t
,
1
)
cluster
:=
newTestCluster
(
t
,
1
)
// generate random 10mb file
// generate random 10mb file
...
...
cmd/swarm/run_test.go
View file @
bd1f7ebd
...
@@ -19,6 +19,7 @@ package main
...
@@ -19,6 +19,7 @@ package main
import
(
import
(
"context"
"context"
"crypto/ecdsa"
"crypto/ecdsa"
"flag"
"fmt"
"fmt"
"io/ioutil"
"io/ioutil"
"net"
"net"
...
@@ -41,6 +42,8 @@ import (
...
@@ -41,6 +42,8 @@ import (
"github.com/ethereum/go-ethereum/swarm"
"github.com/ethereum/go-ethereum/swarm"
)
)
var
loglevel
=
flag
.
Int
(
"loglevel"
,
3
,
"verbosity of logs"
)
func
init
()
{
func
init
()
{
// Run the app if we've been exec'd as "swarm-test" in runSwarm.
// Run the app if we've been exec'd as "swarm-test" in runSwarm.
reexec
.
Register
(
"swarm-test"
,
func
()
{
reexec
.
Register
(
"swarm-test"
,
func
()
{
...
...
cmd/swarm/upload_test.go
View file @
bd1f7ebd
...
@@ -14,13 +14,10 @@
...
@@ -14,13 +14,10 @@
// You should have received a copy of the GNU General Public License
// You should have received a copy of the GNU General Public License
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
// +build !windows
package
main
package
main
import
(
import
(
"bytes"
"bytes"
"flag"
"fmt"
"fmt"
"io"
"io"
"io/ioutil"
"io/ioutil"
...
@@ -28,6 +25,7 @@ import (
...
@@ -28,6 +25,7 @@ import (
"os"
"os"
"path"
"path"
"path/filepath"
"path/filepath"
"runtime"
"strings"
"strings"
"testing"
"testing"
"time"
"time"
...
@@ -37,8 +35,6 @@ import (
...
@@ -37,8 +35,6 @@ import (
"github.com/mattn/go-colorable"
"github.com/mattn/go-colorable"
)
)
var
loglevel
=
flag
.
Int
(
"loglevel"
,
3
,
"verbosity of logs"
)
func
init
()
{
func
init
()
{
log
.
PrintOrigins
(
true
)
log
.
PrintOrigins
(
true
)
log
.
Root
()
.
SetHandler
(
log
.
LvlFilterHandler
(
log
.
Lvl
(
*
loglevel
),
log
.
StreamHandler
(
colorable
.
NewColorableStderr
(),
log
.
TerminalFormat
(
true
))))
log
.
Root
()
.
SetHandler
(
log
.
LvlFilterHandler
(
log
.
Lvl
(
*
loglevel
),
log
.
StreamHandler
(
colorable
.
NewColorableStderr
(),
log
.
TerminalFormat
(
true
))))
...
@@ -47,18 +43,31 @@ func init() {
...
@@ -47,18 +43,31 @@ func init() {
// TestCLISwarmUp tests that running 'swarm up' makes the resulting file
// TestCLISwarmUp tests that running 'swarm up' makes the resulting file
// available from all nodes via the HTTP API
// available from all nodes via the HTTP API
func
TestCLISwarmUp
(
t
*
testing
.
T
)
{
func
TestCLISwarmUp
(
t
*
testing
.
T
)
{
if
runtime
.
GOOS
==
"windows"
{
t
.
Skip
()
}
testCLISwarmUp
(
false
,
t
)
testCLISwarmUp
(
false
,
t
)
}
}
func
TestCLISwarmUpRecursive
(
t
*
testing
.
T
)
{
func
TestCLISwarmUpRecursive
(
t
*
testing
.
T
)
{
if
runtime
.
GOOS
==
"windows"
{
t
.
Skip
()
}
testCLISwarmUpRecursive
(
false
,
t
)
testCLISwarmUpRecursive
(
false
,
t
)
}
}
// TestCLISwarmUpEncrypted tests that running 'swarm encrypted-up' makes the resulting file
// TestCLISwarmUpEncrypted tests that running 'swarm encrypted-up' makes the resulting file
// available from all nodes via the HTTP API
// available from all nodes via the HTTP API
func
TestCLISwarmUpEncrypted
(
t
*
testing
.
T
)
{
func
TestCLISwarmUpEncrypted
(
t
*
testing
.
T
)
{
if
runtime
.
GOOS
==
"windows"
{
t
.
Skip
()
}
testCLISwarmUp
(
true
,
t
)
testCLISwarmUp
(
true
,
t
)
}
}
func
TestCLISwarmUpEncryptedRecursive
(
t
*
testing
.
T
)
{
func
TestCLISwarmUpEncryptedRecursive
(
t
*
testing
.
T
)
{
if
runtime
.
GOOS
==
"windows"
{
t
.
Skip
()
}
testCLISwarmUpRecursive
(
true
,
t
)
testCLISwarmUpRecursive
(
true
,
t
)
}
}
...
@@ -279,6 +288,9 @@ func testCLISwarmUpRecursive(toEncrypt bool, t *testing.T) {
...
@@ -279,6 +288,9 @@ func testCLISwarmUpRecursive(toEncrypt bool, t *testing.T) {
// TestCLISwarmUpDefaultPath tests swarm recursive upload with relative and absolute
// TestCLISwarmUpDefaultPath tests swarm recursive upload with relative and absolute
// default paths and with encryption.
// default paths and with encryption.
func
TestCLISwarmUpDefaultPath
(
t
*
testing
.
T
)
{
func
TestCLISwarmUpDefaultPath
(
t
*
testing
.
T
)
{
if
runtime
.
GOOS
==
"windows"
{
t
.
Skip
()
}
testCLISwarmUpDefaultPath
(
false
,
false
,
t
)
testCLISwarmUpDefaultPath
(
false
,
false
,
t
)
testCLISwarmUpDefaultPath
(
false
,
true
,
t
)
testCLISwarmUpDefaultPath
(
false
,
true
,
t
)
testCLISwarmUpDefaultPath
(
true
,
false
,
t
)
testCLISwarmUpDefaultPath
(
true
,
false
,
t
)
...
...
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