bootperf: reset tmp_dir for each iteration

This fixes an error when bootperf runs with multiple iterations without
the -k option (which saves system log files) and recreates the tmp dir
for each iteration.

BUG=b:166744231
TEST=bootperf $IP_ADDR 10

Change-Id: I1c10ac562fa3a00c3a2987b3058d38b445f18f0f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crostestutils/+/2738903
Reviewed-by: Kuang-che Wu <kcwu@chromium.org>
Reviewed-by: Chinglin Yu <chinglinyu@chromium.org>
Tested-by: Chinglin Yu <chinglinyu@chromium.org>
Commit-Queue: Chinglin Yu <chinglinyu@chromium.org>
diff --git a/performance/bootperf-bin/bootperf b/performance/bootperf-bin/bootperf
index 0dbf3c5..c87bdd9 100755
--- a/performance/bootperf-bin/bootperf
+++ b/performance/bootperf-bin/bootperf
@@ -217,7 +217,6 @@
     """Prepares the working temp and output directories for the test."""
     self._process_output_dir()
     self._validate_output_dir()
-    self._make_tmp_dir()
 
   def _process_output_dir(self):
     """Creates the output dir or use the current working dir for test output."""
@@ -260,6 +259,7 @@
     summary_dir = os.path.join(iter_rundir, _RUNDIR_SUMMARY)
     all_results_dir = os.path.join(iter_rundir, _RUNDIR_ALL_RESULTS)
 
+    self._make_tmp_dir()
     os.mkdir(iter_rundir)
     time_now = datetime.datetime.now().strftime('%H:%M:%S')
     print(f'Test started: {time_now} - {logfile}')
@@ -306,7 +306,6 @@
           | stat.S_IRGRP | stat.S_IXGRP | stat.S_IROTH | stat.S_IXOTH)
     else:
       shutil.rmtree(self.tmp_dir)
-      del self.tmp_dir
 
     self.current_iter += 1