Revert "Copy over failed update/tests into their own tree hierarchy."

This is causing hangs as its increasing the size of the worker object. For now lets revert this until we can fix the parallel lib.

This reverts commit 17be082195b8bee27bad05730815e480cd2af1fa

Change-Id: I65b21bc2364d5aebcc73339e9e9ad187b861f73a
Reviewed-on: https://gerrit.chromium.org/gerrit/40257
Tested-by: Chris Sosa <sosa@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
diff --git a/au_test_harness/au_worker.py b/au_test_harness/au_worker.py
index 7f21b1b..a178ecf 100644
--- a/au_test_harness/au_worker.py
+++ b/au_test_harness/au_worker.py
@@ -30,8 +30,6 @@
     self.board = options.board
     self._first_update = False
     self.test_results_root = test_results_root
-    self.all_results_root = os.path.join(test_results_root, 'all')
-    self.fail_results_root = os.path.join(test_results_root, 'failed')
     self.use_delta_updates = options.delta
     self.verbose = options.verbose
     self.vm_image_path = None
@@ -266,22 +264,17 @@
 
     # Initialize test results directory.
     self.test_name = inspect.stack()[1][3]
-    self.all_results_directory = os.path.join(self.all_results_root,
-                                              self.test_name)
-    self.fail_results_directory = os.path.join(self.fail_results_root,
-                                               self.test_name)
+    self.results_directory = os.path.join(self.test_results_root,
+                                          self.test_name)
     self.results_count = 0
 
   def GetNextResultsPath(self, label):
-    """Returns a tuple results directories to use for this label.
+    """Returns a path for the results directory for this label.
 
     Prefixes directory returned for worker with time called i.e. 1_label,
     2_label, etc.  The directory returned is outside the chroot so if passing
     to an script that is called with enther_chroot, make sure to use
-    ReinterpretPathForChroot. The first dir returned is the one where results
-    should be stored. The second is one where failed test results should be
-    stored. Only the former is created as the latter should only be created if
-    the test fails.
+    ReinterpretPathForChroot.
 
     Args:
       label: The label used to describe this test phase.
@@ -289,14 +282,12 @@
       Returns a path for the results directory to use for this label.
     """
     self.results_count += 1
-    results_dir = os.path.join(self.all_results_directory, '%s_%s' % (
+    return_dir = os.path.join(self.results_directory, '%s_%s' % (
         self.results_count, label))
-    fail_dir = os.path.join(self.fail_results_directory, '%s_%s' % (
-        self.results_count, label))
-    if not os.path.exists(results_dir):
-      os.makedirs(results_dir)
+    if not os.path.exists(return_dir):
+      os.makedirs(return_dir)
 
-    return results_dir, fail_dir
+    return return_dir
 
   # --- PRIVATE HELPER FUNCTIONS ---
 
diff --git a/au_test_harness/real_au_worker.py b/au_test_harness/real_au_worker.py
index a641984..ef13c84 100644
--- a/au_test_harness/real_au_worker.py
+++ b/au_test_harness/real_au_worker.py
@@ -50,7 +50,7 @@
 
   def VerifyImage(self, unittest, percent_required_to_pass=100, test=''):
     """Verifies an image using run_remote_tests.sh with verification suite."""
-    test_directory, _ = self.GetNextResultsPath('autotest_tests')
+    test_directory = self.GetNextResultsPath('verify')
     if not test: test = self.verify_suite
 
     output = cros_lib.RunCommand(
diff --git a/au_test_harness/vm_au_worker.py b/au_test_harness/vm_au_worker.py
index 04fd3b4..3e372b7 100644
--- a/au_test_harness/vm_au_worker.py
+++ b/au_test_harness/vm_au_worker.py
@@ -5,12 +5,10 @@
 """Module containing implementation of an au_worker for virtual machines."""
 
 import os
-import shutil
 
 import cros_build_lib as cros_lib
 
 from crostestutils.au_test_harness import au_worker
-from crostestutils.au_test_harness import update_exception
 
 
 class VMAUWorker(au_worker.AUWorker):
@@ -39,18 +37,10 @@
     """Creates an update-able VM based on base image."""
     self.PrepareVMBase(image_path, signed_base)
 
-  @staticmethod
-  def _HandleFail(log_directory, fail_directory):
-    parent_dir = os.path.dirname(fail_directory)
-    if not os.path.isdir(parent_dir):
-      os.makedirs(parent_dir)
-
-    shutil.copytree(log_directory, fail_directory)
-
   def UpdateImage(self, image_path, src_image_path='', stateful_change='old',
                   proxy_port='', private_key_path=None):
     """Updates VM image with image_path."""
-    log_directory, fail_directory = self.GetNextResultsPath('update')
+    log_directory = self.GetNextResultsPath('update')
     stateful_change_flag = self.GetStatefulChangeFlag(stateful_change)
     if src_image_path and self._first_update:
       src_image_path = self.vm_image_path
@@ -70,16 +60,12 @@
                            private_key_path)
     self.TestInfo(self.GetUpdateMessage(image_path, src_image_path, True,
                                         proxy_port))
-    try:
-      self.RunUpdateCmd(cmd, log_directory)
-    except update_exception.UpdateException:
-      self._HandleFail(log_directory, fail_directory)
-      raise
+    self.RunUpdateCmd(cmd, log_directory)
 
   def UpdateUsingPayload(self, update_path, stateful_change='old',
                          proxy_port=None):
     """Updates a vm image using cros_run_vm_update."""
-    log_directory, fail_directory = self.GetNextResultsPath('update')
+    log_directory = self.GetNextResultsPath('update')
     stateful_change_flag = self.GetStatefulChangeFlag(stateful_change)
     cmd = ['%s/cros_run_vm_update' % self.crosutilsbin,
            '--payload=%s' % update_path,
@@ -94,11 +80,7 @@
           ]
     if proxy_port: cmd.append('--proxy_port=%s' % proxy_port)
     self.TestInfo(self.GetUpdateMessage(update_path, None, True, proxy_port))
-    try:
-      self.RunUpdateCmd(cmd, log_directory)
-    except update_exception.UpdateException:
-      self._HandleFail(log_directory, fail_directory)
-      raise
+    self.RunUpdateCmd(cmd, log_directory)
 
   def AppendUpdateFlags(self, cmd, image_path, src_image_path, proxy_port,
                         private_key_path, for_vm=False):
@@ -118,7 +100,7 @@
 
     Returns True upon success.  Prints test output and returns False otherwise.
     """
-    log_directory, fail_directory = self.GetNextResultsPath('autotest_tests')
+    log_directory = self.GetNextResultsPath('verify')
     (_, _, log_directory_in_chroot) = log_directory.rpartition('chroot')
     # image_to_live already verifies lsb-release matching.  This is just
     # for additional steps.
@@ -144,7 +126,6 @@
           redirect_stdout=True, redirect_stderr=True,
           cwd=self.crosutilsbin, print_cmd=False, combine_stdout_stderr=True)
     except cros_lib.RunCommandException:
-      self._HandleFail(log_directory, fail_directory)
       return False
 
     # If the output contains warnings, print the output.