Skip to content

Commit

Permalink
tests: runtime_shell: custom_calyptia: fix checks
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick Stephens <[email protected]>
  • Loading branch information
patrick-stephens committed Dec 17, 2024
1 parent fd097a6 commit 6c0b8d7
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions tests/runtime_shell/custom_calyptia.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ test_custom_calyptia_fleet_yaml() {
rm -rf "$CALYPTIA_FLEET_DIR"

# Dry-run to check it is valid
if $FLB_BIN -c "$FLB_RUNTIME_SHELL_CONF/custom_calyptia_fleet.conf" --dry-run; then
if ! $FLB_BIN -c "$FLB_RUNTIME_SHELL_CONF/custom_calyptia_fleet.conf" --dry-run; then
fail 'Dry run failed'
fi

Expand All @@ -22,10 +22,12 @@ test_custom_calyptia_fleet_yaml() {
# Check we have YAML files
if find "$CALYPTIA_FLEET_DIR" -name '*.yaml' -type f -exec false {} +; then
fail 'No YAML files found'
else
find "$CALYPTIA_FLEET_DIR" -name '*.yaml' -type f -exec cat {} \;
fi

# Check we are still running
assertTrue 'Fluent bit not running' "[ kill -0 $FLB_PID ]"
assertTrue 'Fluent bit not running' "$(kill -0 $FLB_PID)"

# Clean up
kill -15 $FLB_PID
Expand All @@ -40,7 +42,7 @@ test_custom_calyptia_fleet_toml() {
rm -rf "$CALYPTIA_FLEET_DIR"

# Dry-run to check it is valid
if $FLB_BIN -c "$FLB_RUNTIME_SHELL_CONF/custom_calyptia_fleet.conf" --dry-run; then
if ! $FLB_BIN -c "$FLB_RUNTIME_SHELL_CONF/custom_calyptia_fleet.conf" --dry-run; then
fail 'Dry run failed'
fi

Expand All @@ -51,12 +53,14 @@ test_custom_calyptia_fleet_toml() {
sleep 30

# Check we have no YAML files
if ! find "$CALYPTIA_FLEET_DIR" -name '*.yaml' -type f -exec false {} +; then
if find "$CALYPTIA_FLEET_DIR" -name '*.yaml' -type f -exec false {} +; then
echo 'No YAML files found'
else
fail 'YAML files found'
fi

# Check we are still running
assertTrue 'Fluent bit not running' "[ kill -0 $FLB_PID ]"
assertTrue 'Fluent bit not running' "$(kill -0 $FLB_PID)"

# Clean up
kill -15 $FLB_PID
Expand Down

0 comments on commit 6c0b8d7

Please sign in to comment.