Skip to content

Commit d81ca10

Browse files
authored
quit find after one match, adjust test accordingly (#611)
Signed-off-by: Jacob Salmela <[email protected]>
1 parent b394469 commit d81ca10

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

goss-testing/automated/dst-ct-results.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ set_vars() {
122122
export GOSS_BASE="/opt/cray/tests/install/ncn"
123123
fi
124124
# The cgroups file that contains the pids of the goss suites/vars that are linked to an http endpoint
125-
GOSS_CGROUPS="$(find /sys/fs/cgroup -path '*/goss-servers.service/cgroup.procs' -type f)"
125+
GOSS_CGROUPS="$(find /sys/fs/cgroup -path '*/goss-servers.service/cgroup.procs' -type f -print -quit)"
126126
# The CSM version is needed for the DST pipeline for showing the version of the product the test ran on in the dashboard
127127
CSM_VER="$(kubectl -n services get cm cray-product-catalog -o jsonpath='{.data.csm}' | yq r -j - | jq -r 'keys[]' | sed '/-/!{s/$/_/}' | sort -V | sed 's/_$//' | tail -n1)"
128128
# The DST-compatible results file (see https://github.hpe.com/hpe/hpc-dst-ct-results-api/blob/master/docs/usage/getting-started.md#quick-start)

spec/functional/dst-ct-results_spec.sh

+1
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ Describe "validate global variables are set:"
9292
DST_RESULTS_FILE "/tmp/api-results.json"
9393
# AGGREGATED_RESULTS_FILE "/tmp/aggregated-results.json" # mktmp varies
9494
End
95+
find() { echo "/sys/fs/cgroup/systemd/system.slice/goss-servers.service/cgroup.procs"; } # mock a find result
9596
kubectl() { return 0; } # mock kubectl to set a csm version
9697
# mock yq, jq, sed, and sort to return 0 since they vary in output between systems and are not relevant to this test
9798
# the CSM_VER is normally gathered from a painful kubectl command, but works consistently irl

0 commit comments

Comments
 (0)