@ -19,26 +19,40 @@ from neutron.cmd.sanity import checks
from neutron . tests import base
class OVSSanityTestCase ( base . BaseTestCase ) :
class SanityTestCase ( base . BaseTestCase ) :
""" Sanity checks that do not require root access.
Tests that just call checks . some_function ( ) are to ensure that
neutron - sanity - check runs without throwing an exception , as in the case
where someone modifies the API without updating the check script .
"""
def setUp ( self ) :
super ( SanityTestCase , self ) . setUp ( )
def test_nova_notify_runs ( self ) :
checks . nova_notify_supported ( )
class SanityTestCaseRoot ( base . BaseTestCase ) :
""" Sanity checks that require root access.
Tests that just call checks . some_function ( ) are to ensure that
neutron - sanity - check runs without throwing an exception , as in the case
where someone modifies the API without updating the check script .
"""
def setUp ( self ) :
super ( OVSSanityTestCase , self ) . setUp ( )
super ( SanityTestCaseRoot , self ) . setUp ( )
self . root_helper = ' sudo '
self . check_sudo_enabled ( )
def check_sudo_enabled ( self ) :
if os . environ . get ( ' OS_SUDO_TESTING ' ) not in base . TRUE_STRING :
self . skipTest ( ' testing with sudo is not enabled ' )
def test_ovs_vxlan_support_runs ( self ) :
""" This test just ensures that the test in neutron-sanity-check
can run through without error , without mocking anything out
"""
self . check_sudo_enabled ( )
checks . vxlan_supported ( self . root_helper )
def test_ovs_patch_support_runs ( self ) :
""" This test just ensures that the test in neutron-sanity-check
can run through without error , without mocking anything out
"""
self . check_sudo_enabled ( )
checks . patch_supported ( self . root_helper )