| 1 |
# Filesystem |
| 2 |
# by [email protected] on |
| 3 |
# Tue Feb 15 18:50:04 CET 2011 |
| 4 |
# |
| 5 |
CONFIG |
| 6 |
Agent Filesystem |
| 7 |
AgentRoot /usr/lib/ocf/resource.d/heartbeat |
| 8 |
HangTimeout 20 |
| 9 |
|
| 10 |
VARIABLE |
| 11 |
OCFT_rundir="`get_rundir`" |
| 12 |
OCFT_fs="$OCFT_rundir/resource-agents/ocft-Filesystem-fs" |
| 13 |
OCFT_dir="$OCFT_rundir/resource-agents/ocft-Filesystem-mnt" |
| 14 |
OCFT_loop="`loopbackeddev make $OCFT_fs 16M`" |
| 15 |
|
| 16 |
SETUP-AGENT |
| 17 |
mke2fs -j -Fq -m 0 $OCFT_loop |
| 18 |
|
| 19 |
CLEANUP-AGENT |
| 20 |
loopbackeddev unmake $OCFT_fs |
| 21 |
rmdir $OCFT_dir |
| 22 |
|
| 23 |
CASE-BLOCK required_args |
| 24 |
Env OCF_RESKEY_device=$OCFT_loop |
| 25 |
Env OCF_RESKEY_fstype=ext3 |
| 26 |
Env OCF_RESKEY_directory=$OCFT_dir |
| 27 |
|
| 28 |
CASE-BLOCK default_status |
| 29 |
AgentRun stop |
| 30 |
|
| 31 |
CASE-BLOCK prepare |
| 32 |
Include required_args |
| 33 |
Include default_status |
| 34 |
|
| 35 |
CASE "check base env" |
| 36 |
Include prepare |
| 37 |
AgentRun start OCF_SUCCESS |
| 38 |
|
| 39 |
CASE "check base env: invalid 'OCF_RESKEY_device'" |
| 40 |
Include prepare |
| 41 |
Env OCF_RESKEY_device=/dev/no_such_device |
| 42 |
AgentRun start OCF_ERR_INSTALLED |
| 43 |
|
| 44 |
CASE "check base env: unset 'OCF_RESKEY_device'" |
| 45 |
Include prepare |
| 46 |
Unenv OCF_RESKEY_device |
| 47 |
AgentRun start OCF_ERR_CONFIGURED |
| 48 |
|
| 49 |
CASE "normal start" |
| 50 |
Include prepare |
| 51 |
AgentRun start OCF_SUCCESS |
| 52 |
|
| 53 |
CASE "normal stop" |
| 54 |
Include prepare |
| 55 |
AgentRun start |
| 56 |
AgentRun stop OCF_SUCCESS |
| 57 |
|
| 58 |
CASE "double start" |
| 59 |
Include prepare |
| 60 |
AgentRun start |
| 61 |
AgentRun start OCF_SUCCESS |
| 62 |
|
| 63 |
CASE "double stop" |
| 64 |
Include prepare |
| 65 |
AgentRun stop OCF_SUCCESS |
| 66 |
|
| 67 |
CASE "monitor when running" |
| 68 |
Include prepare |
| 69 |
AgentRun start |
| 70 |
AgentRun monitor OCF_SUCCESS |
| 71 |
|
| 72 |
CASE "monitor when not running" |
| 73 |
Include prepare |
| 74 |
AgentRun monitor OCF_NOT_RUNNING |
| 75 |
|
| 76 |
CASE "monitor depth 10 when running" |
| 77 |
Include prepare |
| 78 |
AgentRun start |
| 79 |
Env OCF_CHECK_LEVEL=10 |
| 80 |
AgentRun monitor OCF_SUCCESS |
| 81 |
|
| 82 |
CASE "monitor depth 20 with running" |
| 83 |
Include prepare |
| 84 |
AgentRun start |
| 85 |
Env OCF_CHECK_LEVEL=20 |
| 86 |
AgentRun monitor OCF_SUCCESS |
| 87 |
|
| 88 |
CASE "start insert failure (remove device)" |
| 89 |
Include prepare |
| 90 |
Bash losetup -d $OCFT_loop |
| 91 |
BashAtExit losetup $OCFT_loop $OCFT_fs |
| 92 |
AgentRun start OCF_ERR_GENERIC |
| 93 |
|
| 94 |
CASE "monitor depth 20 insert failure (r/o fs)" |
| 95 |
Include prepare |
| 96 |
AgentRun start |
| 97 |
Bash mount -o remount,ro $OCFT_dir |
| 98 |
BashAtExit mount -o remount,rw $OCFT_dir |
| 99 |
Env OCF_CHECK_LEVEL=20 |
| 100 |
AgentRun monitor OCF_ERR_GENERIC |
| 101 |
|
| 102 |
CASE "unimplemented command" |
| 103 |
Include prepare |
| 104 |
AgentRun no_cmd OCF_ERR_UNIMPLEMENTED |
| 105 |
|