Skip to content

Commit abb5535

Browse files
Stefan Friesephilpep
authored andcommitted
added busybox hardlink support, added inode property
1 parent e7d89ee commit abb5535

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

testinfra/modules/file.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,10 @@ def mtime(self):
236236
def size(self):
237237
return int(self.check_output("stat -c %%s %s", self.path))
238238

239+
@property
240+
def inode(self):
241+
return int(self.check_output("stat -c %%i %s", self.path))
242+
239243
@property
240244
def md5sum(self):
241245
return self.check_output("md5sum %s | cut -d' ' -f1", self.path)

testinfra/modules/process.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ def _get_process_attribute_by_pid(self, pid, name):
109109
def get_module_class(cls, host):
110110
if host.file("/bin/ps").linked_to == "/bin/busybox":
111111
return BusyboxProcess
112+
if host.file("/bin/ps").inode == host.file("/bin/busybox").inode:
113+
return BusyboxProcess
112114
if host.system_info.type == "linux" or host.system_info.type.endswith("bsd"):
113115
return PosixProcess
114116
raise NotImplementedError

0 commit comments

Comments
 (0)