File tree Expand file tree Collapse file tree 4 files changed +55
-0
lines changed
testcases/node/local/start Expand file tree Collapse file tree 4 files changed +55
-0
lines changed Original file line number Diff line number Diff line change @@ -10,4 +10,5 @@ const (
1010 ValidatorCmd CommandGroup = "validator"
1111 ICMCmd CommandGroup = "icm"
1212 InterchainCmd CommandGroup = "interchain"
13+ NodeCmd CommandGroup = "node"
1314)
Original file line number Diff line number Diff line change @@ -14,7 +14,9 @@ import (
1414
1515 "gopkg.in/yaml.v3"
1616
17+ "github.com/ava-labs/avalanche-cli/cmd"
1718 "github.com/ava-labs/avalanche-cli/pkg/constants"
19+ "github.com/ava-labs/avalanche-cli/tests/e2e/utils"
1820 "github.com/onsi/gomega"
1921)
2022
@@ -207,6 +209,25 @@ func NodeImport(filename string, clusterName string) string {
207209 return runCmd (cmd , ExpectSuccess )
208210}
209211
212+ func NodeLocalStart (clusterName string ) (string , error ) {
213+ return utils .TestCommand (
214+ cmd .NodeCmd ,
215+ "local" ,
216+ []string {
217+ "start" ,
218+ clusterName ,
219+ "--local" ,
220+ },
221+ utils.GlobalFlags {},
222+ utils.TestFlags {},
223+ )
224+ }
225+
226+ // TODO:
227+ // func NodeLocalStop()
228+ // func NodeLocalStatus()
229+ // func NodeLocalDestroy(clusterName string)
230+
210231type StaticConfig struct {
211232 Targets []string `yaml:"targets"`
212233}
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ import (
2525 _ "github.com/ava-labs/avalanche-cli/tests/e2e/testcases/network/stop"
2626 _ "github.com/ava-labs/avalanche-cli/tests/e2e/testcases/node/create"
2727 _ "github.com/ava-labs/avalanche-cli/tests/e2e/testcases/node/devnet"
28+ _ "github.com/ava-labs/avalanche-cli/tests/e2e/testcases/node/local/start"
2829 _ "github.com/ava-labs/avalanche-cli/tests/e2e/testcases/node/monitoring"
2930 _ "github.com/ava-labs/avalanche-cli/tests/e2e/testcases/packageman"
3031 _ "github.com/ava-labs/avalanche-cli/tests/e2e/testcases/relayer/deploy"
Original file line number Diff line number Diff line change 1+ // Copyright (C) 2025, Ava Labs, Inc. All rights reserved.
2+ // See the file LICENSE for licensing terms.
3+
4+ package root
5+
6+ import (
7+ "github.com/ava-labs/avalanche-cli/tests/e2e/commands"
8+ "github.com/onsi/ginkgo/v2"
9+ "github.com/onsi/gomega"
10+ )
11+
12+ var _ = ginkgo .Describe ("[Node local start]" , func () {
13+ testClusterName := "test-cluster"
14+
15+ ginkgo .AfterEach (func () {
16+ commands .CleanNetwork ()
17+ })
18+
19+ ginkgo .It ("can create a local node with a started network" , func () {
20+ output := commands .StartNetwork ()
21+ gomega .Expect (output ).Should (gomega .ContainSubstring ("Network ready to use" ))
22+
23+ output , err := commands .NodeLocalStart (testClusterName )
24+ gomega .Expect (err ).Should (gomega .BeNil ())
25+ gomega .Expect (output ).Should (gomega .ContainSubstring ("NodeID: NodeID-" ))
26+ })
27+
28+ ginkgo .It ("should not create local nodes without a started network" , func () {
29+ output , _ := commands .NodeLocalStart (testClusterName )
30+ gomega .Expect (output ).Should (gomega .ContainSubstring ("network is not running" ))
31+ })
32+ })
You can’t perform that action at this time.
0 commit comments