From b62ba7f5b1caf99a3cbbe06d0e1c788c2dc85416 Mon Sep 17 00:00:00 2001 From: Dmitry Vasilyev Date: Thu, 30 May 2024 19:57:16 +0400 Subject: [PATCH] [lldb] Fixed the TestGdbRemotePlatformFile test running on a remote target (#93832) Skip checking of few stat fields like st_dev (ID of device containing file) in case of a remote target. --- .../lldb-server/TestGdbRemotePlatformFile.py | 25 ++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/lldb/test/API/tools/lldb-server/TestGdbRemotePlatformFile.py b/lldb/test/API/tools/lldb-server/TestGdbRemotePlatformFile.py index 2e1c72ee56d7a8..76b0b204123ddd 100644 --- a/lldb/test/API/tools/lldb-server/TestGdbRemotePlatformFile.py +++ b/lldb/test/API/tools/lldb-server/TestGdbRemotePlatformFile.py @@ -308,19 +308,26 @@ def test_platform_file_fstat(self): ) sys_stat = os.fstat(temp_file.fileno()) - self.assertEqual(gdb_stat.st_dev, uint32_or_zero(sys_stat.st_dev)) - self.assertEqual(gdb_stat.st_ino, uint32_or_zero(sys_stat.st_ino)) self.assertEqual(gdb_stat.st_mode, uint32_trunc(sys_stat.st_mode)) self.assertEqual(gdb_stat.st_nlink, uint32_or_max(sys_stat.st_nlink)) - self.assertEqual(gdb_stat.st_uid, uint32_or_zero(sys_stat.st_uid)) - self.assertEqual(gdb_stat.st_gid, uint32_or_zero(sys_stat.st_gid)) self.assertEqual(gdb_stat.st_rdev, uint32_or_zero(sys_stat.st_rdev)) self.assertEqual(gdb_stat.st_size, sys_stat.st_size) - self.assertEqual(gdb_stat.st_blksize, sys_stat.st_blksize) - self.assertEqual(gdb_stat.st_blocks, sys_stat.st_blocks) - self.assertEqual(gdb_stat.st_atime, uint32_or_zero(int(sys_stat.st_atime))) - self.assertEqual(gdb_stat.st_mtime, uint32_or_zero(int(sys_stat.st_mtime))) - self.assertEqual(gdb_stat.st_ctime, uint32_or_zero(int(sys_stat.st_ctime))) + if not lldb.remote_platform: + self.assertEqual(gdb_stat.st_dev, uint32_or_zero(sys_stat.st_dev)) + self.assertEqual(gdb_stat.st_ino, uint32_or_zero(sys_stat.st_ino)) + self.assertEqual(gdb_stat.st_uid, uint32_or_zero(sys_stat.st_uid)) + self.assertEqual(gdb_stat.st_gid, uint32_or_zero(sys_stat.st_gid)) + self.assertEqual(gdb_stat.st_blksize, sys_stat.st_blksize) + self.assertEqual(gdb_stat.st_blocks, sys_stat.st_blocks) + self.assertEqual( + gdb_stat.st_atime, uint32_or_zero(int(sys_stat.st_atime)) + ) + self.assertEqual( + gdb_stat.st_mtime, uint32_or_zero(int(sys_stat.st_mtime)) + ) + self.assertEqual( + gdb_stat.st_ctime, uint32_or_zero(int(sys_stat.st_ctime)) + ) self.reset_test_sequence() self.test_sequence.add_log_lines(