[Debian-ha-commits] [resource-agents] 01/01: debian/tests: simplify nfsserver tests
Valentin Vidic
vvidic-guest at moszumanska.debian.org
Mon Jan 16 21:37:01 UTC 2017
This is an automated email from the git hooks/post-receive script.
vvidic-guest pushed a commit to branch master
in repository resource-agents.
commit 1eed6b714d1fde53dbbb3a800a47f5a4c4f7b496
Author: Valentin Vidic <Valentin.Vidic at CARNet.hr>
Date: Mon Jan 16 22:08:23 2017 +0100
debian/tests: simplify nfsserver tests
---
debian/patches/ocft-configs.patch | 105 ++++++++++++++++++++++++++++++++++++++
debian/tests/control | 4 +-
debian/tests/nfsserver | 19 -------
3 files changed, 107 insertions(+), 21 deletions(-)
diff --git a/debian/patches/ocft-configs.patch b/debian/patches/ocft-configs.patch
new file mode 100644
index 0000000..c9ce258
--- /dev/null
+++ b/debian/patches/ocft-configs.patch
@@ -0,0 +1,105 @@
+Description: Make agent tests work on Debian
+ Patch package names and other details in ocft test
+ configs to be usable by debian/tests.
+Author: Valentin Vidic <Valentin.Vidic at CARNet.hr>
+Forwarded: not-needed
+Last-Update: 2017-01-12
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/tools/ocft/mysql
++++ b/tools/ocft/mysql
+@@ -3,7 +3,7 @@
+ CONFIG
+ Agent mysql
+ AgentRoot /usr/lib/ocf/resource.d/heartbeat
+- InstallPackage mysql
++ InstallPackage mysql-server
+ HangTimeout 20
+
+ SETUP-AGENT
+@@ -65,7 +65,7 @@
+ Include prepare
+ Bash chmod u-w /var/lib/mysql
+ BashAtExit chmod u+w /var/lib/mysql
+- AgentRun start OCF_ERR_PERM
++ AgentRun start OCF_ERR_GENERIC
+
+ CASE "unimplemented command"
+ Include prepare
+--- a/tools/ocft/named
++++ b/tools/ocft/named
+@@ -6,15 +6,16 @@
+ CONFIG
+ Agent named
+ AgentRoot /usr/lib/ocf/resource.d/heartbeat
+- InstallPackage bind
+- InstallPackage bind-utils
++ InstallPackage bind9
++ InstallPackage bind9utils
+
+ SETUP-AGENT
+- /etc/init.d/named start
+- /etc/init.d/named stop
++ /etc/init.d/bind9 start
++ /etc/init.d/bind9 stop
+
+ CASE-BLOCK crm_setting
+ Env OCF_RESKEY_CRM_meta_timeout=15000
++ Env OCF_RESKEY_named_user=bind
+
+ CASE-BLOCK default_status
+ AgentRun stop
+--- a/tools/ocft/iscsi
++++ b/tools/ocft/iscsi
+@@ -3,7 +3,7 @@
+ CONFIG
+ Agent iscsi
+ AgentRoot /usr/lib/ocf/resource.d/heartbeat
+- InstallPackage open-iscsi targetcli
++ InstallPackage open-iscsi targetcli-fb
+ HangTimeout 20
+
+ VARIABLE
+@@ -24,11 +24,6 @@
+ else
+ /etc/init.d/open-iscsi start
+ fi
+- if systemctl list-unit-files 2>/dev/null | fgrep -q target.service; then
+- systemctl start target.service
+- else
+- /etc/init.d/target start
+- fi
+ export OCF_RESKEY_iqn=$OCFT_target
+ export OCF_RESKEY_portals=$OCFT_portal
+ export OCF_RESKEY_target_iqn=$OCFT_target
+@@ -45,9 +40,6 @@
+ export OCF_RESKEY_lun=1
+ /usr/lib/ocf/resource.d/heartbeat/iSCSILogicalUnit stop
+ /usr/lib/ocf/resource.d/heartbeat/iSCSITarget stop
+- if systemctl list-unit-files 2>/dev/null | fgrep -q target.service; then
+- systemctl stop target.service
+- fi
+ loopbackeddev unmake $OCFT_disk
+
+ CASE-BLOCK required_args
+--- a/tools/ocft/MailTo
++++ b/tools/ocft/MailTo
+@@ -3,7 +3,7 @@
+ CONFIG
+ Agent MailTo
+ AgentRoot /usr/lib/ocf/resource.d/heartbeat
+- InstallPackage mailx
++ InstallPackage bsd-mailx
+ HangTimeout 20
+
+ CASE-BLOCK required_args
+--- a/tools/ocft/nfsserver
++++ b/tools/ocft/nfsserver
+@@ -11,6 +11,7 @@
+ if test -f /etc/init.d/nfsserver; then
+ INITSCRIPT="/etc/init.d/nfsserver"
+ fi
++ service nfs-kernel-server stop
+ true
+
+ CASE-BLOCK required_args
diff --git a/debian/tests/control b/debian/tests/control
index 9fdb9c4..3327111 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -2,7 +2,7 @@ Tests: IPaddr2
Depends: resource-agents
Restrictions: needs-root, isolation-container
-Test-Command: /usr/sbin/service ldirectord status
+Test-Command: service ldirectord status
Depends: ldirectord
Restrictions: needs-root, isolation-container
@@ -42,7 +42,7 @@ Test-Command: debian/tests/run-ocft exportfs-multidir
Depends: resource-agents, nfs-kernel-server
Restrictions: needs-root, isolation-machine
-Tests: nfsserver
+Test-Command: debian/tests/run-ocft nfsserver
Depends: resource-agents, nfs-kernel-server
Restrictions: needs-root, isolation-machine
diff --git a/debian/tests/nfsserver b/debian/tests/nfsserver
deleted file mode 100755
index 1ada66a..0000000
--- a/debian/tests/nfsserver
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/sh
-
-set -e
-
-AGENT=nfsserver
-
-cleanup () {
- ocft clean $AGENT
-}
-
-trap "cleanup" 0 2 3 15
-
-service nfs-common start 2>/dev/null || true
-service rpc-statd start 2>/dev/null || true
-
-mkdir -p /run/resource-agents
-
-ocft make $AGENT
-ocft test $AGENT
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-ha/resource-agents.git
More information about the Debian-HA-Commits
mailing list