Skip to content
This repository has been archived by the owner on Jun 28, 2024. It is now read-only.

[stable][1.5.x] vm_factory: Add clean_vm_template in setup #1434

Merged

Conversation

jcvenegas
Copy link
Member

Clean the vm_template dir before test executes.

Fixes: #1363

Clean the vm_template dir before test executes.

Fixes: kata-containers#1363

Signed-off-by: Hui Zhu <[email protected]>
@jcvenegas
Copy link
Member Author

/test

while [ $(mount | grep ${template_tmpfs_path} | wc -l) -ne 0 ]
do
echo "cleaning vm template"
{ umount ${template_tmpfs_path} ; res=$?; } || true
Copy link
Contributor

Choose a reason for hiding this comment

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

does this work? this looks like you are unmounting the same destingation (template_tmpfs_path) over and over.
Maybe a 'for m in $(mount | grep blah)` loop would be better, then you can specify exactly what you are unmounting (but, you would also probably have to grep out the actual mount path from the grep result).

Copy link
Member Author

@jcvenegas jcvenegas Apr 9, 2019

Choose a reason for hiding this comment

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

edit: @grahamwhaley ah I just cherry pick the PR. It is already merged in master

Copy link
Member Author

Choose a reason for hiding this comment

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

I think is trying multiples times until is able to do it. The issue there is that could be and endless loop. I suggest to bring this in a new PR if want to fix it as this is just a cherry pick to have stable branches testing 'stable'

Copy link
Member

Choose a reason for hiding this comment

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

does this work? this looks like you are unmounting the same destingation (template_tmpfs_path) over and over.
Maybe a 'for m in $(mount | grep blah)` loop would be better, then you can specify exactly what you are unmounting (but, you would also probably have to grep out the actual mount path from the grep result).

Currently, "kata-runtime factory init" doesn't check if vm factory initialized before it mount template tmpfs path. So loop umount is useful.

PS, this comments remind me that kata-runtime factory init should do a check before mount. I will open a issue for it.

@chavafg chavafg merged commit 49f7ba0 into kata-containers:stable-1.5 Apr 10, 2019
@jcvenegas jcvenegas deleted the stable-1.5-vmcache-fix branch May 22, 2019 18:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants