From 9c05580bfaca16fb7f31a75994da9de44b3740ad Mon Sep 17 00:00:00 2001 From: Craig Comstock Date: Wed, 13 Nov 2024 09:57:08 -0600 Subject: [PATCH] Adjusted peer related examples in regards to hostname -f versus sys.fqhost This was breaking on some systems in a way that doesn't benefit the test. Instead of assuming that `hostname -f` is equal to `sys.fqhost` just use `sys.fqhost` in the first place. Ticket: ENT-12437 Changelog: none --- examples/peerleader.cf | 3 ++- examples/peerleaders.cf | 3 ++- examples/peers.cf | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/examples/peerleader.cf b/examples/peerleader.cf index fdc4eb2a52..e2f5a4e184 100644 --- a/examples/peerleader.cf +++ b/examples/peerleader.cf @@ -25,7 +25,8 @@ #@ echo beta >> /tmp/cfe_hostlist #@ echo gamma >> /tmp/cfe_hostlist #@ echo "Set HOSTNAME appropriately beforehand" -#@ echo "$(hostname -f)" | tr 'A-Z' 'a-z' >> /tmp/cfe_hostlist +#@ touch $CFENGINE_TEST_OVERRIDE_WORKDIR/inputs/promises.cf # to enable cf-promises to run +#@ bash -c "${CF_PROMISES} --show-vars=sys.fqhost | grep fqhost | awk '{print \$2}' | tr 'A-Z' 'a-z' 2>&1 >> /tmp/cfe_hostlist" #@ echo "Delta Delta Delta may I help ya help ya help ya" #@ echo delta1 >> /tmp/cfe_hostlist #@ echo delta2 >> /tmp/cfe_hostlist diff --git a/examples/peerleaders.cf b/examples/peerleaders.cf index fdc4eb2a52..e2f5a4e184 100644 --- a/examples/peerleaders.cf +++ b/examples/peerleaders.cf @@ -25,7 +25,8 @@ #@ echo beta >> /tmp/cfe_hostlist #@ echo gamma >> /tmp/cfe_hostlist #@ echo "Set HOSTNAME appropriately beforehand" -#@ echo "$(hostname -f)" | tr 'A-Z' 'a-z' >> /tmp/cfe_hostlist +#@ touch $CFENGINE_TEST_OVERRIDE_WORKDIR/inputs/promises.cf # to enable cf-promises to run +#@ bash -c "${CF_PROMISES} --show-vars=sys.fqhost | grep fqhost | awk '{print \$2}' | tr 'A-Z' 'a-z' 2>&1 >> /tmp/cfe_hostlist" #@ echo "Delta Delta Delta may I help ya help ya help ya" #@ echo delta1 >> /tmp/cfe_hostlist #@ echo delta2 >> /tmp/cfe_hostlist diff --git a/examples/peers.cf b/examples/peers.cf index fdc4eb2a52..e2f5a4e184 100644 --- a/examples/peers.cf +++ b/examples/peers.cf @@ -25,7 +25,8 @@ #@ echo beta >> /tmp/cfe_hostlist #@ echo gamma >> /tmp/cfe_hostlist #@ echo "Set HOSTNAME appropriately beforehand" -#@ echo "$(hostname -f)" | tr 'A-Z' 'a-z' >> /tmp/cfe_hostlist +#@ touch $CFENGINE_TEST_OVERRIDE_WORKDIR/inputs/promises.cf # to enable cf-promises to run +#@ bash -c "${CF_PROMISES} --show-vars=sys.fqhost | grep fqhost | awk '{print \$2}' | tr 'A-Z' 'a-z' 2>&1 >> /tmp/cfe_hostlist" #@ echo "Delta Delta Delta may I help ya help ya help ya" #@ echo delta1 >> /tmp/cfe_hostlist #@ echo delta2 >> /tmp/cfe_hostlist