Move test_ipa_integration to functional tests directory

Since novajoin integrates Nova with FreeIPA, functional tests
won't be able to run without FreeIPA. Therefore, we want to run
integration tests together with functional tests.

Change-Id: I93a3ef03b8bf2141710602fd8ba5f01098767fe3
This commit is contained in:
Grzegorz Grasza 2018-11-06 11:34:26 +01:00
parent 73a47b6652
commit 2ffc08c544
4 changed files with 14 additions and 8 deletions

View File

@ -1,7 +0,0 @@
Currently this test needs to be executed against a live installation with a copy
of the novajoin keytab in /tmp/test.keytab.
A new krb5.conf is included which will force the default ticket lifetime to 1 minute
and time.sleep(60) is used to ensure an expiration will happen.
I execute it as: nosetests -v novajoin/tests/integration/test_ipa.py

View File

@ -0,0 +1,10 @@
The test_ipa_integration.py test needs to be executed against a live
installation of FreeIPA. It will look for a copy of the novajoin keytab in
/etc/novajoin/krb5.keytab or /tmp/test.keytab.
A new krb5.conf is included which will force the default ticket lifetime to
1 minute and time.sleep(60) is used to ensure an expiration will happen.
To run only the FreeIPA integration test, execute it as:
python -m unittest novajoin.tests.functional.test_ipa_integration

View File

@ -54,6 +54,8 @@ class TestIPAService(testtools.TestCase):
def setUp(self): def setUp(self):
global hostname global hostname
CONF.keytab = '/tmp/test.keytab' CONF.keytab = '/tmp/test.keytab'
if not os.path.isfile(CONF.keytab):
CONF.keytab = '/etc/novajoin/krb5.keytab'
super(TestIPAService, self).setUp() super(TestIPAService, self).setUp()
self.ipaclient = IPAClient() self.ipaclient = IPAClient()
@ -66,7 +68,8 @@ class TestIPAService(testtools.TestCase):
if hostname is None: if hostname is None:
hostname = six.text_type(str(uuid.uuid4()) + '.' + api.env.domain) hostname = six.text_type(str(uuid.uuid4()) + '.' + api.env.domain)
os.environ['KRB5_CONFIG'] = 'krb5.conf' os.environ['KRB5_CONFIG'] = os.path.join(
os.path.dirname(__file__), 'krb5.conf')
def test_host_add(self): def test_host_add(self):
global hostname global hostname