So that when the running is aborted by control-C, it won't affect the next run. We can use bitbake -R and -r to do this.
This implies that the seltest code would never need to cleanup and that isn't the case. We need to make sure the cleanup code runs correctly even in the Ctrl+C case.
Right, some of the tests actually need to test adding items to configuration files as the user would, so I don't think this is going to be practical for all of oe-selftest. Besides, configuration is only part of the picture - e.g. files left around in the sysroot or the metadata could also cause problems for future runs. As Richard says it's about ensuring the cleanup runs even when interrupted with Ctrl+C. Something related to (but not the same as) this is covered under bug 8105.
Fix submitted for review: https://patchwork.openembedded.org/patch/132083/
Fix merged in commit 0877278e07e4c2494c4c23199490dc47a5cee69d
Edit, commit: c902e7b93700e56245d8f04397ff01fa278183a3