summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorKeith Mok <keithmok@google.com>2022-04-13 04:00:41 +0000
committerKeith Mok <keithmok@google.com>2022-04-13 22:45:10 +0000
commita4766dc033c042800a51384b8c00c621d77fff9e (patch)
tree99e8183a11cd36eb1997aaaab94e27e13eba0b0d /tests
parent4a0abad6f1b70ff18eb5ade27196da02d66f07b2 (diff)
downloadextras-a4766dc033c042800a51384b8c00c621d77fff9e.tar.gz
Fix CtsKernelConfigTestCases cts-on-gsi
run cts-on-gsi -m CtsKernelConfigTestCases will failed on device with kernel not enabled CONFIG_PSTORE_PMSG. If CONFIG_PSTORE_PMSG not enabled /dev/pmsg0 device node will not exists, but echo HELLOWORLD > /dev/pmsg0 will tries to create a file in /dev folder which will failed. Since CONFIG_PSTORE_PMSG is not a mandatory config, add a checking to see if /dev/pmsg0 exist first before echo/write into it. Bug: 215043302 Test: On device kernel without CONFIG_PSTORE_PMSG enabled run cts-on-gsi -m CtsKernelConfigTestCases Change-Id: I5009558fc3a853772c27e5967eb49bd44f171ae0 (cherry picked from commit 745b67e86f2e1d44462dbda25f9ae7166d1511b8)
Diffstat (limited to 'tests')
-rw-r--r--tests/kernel.config/AndroidTest.xml2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/kernel.config/AndroidTest.xml b/tests/kernel.config/AndroidTest.xml
index 19da90af..78452e1c 100644
--- a/tests/kernel.config/AndroidTest.xml
+++ b/tests/kernel.config/AndroidTest.xml
@@ -26,7 +26,7 @@
</target_preparer>
<!-- Make sure there is some data in the pstore then reboot -->
<target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
- <option name="run-command" value="echo HELLOWORLD >/dev/pmsg0" />
+ <option name="run-command" value="if [ -e /dev/pmsg0 ] ; then echo HELLOWORLD > /dev/pmsg0; fi" />
<option name="throw-if-cmd-fail" value="true" />
</target_preparer>
<target_preparer class="com.android.tradefed.targetprep.RebootTargetPreparer" />