diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 06:50:17 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 06:50:17 +0000 |
commit | 86ed03f8adee56c050c73018537371c230a664a6 (patch) | |
tree | eae3d04cdf1c49848e5a671327ab38297f4acb0d /make/agentccheck.mk | |
parent | Initial commit. (diff) | |
download | fence-agents-86ed03f8adee56c050c73018537371c230a664a6.tar.xz fence-agents-86ed03f8adee56c050c73018537371c230a664a6.zip |
Adding upstream version 4.12.1.upstream/4.12.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'make/agentccheck.mk')
-rw-r--r-- | make/agentccheck.mk | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/make/agentccheck.mk b/make/agentccheck.mk new file mode 100644 index 0000000..e524883 --- /dev/null +++ b/make/agentccheck.mk @@ -0,0 +1,32 @@ +DATADIR:=$(abs_top_srcdir)/tests/data/metadata +TEST_TARGET=$(filter-out $(TEST_TARGET_SKIP),$(TARGET)) + +check: $(TEST_TARGET:%=%.xml-check) $(SYMTARGET:%=%.xml-check) $(TEST_TARGET:%=%.delay-check) $(TEST_TARGET:%=%.rng-check) +delay-check: $(TEST_TARGET:%=%.delay-check) $(SYMTARGET:%=%.delay-check) +xml-check: $(TEST_TARGET:%=%.xml-check) $(SYMTARGET:%=%.xml-check) +xml-upload: $(TEST_TARGET:%=%.xml-upload) $(SYMTARGET:%=%.xml-upload) + +%.xml-check: % + $(eval INPUT=$(subst .xml-check,,$@)) + $(eval TEMPFILE = $(shell mktemp)) + ./$(INPUT) -o metadata > $(TEMPFILE) + diff $(TEMPFILE) $(DATADIR)/$(INPUT).xml + rm $(TEMPFILE) + +%.xml-upload: % + $(eval INPUT=$(subst .xml-upload,,$@)) + ./$(INPUT) -o metadata > $(DATADIR)/$(INPUT).xml + +# If test will fail, rerun fence agents to show problems +%.delay-check: % + $(eval INPUT=$(subst .delay-check,,$@)) + test `/usr/bin/time -p ./$(INPUT) --delay 10 $(FENCE_TEST_ARGS) -- 2>&1 |\ + awk -F"[. ]" -vOFS= '/real/ {print $$2,$$3}' | tail -n 1` -ge 1000 || \ + /usr/bin/time -p ./$(INPUT) --delay 0 $(FENCE_TEST_ARGS) -- + +%.rng-check: % + $(eval INPUT=$(subst .rng-check,,$@)) + ./$(INPUT) -o metadata | \ + xsltproc ${abs_top_srcdir}/lib/fence2rng.xsl - | \ + sed -e 's/ rha:description=/ description=/g' -e 's/ rha:name=/ name=/g' | \ + xmllint --nsclean --noout -; |