Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion framework/examples/myproject/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ require (
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc
github.com/ethereum/go-ethereum v1.15.0
github.com/go-resty/resty/v2 v2.16.3
github.com/smartcontractkit/chainlink-testing-framework/framework v0.7.3
github.com/smartcontractkit/chainlink-testing-framework/framework v0.7.4
github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.2
github.com/smartcontractkit/chainlink-testing-framework/seth v1.50.10
github.com/smartcontractkit/chainlink-testing-framework/wasp v1.50.2
Expand Down
1 change: 1 addition & 0 deletions havoc/.changeset/v1.50.6.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Added and verified with Kind two new havoc actions - corrupt and loss for NetworkChaos
1 change: 1 addition & 0 deletions havoc/.changeset/v1.50.7.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Added and verified with Kind two new havoc actions - corrupt and loss for NetworkChaos
2 changes: 2 additions & 0 deletions havoc/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,5 @@ require (
)

retract [v1.999.0-test-release, v1.999.999-test-release]

retract v1.50.6
122 changes: 122 additions & 0 deletions havoc/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,3 +308,125 @@ func (cr *NamespaceScopedChaosRunner) RunPodStressCPU(ctx context.Context, cfg N
experiment.Create(ctx)
return experiment, nil
}

type PodCorruptCfg struct {
Namespace string
Description string
Corrupt string
Correlation string
LabelKey string
LabelValues []string
InjectionDuration time.Duration
ExperimentCreateDelay time.Duration
}

// RunPodCorrupt initiates packet corruption for some pod in some namespace
func (cr *NamespaceScopedChaosRunner) RunPodCorrupt(ctx context.Context, cfg PodCorruptCfg) (*Chaos, error) {
experiment, err := NewChaos(ChaosOpts{
Object: &v1alpha1.NetworkChaos{
TypeMeta: metav1.TypeMeta{
Kind: string(v1alpha1.TypeNetworkChaos),
APIVersion: "chaos-mesh.org/v1alpha1",
},
ObjectMeta: metav1.ObjectMeta{
Name: fmt.Sprintf("corrupt-%s", uuid.NewString()[0:5]),
Namespace: cfg.Namespace,
},
Spec: v1alpha1.NetworkChaosSpec{
Action: v1alpha1.CorruptAction,
Duration: ptr.To[string]((cfg.InjectionDuration).String()),
TcParameter: v1alpha1.TcParameter{
Corrupt: &v1alpha1.CorruptSpec{
Corrupt: cfg.Corrupt,
Correlation: cfg.Correlation,
},
},
PodSelector: v1alpha1.PodSelector{
Mode: v1alpha1.AllMode,
Selector: v1alpha1.PodSelectorSpec{
GenericSelectorSpec: v1alpha1.GenericSelectorSpec{
Namespaces: []string{cfg.Namespace},
ExpressionSelectors: v1alpha1.LabelSelectorRequirements{
{
Operator: "In",
Key: cfg.LabelKey,
Values: cfg.LabelValues,
},
},
},
},
},
},
},
Listeners: defaultListeners(cr.l),
Logger: &cr.l,
Client: cr.c,
Remove: cr.remove,
})
if err != nil {
return nil, err
}
experiment.Create(ctx)
return experiment, nil
}

type PodLossCfg struct {
Namespace string
Description string
Loss string
Correlation string
LabelKey string
LabelValues []string
InjectionDuration time.Duration
ExperimentCreateDelay time.Duration
}

// RunPodLoss initiates packet loss for some pod in some namespace
func (cr *NamespaceScopedChaosRunner) RunPodLoss(ctx context.Context, cfg PodLossCfg) (*Chaos, error) {
experiment, err := NewChaos(ChaosOpts{
Object: &v1alpha1.NetworkChaos{
TypeMeta: metav1.TypeMeta{
Kind: string(v1alpha1.TypeNetworkChaos),
APIVersion: "chaos-mesh.org/v1alpha1",
},
ObjectMeta: metav1.ObjectMeta{
Name: fmt.Sprintf("loss-%s", uuid.NewString()[0:5]),
Namespace: cfg.Namespace,
},
Spec: v1alpha1.NetworkChaosSpec{
Action: v1alpha1.CorruptAction,
Duration: ptr.To[string]((cfg.InjectionDuration).String()),
TcParameter: v1alpha1.TcParameter{
Loss: &v1alpha1.LossSpec{
Loss: cfg.Loss,
Correlation: cfg.Correlation,
},
},
PodSelector: v1alpha1.PodSelector{
Mode: v1alpha1.AllMode,
Selector: v1alpha1.PodSelectorSpec{
GenericSelectorSpec: v1alpha1.GenericSelectorSpec{
Namespaces: []string{cfg.Namespace},
ExpressionSelectors: v1alpha1.LabelSelectorRequirements{
{
Operator: "In",
Key: cfg.LabelKey,
Values: cfg.LabelValues,
},
},
},
},
},
},
},
Listeners: defaultListeners(cr.l),
Logger: &cr.l,
Client: cr.c,
Remove: cr.remove,
})
if err != nil {
return nil, err
}
experiment.Create(ctx)
return experiment, nil
}
26 changes: 13 additions & 13 deletions sentinel/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require (
github.com/ethereum/go-ethereum v1.14.11
github.com/rs/zerolog v1.33.0
github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.20-0.20250106135623-15722ca32b64
github.com/stretchr/testify v1.9.0
github.com/stretchr/testify v1.10.0
)

require (
Expand All @@ -27,9 +27,10 @@ require (
github.com/deckarep/golang-set/v2 v2.6.0 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect
github.com/distribution/reference v0.6.0 // indirect
github.com/docker/docker v27.3.1+incompatible // indirect
github.com/docker/docker v28.0.1+incompatible // indirect
github.com/docker/go-connections v0.5.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/ebitengine/purego v0.8.2 // indirect
github.com/ethereum/c-kzg-4844 v1.0.0 // indirect
github.com/ethereum/go-verkle v0.1.1-0.20240829091221-dffa7562dbe9 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
Expand All @@ -42,7 +43,7 @@ require (
github.com/holiman/uint256 v1.3.1 // indirect
github.com/klauspost/compress v1.17.9 // indirect
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/magiconair/properties v1.8.9 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mmcloughlin/addchain v0.4.0 // indirect
Expand All @@ -54,32 +55,31 @@ require (
github.com/moby/term v0.5.0 // indirect
github.com/morikuni/aec v1.0.0 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.0 // indirect
github.com/opencontainers/image-spec v1.1.1 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
github.com/shirou/gopsutil v3.21.11+incompatible // indirect
github.com/shirou/gopsutil/v3 v3.23.12 // indirect
github.com/shoenig/go-m1cpu v0.1.6 // indirect
github.com/shirou/gopsutil/v4 v4.25.1 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/stretchr/objx v0.5.2 // indirect
github.com/supranational/blst v0.3.13 // indirect
github.com/testcontainers/testcontainers-go v0.34.0 // indirect
github.com/testcontainers/testcontainers-go v0.36.0 // indirect
github.com/tklauser/go-sysconf v0.3.12 // indirect
github.com/tklauser/numcpus v0.6.1 // indirect
github.com/urfave/cli/v2 v2.27.5 // indirect
github.com/yusufpapurcu/wmi v1.2.3 // indirect
github.com/yusufpapurcu/wmi v1.2.4 // indirect
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 // indirect
go.opentelemetry.io/otel v1.28.0 // indirect
go.opentelemetry.io/otel v1.35.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0 // indirect
go.opentelemetry.io/otel/metric v1.28.0 // indirect
go.opentelemetry.io/otel/sdk v1.19.0 // indirect
go.opentelemetry.io/otel/trace v1.28.0 // indirect
go.opentelemetry.io/otel/metric v1.35.0 // indirect
go.opentelemetry.io/otel/trace v1.35.0 // indirect
go.opentelemetry.io/proto/otlp v1.0.0 // indirect
golang.org/x/crypto v0.32.0 // indirect
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/sys v0.29.0 // indirect
golang.org/x/sys v0.31.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
rsc.io/tmplfunc v0.0.3 // indirect
)
Loading
Loading