Skip to content
This repository has been archived by the owner on Nov 24, 2023. It is now read-only.

Commit

Permalink
fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
lance6716 committed Jan 10, 2021
1 parent e3aea0e commit 67baddf
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions checker/check_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func (s *testCheckerSuite) TestDumpPrivilegeChecking(c *tc.C) {
mock := s.initMockDB(c)
mock.ExpectQuery("SHOW GRANTS").WillReturnRows(sqlmock.NewRows([]string{"Grants for User"}).
AddRow("GRANT USAGE ON *.* TO 'haha'@'%'"))
c.Assert(CheckSyncConfig(context.Background(), cfgs), tc.ErrorMatches, "(.|\n)*lack of RELOAD,SELECT privilege(.|\n)*")
c.Assert(CheckSyncConfig(context.Background(), cfgs), tc.ErrorMatches, "(.|\n)*lack of RELOAD,Select privilege(.|\n)*")

mock = s.initMockDB(c)
mock.ExpectQuery("SHOW GRANTS").WillReturnRows(sqlmock.NewRows([]string{"Grants for User"}).
Expand All @@ -110,7 +110,9 @@ func (s *testCheckerSuite) TestReplicationPrivilegeChecking(c *tc.C) {
mock := s.initMockDB(c)
mock.ExpectQuery("SHOW GRANTS").WillReturnRows(sqlmock.NewRows([]string{"Grants for User"}).
AddRow("GRANT USAGE ON *.* TO 'haha'@'%'"))
c.Assert(CheckSyncConfig(context.Background(), cfgs), tc.ErrorMatches, "(.|\n)*lack of REPLICATION SLAVE,REPLICATION CLIENT privilege(.|\n)*")
err := CheckSyncConfig(context.Background(), cfgs)
c.Assert(err, tc.ErrorMatches, "(.|\n)*lack.*REPLICATION SLAVE(.|\n)*")
c.Assert(err, tc.ErrorMatches, "(.|\n)*lack.*REPLICATION CLIENT(.|\n)*")

mock = s.initMockDB(c)
mock.ExpectQuery("SHOW GRANTS").WillReturnRows(sqlmock.NewRows([]string{"Grants for User"}).
Expand Down

0 comments on commit 67baddf

Please sign in to comment.