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>
import unittest
import platform
import logging
+from argparse import Namespace
from unittest import suite, loader
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()