diff --git a/tools/ocft/Makefile.am b/tools/ocft/Makefile.am index a4de3eac3..b00eecec1 100644 --- a/tools/ocft/Makefile.am +++ b/tools/ocft/Makefile.am @@ -1,54 +1,55 @@ # Author: John Shi # jshi@suse.de # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = $(ocftcfgs_DATA) $(ocft_DATA) sbin_SCRIPTS = ocft ocftcfgsdir = $(datadir)/$(PACKAGE_NAME)/ocft/configs ocftcfgs_DATA = apache \ IPaddr2 \ IPaddr2v4 \ IPaddr2v6 \ IPv6addr \ Filesystem \ LVM \ Raid1 \ IPsrcaddr \ MailTo \ + jboss \ mysql \ mysql-proxy \ pgsql \ db2 \ oracle \ drbd.linbit \ nfsserver \ portblock \ iscsi \ named \ postfix \ tomcat \ Xinetd \ SendArp ocftdir = $(datadir)/$(PACKAGE_NAME)/ocft ocft_DATA = README \ README.zh_CN \ caselib diff --git a/tools/ocft/jboss b/tools/ocft/jboss new file mode 100644 index 000000000..bc99d8f76 --- /dev/null +++ b/tools/ocft/jboss @@ -0,0 +1,83 @@ +# jboss +# +# NOTE: Clean up $jboss_home/standalone/log before running this test +# otherwise creating the pid/log files may fail +# in the test case with a different user. + +CONFIG + Agent jboss + AgentRoot /usr/lib/ocf/resource.d/heartbeat + HangTimeout 120 + +# Note : Change setting by a version of JBoss. +# +VARIABLE + # JBoss5 Environment require +# jboss_version=5 +# jboss_home=/opt/jboss5/current +# java_home=/usr/lib/jvm/java-1.6.0-openjdk.x86_64 +# user=jboss5 + # JBoss6 Environment require + jboss_version=6 + jboss_home=/opt/jboss6/current + java_home=/usr/lib/jvm/java-1.7.0-openjdk.x86_64 + user=jboss6 + +CASE-BLOCK required_args_jboss + Env OCF_RESKEY_jboss_home=${jboss_home} + Env OCF_RESKEY_java_home=${java_home} + Env OCF_RESKEY_jboss_version=${jboss_version} + Env OCF_RESKEY_user=${user} + +CASE-BLOCK args_clear + Unenv OCF_RESKEY_jboss_home + Unenv OCF_RESKEY_java_home + Unenv OCF_RESKEY_jboss_version + Unenv OCF_RESKEY_user + +CASE-BLOCK default_status + AgentRun stop + +CASE-BLOCK prepare_jboss + Include required_args_jboss + Include default_status + +# Test CASE +# +CASE "normal start jboss require_args (user:user)" + Include prepare_jboss + AgentRun start OCF_SUCCESS + AgentRun monitor OCF_SUCCESS + AgentRun stop OCF_SUCCESS + AgentRun monitor OCF_NOT_RUNNING + Include args_clear + +CASE "normal start jboss require_args (user:root)" + Include prepare_jboss + Unenv OCF_RESKEY_user + AgentRun start OCF_SUCCESS + AgentRun monitor OCF_SUCCESS + AgentRun stop OCF_SUCCESS + AgentRun monitor OCF_NOT_RUNNING + Include args_clear + +CASE "error start jboss no jboss_home" + Include prepare_jboss + Unenv OCF_RESKEY_jboss_home + AgentRun start OCF_ERR_INSTALLED + Include args_clear + +CASE "error start jboss no java_home" + Include prepare_jboss + Unenv OCF_RESKEY_java_home + AgentRun start OCF_ERR_INSTALLED + Include args_clear + +CASE "error start jboss no java command" + Include prepare_jboss + Env OCF_RESKEY_java_home=/var + AgentRun start OCF_ERR_INSTALLED + AgentRun stop OCF_SUCCESS + AgentRun monitor OCF_NOT_RUNNING + Include args_clear +