Browse Source

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
Grzegorz Grasza 5 months ago
parent
commit
2ffc08c544

+ 0
- 7
novajoin/novajoin/tests/integration/README View File

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

+ 10
- 0
novajoin/tests/functional/README View File

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

novajoin/novajoin/tests/integration/krb5.conf → novajoin/tests/functional/krb5.conf View File


novajoin/novajoin/tests/integration/test_ipa.py → novajoin/tests/functional/test_ipa_integration.py View File

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

Loading…
Cancel
Save