Skip libvirt tests if not running as root

Running salt.states.libvirt.keys() results in an OSError if the pki dir
needs to be created.
This commit is contained in:
Erik Johnson 2015-05-27 11:53:26 -05:00
parent 4a8dbc7f13
commit 72e7416ad2

View File

@ -4,6 +4,7 @@
'''
# Import Python libs
from __future__ import absolute_import
import os
# Import Salt Testing Libs
from salttesting import skipIf, TestCase
@ -33,6 +34,7 @@ class LibvirtTestCase(TestCase):
'''
# 'keys' function tests: 1
@skipIf(os.geteuid() != 0, 'you must be root to run this test')
@patch('os.path.isfile', MagicMock(return_value=False))
def test_keys(self):
'''