cmd/devp2p/internal/ethtest: skip eth/66 tests when v66 not supported (#22460)

This commit is contained in:
rene
2021-03-19 14:15:39 +00:00
committed by GitHub
parent c454717fa6
commit d3040a80d7
6 changed files with 116 additions and 15 deletions

View File

@ -22,6 +22,7 @@ import (
"github.com/ethereum/go-ethereum/cmd/devp2p/internal/ethtest"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/internal/utesting"
"github.com/ethereum/go-ethereum/p2p"
"github.com/ethereum/go-ethereum/p2p/rlpx"
"github.com/ethereum/go-ethereum/rlp"
@ -98,5 +99,10 @@ func rlpxEthTest(ctx *cli.Context) error {
if err != nil {
exit(err)
}
return runTests(ctx, suite.EthTests())
// check if given node supports eth66, and if so, run eth66 protocol tests as well
is66Failed, _ := utesting.Run(utesting.Test{Name: "Is_66", Fn: suite.Is_66})
if is66Failed {
return runTests(ctx, suite.EthTests())
}
return runTests(ctx, suite.AllEthTests())
}