diff mbox

[Branch,~linaro-validation/lava-dispatcher/trunk] Rev 478: a few fixes for problems found trying to use signals in the real world

Message ID 20121203195813.17810.67927.launchpad@ackee.canonical.com
State Accepted
Headers show

Commit Message

Michael-Doyle Hudson Dec. 3, 2012, 7:58 p.m. UTC
Merge authors:
  Michael Hudson-Doyle (mwhudson)
Related merge proposals:
  https://code.launchpad.net/~mwhudson/lava-dispatcher/signal-fixes/+merge/137671
  proposed by: Michael Hudson-Doyle (mwhudson)
------------------------------------------------------------
revno: 478 [merge]
committer: Michael Hudson-Doyle <michael.hudson@linaro.org>
branch nick: trunk
timestamp: Tue 2012-12-04 08:57:52 +1300
message:
  a few fixes for problems found trying to use signals in the real world
modified:
  lava_dispatcher/actions/lava_test_shell.py
  lava_dispatcher/lava_test_shell.py
  lava_test_shell/lava-test-case
  lava_test_shell/lava-test-runner-android
  lava_test_shell/lava-test-runner-ubuntu


--
lp:lava-dispatcher
https://code.launchpad.net/~linaro-validation/lava-dispatcher/trunk

You are subscribed to branch lp:lava-dispatcher.
To unsubscribe from this branch go to https://code.launchpad.net/~linaro-validation/lava-dispatcher/trunk/+edit-subscription
diff mbox

Patch

=== modified file 'lava_dispatcher/actions/lava_test_shell.py'
--- lava_dispatcher/actions/lava_test_shell.py	2012-11-23 01:41:43 +0000
+++ lava_dispatcher/actions/lava_test_shell.py	2012-12-03 19:38:41 +0000
@@ -441,9 +441,8 @@ 
         self._sw_sources.append(info)
 
     def copy_test(self, hostdir, targetdir):
+        shutil.copytree(self.repo, hostdir, symlinks=True)
         URLTestDefinition.copy_test(self, hostdir, targetdir)
-        for filepath in glob(os.path.join(self.repo, '*')):
-            shutil.copy2(filepath, hostdir)
         logging.info('copied all test files')
 
 
@@ -544,6 +543,7 @@ 
     def _mk_runner_dirs(self, mntdir):
         utils.ensure_directory('%s/bin' % mntdir)
         utils.ensure_directory_empty('%s/tests' % mntdir)
+        utils.ensure_directory_empty('%s/results' % mntdir)
 
     def _configure_target(self, target, testdef_urls, testdef_repos):
         ldir = target.deployment_data['lava_test_dir']

=== modified file 'lava_dispatcher/lava_test_shell.py'
--- lava_dispatcher/lava_test_shell.py	2012-11-22 23:34:43 +0000
+++ lava_dispatcher/lava_test_shell.py	2012-12-03 19:41:16 +0000
@@ -125,7 +125,7 @@ 
     for filename, filepath in _directory_names_and_paths(dir, ignore_missing=True):
         if filename.endswith('.mimetype'):
             continue
-        mime_type = _read_content(filepath + '.mimetype', ignore_missing=True)
+        mime_type = _read_content(filepath + '.mimetype', ignore_missing=True).strip()
         if not mime_type:
             mime_type = mimetypes.guess_type(filepath)[0]
             if mime_type is None:

=== modified file 'lava_test_shell/lava-test-case'
--- lava_test_shell/lava-test-case	2012-11-21 01:33:01 +0000
+++ lava_test_shell/lava-test-case	2012-12-03 19:39:15 +0000
@@ -17,11 +17,11 @@ 
 fi
 if [ "$1" = "--shell" ]; then
     shift
-    echo "<LAVA_SIGNAL_STARTTC $TEST_CASE_ID>"
+    echo "<LAVA_SIGNAL_STARTTC $TEST_CASE_ID>" > /dev/console
     read -t 600 < $ACK_FIFO
     $*
     rc=$?
-    echo "<LAVA_SIGNAL_ENDTC $TEST_CASE_ID>"
+    echo "<LAVA_SIGNAL_ENDTC $TEST_CASE_ID>" > /dev/console
     read -t 600 < $ACK_FIFO
     if [ $rc -eq 0 ]; then
         RESULT=pass
@@ -71,4 +71,5 @@ 
 
 if [ -n "${MEASUREMENT+x}" ]; then
     echo $MEASUREMENT > $result_dir/measurement
-fi
\ No newline at end of file
+fi
+[ -n "${rc+x}" ] && exit $rc

=== modified file 'lava_test_shell/lava-test-runner-android'
--- lava_test_shell/lava-test-runner-android	2012-11-22 22:47:53 +0000
+++ lava_test_shell/lava-test-runner-android	2012-12-03 19:46:40 +0000
@@ -101,7 +101,11 @@ 
 		cp ${line}/testdef.yaml ${odir}/
 		cp ${line}/uuid ${odir}/analyzer_assigned_uuid
 		cp ${line}/run.sh ${odir}/attachments/
-		[ -f ${line}/install.sh ] && cp ${line}/install.sh ${odir}/attachments/
+		echo 'text/plain' > ${odir}/attachments/run.sh.mimetype
+		if [ -f ${line}/install.sh ]; then
+			cp ${line}/install.sh ${odir}/attachments/
+			echo 'text/plain' > ${odir}/attachments/install.sh.mimetype
+		fi
 		lava-test-shell --output_dir ${odir} /system/bin/sh -e "${line}/run.sh"
 		echo "${PREFIX} ${test} exited with: `cat ${odir}/return_code`"
 	done < ${WORKFILE}

=== modified file 'lava_test_shell/lava-test-runner-ubuntu'
--- lava_test_shell/lava-test-runner-ubuntu	2012-11-22 01:43:14 +0000
+++ lava_test_shell/lava-test-runner-ubuntu	2012-12-03 19:40:49 +0000
@@ -84,7 +84,11 @@ 
 	cp ${line}/uuid ${odir}/analyzer_assigned_uuid
 	cp ${line}/testdef.yaml ${odir}/
 	cp ${line}/run.sh ${odir}/attachments/
-	[ -f ${line}/install.sh ] && cp ${line}/install.sh ${odir}/attachments/
+	echo 'text/plain' > ${odir}/attachments/run.sh.mimetype
+	if [ -f ${line}/install.sh ]; then
+	    cp ${line}/install.sh ${odir}/attachments/
+	    echo 'text/plain' > ${odir}/attachments/install.sh.mimetype
+	fi
 	# run.sh includes a "read -t <timeout>" which isn't supported by dash
 	# so be sure to use bash
 	lava-test-shell --output_dir ${odir} /bin/bash -e "${line}/run.sh"