File tree Expand file tree Collapse file tree 4 files changed +54
-0
lines changed
testcases/node/local/start Expand file tree Collapse file tree 4 files changed +54
-0
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import (
1515 "gopkg.in/yaml.v3"
1616
1717 "github.com/ava-labs/avalanche-cli/pkg/constants"
18+ "github.com/ava-labs/avalanche-cli/tests/e2e/utils"
1819 "github.com/onsi/gomega"
1920)
2021
@@ -207,6 +208,25 @@ func NodeImport(filename string, clusterName string) string {
207208 return runCmd (cmd , ExpectSuccess )
208209}
209210
211+ func NodeLocalStart (clusterName string ) (string , error ) {
212+ return utils .TestCommand (
213+ utils .NodeCmd ,
214+ "local" ,
215+ []string {
216+ "start" ,
217+ clusterName ,
218+ "--local" ,
219+ },
220+ utils.GlobalFlags {},
221+ utils.TestFlags {},
222+ )
223+ }
224+
225+ // TODO:
226+ // func NodeLocalStop()
227+ // func NodeLocalStatus()
228+ // func NodeLocalDestroy(clusterName string)
229+
210230type StaticConfig struct {
211231 Targets []string `yaml:"targets"`
212232}
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ import (
2121 _ "github.com/ava-labs/avalanche-cli/tests/e2e/testcases/network/stop"
2222 _ "github.com/ava-labs/avalanche-cli/tests/e2e/testcases/node/create"
2323 _ "github.com/ava-labs/avalanche-cli/tests/e2e/testcases/node/devnet"
24+ _ "github.com/ava-labs/avalanche-cli/tests/e2e/testcases/node/local/start"
2425 _ "github.com/ava-labs/avalanche-cli/tests/e2e/testcases/node/monitoring"
2526 _ "github.com/ava-labs/avalanche-cli/tests/e2e/testcases/packageman"
2627 _ "github.com/ava-labs/avalanche-cli/tests/e2e/testcases/root"
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+ })
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ type CommandGroup string
1919
2020const (
2121 BlockchainCmd CommandGroup = "blockchain"
22+ NodeCmd CommandGroup = "node"
2223)
2324
2425var avalancheBinaryPath = "./bin/avalanche"
You can’t perform that action at this time.
0 commit comments