Skip to content

Commit

Permalink
Merge pull request #1400 from shaloulcy/plugin_sock_clean
Browse files Browse the repository at this point in the history
enhance: clean the local-persist after integration tests
  • Loading branch information
rudyfly authored May 25, 2018
2 parents c320db1 + de673c5 commit b2c5b3f
Showing 1 changed file with 20 additions and 0 deletions.
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

0 comments on commit b2c5b3f

Please sign in to comment.