From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752492AbbIOClq (ORCPT ); Mon, 14 Sep 2015 22:41:46 -0400 Received: from mail9.hitachi.co.jp ([133.145.228.44]:55696 "EHLO mail9.hitachi.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751625AbbIOClo (ORCPT ); Mon, 14 Sep 2015 22:41:44 -0400 Message-ID: <55F78563.50006@hitachi.com> Date: Tue, 15 Sep 2015 11:41:39 +0900 From: Hiraku Toyooka User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0 MIME-Version: 1.0 To: Kees Cook CC: LKML , Tony Luck , Linux API , Anton Vorontsov , Shuah Khan , Mark Salyzyn , Colin Cross , Subject: Re: [PATCH 2/2] selftests/pstore: add pstore test scripts going with reboot References: <20150908110615.9783.69477.stgit@arietta> <20150908110620.9783.33823.stgit@arietta> In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.232.31.66] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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