Browse Source

Fix issues with tests

Some fixes were needed to make sure the ipa client code was
accessing the right config parameters for connect_retries and
keytab.

Also, more attributes needed to be added to the flavors to make
the enrollment tests successful.  This prevents nova returning
No Valid Host available errors.

Change-Id: I018a2dd8f3de9598e19394ea2b3f0a0bfdf4c669
changes/72/680472/1
Ade Lee 1 month ago
parent
commit
67b6aa37a8

+ 3
- 0
novajoin_tempest_plugin/config.py View File

@@ -27,6 +27,9 @@ novajoin_group = cfg.OptGroup(
27 27
     title="Novajoin test plugin settings")
28 28
 
29 29
 NovajoinGroup = [
30
+    cfg.IntOpt('connect_retries',
31
+               default=1,
32
+               help='Number of connection attempts to IPA'),
30 33
     cfg.StrOpt('flavor_tag',
31 34
                default='vm',
32 35
                help='Flavor tag to use in novajoin enrollment tests'),

+ 2
- 9
novajoin_tempest_plugin/ipa/ipa_client.py View File

@@ -40,18 +40,11 @@ LOG = logging.getLogger(__name__)
40 40
 class IPABase(object):
41 41
 
42 42
     def __init__(self, backoff=0):
43
-        try:
44
-            self.ntries = CONF.connect_retries
45
-        except cfg.NoSuchOptError:
46
-            self.ntries = 1
47 43
         if not ipalib_imported:
48 44
             return
49 45
 
50
-        try:
51
-            self.keytab = CONF.keytab
52
-        except cfg.NoSuchOptError:
53
-            self.keytab = '/etc/novajoin/krb5.keytab'
54
-
46
+        self.ntries = CONF.novajoin.connect_retries
47
+        self.keytab = CONF.novajoin.keytab
55 48
         with open(self.keytab):
56 49
             pass  # Throw a nicer exception if krb5.keytab does not exist
57 50
 

+ 10
- 3
novajoin_tempest_plugin/tests/scenario/test_novajoin_enrollment.py View File

@@ -29,17 +29,24 @@ NETWORK = 'ctlplane'
29 29
 FLAVORS = {
30 30
     'baremetal': {'ram': 4096,
31 31
                   'vcpus': 3,
32
-                  'disk': 30,
32
+                  'disk': 38,
33 33
                   'specs': {
34 34
                       "capabilities:boot_option": "local",
35
+                      "cpu_arch": "x86_64",
35 36
                       "capabilities:profile": "ironic",
36
-                      "resources:CUSTOM_IRONIC": '1'}},
37
+                      "resources:CUSTOM_IRONIC": '1',
38
+                      "resources:DISK_GB": '0',
39
+                      "resources:MEMORY_MB": '0',
40
+                      "resources:VCPU": '0'}},
37 41
     'vm': {'ram': 4096,
38 42
            'vcpus': 1,
39 43
            'disk': 40,
40 44
            'specs': {
41 45
                "capabilities:boot_option": "local",
42
-               "capabilities:profile": "compute"}}
46
+               "capabilities:profile": "compute",
47
+               "resources:DISK_GB": '0',
48
+               "resources:MEMORY_MB": '0',
49
+               "resources:VCPU": '0'}}
43 50
 }
44 51
 
45 52
 

Loading…
Cancel
Save