[stable][1.5.x] vm_factory: Add clean_vm_template in setup#1434
Conversation
Clean the vm_template dir before test executes. Fixes: kata-containers#1363 Signed-off-by: Hui Zhu <teawater@hyper.sh>
|
/test |
| while [ $(mount | grep ${template_tmpfs_path} | wc -l) -ne 0 ] | ||
| do | ||
| echo "cleaning vm template" | ||
| { umount ${template_tmpfs_path} ; res=$?; } || true |
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
edit: @grahamwhaley ah I just cherry pick the PR. It is already merged in master
There was a problem hiding this comment.
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'
There was a problem hiding this comment.
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.
Clean the vm_template dir before test executes.
Fixes: #1363