Merge pull request #1200 from timstclair/integration
Improve local cAdvisor integration test script
This commit is contained in:
commit
366dee28f8
@ -14,18 +14,34 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
if [[ -n "${JENKINS_HOME}" ]]
|
if [[ -n "${JENKINS_HOME}" ]]; then
|
||||||
then
|
|
||||||
exec ./build/jenkins_e2e.sh
|
exec ./build/jenkins_e2e.sh
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
sudo -v || exit 1
|
||||||
|
|
||||||
echo ">> starting cAdvisor locally"
|
echo ">> starting cAdvisor locally"
|
||||||
sudo ./cadvisor &
|
sudo ./cadvisor &
|
||||||
|
|
||||||
|
readonly TIMEOUT=120 # Timeout to wait for cAdvisor, in seconds.
|
||||||
|
START=$(date +%s)
|
||||||
|
while [ "$(curl -Gs http://localhost:8080/healthz)" != "ok" ]; do
|
||||||
|
if (( $(date +%s) - $START > $TIMEOUT )); then
|
||||||
|
echo "Timed out waiting for cAdvisor to start"
|
||||||
|
sudo pkill -9 cadvisor
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "Waiting for cAdvisor to start ..."
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
|
||||||
echo ">> running integration tests against local cAdvisor"
|
echo ">> running integration tests against local cAdvisor"
|
||||||
godep go test github.com/google/cadvisor/integration/tests/... --vmodule=*=2
|
godep go test github.com/google/cadvisor/integration/tests/... --vmodule=*=2
|
||||||
if [ $? -ne 0 ]
|
STATUS=$?
|
||||||
then
|
if [ $STATUS -ne 0 ]; then
|
||||||
echo "Integration tests failed"
|
echo "Integration tests failed"
|
||||||
fi
|
fi
|
||||||
echo ">> stopping cAdvisor"
|
echo ">> stopping cAdvisor"
|
||||||
sudo pkill -9 cadvisor
|
sudo pkill -9 cadvisor
|
||||||
|
|
||||||
|
exit $STATUS
|
||||||
|
Loading…
Reference in New Issue
Block a user