Skip to content

Commit

Permalink
rename to fuji
Browse files Browse the repository at this point in the history
  • Loading branch information
sukantoraymond committed Dec 4, 2024
1 parent 0061cdf commit a692e95
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 43 deletions.
29 changes: 28 additions & 1 deletion tests/e2e/commands/etna.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const (

const (
etnaDevnetFlag = "--etna-devnet"
fujiFlag = "--fuji"
PoSString = "proof-of-stake"
PoAString = "proof-of-authority"
)
Expand Down Expand Up @@ -104,6 +105,32 @@ func CreateLocalEtnaDevnetNode(
return string(output), err
}

func CreateLocalFujiNode(
clusterName string,
numNodes int,
) (string, error) {
cmd := exec.Command(
CLIBinary,
"node",
"local",
"start",
clusterName,
fujiFlag,
"--num-nodes",
fmt.Sprintf("%d", numNodes),
"--"+constants.SkipUpdateFlag,
)
fmt.Println(cmd)
output, err := cmd.CombinedOutput()
if err != nil {
fmt.Println(cmd.String())
fmt.Println(string(output))
utils.PrintStdErr(err)
}
gomega.Expect(err).Should(gomega.BeNil())
return string(output), err
}

func DestroyLocalNode(
clusterName string,
) (string, error) {
Expand Down Expand Up @@ -171,7 +198,7 @@ func DeployEtnaSubnetToCluster(
return string(output), err
}

func TrackLocalEtnaSubnet(
func TrackLocalSubnet(
clusterName string,
subnetName string,
) (string, error) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ var _ = ginkgo.Describe("[Etna AddRemove Validator SOV PoA]", func() {
})

ginkgo.It("Can make cluster track a subnet", func() {
output, err := commands.TrackLocalEtnaSubnet(testLocalNodeName, subnetName)
output, err := commands.TrackLocalSubnet(testLocalNodeName, subnetName)
gomega.Expect(err).Should(gomega.BeNil())
fmt.Println(output)
// parse blockchainID from output
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ var _ = ginkgo.Describe("[Etna AddRemove Validator SOV PoS]", func() {
})

ginkgo.It("Can make cluster track a subnet", func() {
output, err := commands.TrackLocalEtnaSubnet(testLocalNodeName, subnetName)
output, err := commands.TrackLocalSubnet(testLocalNodeName, subnetName)
gomega.Expect(err).Should(gomega.BeNil())
fmt.Println(output)
// parse blockchainID from output
Expand Down
6 changes: 3 additions & 3 deletions tests/e2e/testcases/subnet/sov/etna/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ var _ = ginkgo.Describe("[Etna Subnet SOV]", func() {
gomega.Expect(err).Should(gomega.BeNil())
createEtnaSubnetEvmConfig(true, false)
deployEtnaSubnetClusterFlagConvertOnly(testLocalNodeName)
_, err = commands.TrackLocalEtnaSubnet(testLocalNodeName, subnetName)
_, err = commands.TrackLocalSubnet(testLocalNodeName, subnetName)
gomega.Expect(err).Should(gomega.BeNil())
err = initValidatorManagerClusterFlag(subnetName, testLocalNodeName)
gomega.Expect(err).Should(gomega.BeNil())
Expand All @@ -399,15 +399,15 @@ var _ = ginkgo.Describe("[Etna Subnet SOV]", func() {
gomega.Expect(err).Should(gomega.BeNil())
createEtnaSubnetEvmConfig(true, false)
deployEtnaSubnetClusterFlagConvertOnly(testLocalNodeName)
_, err = commands.TrackLocalEtnaSubnet(testLocalNodeName, subnetName)
_, err = commands.TrackLocalSubnet(testLocalNodeName, subnetName)
gomega.Expect(err).Should(gomega.BeNil())
_, err = initValidatorManagerEtnaFlag(subnetName)
gomega.Expect(err).Should(gomega.BeNil())
})
ginkgo.It("Mix and match network and cluster flags test 2", func() {
createEtnaSubnetEvmConfig(true, false)
deployEtnaSubnetEtnaFlagConvertOnly()
_, err := commands.TrackLocalEtnaSubnet(testLocalNodeName, subnetName)
_, err := commands.TrackLocalSubnet(testLocalNodeName, subnetName)
gomega.Expect(err).Should(gomega.BeNil())
err = initValidatorManagerClusterFlag(subnetName, testLocalNodeName)
gomega.Expect(err).Should(gomega.BeNil())
Expand Down
72 changes: 36 additions & 36 deletions tests/e2e/testcases/subnet/sov/public/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const (
testLocalNodeName = "e2eSubnetTest-local-node"
)

func createEtnaSubnetEvmConfig(poa, pos bool) {
func createSubnetEvmConfig(poa, pos bool) {
// Check config does not already exist
exists, err := utils.SubnetConfigExists(subnetName)
gomega.Expect(err).Should(gomega.BeNil())
Expand Down Expand Up @@ -66,7 +66,7 @@ func createEtnaSubnetEvmConfig(poa, pos bool) {
gomega.Expect(exists).Should(gomega.BeTrue())
}

func createEtnaSubnetEvmConfigWithoutProxyOwner(poa, pos bool) {
func createSubnetEvmConfigWithoutProxyOwner(poa, pos bool) {
// Check config does not already exist
exists, err := utils.SubnetConfigExists(subnetName)
gomega.Expect(err).Should(gomega.BeNil())
Expand Down Expand Up @@ -106,7 +106,7 @@ func createEtnaSubnetEvmConfigWithoutProxyOwner(poa, pos bool) {
gomega.Expect(exists).Should(gomega.BeTrue())
}

func createEtnaSubnetEvmConfigValidatorManagerFlagKeyname(poa, pos bool) {
func createSubnetEvmConfigValidatorManagerFlagKeyname(poa, pos bool) {
// Check config does not already exist
exists, err := utils.SubnetConfigExists(subnetName)
gomega.Expect(err).Should(gomega.BeNil())
Expand Down Expand Up @@ -148,7 +148,7 @@ func createEtnaSubnetEvmConfigValidatorManagerFlagKeyname(poa, pos bool) {
gomega.Expect(exists).Should(gomega.BeTrue())
}

func createEtnaSubnetEvmConfigValidatorManagerFlagPChain(poa, pos bool) {
func createSubnetEvmConfigValidatorManagerFlagPChain(poa, pos bool) {
// Check config does not already exist
exists, err := utils.SubnetConfigExists(subnetName)
gomega.Expect(err).Should(gomega.BeNil())
Expand Down Expand Up @@ -207,7 +207,7 @@ func destroyLocalNode() {
gomega.Expect(err).Should(gomega.BeNil())
}

func deployEtnaSubnetEtnaFlag() {
func deploySubnetFujiFlag() {

Check failure on line 210 in tests/e2e/testcases/subnet/sov/public/suite.go

View workflow job for this annotation

GitHub Actions / Lint

empty-lines: extra empty line at the end of a block (revive)
// Check config exists
exists, err := utils.SubnetConfigExists(subnetName)
gomega.Expect(err).Should(gomega.BeNil())
Expand All @@ -217,7 +217,7 @@ func deployEtnaSubnetEtnaFlag() {
err = os.Setenv(constants.SimulatePublicNetwork, "true")
gomega.Expect(err).Should(gomega.BeNil())

// Deploy subnet on etna devnet with local machine as bootstrap validator
// Deploy subnet on fuji with local machine as bootstrap validator
cmd := exec.Command(
CLIBinary,
"blockchain",
Expand Down Expand Up @@ -245,7 +245,7 @@ func deployEtnaSubnetEtnaFlag() {

}

Check failure on line 246 in tests/e2e/testcases/subnet/sov/public/suite.go

View workflow job for this annotation

GitHub Actions / Lint

unnecessary trailing newline (whitespace)

func deployEtnaSubnetEtnaFlagConvertOnly() {
func deploySubnetFujiFlagConvertOnly() {
// Check config exists
exists, err := utils.SubnetConfigExists(subnetName)
gomega.Expect(err).Should(gomega.BeNil())
Expand Down Expand Up @@ -274,7 +274,7 @@ func deployEtnaSubnetEtnaFlagConvertOnly() {
gomega.Expect(err).Should(gomega.BeNil())
}

func deployEtnaSubnetClusterFlagConvertOnly(clusterName string) {
func deployFujiSubnetClusterFlagConvertOnly(clusterName string) {
// Check config exists
exists, err := utils.SubnetConfigExists(subnetName)
gomega.Expect(err).Should(gomega.BeNil())
Expand All @@ -284,7 +284,7 @@ func deployEtnaSubnetClusterFlagConvertOnly(clusterName string) {
err = os.Setenv(constants.SimulatePublicNetwork, "true")
gomega.Expect(err).Should(gomega.BeNil())

// Deploy subnet on etna devnet with local machine as bootstrap validator
// Deploy subnet on fuji with local machine as bootstrap validator
cmd := exec.Command(
CLIBinary,
"blockchain",
Expand Down Expand Up @@ -335,7 +335,7 @@ func initValidatorManagerClusterFlag(
return err
}

func initValidatorManagerEtnaFlag(
func initValidatorManagerFujiFlag(
subnetName string,
) (string, error) {
cmd := exec.Command(
Expand All @@ -357,7 +357,7 @@ func initValidatorManagerEtnaFlag(
return string(output), err
}

var _ = ginkgo.Describe("[Etna Subnet SOV]", func() {
var _ = ginkgo.Describe("[Public Subnet SOV]", func() {
ginkgo.BeforeEach(func() {
// key
_ = utils.DeleteKey(keyName)
Expand All @@ -380,53 +380,53 @@ var _ = ginkgo.Describe("[Etna Subnet SOV]", func() {
commands.CleanNetwork()
})

ginkgo.It("Test Create Etna POA Subnet Config With Key Name for Validator Manager Flag", func() {
createEtnaSubnetEvmConfigValidatorManagerFlagKeyname(true, false)
ginkgo.It("Test Create POA Subnet Config With Key Name for Validator Manager Flag", func() {
createSubnetEvmConfigValidatorManagerFlagKeyname(true, false)
})

ginkgo.It("Test Create Etna POA Subnet Config With P Chain Address for Validator Manager Flag", func() {
createEtnaSubnetEvmConfigValidatorManagerFlagPChain(true, false)
ginkgo.It("Test Create POA Subnet Config With P Chain Address for Validator Manager Flag", func() {
createSubnetEvmConfigValidatorManagerFlagPChain(true, false)
})

ginkgo.It("Test Create Etna POA Subnet Config Without Proxy Owner Flag", func() {
createEtnaSubnetEvmConfigWithoutProxyOwner(true, false)
ginkgo.It("Test Create POA Subnet Config Without Proxy Owner Flag", func() {
createSubnetEvmConfigWithoutProxyOwner(true, false)
})

ginkgo.It("Create Etna POA Subnet Config & Deploy the Subnet To Public Etna On Local Machine", func() {
createEtnaSubnetEvmConfig(true, false)
deployEtnaSubnetEtnaFlag()
ginkgo.It("Create POA Subnet Config & Deploy the Subnet To Fuji On Local Machine", func() {
createSubnetEvmConfig(true, false)
deploySubnetFujiFlag()
})

ginkgo.It("Create Etna POS Subnet Config & Deploy the Subnet To Public Etna On Local Machine", func() {
createEtnaSubnetEvmConfig(false, true)
deployEtnaSubnetEtnaFlag()
ginkgo.It("Create POS Subnet Config & Deploy the Subnet To Fuji On Local Machine", func() {
createSubnetEvmConfig(false, true)
deploySubnetFujiFlag()
})

ginkgo.It("Start Local Node on Etna & Deploy the Subnet To Public Etna using cluster flag", func() {
_, err := commands.CreateLocalEtnaDevnetNode(testLocalNodeName, 1)
ginkgo.It("Start Local Node on Fuji & Deploy the Subnet To Fuji using cluster flag", func() {
_, err := commands.CreateLocalFujiNode(testLocalNodeName, 1)
gomega.Expect(err).Should(gomega.BeNil())
createEtnaSubnetEvmConfig(true, false)
deployEtnaSubnetClusterFlagConvertOnly(testLocalNodeName)
_, err = commands.TrackLocalEtnaSubnet(testLocalNodeName, subnetName)
createSubnetEvmConfig(true, false)
deployFujiSubnetClusterFlagConvertOnly(testLocalNodeName)
_, err = commands.TrackLocalSubnet(testLocalNodeName, subnetName)
gomega.Expect(err).Should(gomega.BeNil())
err = initValidatorManagerClusterFlag(subnetName, testLocalNodeName)
gomega.Expect(err).Should(gomega.BeNil())
})

ginkgo.It("Mix and match network and cluster flags test 1", func() {
_, err := commands.CreateLocalEtnaDevnetNode(testLocalNodeName, 1)
_, err := commands.CreateLocalFujiNode(testLocalNodeName, 1)
gomega.Expect(err).Should(gomega.BeNil())
createEtnaSubnetEvmConfig(true, false)
deployEtnaSubnetClusterFlagConvertOnly(testLocalNodeName)
_, err = commands.TrackLocalEtnaSubnet(testLocalNodeName, subnetName)
createSubnetEvmConfig(true, false)
deployFujiSubnetClusterFlagConvertOnly(testLocalNodeName)
_, err = commands.TrackLocalSubnet(testLocalNodeName, subnetName)
gomega.Expect(err).Should(gomega.BeNil())
_, err = initValidatorManagerEtnaFlag(subnetName)
_, err = initValidatorManagerFujiFlag(subnetName)
gomega.Expect(err).Should(gomega.BeNil())
})
ginkgo.It("Mix and match network and cluster flags test 2", func() {
createEtnaSubnetEvmConfig(true, false)
deployEtnaSubnetEtnaFlagConvertOnly()
_, err := commands.TrackLocalEtnaSubnet(testLocalNodeName, subnetName)
createSubnetEvmConfig(true, false)
deploySubnetFujiFlagConvertOnly()
_, err := commands.TrackLocalSubnet(testLocalNodeName, subnetName)
gomega.Expect(err).Should(gomega.BeNil())
err = initValidatorManagerClusterFlag(subnetName, testLocalNodeName)
gomega.Expect(err).Should(gomega.BeNil())
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/testcases/validatormanager/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ var _ = ginkgo.Describe("[Validator Manager POA Set Up]", ginkgo.Ordered, func()
ginkgo.It("Set Up POA Validator Manager", func() {
subnetIDStr, blockchainIDStr, err := createSovereignSubnet()
gomega.Expect(err).Should(gomega.BeNil())
_, err = commands.TrackLocalEtnaSubnet(testLocalNodeName, subnetName)
_, err = commands.TrackLocalSubnet(testLocalNodeName, subnetName)
gomega.Expect(err).Should(gomega.BeNil())
keyPath := path.Join(utils.GetBaseDir(), constants.KeyDir, fmt.Sprintf("subnet_%s_airdrop", subnetName)+constants.KeySuffix)
k, err := key.LoadSoft(models.NewLocalNetwork().ID, keyPath)
Expand Down

0 comments on commit a692e95

Please sign in to comment.