Blame tests/p_mdadm/5-test_mdadm.sh
|
Steve Barnes |
464547 |
#!/bin/bash
|
|
Steve Barnes |
464547 |
|
|
Steve Barnes |
464547 |
t_Log "Running $0 - checking mdadm utility works and returns non-zero exit status."
|
|
Steve Barnes |
464547 |
|
|
Steve Barnes |
464547 |
# mdadm utility only available to root
|
|
Steve Barnes |
464547 |
[ ${EUID} -eq 0 ] || { t_Log "Not running as root, skipping this test. Non-fatal."; exit $PASS; }
|
|
Steve Barnes |
464547 |
|
|
Steve Barnes |
464547 |
MDADM=`which mdadm`
|
|
Steve Barnes |
464547 |
|
|
Steve Barnes |
464547 |
[ -z "${MDADM}" ] && { t_Log "Failed to find mdadm binary. That ain't good...."; exit $FAIL; }
|
|
Steve Barnes |
464547 |
|
|
Steve Barnes |
464547 |
# even with no meta devices available, this should still return a 0 exit status
|
|
Steve Barnes |
464547 |
${MDADM} --detail --scan &>/dev/null
|
|
Steve Barnes |
464547 |
|
|
![](https://seccdn.libravatar.org/avatar/a553e6743221545d13dfde167d27fcb14665fb9c6d864da1d507e7813f9c084e?s=16&d=retro) |
6d1bce |
[ $? -eq 0 ] || { t_Log "mdadm exited with non-zero status. That ain't good..."; exit $FAIL; }
|