|
20 | 20 | package org.apache.iotdb.pipe.it.dual.tablemodel.manual.basic; |
21 | 21 |
|
22 | 22 | import org.apache.iotdb.common.rpc.thrift.TSStatus; |
23 | | -import org.apache.iotdb.commons.auth.entity.PrivilegeType; |
24 | 23 | import org.apache.iotdb.commons.client.sync.SyncConfigNodeIServiceClient; |
25 | 24 | import org.apache.iotdb.confignode.rpc.thrift.TCreatePipeReq; |
26 | 25 | import org.apache.iotdb.db.it.utils.TestUtils; |
27 | 26 | import org.apache.iotdb.it.env.cluster.node.DataNodeWrapper; |
28 | 27 | import org.apache.iotdb.it.framework.IoTDBTestRunner; |
29 | 28 | import org.apache.iotdb.itbase.category.MultiClusterIT2DualTableManualBasic; |
30 | | -import org.apache.iotdb.itbase.env.BaseEnv; |
31 | 29 | import org.apache.iotdb.pipe.it.dual.tablemodel.TableModelUtils; |
32 | 30 | import org.apache.iotdb.pipe.it.dual.tablemodel.manual.AbstractPipeTableModelDualManualIT; |
33 | 31 | import org.apache.iotdb.rpc.TSStatusCode; |
|
39 | 37 | import org.junit.experimental.categories.Category; |
40 | 38 | import org.junit.runner.RunWith; |
41 | 39 |
|
42 | | -import java.util.Arrays; |
43 | 40 | import java.util.Collections; |
44 | 41 | import java.util.HashMap; |
45 | 42 | import java.util.Map; |
|
49 | 46 | import static org.apache.iotdb.db.it.utils.TestUtils.assertTableNonQueryTestFail; |
50 | 47 | import static org.apache.iotdb.db.it.utils.TestUtils.assertTableTestFail; |
51 | 48 | import static org.apache.iotdb.db.it.utils.TestUtils.createUser; |
52 | | -import static org.apache.iotdb.db.it.utils.TestUtils.executeNonQueriesWithRetry; |
53 | 49 | import static org.apache.iotdb.db.it.utils.TestUtils.executeNonQueryWithRetry; |
54 | | -import static org.apache.iotdb.db.it.utils.TestUtils.executeQueryWithRetry; |
55 | | -import static org.apache.iotdb.db.it.utils.TestUtils.grantUserSystemPrivileges; |
56 | 50 |
|
57 | 51 | @RunWith(IoTDBTestRunner.class) |
58 | 52 | @Category({MultiClusterIT2DualTableManualBasic.class}) |
@@ -725,91 +719,59 @@ public void testPermission() { |
725 | 719 | + " 'connector.ip'='127.0.0.1',\n" |
726 | 720 | + " 'connector.port'='6668'\n" |
727 | 721 | + ")", |
728 | | - "803: Access Denied: No permissions for this operation, please add privilege MAINTAIN", |
| 722 | + "803: Access Denied: No permissions for this operation, only root user is allowed", |
729 | 723 | "test", |
730 | 724 | "test123", |
731 | 725 | null); |
732 | 726 | assertTableNonQueryTestFail( |
733 | 727 | senderEnv, |
734 | 728 | "drop pipe testPipe", |
735 | | - "803: Access Denied: No permissions for this operation, please add privilege MAINTAIN", |
| 729 | + "803: Access Denied: No permissions for this operation, only root user is allowed", |
736 | 730 | "test", |
737 | 731 | "test123", |
738 | 732 | null); |
739 | 733 | assertTableTestFail( |
740 | 734 | senderEnv, |
741 | 735 | "show pipes", |
742 | | - "803: Access Denied: No permissions for this operation, please add privilege MAINTAIN", |
| 736 | + "803: Access Denied: No permissions for this operation, only root user is allowed", |
743 | 737 | "test", |
744 | 738 | "test123", |
745 | 739 | null); |
746 | 740 | assertTableNonQueryTestFail( |
747 | 741 | senderEnv, |
748 | 742 | "start pipe testPipe", |
749 | | - "803: Access Denied: No permissions for this operation, please add privilege MAINTAIN", |
| 743 | + "803: Access Denied: No permissions for this operation, only root user is allowed", |
750 | 744 | "test", |
751 | 745 | "test123", |
752 | 746 | null); |
753 | 747 | assertTableNonQueryTestFail( |
754 | 748 | senderEnv, |
755 | 749 | "stop pipe testPipe", |
756 | | - "803: Access Denied: No permissions for this operation, please add privilege MAINTAIN", |
| 750 | + "803: Access Denied: No permissions for this operation, only root user is allowed", |
757 | 751 | "test", |
758 | 752 | "test123", |
759 | 753 | null); |
760 | 754 |
|
761 | 755 | assertTableNonQueryTestFail( |
762 | 756 | senderEnv, |
763 | 757 | "create pipePlugin TestProcessor as 'org.apache.iotdb.db.pipe.example.TestProcessor' USING URI 'xxx'", |
764 | | - "803: Access Denied: No permissions for this operation, please add privilege MAINTAIN", |
| 758 | + "803: Access Denied: No permissions for this operation, only root user is allowed", |
765 | 759 | "test", |
766 | 760 | "test123", |
767 | 761 | null); |
768 | 762 | assertTableNonQueryTestFail( |
769 | 763 | senderEnv, |
770 | 764 | "drop pipePlugin TestProcessor", |
771 | | - "803: Access Denied: No permissions for this operation, please add privilege MAINTAIN", |
| 765 | + "803: Access Denied: No permissions for this operation, only root user is allowed", |
772 | 766 | "test", |
773 | 767 | "test123", |
774 | 768 | null); |
775 | 769 | assertTableTestFail( |
776 | 770 | senderEnv, |
777 | 771 | "show pipe plugins", |
778 | | - "803: Access Denied: No permissions for this operation, please add privilege MAINTAIN", |
| 772 | + "803: Access Denied: No permissions for this operation, only root user is allowed", |
779 | 773 | "test", |
780 | 774 | "test123", |
781 | 775 | null); |
782 | | - |
783 | | - grantUserSystemPrivileges(senderEnv, "test", PrivilegeType.MAINTAIN); |
784 | | - |
785 | | - executeNonQueryWithRetry( |
786 | | - senderEnv, |
787 | | - "create pipe testPipe\n" |
788 | | - + "with connector (\n" |
789 | | - + " 'connector'='write-back-connector'\n" |
790 | | - + ")", |
791 | | - "test", |
792 | | - "test123", |
793 | | - null, |
794 | | - BaseEnv.TABLE_SQL_DIALECT); |
795 | | - executeQueryWithRetry( |
796 | | - senderEnv, "show pipes", "test", "test123", null, BaseEnv.TABLE_SQL_DIALECT); |
797 | | - executeNonQueriesWithRetry( |
798 | | - senderEnv, |
799 | | - Arrays.asList("start pipe testPipe", "stop pipe testPipe", "drop pipe testPipe"), |
800 | | - "test", |
801 | | - "test123", |
802 | | - null, |
803 | | - BaseEnv.TABLE_SQL_DIALECT); |
804 | | - |
805 | | - assertTableNonQueryTestFail( |
806 | | - senderEnv, |
807 | | - "create pipePlugin TestProcessor as 'org.apache.iotdb.db.pipe.example.TestProcessor' USING URI 'xxx'", |
808 | | - "701: Untrusted uri xxx", |
809 | | - "test", |
810 | | - "test123", |
811 | | - null); |
812 | | - executeQueryWithRetry( |
813 | | - senderEnv, "show pipe plugins", "test", "test123", null, BaseEnv.TABLE_SQL_DIALECT); |
814 | 776 | } |
815 | 777 | } |
0 commit comments