self.mount_a.umount_wait()
with self.assert_cluster_log("inode table repaired", invert_match=True):
- out_json = self.fs.mds_asok(["scrub_path", "/", "repair", "recursive"])
+ out_json = self.fs.rank_tell(["scrub", "start", "/", "repair", "recursive"])
self.assertNotEqual(out_json, None)
self.mds_cluster.mds_stop()
self.fs.wait_for_daemons()
with self.assert_cluster_log("inode table repaired"):
- out_json = self.fs.mds_asok(["scrub_path", "/", "repair", "recursive"])
+ out_json = self.fs.rank_tell(["scrub", "start", "/", "repair", "recursive"])
self.assertNotEqual(out_json, None)
self.mds_cluster.mds_stop()
"oh i'm sorry did i overwrite your xattr?")
with self.assert_cluster_log("bad backtrace on inode"):
- out_json = self.fs.mds_asok(["scrub_path", "/", "repair", "recursive"])
+ out_json = self.fs.rank_tell(["scrub", "start", "/", "repair", "recursive"])
self.assertNotEqual(out_json, None)
self.fs.mds_asok(["flush", "journal"])
backtrace = self.fs.read_backtrace(file_ino)
nep = "{test_path}/i/dont/exist".format(test_path=abs_test_path)
self.asok_command(mds_rank, "flush_path {nep}".format(nep=nep),
lambda j, r: self.json_validator(j, r, "return_code", -errno.ENOENT))
- self.asok_command(mds_rank, "scrub_path {nep}".format(nep=nep),
+ self.tell_command(mds_rank, "scrub start {nep}".format(nep=nep),
lambda j, r: self.json_validator(j, r, "return_code", -errno.ENOENT))
test_repo_path = "{test_path}/ceph-qa-suite".format(test_path=abs_test_path)
log.info("First run: flushing {dirpath}".format(dirpath=dirpath))
command = "flush_path {dirpath}".format(dirpath=dirpath)
self.asok_command(mds_rank, command, success_validator)
- command = "scrub_path {dirpath}".format(dirpath=dirpath)
- self.asok_command(mds_rank, command, success_validator)
+ command = "scrub start {dirpath}".format(dirpath=dirpath)
+ self.tell_command(mds_rank, command, success_validator)
filepath = "{repo_path}/suites/fs/verify/validater/valgrind.yaml".format(
repo_path=test_repo_path)
log.info("First run: flushing {filepath}".format(filepath=filepath))
command = "flush_path {filepath}".format(filepath=filepath)
self.asok_command(mds_rank, command, success_validator)
- command = "scrub_path {filepath}".format(filepath=filepath)
- self.asok_command(mds_rank, command, success_validator)
+ command = "scrub start {filepath}".format(filepath=filepath)
+ self.tell_command(mds_rank, command, success_validator)
filepath = "{repo_path}/suites/fs/basic/clusters/fixed-3-cephfs.yaml". \
format(repo_path=test_repo_path)
- command = "scrub_path {filepath}".format(filepath=filepath)
- self.asok_command(mds_rank, command,
+ command = "scrub start {filepath}".format(filepath=filepath)
+ self.tell_command(mds_rank, command,
lambda j, r: self.json_validator(j, r, "performed_validation",
False))
log.info("First run: flushing base dir /")
command = "flush_path /"
self.asok_command(mds_rank, command, success_validator)
- command = "scrub_path /"
- self.asok_command(mds_rank, command, success_validator)
+ command = "scrub start /"
+ self.tell_command(mds_rank, command, success_validator)
new_dir = "{repo_path}/new_dir_{i}".format(repo_path=repo_path, i=run_seq)
test_new_dir = "{repo_path}/new_dir_{i}".format(repo_path=test_repo_path,
# check that scrub fails on errors
ino = self.mount_a.path_to_ino(new_file)
rados_obj_name = "{ino:x}.00000000".format(ino=ino)
- command = "scrub_path {file}".format(file=test_new_file)
+ command = "scrub start {file}".format(file=test_new_file)
# Missing parent xattr -> ENODATA
self.fs.rados(["rmxattr", rados_obj_name, "parent"], pool=self.fs.get_data_pool_name())
- self.asok_command(mds_rank, command,
+ self.tell_command(mds_rank, command,
lambda j, r: self.json_validator(j, r, "return_code", -errno.ENODATA))
# Missing object -> ENOENT
self.fs.rados(["rm", rados_obj_name], pool=self.fs.get_data_pool_name())
- self.asok_command(mds_rank, command,
+ self.tell_command(mds_rank, command,
lambda j, r: self.json_validator(j, r, "return_code", -errno.ENOENT))
command = "flush_path /"
self.mount_a.run_shell(["sudo", "rmdir", test_dir])
self.assertEqual(ar.exception.exitstatus, 1)
- self.asok_command(mds_rank, "scrub_path /{0} repair".format(test_dir),
+ self.tell_command(mds_rank, "scrub start /{0} repair".format(test_dir),
lambda j, r: self.json_validator(j, r, "return_code", 0))
# wait a few second for background repair
jv=element_value, ev=expected_value)
return True, "Succeeded"
+ def tell_command(self, mds_rank, command, validator):
+ log.info("Running command '{command}'".format(command=command))
+
+ command_list = command.split()
+ jout = self.fs.rank_tell(command_list, mds_rank)
+
+ log.info("command '{command}' returned '{jout}'".format(
+ command=command, jout=jout))
+
+ success, errstring = validator(jout, 0)
+ if not success:
+ raise AsokCommandFailedError(command, rout, jout, errstring)
+ return jout
+
def asok_command(self, mds_rank, command, validator):
log.info("Running command '{command}'".format(command=command))