diff --git a/server/bin/pbench-dispatch.sh b/server/bin/pbench-dispatch.sh index a7138c8925..82ebb0c46e 100755 --- a/server/bin/pbench-dispatch.sh +++ b/server/bin/pbench-dispatch.sh @@ -63,6 +63,14 @@ fi # Optional "PUT API" bearer token for sending tar balls to the "new" Pbench # Server. put_token=$(getconf.py put-token pbench-server) +if [[ -n "${put_token}" ]]; then + agent_profile=$(getconf.py agent-profile pbench-server) + if [[ ! -e "${agent_profile}" ]]; then + echo "Failed: PUT API token provided but no pbench-agent profile" >> ${errlog} + exit 2 + fi + source ${agent_profile} +fi qdir=$(getconf.py pbench-quarantine-dir pbench-server) if [[ -z "${qdir}" ]]; then diff --git a/server/bin/state/test-12.config/pbench-server.cfg b/server/bin/state/test-12.config/pbench-server.cfg index 98a5600c26..c833e80a5c 100644 --- a/server/bin/state/test-12.config/pbench-server.cfg +++ b/server/bin/state/test-12.config/pbench-server.cfg @@ -2,6 +2,7 @@ install-dir = %(unittest-dir)s/opt/pbench-server [pbench-server] put-token = 71ac1fe3f0743aa710e82000e553ec30 +agent-profile = %(unittest-dir)s/agent-profile [config] path = %(unittest-dir)s/tmp, %(install-dir)s/lib/config diff --git a/server/bin/state/test-12.reset b/server/bin/state/test-12.reset new file mode 100755 index 0000000000..e0e4d78197 --- /dev/null +++ b/server/bin/state/test-12.reset @@ -0,0 +1,4 @@ +#!/bin/bash + +rm ${_testroot}/agent-profile +exit ${?} diff --git a/server/bin/state/test-12.setup b/server/bin/state/test-12.setup index 8b4394651c..a6e81a58d4 100755 --- a/server/bin/state/test-12.setup +++ b/server/bin/state/test-12.setup @@ -1,4 +1,7 @@ #!/bin/bash +cat > ${_testroot}/agent-profile <<-EOF + export _PBENCH_AGENT_CONFIG="fake" + EOF mkdir pbench-local/archive.backup exit ${?} diff --git a/server/bin/state/test-21.reset b/server/bin/state/test-21.reset new file mode 120000 index 0000000000..2e9e2bed08 --- /dev/null +++ b/server/bin/state/test-21.reset @@ -0,0 +1 @@ +test-12.reset \ No newline at end of file diff --git a/server/bin/test-bin/pbench-results-push b/server/bin/test-bin/pbench-results-push deleted file mode 120000 index 1a7a95c2f9..0000000000 --- a/server/bin/test-bin/pbench-results-push +++ /dev/null @@ -1 +0,0 @@ -_mock_simple_cmd_suc \ No newline at end of file diff --git a/server/bin/test-bin/pbench-results-push b/server/bin/test-bin/pbench-results-push new file mode 100755 index 0000000000..520c080106 --- /dev/null +++ b/server/bin/test-bin/pbench-results-push @@ -0,0 +1,5 @@ +#! /bin/bash + +echo "${0##*/} $*" >> $_testlog +test -n "${_PBENCH_AGENT_CONFIG}" +exit ${?}