You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by ec...@apache.org on 2013/02/27 22:55:30 UTC

svn commit: r1450987 - in /accumulo/trunk: ./ assemble/ core/ core/src/main/java/org/apache/accumulo/core/util/shell/commands/ examples/ examples/simple/src/test/java/org/apache/accumulo/examples/simple/dirlist/ fate/src/main/java/org/apache/accumulo/f...

Author: ecn
Date: Wed Feb 27 21:55:30 2013
New Revision: 1450987

URL: http://svn.apache.org/r1450987
Log:
ACCUMULO-1004 fixing functional tests

Modified:
    accumulo/trunk/   (props changed)
    accumulo/trunk/assemble/   (props changed)
    accumulo/trunk/core/   (props changed)
    accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/UserCommand.java
    accumulo/trunk/examples/   (props changed)
    accumulo/trunk/examples/simple/src/test/java/org/apache/accumulo/examples/simple/dirlist/CountTest.java
    accumulo/trunk/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java   (props changed)
    accumulo/trunk/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooSession.java   (props changed)
    accumulo/trunk/server/   (props changed)
    accumulo/trunk/src/   (props changed)
    accumulo/trunk/test/src/main/java/org/apache/accumulo/test/TestIngest.java
    accumulo/trunk/test/src/main/java/org/apache/accumulo/test/VerifyIngest.java
    accumulo/trunk/test/src/main/java/org/apache/accumulo/test/functional/BulkSplitOptimizationTest.java
    accumulo/trunk/test/system/auto/TestUtils.py
    accumulo/trunk/test/system/auto/simple/binary.py
    accumulo/trunk/test/system/auto/simple/examples.py
    accumulo/trunk/test/system/auto/simple/readwrite.py
    accumulo/trunk/test/system/auto/stress/batchWrite.py

Propchange: accumulo/trunk/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.5:r1450985

Propchange: accumulo/trunk/assemble/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.5/assemble:r1450985

Propchange: accumulo/trunk/core/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.5/core:r1450985

Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/UserCommand.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/UserCommand.java?rev=1450987&r1=1450986&r2=1450987&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/UserCommand.java (original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/UserCommand.java Wed Feb 27 21:55:30 2013
@@ -17,14 +17,12 @@
 package org.apache.accumulo.core.util.shell.commands;
 
 import java.io.IOException;
-import java.nio.ByteBuffer;
 import java.util.Map;
 import java.util.Set;
 
 import org.apache.accumulo.core.client.AccumuloException;
 import org.apache.accumulo.core.client.AccumuloSecurityException;
 import org.apache.accumulo.core.security.CredentialHelper;
-import org.apache.accumulo.core.security.thrift.Credential;
 import org.apache.accumulo.core.security.tokens.PasswordToken;
 import org.apache.accumulo.core.util.shell.Shell;
 import org.apache.accumulo.core.util.shell.Shell.Command;

Propchange: accumulo/trunk/examples/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.5/examples:r1450985

Modified: accumulo/trunk/examples/simple/src/test/java/org/apache/accumulo/examples/simple/dirlist/CountTest.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/examples/simple/src/test/java/org/apache/accumulo/examples/simple/dirlist/CountTest.java?rev=1450987&r1=1450986&r2=1450987&view=diff
==============================================================================
--- accumulo/trunk/examples/simple/src/test/java/org/apache/accumulo/examples/simple/dirlist/CountTest.java (original)
+++ accumulo/trunk/examples/simple/src/test/java/org/apache/accumulo/examples/simple/dirlist/CountTest.java Wed Feb 27 21:55:30 2013
@@ -70,6 +70,7 @@ public class CountTest extends TestCase 
     opts.instance = "counttest";
     opts.tableName = "dirlisttable";
     opts.mock = true;
+    opts.password = new Opts.Password("");
     FileCount fc = new FileCount(opts, scanOpts, bwOpts);
     fc.run();
     

Propchange: accumulo/trunk/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.5/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java:r1450985

Propchange: accumulo/trunk/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooSession.java
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.5/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooSession.java:r1450985

Propchange: accumulo/trunk/server/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.5/server:r1450985

Propchange: accumulo/trunk/src/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.5/src:r1450985

Modified: accumulo/trunk/test/src/main/java/org/apache/accumulo/test/TestIngest.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/test/src/main/java/org/apache/accumulo/test/TestIngest.java?rev=1450987&r1=1450986&r2=1450987&view=diff
==============================================================================
--- accumulo/trunk/test/src/main/java/org/apache/accumulo/test/TestIngest.java (original)
+++ accumulo/trunk/test/src/main/java/org/apache/accumulo/test/TestIngest.java Wed Feb 27 21:55:30 2013
@@ -204,7 +204,6 @@ public class TestIngest {
       
       BatchWriter bw = null;
       FileSKVWriter writer = null;
-      Connector connector = opts.getConnector();
       
       if (opts.outputFile != null) {
         Configuration conf = CachedConfiguration.getInstance();
@@ -213,9 +212,10 @@ public class TestIngest {
             AccumuloConfiguration.getDefaultConfiguration());
         writer.startDefaultLocalityGroup();
       } else {
+        Connector connector = opts.getConnector();
         bw = connector.createBatchWriter(opts.getTableName(), bwOpts.getBatchWriterConfig());
+        connector.securityOperations().changeUserAuthorizations(opts.principal, AUTHS);
       }
-      connector.securityOperations().changeUserAuthorizations(opts.principal, AUTHS);
       Text labBA = new Text(opts.columnVisibility.getExpression());
       
       long startTime = System.currentTimeMillis();

Modified: accumulo/trunk/test/src/main/java/org/apache/accumulo/test/VerifyIngest.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/test/src/main/java/org/apache/accumulo/test/VerifyIngest.java?rev=1450987&r1=1450986&r2=1450987&view=diff
==============================================================================
--- accumulo/trunk/test/src/main/java/org/apache/accumulo/test/VerifyIngest.java (original)
+++ accumulo/trunk/test/src/main/java/org/apache/accumulo/test/VerifyIngest.java Wed Feb 27 21:55:30 2013
@@ -71,19 +71,12 @@ public class VerifyIngest {
         Trace.currentTrace().data("cmdLine", Arrays.asList(args).toString());
       }
       
-      Connector connector = null;
-      while (connector == null) {
-        try {
-          connector = opts.getConnector();
-        } catch (AccumuloException e) {
-          log.warn("Could not connect to accumulo; will retry: " + e);
-          UtilWaitThread.sleep(1000);
-        }
-      }
+      Connector connector = opts.getConnector();
       
       byte[][] bytevals = TestIngest.generateValues(opts);
       
       Authorizations labelAuths = new Authorizations("L1", "L2", "G1", "GROUP2");
+      connector.securityOperations().changeUserAuthorizations(opts.principal, labelAuths);
       
       int expectedRow = opts.startRow;
       int expectedCol = 0;

Modified: accumulo/trunk/test/src/main/java/org/apache/accumulo/test/functional/BulkSplitOptimizationTest.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/test/src/main/java/org/apache/accumulo/test/functional/BulkSplitOptimizationTest.java?rev=1450987&r1=1450986&r2=1450987&view=diff
==============================================================================
--- accumulo/trunk/test/src/main/java/org/apache/accumulo/test/functional/BulkSplitOptimizationTest.java (original)
+++ accumulo/trunk/test/src/main/java/org/apache/accumulo/test/functional/BulkSplitOptimizationTest.java Wed Feb 27 21:55:30 2013
@@ -21,6 +21,8 @@ import java.util.List;
 import java.util.Map;
 
 import org.apache.accumulo.core.conf.Property;
+import org.apache.accumulo.core.security.tokens.PasswordToken;
+import org.apache.accumulo.core.security.tokens.SecurityToken;
 import org.apache.accumulo.core.util.CachedConfiguration;
 import org.apache.accumulo.core.util.UtilWaitThread;
 import org.apache.accumulo.test.CreateRFiles;
@@ -62,7 +64,7 @@ public class BulkSplitOptimizationTest e
     
     FileSystem fs = FileSystem.get(CachedConfiguration.getInstance());
     fs.delete(new Path("/tmp/testmf"), true);
-    
+    SecurityToken token = this.getToken();
     CreateRFiles.main(new String[] { "--output", "tmp/testmf", "--numThreads", "8", "--start", "0", "--end", "100000", "--splits", "99"});
     
     bulkImport(fs, TABLE_NAME, "/tmp/testmf");
@@ -82,7 +84,11 @@ public class BulkSplitOptimizationTest e
     
     checkSplits(TABLE_NAME, 50, 100);
     
-    VerifyIngest.main(new String[] {"--timestamp", "1", "--size", "50", "--random", "56", "--rows", "100000", "--start", "0", "--cols", "1"});
+    String passwd = "";
+    if (token instanceof PasswordToken) {
+      passwd = new String(((PasswordToken)token).getPassword());
+    }
+    VerifyIngest.main(new String[] {"--timestamp", "1", "--size", "50", "--random", "56", "--rows", "100000", "--start", "0", "--cols", "1", "-p", passwd});
     
     // ensure each tablet does not have all map files
     checkRFiles(TABLE_NAME, 50, 100, 1, 4);

Modified: accumulo/trunk/test/system/auto/TestUtils.py
URL: http://svn.apache.org/viewvc/accumulo/trunk/test/system/auto/TestUtils.py?rev=1450987&r1=1450986&r2=1450987&view=diff
==============================================================================
--- accumulo/trunk/test/system/auto/TestUtils.py (original)
+++ accumulo/trunk/test/system/auto/TestUtils.py Wed Feb 27 21:55:30 2013
@@ -120,7 +120,7 @@ class TestUtilsMixin:
             ld = 'ACCUMULO_LOG_DIR=%s/logs/%s' % (ACCUMULO_HOME, ID)
             execcmd = ['ssh', '-q', host, cp, jo, go, ld] + quote(cmd)
             log.debug(repr(execcmd))
-            return Popen(execcmd, stdin=PIPE, stdout=PIPE, stderr=PIPE, **opts)
+            return Popen(execcmd, stdout=PIPE, stderr=PIPE, **opts)
             
     def shell(self, host, input, **opts):
         """Run accumulo shell with the given input,
@@ -220,7 +220,7 @@ class TestUtilsMixin:
         args = ''
         if timestamp:
             args += "-ts %ld " % int(timestamp)
-        args += '--debug -i %s -u %s --size %d --random 56 --rows %d --start %d --cols 1 --createTable ' % (INSTANCE_NAME, ROOT, size, count, start)
+        args += '--debug -i %s -u %s --size %d --random 56 --rows %d --start %d --cols 1 --createTable -p %s' % (INSTANCE_NAME, ROOT, size, count, start, ROOT_PASSWORD)
         if colf:
            args = '--columnFamily %s ' % colf + args
         return self.runClassOn(host, klass, args.split(), **kwargs)
@@ -230,7 +230,7 @@ class TestUtilsMixin:
         args = ''
         if timestamp:
             args += "-ts %ld " % int(timestamp)
-        args += '-i %s -u %s --size %d --random 56 -cf %s --rows %d --start %d --cols 1 ' % (INSTANCE_NAME, ROOT, size, colf, count, start)
+        args += '-i %s -u %s --size %d --random 56 -cf %s --rows %d --start %d --cols 1 -p %s' % (INSTANCE_NAME, ROOT, size, colf, count, start, ROOT_PASSWORD)
         return self.runClassOn(host, klass, args.split())
 
     def stop_accumulo(self, signal=signal.SIGHUP):

Modified: accumulo/trunk/test/system/auto/simple/binary.py
URL: http://svn.apache.org/viewvc/accumulo/trunk/test/system/auto/simple/binary.py?rev=1450987&r1=1450986&r2=1450987&view=diff
==============================================================================
--- accumulo/trunk/test/system/auto/simple/binary.py (original)
+++ accumulo/trunk/test/system/auto/simple/binary.py Wed Feb 27 21:55:30 2013
@@ -36,7 +36,7 @@ class BinaryTest(unittest.TestCase, Test
         handle = self.runClassOn(self.masterHost(), testClass, 
                                  ['-u', 'root',
                                   '--mode', mode, '-t', table, 
-                                  '--start', min, '--count', max])
+                                  '--start', min, '--count', max, '-p', 'secret'])
         self.waitForStop(handle, 200)
         
     def tearDown(self):

Modified: accumulo/trunk/test/system/auto/simple/examples.py
URL: http://svn.apache.org/viewvc/accumulo/trunk/test/system/auto/simple/examples.py?rev=1450987&r1=1450986&r2=1450987&view=diff
==============================================================================
--- accumulo/trunk/test/system/auto/simple/examples.py (original)
+++ accumulo/trunk/test/system/auto/simple/examples.py Wed Feb 27 21:55:30 2013
@@ -63,7 +63,7 @@ class Examples(TestUtilsMixin, unittest.
 	self.comment("Testing MaxMutation constraint")
 	self.ashell('createtable test_ingest\n'
                     'constraint -a org.apache.accumulo.examples.simple.constraints.MaxMutationSize\n')
-        handle = self.runOn('localhost', [self.accumulo_sh(), 'org.apache.accumulo.test.TestIngest', '-u', ROOT, '--rows', '1', '--start', '0', '--cols', '10000'])
+        handle = self.runOn('localhost', [self.accumulo_sh(), 'org.apache.accumulo.test.TestIngest', '-u', ROOT, '--rows', '1', '--start', '0', '--cols', '10000', '-p', ROOT_PASSWORD])
         out, err = handle.communicate()
         self.failIf(handle.returncode==0)
         self.failUnless(err.find("MutationsRejectedException: # constraint violations : 1") >= 0, "Was able to insert a mutation larger than max size")

Modified: accumulo/trunk/test/system/auto/simple/readwrite.py
URL: http://svn.apache.org/viewvc/accumulo/trunk/test/system/auto/simple/readwrite.py?rev=1450987&r1=1450986&r2=1450987&view=diff
==============================================================================
--- accumulo/trunk/test/system/auto/simple/readwrite.py (original)
+++ accumulo/trunk/test/system/auto/simple/readwrite.py Wed Feb 27 21:55:30 2013
@@ -20,7 +20,7 @@ import unittest
 import time
 import sys
 
-from TestUtils import TestUtilsMixin, FUZZ, ACCUMULO_HOME, SITE, INSTANCE_NAME
+from TestUtils import TestUtilsMixin, FUZZ, ACCUMULO_HOME, SITE, INSTANCE_NAME, ROOT, ROOT_PASSWORD
 
 log = logging.getLogger('test.auto')
 
@@ -82,12 +82,12 @@ class MultiTableTest(SunnyDayTest):
     
     def ingest(self, host, count, *args, **kwargs):
         klass = 'org.apache.accumulo.test.TestMultiTableIngest'
-        args = '--count %d -u root -i %s ' % (count, INSTANCE_NAME)
+        args = '--count %d -u root -i %s -p %s' % (count, INSTANCE_NAME, ROOT_PASSWORD)
         return self.runClassOn(host, klass, args.split())
 
     def verify(self, host, count, *args, **kwargs):
         klass = 'org.apache.accumulo.test.TestMultiTableIngest'
-        args = '--count %d --readonly -u root -i %s ' % (count, INSTANCE_NAME)
+        args = '--count %d --readonly -u root -i %s -p %s' % (count, INSTANCE_NAME, ROOT_PASSWORD)
         return self.runClassOn(host, klass, args.split())
 
 

Modified: accumulo/trunk/test/system/auto/stress/batchWrite.py
URL: http://svn.apache.org/viewvc/accumulo/trunk/test/system/auto/stress/batchWrite.py?rev=1450987&r1=1450986&r2=1450987&view=diff
==============================================================================
--- accumulo/trunk/test/system/auto/stress/batchWrite.py (original)
+++ accumulo/trunk/test/system/auto/stress/batchWrite.py Wed Feb 27 21:55:30 2013
@@ -19,7 +19,7 @@ import logging
 import unittest
 import time
 
-from TestUtils import TestUtilsMixin
+from TestUtils import TestUtilsMixin, ROOT_PASSWORD
 
 log = logging.getLogger('test.auto')
 
@@ -33,7 +33,7 @@ class WriteLots(unittest.TestCase, TestU
 
     def ingest(self, host, start, count, **kwargs):
         klass = 'org.apache.accumulo.test.TestIngest'
-        args = '--user root --size 50 --random 56 --rows %d --start %d --cols 1' % (count, start)
+        args = '--user root --size 50 --random 56 --rows %d --start %d --cols 1 -p %s' % (count, start, ROOT_PASSWORD)
         return self.runClassOn(host, klass, args.split(), **kwargs)
 
     def setUp(self):