diff --git a/fence/agents/kdump/Makefile.am b/fence/agents/kdump/Makefile.am
index 26e452ce..0752376d 100644
--- a/fence/agents/kdump/Makefile.am
+++ b/fence/agents/kdump/Makefile.am
@@ -1,14 +1,19 @@
MAINTAINERCLEANFILES = Makefile.in
sbin_PROGRAMS = fence_kdump
libexec_PROGRAMS = fence_kdump_send
noinst_HEADERS = list.h message.h options.h version.h
fence_kdump_SOURCES = fence_kdump.c
fence_kdump_CFLAGS = -D_GNU_SOURCE
fence_kdump_send_SOURCES = fence_kdump_send.c
fence_kdump_send_CFLAGS = -D_GNU_SOURCE
dist_man_MANS = fence_kdump.8 fence_kdump_send.8
+
+include $(top_srcdir)/make/agentccheck.mk
+
+check: xml-check.fence_kdump
+
diff --git a/fence/agents/rackswitch/Makefile.am b/fence/agents/rackswitch/Makefile.am
index 8c435c07..07923081 100644
--- a/fence/agents/rackswitch/Makefile.am
+++ b/fence/agents/rackswitch/Makefile.am
@@ -1,16 +1,17 @@
MAINTAINERCLEANFILES = Makefile.in
TARGET = fence_rackswitch
sbin_PROGRAMS = $(TARGET)
noinst_HEADERS = do_rack.h
fence_rackswitch_SOURCES = do_rack.c
man_MANS = $(TARGET).8
include $(top_srcdir)/make/fencemanc.mk
+include $(top_srcdir)/make/agentccheck.mk
clean-local: clean-man
rm -f $(TARGET)
diff --git a/fence/agents/zvm/Makefile.am b/fence/agents/zvm/Makefile.am
index 2dc0005d..01d551ff 100644
--- a/fence/agents/zvm/Makefile.am
+++ b/fence/agents/zvm/Makefile.am
@@ -1,13 +1,18 @@
MAINTAINERCLEANFILES = Makefile.in
sbin_PROGRAMS = fence_zvm fence_zvmip
noinst_HEADERS = fence_zvm.h
fence_zvm_SOURCES = fence_zvm.c
fence_zvm_CFLAGS = -D_GNU_SOURCE
fence_zvmip_SOURCES = fence_zvmip.c
fence_zvmip_CFLAGS = -D_GNU_SOURCE
dist_man_MANS = fence_zvm.8 fence_zvmip.8
+
+include $(top_srcdir)/make/agentccheck.mk
+
+# we do not test fence_zvm because it can be compiled only on specific architecture
+check: xml-check.fence_zvmip
\ No newline at end of file
diff --git a/make/agentccheck.mk b/make/agentccheck.mk
new file mode 100644
index 00000000..d0dfb36c
--- /dev/null
+++ b/make/agentccheck.mk
@@ -0,0 +1,15 @@
+TEMPFILE:=$(shell mktemp)
+DATADIR:=../../../tests/data/metadata
+
+check: $(TARGET:%=xml-check.%) $(SYMTARGET:%=xml-check.%)
+
+xml-check.%: %
+ $(eval INPUT=$(subst xml-check.,,$@))
+ ./$(INPUT) -o metadata > $(TEMPFILE)
+ diff $(TEMPFILE) $(DATADIR)/$(INPUT).xml
+ rm $(TEMPFILE)
+
+xml-upload.%: %
+ $(eval INPUT=$(subst xml-upload.,,$@))
+ ./$(INPUT) -o metadata > $(DATADIR)/$(INPUT).xml
+
diff --git a/tests/data/metadata/fence_kdump.xml b/tests/data/metadata/fence_kdump.xml
new file mode 100644
index 00000000..c985cacf
--- /dev/null
+++ b/tests/data/metadata/fence_kdump.xml
@@ -0,0 +1,51 @@
+
+
+The fence_kdump agent is intended to be used with with kdump service.
+http://www.kernel.org/pub/linux/utils/kernel/kexec/
+
+
+
+
+ Name or IP address of node to be fenced
+
+
+
+
+ Port number
+
+
+
+
+ Network family
+
+
+
+
+ Fencing action
+
+
+
+
+ Timeout in seconds
+
+
+
+
+ Print verbose output
+
+
+
+
+ Print version
+
+
+
+
+ Print usage
+
+
+
+
+
+
+
diff --git a/tests/data/metadata/fence_rackswitch.xml b/tests/data/metadata/fence_rackswitch.xml
new file mode 100644
index 00000000..63f2faf8
--- /dev/null
+++ b/tests/data/metadata/fence_rackswitch.xml
@@ -0,0 +1,30 @@
+
+
+fence_rackswitch is an I/O Fencing agent which can be used with the RackSaver RackSwitch. It logs into the RackSwitch and boots a specified plug. Using the http interface to the RackSwitch should be avoided while a GFS cluster is running because the connection may interfere with the operation of this agent.
+http://www.bladenetwork.net
+
+
+
+
+ IP Address or Hostname
+
+
+
+
+ Login Name
+
+
+
+
+ Login password or passphrase
+
+
+
+
+ Script to retrieve password
+
+
+
+
+
+
diff --git a/tests/data/metadata/fence_zvmip.xml b/tests/data/metadata/fence_zvmip.xml
new file mode 100644
index 00000000..0ffab1f0
--- /dev/null
+++ b/tests/data/metadata/fence_zvmip.xml
@@ -0,0 +1,42 @@
+
+
+The fence_zvm agent is intended to be used with with z/VM SMAPI service via TCP/IP
+
+
+
+
+ Name of the Virtual Machine to be fenced
+
+
+
+
+ IP Name or Address of SMAPI Server
+
+
+
+
+ Name of authorized SMAPI user
+
+
+
+
+
+ Password of authorized SMAPI user
+
+
+
+
+
+ Fencing action
+
+
+
+
+ Print usage
+
+
+
+
+
+
+