|
22 | 22 | import org.apache.iotdb.common.rpc.thrift.TSStatus; |
23 | 23 | import org.apache.iotdb.commons.client.sync.SyncConfigNodeIServiceClient; |
24 | 24 | import org.apache.iotdb.confignode.rpc.thrift.TCreatePipeReq; |
25 | | -import org.apache.iotdb.confignode.rpc.thrift.TShowPipeReq; |
26 | 25 | import org.apache.iotdb.consensus.ConsensusFactory; |
27 | 26 | import org.apache.iotdb.db.it.utils.TestUtils; |
28 | 27 | import org.apache.iotdb.it.env.MultiEnvFactory; |
|
39 | 38 | import org.junit.runner.RunWith; |
40 | 39 |
|
41 | 40 | import java.sql.Connection; |
| 41 | +import java.sql.ResultSet; |
42 | 42 | import java.sql.SQLException; |
43 | 43 | import java.sql.Statement; |
44 | 44 | import java.util.Arrays; |
@@ -414,15 +414,17 @@ public void testSourcePermission() { |
414 | 414 | fail("Create pipe without user shall succeed if use the current session"); |
415 | 415 | } |
416 | 416 |
|
417 | | - TestUtils.executeNonQuery(senderEnv, "revoke SYSTEM on root.** from user thulab"); |
418 | | - |
419 | 417 | // A user shall only see its own pipe |
420 | | - try (final SyncConfigNodeIServiceClient client = |
421 | | - (SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) { |
422 | | - Assert.assertEquals( |
423 | | - 1, client.showPipe(new TShowPipeReq().setUserName("thulab")).pipeInfoList.size()); |
| 418 | + try (final Connection connection = senderEnv.getConnection("thulab", "passwD@123456"); |
| 419 | + final Statement statement = connection.createStatement()) { |
| 420 | + // Will not throw any exception |
| 421 | + final ResultSet resultSet = statement.executeQuery("show pipes"); |
| 422 | + Assert.assertTrue(resultSet.next()); |
| 423 | + Assert.assertFalse(resultSet.next()); |
424 | 424 | } catch (Exception e) { |
425 | 425 | fail(e.getMessage()); |
426 | 426 | } |
| 427 | + |
| 428 | + TestUtils.executeNonQuery(senderEnv, "revoke SYSTEM on root.** from user thulab"); |
427 | 429 | } |
428 | 430 | } |
0 commit comments