2017-08-11 01:18:35 -07:00
|
|
|
// Copyright 2017 AMIS Technologies
|
|
|
|
// This file is part of the go-ethereum library.
|
|
|
|
//
|
|
|
|
// The go-ethereum library is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU Lesser General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
|
|
|
// The go-ethereum library is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU Lesser General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU Lesser General Public License
|
|
|
|
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
2017-08-31 20:26:54 -07:00
|
|
|
package functional
|
2017-08-11 01:18:35 -07:00
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
. "github.com/onsi/ginkgo"
|
|
|
|
. "github.com/onsi/gomega"
|
2017-09-01 01:52:08 -07:00
|
|
|
|
|
|
|
"github.com/getamis/istanbul-tools/container"
|
2017-08-11 01:18:35 -07:00
|
|
|
)
|
|
|
|
|
2017-08-22 00:38:24 -07:00
|
|
|
// Example
|
|
|
|
//
|
|
|
|
// var _ = Describe("4 validators Istanbul", func() {
|
|
|
|
// const (
|
|
|
|
// numberOfValidators = 4
|
|
|
|
// )
|
|
|
|
// var (
|
|
|
|
// blockchain container.Blockchain
|
|
|
|
// )
|
|
|
|
//
|
|
|
|
// BeforeSuite(func() {
|
|
|
|
// blockchain = container.NewBlockchain(
|
|
|
|
// numberOfValidators,
|
|
|
|
// container.ImageRepository("quay.io/amis/geth"),
|
|
|
|
// container.ImageTag("istanbul_develop"),
|
|
|
|
// container.DataDir("/data"),
|
|
|
|
// container.WebSocket(),
|
|
|
|
// container.WebSocketAddress("0.0.0.0"),
|
|
|
|
// container.WebSocketAPI("admin,eth,net,web3,personal,miner"),
|
|
|
|
// container.WebSocketOrigin("*"),
|
|
|
|
// container.NAT("any"),
|
|
|
|
// container.NoDiscover(),
|
|
|
|
// container.Etherbase("1a9afb711302c5f83b5902843d1c007a1a137632"),
|
|
|
|
// container.Mine(),
|
|
|
|
// container.Logging(true),
|
|
|
|
// )
|
|
|
|
//
|
|
|
|
// Expect(blockchain.Start()).To(BeNil())
|
|
|
|
// })
|
|
|
|
//
|
|
|
|
// AfterSuite(func() {
|
|
|
|
// Expect(blockchain.Stop()).To(BeNil())
|
|
|
|
// blockchain.Finalize()
|
|
|
|
// })
|
|
|
|
//
|
|
|
|
// It("Blockchain creation", func() {
|
|
|
|
// for _, geth := range blockchain.Validators() {
|
|
|
|
// client := geth.NewClient()
|
|
|
|
// Expect(client).NotTo(BeNil())
|
|
|
|
//
|
|
|
|
// block, err := client.BlockByNumber(context.Background(), big.NewInt(0))
|
|
|
|
// Expect(err).To(BeNil())
|
|
|
|
// Expect(block).NotTo(BeNil())
|
|
|
|
// }
|
|
|
|
// })
|
|
|
|
// })
|
|
|
|
//
|
2017-08-11 01:18:35 -07:00
|
|
|
|
2017-09-01 01:52:08 -07:00
|
|
|
var dockerNetwork *container.DockerNetwork
|
|
|
|
|
2017-08-11 01:18:35 -07:00
|
|
|
func TestIstanbul(t *testing.T) {
|
|
|
|
RegisterFailHandler(Fail)
|
|
|
|
RunSpecs(t, "Istanbul Test Suite")
|
|
|
|
}
|
2017-09-01 01:52:08 -07:00
|
|
|
|
|
|
|
var _ = BeforeSuite(func() {
|
|
|
|
var err error
|
|
|
|
dockerNetwork, err = container.NewDockerNetwork()
|
|
|
|
Expect(err).To(BeNil())
|
|
|
|
})
|
|
|
|
|
|
|
|
var _ = AfterSuite(func() {
|
|
|
|
err := dockerNetwork.Remove()
|
|
|
|
Expect(err).To(BeNil())
|
|
|
|
})
|