Browse Source

Update tests to not set `fsid` and `monitor-secret`

Get `fsid` from leader settings on ceph-mon unit where needed
for validation.

Change-Id: I751ecff76873a599c0d03ec1308e30e615e38aa8
Related-Bug: #1698154
changes/96/572696/1
Frode Nordahl 1 year ago
parent
commit
1f68a5874e
No account linked to committer's email address
1 changed files with 10 additions and 6 deletions
  1. 10
    6
      tests/basic_deployment.py

+ 10
- 6
tests/basic_deployment.py View File

@@ -115,8 +115,6 @@ class CephOsdBasicDeployment(OpenStackAmuletDeployment):
115 115
         ceph_config = {
116 116
             'monitor-count': '3',
117 117
             'auth-supported': 'none',
118
-            'fsid': '6547bd3e-1397-11e2-82e5-53567c8d32dc',
119
-            'monitor-secret': 'AQCXrnZQwI7KGBAAiPofmKEXKxu5bUzoYLVkbQ==',
120 118
         }
121 119
 
122 120
         # Include a non-existent device as osd-devices is a whitelist,
@@ -322,13 +320,14 @@ class CephOsdBasicDeployment(OpenStackAmuletDeployment):
322 320
         """Verify the ceph0 to ceph-osd relation data."""
323 321
         u.log.debug('Checking ceph0:ceph-osd mon relation data...')
324 322
         unit = self.ceph0_sentry
323
+        (fsid, _) = unit.run('leader-get fsid')
325 324
         relation = ['osd', 'ceph-osd:mon']
326 325
         expected = {
327 326
             'osd_bootstrap_key': u.not_null,
328 327
             'private-address': u.valid_ip,
329 328
             'auth': u'none',
330 329
             'ceph-public-address': u.valid_ip,
331
-            'fsid': u'6547bd3e-1397-11e2-82e5-53567c8d32dc'
330
+            'fsid': fsid,
332 331
         }
333 332
 
334 333
         ret = u.validate_relation_data(unit, relation, expected)
@@ -340,13 +339,14 @@ class CephOsdBasicDeployment(OpenStackAmuletDeployment):
340 339
         """Verify the ceph1 to ceph-osd relation data."""
341 340
         u.log.debug('Checking ceph1:ceph-osd mon relation data...')
342 341
         unit = self.ceph1_sentry
342
+        (fsid, _) = unit.run('leader-get fsid')
343 343
         relation = ['osd', 'ceph-osd:mon']
344 344
         expected = {
345 345
             'osd_bootstrap_key': u.not_null,
346 346
             'private-address': u.valid_ip,
347 347
             'auth': u'none',
348 348
             'ceph-public-address': u.valid_ip,
349
-            'fsid': u'6547bd3e-1397-11e2-82e5-53567c8d32dc'
349
+            'fsid': fsid,
350 350
         }
351 351
 
352 352
         ret = u.validate_relation_data(unit, relation, expected)
@@ -358,13 +358,14 @@ class CephOsdBasicDeployment(OpenStackAmuletDeployment):
358 358
         """Verify the ceph2 to ceph-osd relation data."""
359 359
         u.log.debug('Checking ceph2:ceph-osd mon relation data...')
360 360
         unit = self.ceph2_sentry
361
+        (fsid, _) = unit.run('leader-get fsid')
361 362
         relation = ['osd', 'ceph-osd:mon']
362 363
         expected = {
363 364
             'osd_bootstrap_key': u.not_null,
364 365
             'private-address': u.valid_ip,
365 366
             'auth': u'none',
366 367
             'ceph-public-address': u.valid_ip,
367
-            'fsid': u'6547bd3e-1397-11e2-82e5-53567c8d32dc'
368
+            'fsid': fsid,
368 369
         }
369 370
 
370 371
         ret = u.validate_relation_data(unit, relation, expected)
@@ -375,6 +376,9 @@ class CephOsdBasicDeployment(OpenStackAmuletDeployment):
375 376
     def test_300_ceph_osd_config(self):
376 377
         """Verify the data in the ceph config file."""
377 378
         u.log.debug('Checking ceph config file data...')
379
+        mon_unit = self.ceph0_sentry
380
+        (fsid, _) = mon_unit.run('leader-get fsid')
381
+
378 382
         unit = self.ceph_osd_sentry
379 383
         conf = '/etc/ceph/ceph.conf'
380 384
         expected = {
@@ -382,7 +386,7 @@ class CephOsdBasicDeployment(OpenStackAmuletDeployment):
382 386
                 'auth cluster required': 'none',
383 387
                 'auth service required': 'none',
384 388
                 'auth client required': 'none',
385
-                'fsid': '6547bd3e-1397-11e2-82e5-53567c8d32dc',
389
+                'fsid': fsid,
386 390
                 'log to syslog': 'false',
387 391
                 'err to syslog': 'false',
388 392
                 'clog to syslog': 'false'

Loading…
Cancel
Save