Skip to content

Commit

Permalink
fix3
Browse files Browse the repository at this point in the history
  • Loading branch information
庄润梓 committed Jun 14, 2024
1 parent 693a722 commit 7f9be86
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions tests/e2e/greptimedbcluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ var _ = Describe("Basic test of greptimedb cluster", func() {
err = getCluster()
Expect(err).NotTo(HaveOccurred(), "failed to get cluster")

err = createClusterinBaremetal()
Expect(err).NotTo(HaveOccurred(), "failed to create cluster in baremetal")

err = getClusterinBaremetal()
Expect(err).NotTo(HaveOccurred(), "failed to get cluster in baremetal")

err = listCluster()
Expect(err).NotTo(HaveOccurred(), "failed to list cluster")

Expand Down Expand Up @@ -138,6 +144,9 @@ var _ = Describe("Basic test of greptimedb cluster", func() {

err = deleteCluster()
Expect(err).NotTo(HaveOccurred(), "failed to delete cluster")

err = deleteClusterinBaremetal()
Expect(err).NotTo(HaveOccurred(), "failed to delete cluster in baremetal")
})
})

Expand All @@ -151,6 +160,16 @@ func createCluster() error {
return nil
}

func createClusterinBaremetal() error {
cmd := exec.Command("../../bin/gtctl", "cluster", "create", "mydb", "--timeout", "300", "--bare-metal")
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
if err := cmd.Run(); err != nil {
return err
}
return nil
}

func getCluster() error {
cmd := exec.Command("../../bin/gtctl", "cluster", "get", "mydb")
cmd.Stdout = os.Stdout
Expand All @@ -161,6 +180,16 @@ func getCluster() error {
return nil
}

func getClusterinBaremetal() error {
cmd := exec.Command("../../bin/gtctl", "cluster", "get", "mydb", "--bare-metal")
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
if err := cmd.Run(); err != nil {
return err
}
return nil
}

func listCluster() error {
cmd := exec.Command("../../bin/gtctl", "cluster", "list")
cmd.Stdout = os.Stdout
Expand All @@ -181,6 +210,16 @@ func deleteCluster() error {
return nil
}

func deleteClusterinBaremetal() error {
cmd := exec.Command("../../bin/gtctl", "cluster", "delete", "mydb", "--tear-down-etcd", "--bare-metal")
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
if err := cmd.Run(); err != nil {
return err
}
return nil
}

func forwardRequest() {
for {
cmd := exec.Command("kubectl", "port-forward", "svc/mydb-frontend", "4002:4002")
Expand Down

0 comments on commit 7f9be86

Please sign in to comment.