=== modified file 'lava_dispatcher/client/fastmodel.py'
@@ -24,6 +24,7 @@
import os
import pexpect
import shutil
+import stat
import threading
from lava_dispatcher.client.base import (
@@ -121,6 +122,17 @@
def _close_serial_proc(self):
self.proc.close(True)
+ def _fix_perms(self):
+ ''' The directory created for the image download/creation gets created
+ with tempfile.mkdtemp which grants permission only to the creator of
+ the directory. We need group access because the dispatcher may run
+ the simulator as a different user
+ '''
+ d = os.path.dirname(self._sd_image)
+ os.chmod(d, stat.S_IRWXG|stat.S_IRWXU)
+ os.chmod(self._sd_image, stat.S_IRWXG|stat.S_IRWXU)
+ os.chmod(self._axf, stat.S_IRWXG|stat.S_IRWXU)
+
def _get_sim_cmd(self):
return ("%s -a coretile.cluster0.*=%s "
"-C motherboard.smsc_91c111.enabled=1 "
@@ -137,6 +149,7 @@
if self._sim_proc is not None:
self._sim_proc.close()
+ self._fix_perms()
sim_cmd = self._get_sim_cmd()
# the simulator proc only has stdout/stderr about the simulator
@@ -185,4 +198,4 @@
# change simproc's stdout so it doesn't overlap the stdout from our
# serial console logging
self.proc.logfile = open('/dev/null', 'w')
- self.proc.interact()
+ self.proc.drain()
=== modified file 'lava_dispatcher/utils.py'
@@ -22,6 +22,7 @@
import errno
import logging
import os
+import sys
import shutil
import urllib2
import urlparse
@@ -124,6 +125,15 @@
return super(logging_spawn, self).expect(*args, **kw)
+ def drain(self):
+ """this is a one-off of the pexect __interact that ignores STDIN and
+ handles an error that happens when we call read just after the process exits
+ """
+ try:
+ self._spawn__interact_copy(escape_character=chr(29))
+ except:
+ logging.warn(sys.exc_info())
+ pass
# XXX Duplication: we should reuse lava-test TestArtifacts
def generate_bundle_file_name(test_name):