]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/vstart_runner: store FSID in LocalContext instances 46314/head
authorRishabh Dave <ridave@redhat.com>
Wed, 18 May 2022 08:44:57 +0000 (14:14 +0530)
committerRishabh Dave <ridave@redhat.com>
Wed, 18 May 2022 14:14:34 +0000 (19:44 +0530)
1. Method cluster() in ceph.py creates a dictionary "ctx.ceph", attaches
   a namespace to ctx.ceph[cluster_name], create an attribute "fsid" and
   stores Ceph cluster's FSID in it.

2. The method kernel_mount.KernelMount._get_debug_dir() uses that "fsid"
   attribute to get Ceph cluster's FSID. (The exact that does that is
   "fsid = self.ctx.ceph[cluster_name].fsid").

3. Test test_readahead.TestReadahead.test_flush() crashes with
   vstart_runner.py because that test eventually calls _get_debug_dir()
   and "ctx" in case of vstart_runner.py doesn't hold "ceph" dictionary
   or anything similar.

Adding a dictionary, similar to the one added in ceph.py, to
vstart_runner.LocalContext's instances will fix this issue.

Fixes: https://tracker.ceph.com/issues/55694
Signed-off-by: Rishabh Dave <ridave@redhat.com>
qa/tasks/vstart_runner.py

index 3657570556a65b433d6f2ccca0bb86282f577811..d433790f8b0ebd366668a57153b8ea39346300b8 100644 (file)
@@ -71,6 +71,7 @@ from IPy import IP
 import unittest
 import platform
 import logging
+from argparse import Namespace
 
 from unittest import suite, loader
 
@@ -943,7 +944,13 @@ class LocalCluster(object):
 
 class LocalContext(object):
     def __init__(self):
-        self.config = {'cluster': 'ceph'}
+        FSID = remote.run(args=[os.path.join(BIN_PREFIX, 'ceph'), 'fsid'],
+                          stdout=StringIO()).stdout.getvalue()
+
+        cluster_name = 'ceph'
+        self.config = {'cluster': cluster_name}
+        self.ceph = {cluster_name: Namespace()}
+        self.ceph[cluster_name].fsid = FSID
         self.teuthology_config = teuth_config
         self.cluster = LocalCluster()
         self.daemons = DaemonGroup()