Merge pull request #535 from Ostrokrzew/by-id

Disallow to use other than by-id path to core or cache device
This commit is contained in:
Robert Baldyga
2020-12-23 14:38:07 +01:00
committed by GitHub
99 changed files with 740 additions and 724 deletions

View File

@@ -19,12 +19,12 @@ class Cache:
self.__metadata_size = None
def __get_cache_id(self):
cmd = f"{list_cmd()} | grep {self.cache_device.system_path}"
cmd = f"{list_cmd(by_id_path=False)} | grep {self.cache_device.short_path}"
output = TestRun.executor.run(cmd)
if output.exit_code == 0 and output.stdout.strip():
return output.stdout.split()[1]
else:
raise Exception(f"There is no cache started on {self.cache_device.system_path}.")
raise Exception(f"There is no cache started on {self.cache_device.path}.")
def get_core_devices(self):
return get_cores(self.cache_id)