Merge lp:~pwlars/utah/from-host-unique-dir into lp:utah

Proposed by Paul Larson
Status: Merged
Merged at revision: 1008
Proposed branch: lp:~pwlars/utah/from-host-unique-dir
Merge into: lp:utah
Diff against target: 30 lines (+6/-2)
1 file modified
examples/run_utah_phablet.py (+6/-2)
To merge this branch: bzr merge lp:~pwlars/utah/from-host-unique-dir
Reviewer Review Type Date Requested Status
Andy Doan (community) Approve
Max Brustkern (community) Approve
Review via email: mp+186112@code.launchpad.net

Description of the change

When we tried to run tests with FROM_HOST turned on for the phone testing, we saw that sometimes directories appeared to be missing at random. It looks like when utah is copying those testsuites to /var/lib/utah/testssuites and cleaning them up, it's all going to the same place. So the testsuites are getting yanked out from under running tests at some points.

This sets up a temporary directory to point utah to as the testdir. After some digging, I noticed that the statefile for utah still all happens in /var/lib/utah. I didn't see any problems with this since we don't reboot the host during tests, and we never saw any errors about the statefile, just the testsuite dirs being missing midway through the tests. Tested this locally with a phablet test run and the tmpdir does happen in /tmp/[generated] for each run

To post a comment you must log in.
Revision history for this message
Max Brustkern (nuclearbob) wrote :

We may want to implement a deeper solution at some point, but we've already discussed how difficult that will be. I think this looks good for now.

review: Approve
Revision history for this message
Andy Doan (doanac) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'examples/run_utah_phablet.py'
2--- examples/run_utah_phablet.py 2013-09-03 17:03:45 +0000
3+++ examples/run_utah_phablet.py 2013-09-17 17:21:27 +0000
4@@ -20,9 +20,11 @@
5
6 import argparse
7 import os
8+import shutil
9 import socket
10 import subprocess
11 import sys
12+import tempfile
13 import threading
14 import time
15
16@@ -271,10 +273,12 @@
17 device.run_ubuntu('mkdir {}'.format(CLIENT_PROBES_DIR))
18
19 host = os.path.join(args.results_dir, 'utah-host.yml')
20- cmd = '{} -d -o {} -r {} -p {}'.format(
21- args.utah_cmd, host, args.runlist, args.results_dir)
22+ tmpdir = tempfile.mkdtemp()
23+ cmd = '{} -d -o {} -r {} -p {} -t {}'.format(
24+ args.utah_cmd, host, args.runlist, args.results_dir, tmpdir)
25 rc = subprocess.call(cmd, env=env, shell=True)
26 print('utah runlist exited with rc={}'.format(rc))
27+ shutil.rmtree(tmpdir)
28
29 # We've run the test, now do a run on the target so we can grab its YAML
30 # and combine the proper parts of it with our results

Subscribers

People subscribed via source and target branches