-
Notifications
You must be signed in to change notification settings - Fork 0
/
kurtosis_test_suite.go
75 lines (65 loc) · 2.44 KB
/
kurtosis_test_suite.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
// Copyright (C) 2022, Chain4Travel AG. All rights reserved.
//
// This file is a derived work, based on ava-labs code
//
// It is distributed under the same license conditions as the
// original code from which it is derived.
//
// Much love to the original authors for their work.
package kurtosis
import (
"time"
"github.com/kurtosis-tech/kurtosis-go/lib/testsuite"
"github.com/chain4travel/camino-testing/testsuite/tests/bombard"
"github.com/chain4travel/camino-testing/testsuite/tests/conflictvtx"
"github.com/chain4travel/camino-testing/testsuite/tests/connected"
"github.com/chain4travel/camino-testing/testsuite/tests/duplicate"
"github.com/chain4travel/camino-testing/testsuite/tests/spamchits"
"github.com/chain4travel/camino-testing/testsuite/tests/workflow"
"github.com/chain4travel/camino-testing/testsuite/verifier"
)
const (
// The number of bits to make each test network, which dictates the max number of services a test can spin up
// Here we choose 8 bits = 256 max services per test
networkWidthBits = 8
)
// CaminoTestSuite implements the Kurtosis TestSuite interface
type CaminoTestSuite struct {
ByzantineImageName string
NormalImageName string
}
// GetTests implements the Kurtosis TestSuite interface
func (a CaminoTestSuite) GetTests() map[string]testsuite.Test {
result := make(map[string]testsuite.Test)
if a.ByzantineImageName != "" {
result["stakingNetworkChitSpammerTest"] = spamchits.NewStakingNetworkUnrequestedChitSpammerTest(
a.ByzantineImageName,
a.NormalImageName,
)
result["conflictingTxsVertexTest"] = conflictvtx.StakingNetworkConflictingTxsVertexTest{
ByzantineImageName: a.ByzantineImageName,
NormalImageName: a.NormalImageName,
}
}
result["stakingNetworkBombardXChainTest"] = bombard.StakingNetworkBombardTest{
ImageName: a.NormalImageName,
NumTxs: 1000,
TxFee: 1000000,
AcceptanceTimeout: 10 * time.Second,
}
result["stakingNetworkFullyConnectedTest"] = connected.StakingNetworkFullyConnectedTest{
ImageName: a.NormalImageName,
Verifier: verifier.NewNetworkStateVerifier(),
}
result["stakingNetworkDuplicateNodeIDTest"] = duplicate.DuplicateNodeIDTest{
ImageName: a.NormalImageName,
Verifier: verifier.NewNetworkStateVerifier(),
}
result["StakingNetworkRPCWorkflowTest"] = workflow.StakingNetworkRPCWorkflowTest{
ImageName: a.NormalImageName,
}
return result
}
func (a CaminoTestSuite) GetNetworkWidthBits() uint32 {
return networkWidthBits
}