From: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
V3 -> V4
update test case
V2 -> V3
sort the import.
V1 -> V2
use debug to log the open exception trace stack.
It is complex to check the permission for qemu user.
There are too many access controlling mechanisms in
Linux, such as ACL, traditional ugo+-rwx, SELinux and AppArmor. It's not
possible to enumerate and check every access mechanisms if it allows
QEMU to access a file.
So now I'm simply trying to access the file with qemu user and see if it's OK
It is simple and avoid handling corner case.
Also I can try to start a simple guest with the given iso.
ShaoHe Feng (4):
add a method to probe the permission as qemu user
qemu user tests: probe the username of qemu process started by libvirt
Don't allow templates to be created with ISOs that won't be usable.
probe iso permission: update test case
Makefile.am | 1 +
src/kimchi/i18n.py | 5 ++++
src/kimchi/kvmusertests.py | 64 +++++++++++++++++++++++++++++++++++++++++++
src/kimchi/model/templates.py | 13 ++++++++-
src/kimchi/utils.py | 26 ++++++++++++++++++
tests/test_model.py | 38 ++++++++++++++++---------
6 files changed, 133 insertions(+), 14 deletions(-)
create mode 100644 src/kimchi/kvmusertests.py
--
1.8.4.2