]> git.ipfire.org Git - thirdparty/mdadm.git/commit
mdadm/test: Refactor and revamp 'test' script
authorZhilong Liu <zlliu@suse.com>
Wed, 14 Jun 2017 13:02:51 +0000 (21:02 +0800)
committerJes Sorensen <jsorensen@fb.com>
Mon, 10 Jul 2017 17:30:10 +0000 (13:30 -0400)
commit20d10b4be873baf6044304702808bd66ce84299c
tree91220740a119274c99aab3225ac564a191d6b2ff
parent662c349a5a995c270c8f7bcf0a4b4a0408c813fd
mdadm/test: Refactor and revamp 'test' script

Adding functions:
die()
  uniform the abnormal situations that have to abort.
check_env()
  do various basic checking before running test suite.
save_log()
  collect array infos, include of dmesg, superblock,
  bitmap and /proc/mdstat.
main()
  the core function of this script.

Improve functions:
cleanup()
  clear dmesg and remove the /var/tmp/mdtest* files.
mdadm()
  clear superblock once creating or building arrays
  every time, because it's always creating arrays
  many times in a test case.
check()
  just tidy up with die(), didn't change code meanings.
testdev()
  add checking $1 must be a block device, add 'return 0'
  in final because this function exists in last line of
  test case, such as tests/05r6tor0.
do_test()
  add checking abnormal dmesg and changing log management.
do_help()
  just recommend a better way to print Usage.
parse_args()
  revamp and improve.

Delete function:
fast_sync()
  It's no longer used, so get rid of it.

Signed-off-by: Zhilong Liu <zlliu@suse.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
test