lkml.org 
[lkml]   [2015]   [Sep]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] selftests/pstore: add pstore test scripts going with reboot
Hello Kees,

>> +run_crash:
>> + @sh pstore_crash_test || echo "pstore_crash_test: [FAIL]"
>
> This is probably better written to exit 1 on failure, otherwise it
> just _says_ it fails. (Though lots of selftests in the tree already
> have this problem, it's best to avoid the pattern for new stuff.)
> Maybe something like:
>
> @sh pstore_crash_test || { echo "pstore_crash_test: [FAIL]";
exit 1; }

OK. I'll add the "exit 1".

>> +prlog -n "Checking dmesg files exist in pstore filesystem ... "
>> +if [ -e dmesg-${backend}-0 ]; then
>> + prlog "ok"
>> + for f in `ls dmesg-${backend}-*`; do
>> + prlog -e "\t${f}"
>> + done
>> +else
>> + prlog "FAIL"
>> + rc=1
>> +fi
>
> This test pattern is repeated a lot. Maybe better to create a helper
> function instead? It could make the tests much more readable.

Yes, I should make a helper function in v2.

Best regards,
Hiraku Toyooka


\
 
 \ /
  Last update: 2015-09-15 05:01    [W:0.053 / U:0.192 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site