Github user interma commented on a diff in the pull request:
https://github.com/apache/incubator-hawq/pull/1165#discussion_r105339591
--- Diff: src/test/feature/Ranger/test_ranger.cpp ---
@@ -157,3 +154,59 @@ TEST_F(TestHawqRanger, BasicTest) {
gpdfist.finalize_gpfdist();
}
}
+
+static void clear_env(SQLUtility &util, int sql_id, string rootPath,
string rangerHost)
+{
+ int i = sql_id;
+ // delete user_num
+ std::string normalusername = hawq::test::stringFormat("usertest%d", i);
+ std::string superusername = hawq::test::stringFormat("usersuper%d", i);
+ util.execute(hawq::test::stringFormat("drop role
%s;",normalusername.c_str()), false);
+ util.execute(hawq::test::stringFormat("drop role
%s;",superusername.c_str()), false);
+
+ // delete policy
+ std::string cmd = hawq::test::stringFormat("ls -l %s/Ranger/policy/%d/
2>/dev/null| grep \"^-\" | wc -l ", rootPath.c_str(), i);
+ int policy_num = std::atoi(Command::getCommandOutput(cmd).c_str());
+ for (int j = 1; j <= policy_num; j++) {
+ cmd = hawq::test::stringFormat("python
%s/Ranger/rangerpolicy.py -h %s -d policy%d-%d", rootPath.c_str(),
rangerHost.c_str(), i, j);
+ Command::getCommandStatus(cmd);
+ }
+}
+
+TEST_F(TestHawqRanger, FallbackTest) {
+ SQLUtility util;
+
+ if (util.getGUCValue("hawq_acl_type") == "ranger")
+ {
+ string rootPath(util.getTestRootPath());
+ string rangerHost = RANGER_HOST;
+ string initfile = "Ranger/sql/init_file";
+ string cmd;
+ int FallbackCase = 10000;
--- End diff --
I assumed < 10000 is generated sql, >=10000 is manual writed sql.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---