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

tests: add setup/teardown for asok dir #16523

Merged
merged 2 commits into from
Jul 24, 2017
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions src/ceph-disk/tests/ceph-disk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ function setup() {
local dir=$1
teardown $dir
mkdir -p $dir/osd
mkdir -p $(get_asok_dir)
touch $dir/ceph.conf # so ceph-disk think ceph is the cluster
}

Expand All @@ -78,6 +79,7 @@ function teardown() {
umount $mounted
done
rm -fr $dir
rm -rf $(get_asok_dir)
}

function command_fixture() {
Expand Down
4 changes: 3 additions & 1 deletion src/vstart.sh
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,9 @@ else
if [ "$new" -ne 0 ]; then
# only delete if -n
asok_dir=`dirname $($CEPH_BIN/ceph-conf --show-config-value admin_socket)`
[ -d $asok_dir ] && rm -f $asok_dir/* && rmdir $asok_dir
if [ $asok_dir != /var/run/ceph ]; then
[ -d $asok_dir ] && rm -f $asok_dir/* && rmdir $asok_dir
fi
if [ -z "$CEPH_ASOK_DIR" ]; then
CEPH_ASOK_DIR=`mktemp -u -d "${TMPDIR:-/tmp}/ceph-asok.XXXXXX"`
fi
Expand Down