Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/pull/1/head' into multimds-thrash
Browse files Browse the repository at this point in the history
* origin/pull/1/head:
  tasks/vstart_runner: fix default run-all
  tasks/vstart_runner: update for Filesystem changes
  • Loading branch information
batrick committed Nov 8, 2016
2 parents 9832bea + 530d03d commit 69fe46c
Showing 1 changed file with 25 additions and 17 deletions.
42 changes: 25 additions & 17 deletions tasks/vstart_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -645,8 +645,8 @@ def clear_firewall(self):
# FIXME: unimplemented
pass

def get_filesystem(self, name):
return LocalFilesystem(self._ctx, name)
def newfs(self, name):
return LocalFilesystem(self._ctx, create=name)


class LocalMgrCluster(LocalCephCluster, MgrCluster):
Expand All @@ -665,16 +665,14 @@ class LocalFilesystem(Filesystem, LocalMDSCluster):
def admin_remote(self):
return LocalRemote()

def __init__(self, ctx, name=None):
def __init__(self, ctx, fscid=None, create=None):
# Deliberately skip calling parent constructor
self._ctx = ctx

if name is None:
name = "cephfs"

self.name = name
self.metadata_pool_name = "{0}_metadata".format(name)
self.data_pool_name = "{0}_data".format(name)
self.id = None
self.name = None
self.metadata_pool_name = None
self.data_pools = None

# Hack: cheeky inspection of ceph.conf to see what MDSs exist
self.mds_ids = set()
Expand All @@ -698,6 +696,18 @@ def __init__(self, ctx, name=None):

self._conf = defaultdict(dict)

if create is not None:
if fscid is not None:
raise RuntimeError("cannot specify fscid when creating fs")
if create is True:
self.name = 'cephfs'
else:
self.name = create
self.create()
elif fscid is not None:
self.id = fscid
self.getinfo(refresh=True)

@property
def _prefix(self):
return BIN_PREFIX
Expand Down Expand Up @@ -818,7 +828,6 @@ def __del__(self):
else:
if os.path.exists(mount.mountpoint):
os.rmdir(mount.mountpoint)
filesystem = LocalFilesystem(ctx)
ceph_cluster = LocalCephCluster(ctx)
mds_cluster = LocalMDSCluster(ctx)
mgr_cluster = LocalMgrCluster(ctx)
Expand Down Expand Up @@ -846,25 +855,24 @@ def flush(self):
"ctx": ctx,
"mounts": mounts,
"ceph_cluster": ceph_cluster,
"fs": filesystem,
"mds_cluster": mds_cluster,
"mgr_cluster": mgr_cluster,
})

# For the benefit of polling tests like test_full -- in teuthology land we set this
# in a .yaml, here it's just a hardcoded thing for the developer's pleasure.
remote.run(args=[os.path.join(BIN_PREFIX, "ceph"), "tell", "osd.*", "injectargs", "--osd-mon-report-interval-max", "5"])
filesystem.set_ceph_conf("osd", "osd_mon_report_interval_max", "5")
ceph_cluster.set_ceph_conf("osd", "osd_mon_report_interval_max", "5")

# Vstart defaults to two segments, which very easily gets a "behind on trimming" health warning
# from normal IO latency. Increase it for running teests.
filesystem.set_ceph_conf("mds", "mds log max segments", "10")
ceph_cluster.set_ceph_conf("mds", "mds log max segments", "10")

# Make sure the filesystem created in tests has uid/gid that will let us talk to
# it after mounting it (without having to go root). Set in 'global' not just 'mds'
# so that cephfs-data-scan will pick it up too.
filesystem.set_ceph_conf("global", "mds root ino uid", "%s" % os.getuid())
filesystem.set_ceph_conf("global", "mds root ino gid", "%s" % os.getgid())
ceph_cluster.set_ceph_conf("global", "mds root ino uid", "%s" % os.getuid())
ceph_cluster.set_ceph_conf("global", "mds root ino gid", "%s" % os.getgid())

# Monkeypatch get_package_version to avoid having to work out what kind of distro we're on
def _get_package_version(remote, pkg_name):
Expand Down Expand Up @@ -903,9 +911,9 @@ def enumerate_methods(s):
log.info("Loaded: {0}".format(list(module_suites)))
overall_suite = suite.TestSuite(module_suites)
else:
log.info("Excuting all tests")
log.info("Executing all cephfs tests")
overall_suite = decorating_loader.discover(
os.path.dirname(os.path.abspath(__file__))
os.path.join(os.path.dirname(os.path.abspath(__file__)), "cephfs")
)

# Filter out tests that don't lend themselves to interactive running,
Expand Down

0 comments on commit 69fe46c

Please sign in to comment.