Skip to content

Commit

Permalink
Add integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
Lars T Hansen committed Jun 24, 2024
1 parent 5ac0cbe commit 9972eaf
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/load.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash
#
# Test that we can emit per-cpu load data properly.

set -e

( cd .. ; cargo build )
loadlines=$(../target/debug/sonar ps --load | grep ',load=' | wc -l)
if [[ $loadlines -ne 1 ]]; then
echo "Did not emit load data properly - not exactly 1"
exit 1
fi

loadlines=$(../target/debug/sonar ps | grep ',load=' | wc -l)
if [[ $loadlines -ne 0 ]]; then
echo "Did not emit load data properly - not exactly 0"
exit 1
fi
1 change: 1 addition & 0 deletions tests/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ for test in command-line \
exclude-users \
hostname \
interrupt \
load \
lockfile \
min-cpu-time \
ps-syntax \
Expand Down

0 comments on commit 9972eaf

Please sign in to comment.