Skip to content

Commit 7cd4ae5

Browse files
committed
add test for oversized inodes
Signed-off-by: Zen <[email protected]>
1 parent f8aec3f commit 7cd4ae5

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/test_cpio.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
from pycpio import PyCPIO
99
from pycpio.header import CPIOHeader
10+
from pycpio.cpio import CPIOData
1011
from zenlib.logging import loggify
1112

1213
from cpio_test_headers import newc_test_headers, build_newc_header
@@ -145,5 +146,11 @@ def test_invalid_symlink_target(self):
145146
test_symlink.symlink_to('/a/totally/nonexistent/path')
146147
self.cpio.append_recursive(self.workdir.name)
147148

149+
def test_large_inode(self):
150+
""" Tests handling of inode numbers larger than 0xFFFFFFFF """
151+
entry = CPIOData.create_entry('large_inode_test', inode=0x1FFFFFFFF, logger=self.logger)
152+
# Should be reset to 0
153+
self.assertEqual(entry.header.ino, b'00000000')
154+
148155
if __name__ == '__main__':
149156
main()

0 commit comments

Comments
 (0)