-
Notifications
You must be signed in to change notification settings - Fork 46
Expand file tree
/
Copy pathreload.go
More file actions
34 lines (29 loc) · 1.17 KB
/
reload.go
File metadata and controls
34 lines (29 loc) · 1.17 KB
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
package simple_node_set
import (
"fmt"
"testing"
"time"
"github.com/google/uuid"
"github.com/smartcontractkit/chainlink-testing-framework/framework"
"github.com/smartcontractkit/chainlink-testing-framework/framework/chaos"
"github.com/smartcontractkit/chainlink-testing-framework/framework/components/blockchain"
)
// UpgradeNodeSet updates nodes configuration TOML files
// this API is discouraged, however, you can use it if nodes require restart or configuration updates, temporarily!
func UpgradeNodeSet(t *testing.T, in *Input, bc *blockchain.Output, wait time.Duration) (*Output, error) {
return UpgradeNodeSetWithTag(t.Name(), in, bc, wait)
}
func UpgradeNodeSetWithTag(tag string, in *Input, bc *blockchain.Output, wait time.Duration) (*Output, error) {
uniq := fmt.Sprintf("%s-%s-%s", framework.DefaultCTFLogsDir, tag, uuid.NewString()[0:4])
if _, err := framework.SaveContainerLogs(uniq); err != nil {
return nil, err
}
_, err := chaos.ExecPumba(fmt.Sprintf("rm --volumes=false re2:^%s-node.*|%s-ns-postgresql.*", in.Name, in.Name), wait)
if err != nil {
return nil, err
}
in.Out = nil
out, err := NewSharedDBNodeSet(in, bc)
in.Out = out
return out, err
}