falcon-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From samar...@apache.org
Subject git commit: FALCON-656 add test in falcon regression's Authorization test where non-feed owner updates a feed with a dependent process contributed by Karishma
Date Mon, 08 Sep 2014 09:54:48 GMT
Repository: incubator-falcon
Updated Branches:
  refs/heads/master 120c1c04d -> 245b6b457


FALCON-656 add test in falcon regression's Authorization test where non-feed owner updates
a feed with a dependent process contributed by Karishma


Project: http://git-wip-us.apache.org/repos/asf/incubator-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-falcon/commit/245b6b45
Tree: http://git-wip-us.apache.org/repos/asf/incubator-falcon/tree/245b6b45
Diff: http://git-wip-us.apache.org/repos/asf/incubator-falcon/diff/245b6b45

Branch: refs/heads/master
Commit: 245b6b45755c375e3d5af4b113a3b206d1669727
Parents: 120c1c0
Author: Samarth Gupta <samarth.gupta@inmobi.com>
Authored: Mon Sep 8 15:24:39 2014 +0530
Committer: Samarth Gupta <samarth.gupta@inmobi.com>
Committed: Mon Sep 8 15:24:39 2014 +0530

----------------------------------------------------------------------
 falcon-regression/CHANGES.txt                   |  2 ++
 .../falcon/regression/AuthorizationTest.java    | 28 ++++++++++++++++++++
 2 files changed, 30 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/245b6b45/falcon-regression/CHANGES.txt
----------------------------------------------------------------------
diff --git a/falcon-regression/CHANGES.txt b/falcon-regression/CHANGES.txt
index cc38357..231f33e 100644
--- a/falcon-regression/CHANGES.txt
+++ b/falcon-regression/CHANGES.txt
@@ -9,6 +9,8 @@ Trunk (Unreleased)
    via Samarth Gupta)
 
   IMPROVEMENTS
+   FALCON-656 add test in falcon regression's Authorization test where non-feed owner updates
+   a feed with a dependent process(Karishma via Samarth Gupta)
    FALCON-674 General code factored out for ProcessInstance* tests (Paul Isaychuk via Ruslan
    Ostafiychuk)
 

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/245b6b45/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/AuthorizationTest.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/AuthorizationTest.java
b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/AuthorizationTest.java
index 8bf4288..49b13b5 100644
--- a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/AuthorizationTest.java
+++ b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/AuthorizationTest.java
@@ -669,6 +669,34 @@ public class AuthorizationTest extends BaseTestClass {
         Assert.assertEquals(oldProcessUser, newProcessUser, "User should be the same");
     }
 
+    public void u1ScheduleFeedU2ScheduleDependantProcessU2UpdateFeed() throws Exception {
+        String feed = bundles[0].getInputFeedFromBundle();
+        String process = bundles[0].getProcessData();
+        //submit both feeds
+        bundles[0].submitClusters(prism);
+        bundles[0].submitFeeds(prism);
+        //schedule input feed by U1
+        AssertUtil.assertSucceeded(prism.getFeedHelper().schedule(Util.URLS.SCHEDULE_URL,
feed));
+        AssertUtil.checkStatus(clusterOC, EntityType.FEED, feed, Job.Status.RUNNING);
+
+        //by U2 schedule process dependent on scheduled feed by U1
+        KerberosHelper.loginFromKeytab(MerlinConstants.USER2_NAME);
+        ServiceResponse serviceResponse = prism.getProcessHelper().submitAndSchedule(Util
+                 .URLS.SUBMIT_AND_SCHEDULE_URL, process, MerlinConstants.USER2_NAME);
+        AssertUtil.assertSucceeded(serviceResponse);
+        AssertUtil.checkStatus(clusterOC, EntityType.PROCESS, process, Job.Status.RUNNING);
+
+        //update feed definition
+        String newFeed = Util.setFeedPathValue(feed,
+        baseHDFSDir + "/randomPath/${YEAR}/${MONTH}/${DAY}/${HOUR}/${MINUTE}/");
+
+        //update feed by U2
+        serviceResponse = prism.getFeedHelper().update(feed, newFeed,
+        TimeUtil.getTimeWrtSystemTime(0), MerlinConstants.USER2_NAME);
+        AssertUtil.assertFailedWithStatus(serviceResponse, HttpStatus.SC_BAD_REQUEST,
+                 "Feed scheduled by first user should not be updated by second user");
+    }
+
     private String getBundleUser(ColoHelper coloHelper, String entityName, EntityType entityType)
         throws OozieClientException {
         String newProcessBundleId = InstanceUtil.getLatestBundleID(coloHelper, entityName,


Mime
View raw message