[autotest] Enable log_diff for server side test.
The bug was introduced when we try to force to collect all logs if a test
failed, refer to CL:
https://chromium-review.googlesource.com/#/c/174058
For server side test, the success flag does not pass to the code to run
log_after_each_test, thus all logs are collected by default.
The fix is to add a line of code in _sysinfo_after_test_script to pass the
flag mytest.success to the script to run on the dut.
Also update dummy_FailServer to be consistent on naming.
BUG=chromium:386242
TEST=test_that 172.22.30.146 dummy_PassServer
confirm only the log diff is collected:
/tmp/test_that_results_8Xj6Qj/results-1-dummy_PassServer/dummy_PassServer/sysinfo/var/log_diff/
test_that 172.22.30.146 dummy_FailServer
confirm the full log is collected:
/tmp/test_that_results_iAOAfZ/results-1-dummy_FailServer/dummy_FailServer/sysinfo/var/log/
Change-Id: Icec189c1c0d05ece11d41c68517b6671193a9cd9
Reviewed-on: https://chromium-review.googlesource.com/204488
Reviewed-by: Dan Shi <[email protected]>
Commit-Queue: Dan Shi <[email protected]>
Tested-by: Dan Shi <[email protected]>
diff --git a/server/test.py b/server/test.py
index 8fdba9d7..c184d65 100644
--- a/server/test.py
+++ b/server/test.py
@@ -27,6 +27,9 @@
import pickle
from autotest_lib.client.bin import test
mytest = test.test(job, '', %r)
+# success is passed in so diffable_logdir can decide if or not to collect
+# full log content.
+mytest.success = %s
sysinfo_pickle = os.path.join(mytest.outputdir, 'sysinfo.pickle')
if os.path.exists(sysinfo_pickle):
job.sysinfo = pickle.load(open(sysinfo_pickle))
@@ -200,7 +203,7 @@
def after_hook(self, mytest, host, at, outputdir):
self._push_pickle(host, outputdir);
# run the post-test sysinfo script
- at.run(_sysinfo_after_test_script % outputdir,
+ at.run(_sysinfo_after_test_script % (outputdir, mytest.success),
results_dir=self.job.resultdir)
self._pull_sysinfo_keyval(host, outputdir, mytest)