From 59273966f1bee1aca5c3a6b612b87e36cd6219d0 Mon Sep 17 00:00:00 2001 From: Rishabh Dave Date: Wed, 18 May 2022 14:14:57 +0530 Subject: [PATCH] qa/vstart_runner: store FSID in LocalContext instances 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 --- qa/tasks/vstart_runner.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/qa/tasks/vstart_runner.py b/qa/tasks/vstart_runner.py index 3657570556a6..d433790f8b0e 100644 --- a/qa/tasks/vstart_runner.py +++ b/qa/tasks/vstart_runner.py @@ -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() -- 2.47.3