Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1221148

Re: [PATCH 0/2] selftests/pstore: add pstore test script

From Kees Cook <keescook@chromium.org>
Newsgroups linux.kernel
Subject Re: [PATCH 0/2] selftests/pstore: add pstore test script
Date 2015-09-09 01:50 +0200
Message-ID <q6AOd-2wV-5@gated-at.bofh.it> (permalink)
References <q6oWK-2qG-21@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Sep 8, 2015 at 4:06 AM, Hiraku Toyooka
<hiraku.toyooka.gu@hitachi.com> wrote:
> These scripts include test cases which check pstore behavior. This
> is useful to avoid regressions of pstore.
>
> Pstore is used across kernel crash, so these test cases are split
> into three parts.
>
>  - pstore_tests: check pstore behavior before crash
>  - pstore_post_reboot_tests: check pstore behavior after crash and reboot
>  - pstore_crash_test: cause kernel crash and reboot
>
> The pstore_test and the pstore_post_reboot_tests are the actual scripts
> for testing pstore and are executed in usual selftest's "run_test" target.
> On the other hand, the pstore_crash_test is to cause kernel panic and reboot,
> so it is executed in new "run_pstore_crash" target which is specified ad-hoc
> by users. In addition, there is a "common_tests" script which includes
> utilities and test cases used commonly in these scripts.
>
> When the pstore_crash_test is executed, it creates a file as a reboot flag.
> The pstore_post_reboot_tests detects whether the file exists or not. If the
> file doesn't exists, the test cases are skipped.
>
> These scripts expect that one pstore backend is registered before the
> scripts are executed.
> Assumed use case is following.
>
> # cd linux/tools/testing/selftests
> # make run_tests -C pstore
> make: Entering directory '/home/root/selftests/pstore'
> === Pstore unit tests (pstore_tests)===
> Checking pstore backend is registered ... ok
> Checking pstore console is registered ... ok
> Checking /dev/pmsg0 exists ... ok
> Writing TEST_STRING to /dev/pmsg0 ... ok
> selftests: pstore_tests [PASS]
> === Pstore unit tests (pstore_post_reboot_tests)===
> Checking pstore backend is registered ... ok
> pstore_crash_test has not been executed yet. we skip further tests.
> selftests: pstore_post_reboot_tests [PASS]
> make: Leaving directory '/home/root/selftests/pstore'
> # make run_pstore_crash
> ...
> (kernel crash and reboot)
> ...
> # make run_tests -C pstore
> make: Entering directory '/home/root/selftests/pstore'
> === Pstore unit tests (pstore_tests)===
> Checking pstore backend is registered ... ok
> Checking pstore console is registered ... ok
> Checking /dev/pmsg0 exists ... ok
> Writing TEST_STRING to /dev/pmsg0 ... ok
> selftests: pstore_tests [PASS]
> === Pstore unit tests (pstore_post_reboot_tests)===
> Checking pstore backend is registered ... ok
> Mounting pstore filesystem ... ok
> Checking dmesg files exist in pstore filesystem ... ok
>         dmesg-ramoops-0
>         dmesg-ramoops-1
> Checking console files exist in pstore filesystem ... ok
>         console-ramoops-0
> Checking pmsg files exist in pstore filesystem ... ok
>         pmsg-ramoops-0
> Checking dmesg files contains oops end marker
>         dmesg-ramoops-0 ... ok
>         dmesg-ramoops-1 ... ok
> Checking console file contains oops end marker ... ok
> Checking pmsg file contains TEST_STRING ... ok
> Removing all files in pstore filesystem
>         console-ramoops-0 ... ok
>         dmesg-ramoops-0 ... ok
>         dmesg-ramoops-1 ... ok
>         pmsg-ramoops-0 ... ok
> selftests: pstore_post_reboot_tests [PASS]
> make: Leaving directory '/home/root/selftests/pstore'
>
>
> We can also see test logs later.
>
> # cat pstore/logs/20150903-111158/pstore_tests.log
> ...

Thanks for working on this! Pstore does need some selftests, so this
is greatly appreciated. :) I sent some improvement ideas in separate
emails.

-Kees

-- 
Kees Cook
Chrome OS Security
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH 0/2] selftests/pstore: add pstore test script Hiraku Toyooka <hiraku.toyooka.gu@hitachi.com> - 2015-09-08 13:10 +0200
  [PATCH 1/2] selftests/pstore: add pstore test script for pre-reboot Hiraku Toyooka <hiraku.toyooka.gu@hitachi.com> - 2015-09-08 13:40 +0200
    Re: [PATCH 1/2] selftests/pstore: add pstore test script for pre-reboot Mark Salyzyn <salyzyn@android.com> - 2015-09-09 01:30 +0200
      Re: [PATCH 1/2] selftests/pstore: add pstore test script for pre-reboot Hiraku Toyooka <hiraku.toyooka.gu@hitachi.com> - 2015-09-15 04:40 +0200
        Re: [PATCH 1/2] selftests/pstore: add pstore test script for  pre-reboot Mark Salyzyn <salyzyn@android.com> - 2015-09-21 23:10 +0200
    Re: [PATCH 1/2] selftests/pstore: add pstore test script for pre-reboot Kees Cook <keescook@chromium.org> - 2015-09-09 01:40 +0200
      Re: [PATCH 1/2] selftests/pstore: add pstore test script for pre-reboot Hiraku Toyooka <hiraku.toyooka.gu@hitachi.com> - 2015-09-15 04:40 +0200
        RE: [PATCH 1/2] selftests/pstore: add pstore test script for  pre-reboot 阿口誠司 / AGUCHI,SEIJI   <seiji.aguchi.tr@hitachi.com> - 2015-09-16 14:10 +0200
          Re: [PATCH 1/2] selftests/pstore: add pstore test script for pre-reboot Hiraku Toyooka <hiraku.toyooka.gu@hitachi.com> - 2015-09-17 08:00 +0200
  [PATCH 2/2] selftests/pstore: add pstore test scripts going with  reboot Hiraku Toyooka <hiraku.toyooka.gu@hitachi.com> - 2015-09-08 13:40 +0200
    Re: [PATCH 2/2] selftests/pstore: add pstore test scripts going with reboot Kees Cook <keescook@chromium.org> - 2015-09-09 01:50 +0200
      Re: [PATCH 2/2] selftests/pstore: add pstore test scripts going with  reboot Hiraku Toyooka <hiraku.toyooka.gu@hitachi.com> - 2015-09-15 04:50 +0200
        RE: [PATCH 2/2] selftests/pstore: add pstore test scripts going  with reboot 阿口誠司 / AGUCHI,SEIJI   <seiji.aguchi.tr@hitachi.com> - 2015-09-16 14:20 +0200
          Re: [PATCH 2/2] selftests/pstore: add pstore test scripts going with  reboot Hiraku Toyooka <hiraku.toyooka.gu@hitachi.com> - 2015-09-17 08:00 +0200
  Re: [PATCH 0/2] selftests/pstore: add pstore test script Kees Cook <keescook@chromium.org> - 2015-09-09 01:50 +0200

csiph-web