Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhance: clean the local-persist after integration tests #1400

Merged
merged 1 commit into from
May 25, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions hack/make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,21 @@ function install_local_persist
mv /tmp/local-persist /usr/local/bin/
}

# clean the local-persist
function clean_local_persist
{
echo "Try cleaning local-persist"
pid=$(pgrep local-persist)

if [[ $pid ]]; then
echo "Try killing local-persist process"
kill -9 $pid
fi

echo "Try removing local-persist.sock"
rm -rf /var/run/docker/plugins/local-persist.sock
}

function install_nsenter
{
echo "Try installing nsenter"
Expand Down Expand Up @@ -269,11 +284,16 @@ function target
# If test is failed, print pouch daemon log.
set +e
$DIR/test/integration-test -test.v -check.v

if (( $? != 0 )); then
echo "pouch daemon log:"
cat $TMP/log
clean_local_persist
return 1
fi

clean_local_persist

set -e
;;
*)
Expand Down