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

test: Clean /dev/shm a bit better #459

Merged
merged 3 commits into from
Mar 18, 2022
Merged

Conversation

chrissie-c
Copy link
Contributor

This isn't perfect, but it does tidy more of /dev/shm than
previously. Because some of the tests leave empty directories
we have no way of telling (in resources.test) whether they
belong to this test run, another test run, or a running
application.

This isn't perfect, but it does tidy more of /dev/shm than
previously. Because some of the tests leave empty directories
we have no way of telling (in resources.test) whether they
belong to this test run, another test run, or a running
application.
Copy link
Contributor

@kgaillot kgaillot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me, though I didn't test it

@@ -28,8 +31,12 @@ for d in /dev/shm /var/run $SOCKETDIR; do
if [ "$(printf '%s\n' "${leftovers}" | wc -l)" -eq $(($SOCKS_PER_PROCESS * 2)) ]; then
echo
echo "There were some empty leftovers (expected), removing them"
echo "${leftovers}" | tee /dev/stderr | xargs rm
echo "${leftovers}" | tee /dev/stderr
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems odd to output just the names to both stdout and stderr, I would expect all the echos to go to one place. echo blah >&2 goes to just stderr

for dd in $leftovers; do
rm $dd
rmdir `dirname $dd` 2>/dev/null
done
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could be worth functionizing since it's used twice

@chrissie-c chrissie-c merged commit 2d3cd76 into ClusterLabs:main Mar 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants