Skip to content

Commit

Permalink
Update e2e test
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Lord <[email protected]>
  • Loading branch information
mattlord committed Oct 15, 2023
1 parent fab1556 commit 8374837
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions go/test/endtoend/vreplication/migrate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,17 +221,17 @@ func TestVtctldMigrate(t *testing.T) {
var output, expected string

t.Run("mount external cluster", func(t *testing.T) {
output, err := vc.VtctldClient.ExecuteCommandWithOutput("Mount", "Register", "--topo-type=etcd2",
fmt.Sprintf("--topo-server=localhost:%d", extVc.ClusterConfig.topoPort), "--topo-root=/vitess/global", "ext1")
output, err := vc.VtctldClient.ExecuteCommandWithOutput("Mount", "register", "--name=ext1", "--topo-type=etcd2",
fmt.Sprintf("--topo-server=localhost:%d", extVc.ClusterConfig.topoPort), "--topo-root=/vitess/global")
require.NoError(t, err, "Mount Register command failed with %s", output)

output, err = vc.VtctldClient.ExecuteCommandWithOutput("Mount", "List")
output, err = vc.VtctldClient.ExecuteCommandWithOutput("Mount", "list")
require.NoError(t, err, "Mount List command failed with %s", output)

names := gjson.Get(output, "names")
require.Equal(t, 1, len(names.Array()))
require.Equal(t, "ext1", names.Array()[0].String())
output, err = vc.VtctldClient.ExecuteCommandWithOutput("Mount", "Show", "ext1")
output, err = vc.VtctldClient.ExecuteCommandWithOutput("Mount", "show", "--name=ext1")
require.NoError(t, err, "Mount command failed with %s\n", output)

require.Equal(t, "etcd2", gjson.Get(output, "topo_type").String())
Expand Down Expand Up @@ -302,15 +302,15 @@ func TestVtctldMigrate(t *testing.T) {
})

t.Run("unmount external cluster", func(t *testing.T) {
output, err = vc.VtctldClient.ExecuteCommandWithOutput("Mount", "Unregister", "ext1")
output, err = vc.VtctldClient.ExecuteCommandWithOutput("Mount", "unregister", "--name=ext1")
require.NoError(t, err, "Mount command failed with %s\n", output)

output, err = vc.VtctldClient.ExecuteCommandWithOutput("Mount", "List")
output, err = vc.VtctldClient.ExecuteCommandWithOutput("Mount", "list")
require.NoError(t, err, "Mount command failed with %+v : %s\n", output)
expected = "{}\n"
require.Equal(t, expected, output)

output, err = vc.VtctldClient.ExecuteCommandWithOutput("Mount", "Show", "ext1")
output, err = vc.VtctldClient.ExecuteCommandWithOutput("Mount", "show", "--name=ext1")
require.Errorf(t, err, "there is no vitess cluster named ext1")
})
}

0 comments on commit 8374837

Please sign in to comment.