Skip to content

Commit

Permalink
Tests: Corrected paths in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
blackandred committed Oct 28, 2019
1 parent c4f2cd5 commit 3a76afc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions infracheck/checks-tests/load-average-auto-test.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#!/bin/bash

echo " >> Assert that load 11.6 is higher than 10+1"
MAXIMUM_ABOVE=1.0 MOCK_CPU_COUNT=10 MOCK_LOAD_AVERAGE=11.6 ./infracheck/checks/load-average-auto
MAXIMUM_ABOVE=1.0 MOCK_CPU_COUNT=10 MOCK_LOAD_AVERAGE=11.6 ../checks/load-average-auto
if [[ $? != 1 ]]; then
echo " >> Test failed."
exit 1
fi

echo " >> Assert that load 20 is ok, when we have 30 cores and MAXIMUM_ABOVE=0.5"
MAXIMUM_ABOVE=0.5 MOCK_CPU_COUNT=20 MOCK_LOAD_AVERAGE=20 ./infracheck/checks/load-average-auto
MAXIMUM_ABOVE=0.5 MOCK_CPU_COUNT=20 MOCK_LOAD_AVERAGE=20 ../checks/load-average-auto
if [[ $? != 0 ]]; then
echo " >> Test failed."
exit 1
Expand Down
6 changes: 3 additions & 3 deletions infracheck/checks-tests/load-average-test.sh
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
#!/bin/bash

echo " >> Assert that 1.5 core load is more than 1.0 core allowed"
MAX_LOAD=1.0 MOCK_LOAD_AVERAGE=1.5 ./infracheck/checks/load-average
MAX_LOAD=1.0 MOCK_LOAD_AVERAGE=1.5 ../checks/load-average
if [[ $? != 1 ]]; then
echo " >> Test failed."
exit 1
fi

echo " >> Assert that 1.5 core load is more than 1.0 core allowed (using integer instead of float)"
MAX_LOAD=1 MOCK_LOAD_AVERAGE=1.5 ./infracheck/checks/load-average
MAX_LOAD=1 MOCK_LOAD_AVERAGE=1.5 ../checks/load-average
if [[ $? != 1 ]]; then
echo " >> Test failed."
exit 1
fi

echo " >> Assert that load of 10.1 is ok, when we allow load of max. 15.0"
MAX_LOAD=15 MOCK_LOAD_AVERAGE=10.1 ./infracheck/checks/load-average
MAX_LOAD=15 MOCK_LOAD_AVERAGE=10.1 ../checks/load-average
if [[ $? != 0 ]]; then
echo " >> Test failed."
exit 1
Expand Down
6 changes: 3 additions & 3 deletions infracheck/checks-tests/swap-usage-max-percent-test.sh
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
#!/bin/bash

echo " >> Assert that current usage of 50% is higher than maximum of 40%"
MOCK_SWAP_USAGE=50 MAX_ALLOWED_PERCENTAGE=40 ./infracheck/checks/swap-usage-max-percent
MOCK_SWAP_USAGE=50 MAX_ALLOWED_PERCENTAGE=40 ../checks/swap-usage-max-percent
if [[ $? != 1 ]]; then
echo " >> Test failed."
exit 1
fi

echo " >> Assert that swap is not used"
MOCK_SWAP_USAGE=0 MAX_ALLOWED_PERCENTAGE=0 ./infracheck/checks/swap-usage-max-percent
MOCK_SWAP_USAGE=0 MAX_ALLOWED_PERCENTAGE=0 ../checks/swap-usage-max-percent
if [[ $? != 0 ]]; then
echo " >> Test failed."
exit 1
fi

echo " >> Assert 10% is ok, when maximum is defined at 15%"
MOCK_SWAP_USAGE=10 MAX_ALLOWED_PERCENTAGE=15 ./infracheck/checks/swap-usage-max-percent
MOCK_SWAP_USAGE=10 MAX_ALLOWED_PERCENTAGE=15 ../checks/swap-usage-max-percent
if [[ $? != 0 ]]; then
echo " >> Test failed."
exit 1
Expand Down

0 comments on commit 3a76afc

Please sign in to comment.