Merge pull request #32 from katlapinka/kasiat/device-get-serial
Add method for getting device sysfs serial
This commit is contained in:
commit
2b085c1cff
@ -101,6 +101,11 @@ class Device:
|
|||||||
return int(TestRun.executor.run_expect_success(
|
return int(TestRun.executor.run_expect_success(
|
||||||
f"cat {get_sysfs_path(self.get_device_id())}/device/numa_node").stdout)
|
f"cat {get_sysfs_path(self.get_device_id())}/device/numa_node").stdout)
|
||||||
|
|
||||||
|
def get_serial(self):
|
||||||
|
sysfs_path = get_sysfs_path(self.get_device_id())
|
||||||
|
serial_path = posixpath.join(sysfs_path, "device", "serial")
|
||||||
|
return TestRun.executor.run_expect_success(f"cat {serial_path}").stdout
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return (
|
return (
|
||||||
f'system path: {self.path}, short link: /dev/{self.get_device_id()},'
|
f'system path: {self.path}, short link: /dev/{self.get_device_id()},'
|
||||||
|
Loading…
Reference in New Issue
Block a user