bigtop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@apache.org
Subject [1/2] git commit: BIGTOP-1180: Add TestRmAdmin to test yarn rmadmin
Date Thu, 27 Feb 2014 19:46:37 GMT
Repository: bigtop
Updated Branches:
  refs/heads/master fd63c4f9a -> 69f7c9426


BIGTOP-1180: Add TestRmAdmin to test yarn rmadmin


Project: http://git-wip-us.apache.org/repos/asf/bigtop/repo
Commit: http://git-wip-us.apache.org/repos/asf/bigtop/commit/d4504ae4
Tree: http://git-wip-us.apache.org/repos/asf/bigtop/tree/d4504ae4
Diff: http://git-wip-us.apache.org/repos/asf/bigtop/diff/d4504ae4

Branch: refs/heads/master
Commit: d4504ae46cb286e6789c83da40c67e929516dd40
Parents: fd63c4f
Author: wenwu <pengwenwu2008@163.com>
Authored: Tue Jan 14 03:07:43 2014 -0500
Committer: vagrant <vagrant@ubuntu-server-12042-x64-vbox4210.(none)>
Committed: Thu Feb 27 19:24:01 2014 +0000

----------------------------------------------------------------------
 .../bigtop/itest/hadoop/yarn/TestRmAdmin.groovy | 92 ++++++++++++++++++++
 1 file changed, 92 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/bigtop/blob/d4504ae4/bigtop-tests/test-artifacts/hadoop/src/main/groovy/org/apache/bigtop/itest/hadoop/yarn/TestRmAdmin.groovy
----------------------------------------------------------------------
diff --git a/bigtop-tests/test-artifacts/hadoop/src/main/groovy/org/apache/bigtop/itest/hadoop/yarn/TestRmAdmin.groovy
b/bigtop-tests/test-artifacts/hadoop/src/main/groovy/org/apache/bigtop/itest/hadoop/yarn/TestRmAdmin.groovy
new file mode 100644
index 0000000..debbb16
--- /dev/null
+++ b/bigtop-tests/test-artifacts/hadoop/src/main/groovy/org/apache/bigtop/itest/hadoop/yarn/TestRmAdmin.groovy
@@ -0,0 +1,92 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.bigtop.itest.hadoop.yarn;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.apache.bigtop.itest.JarContent;
+import org.apache.bigtop.itest.shell.Shell;
+
+public class TestRmAdmin {
+ 
+  // set debugging variable to true if you want error messages sent to stdout
+  private static Shell sh = new Shell("/bin/bash");
+
+  @BeforeClass
+  public static void setUp() {
+    // unpack resource
+    JarContent.unpackJarContainer(TestRmAdmin.class, "." , null);
+    System.out.println("Running RmAdmin commands:");
+  }
+
+  @AfterClass
+  public static void tearDown() {
+  }
+
+  @Test
+  public void testRmAdminBasic() { 
+    // help
+    System.out.println("-help"); 
+    sh.exec("YARN_ROOT_LOGGER=WARN,console yarn rmadmin -help");    
+    assertTrue("-help failed", sh.getRet() == 0);
+
+    // getGroups
+    System.out.println("-getGroups");
+    sh.exec("YARN_ROOT_LOGGER=WARN,console yarn rmadmin -getGroups");
+    assertTrue("-getGroups failed", sh.getRet() == 0);
+  }
+  
+  @Test
+  public void testRmAdminRefreshcommands() {
+    // refreshQueues
+    System.out.println("-refreshQueues");
+    sh.exec("YARN_ROOT_LOGGER=WARN,console yarn rmadmin -refreshQueues");
+    assertTrue("-refreshQueues failed", sh.getRet() == 0);
+
+    // refreshNodes
+    System.out.println("-refreshNodes");
+    sh.exec("YARN_ROOT_LOGGER=WARN,console yarn rmadmin -refreshNodes");
+    assertTrue("-refreshNodes failed", sh.getRet() == 0);
+
+    // refreshUserToGroupsMappings
+    System.out.println("-refreshUserToGroupsMappings");
+    sh.exec("YARN_ROOT_LOGGER=WARN,console yarn rmadmin -refreshUserToGroupsMappings");
+    assertTrue("-refreshUserToGroupsMappings failed", sh.getRet() == 0);
+
+    // refreshSuperUserGroupsConfiguration
+    System.out.println("-refreshSuperUserGroupsConfiguration");
+    sh.exec("YARN_ROOT_LOGGER=WARN,console yarn rmadmin -refreshSuperUserGroupsConfiguration");
+    assertTrue("-refreshSuperUserGroupsConfiguration failed", sh.getRet() == 0);
+
+    // refreshAdminAcls
+    System.out.println("-refreshAdminAcls");
+    sh.exec("YARN_ROOT_LOGGER=WARN,console yarn rmadmin -refreshAdminAcls");
+    assertTrue("-refreshAdminAcls failed", sh.getRet() == 0);
+
+    /*// refreshServiceAcl - does not work - shHDFS.getRet() = 255
+    System.out.println("-refreshServiceAcl");
+    sh.exec("YARN_ROOT_LOGGER=WARN,console yarn rmadmin -refreshServiceAcl");
+    assertTrue("-refreshServiceAcl failed", sh.getRet() == 0);*/
+
+  }
+
+}


Mime
View raw message