[LTP] [PATCH v1] ioctl10.c: New case test PROCMAP_QUERY ioctl()
Wei Gao
wegao@suse.com
Mon Jan 13 06:57:48 CET 2025
On Mon, Jan 13, 2025 at 12:52:31AM -0500, Wei Gao wrote:
> Signed-off-by: Wei Gao <wegao@suse.com>
> ---
> configure.ac | 1 +
> runtest/syscalls | 1 +
> testcases/kernel/syscalls/ioctl/.gitignore | 1 +
> testcases/kernel/syscalls/ioctl/ioctl10.c | 175 +++++++++++++++++++++
> 4 files changed, 178 insertions(+)
> create mode 100644 testcases/kernel/syscalls/ioctl/ioctl10.c
The test report error when i check tw in my env(wrong dev_minor number). I guess is kernel issue?
susetest:~/ltp # uname -r
6.12.8-2-default
susetest:~/ltp # cat /etc/os-release
NAME="openSUSE Tumbleweed"
# VERSION="20250109"
ID="opensuse-tumbleweed"
ID_LIKE="opensuse suse"
VERSION_ID="20250109"
PRETTY_NAME="openSUSE Tumbleweed"
ANSI_COLOR="0;32"
# CPE 2.3 format, boo#1217921
CPE_NAME="cpe:2.3:o:opensuse:tumbleweed:20250109:*:*:*:*:*:*:*"
#CPE 2.2 format
#CPE_NAME="cpe:/o:opensuse:tumbleweed:20250109"
BUG_REPORT_URL="https://bugzilla.opensuse.org"
SUPPORT_URL="https://bugs.opensuse.org"
HOME_URL="https://www.opensuse.org"
DOCUMENTATION_URL="https://en.opensuse.org/Portal:Tumbleweed"
LOGO="distributor-logo-Tumbleweed"
tst_test.c:1893: TINFO: LTP version: 20240524-413-g96a255983
tst_test.c:1897: TINFO: Tested kernel: 6.12.8-2-default #1 SMP PREEMPT_DYNAMIC Mon Jan 6 06:45:37 UTC 2025 (90b0f5b) x86_64
tst_test.c:1730: TINFO: Timeout per run is 0h 00m 30s
line=00400000-00431000 r-xp 00000000 00:30 14632 /root/ioctl09
ioctl09.c:100: TPASS: parse_maps_file(path_buf, "*", &entry) passed
ID of containing device: [0,15]
ioctl09.c:120: TPASS: ioctl(fd, PROCMAP_QUERY, &q) passed
ioctl09.c:122: TPASS: q.query_addr == entry.vm_start (4194304)
ioctl09.c:123: TPASS: q.query_flags == 0 (0)
ioctl09.c:124: TPASS: q.vma_flags == entry.vm_flags (5)
ioctl09.c:125: TPASS: q.vma_start == entry.vm_start (4194304)
ioctl09.c:126: TPASS: q.vma_end == entry.vm_end (4395008)
ioctl09.c:127: TPASS: q.vma_page_size == getpagesize() (4096)
ioctl09.c:128: TPASS: q.vma_offset == entry.vm_pgoff (0)
ioctl09.c:129: TPASS: q.inode == entry.vm_inode (14632)
ioctl09.c:130: TPASS: q.dev_major == entry.vm_major (0)
ioctl09.c:131: TFAIL: q.dev_minor (35) != entry.vm_minor (48) <<<<<<<<<<<<<<<<<<<<<<<<
ioctl09.c:139: TPASS: ioctl(fd, PROCMAP_QUERY, &q) : ENOENT (2)
ioctl09.c:147: TPASS: ioctl(fd, PROCMAP_QUERY, &q) passed
line=00400000-00431000 r-xp 00000000 00:30 14632 /root/ioctl09
ioctl09.c:151: TPASS: parse_maps_file("/proc/self/maps", "*r-?p *", &entry) passed
ioctl09.c:157: TPASS: ioctl(fd, PROCMAP_QUERY, &q) : ENOENT (2)
line=00400000-00431000 r-xp 00000000 00:30 14632 /root/ioctl09
ioctl09.c:166: TPASS: parse_maps_file("/proc/self/maps", pattern, &entry) passed
ioctl09.c:175: TPASS: ioctl(fd, PROCMAP_QUERY, &q) passed
ioctl09.c:176: TPASS: q.vma_name_size == strlen(process_name) + 1 (14)
ioctl09.c:177: TPASS: (char *)q.vma_name_addr == process_name (/root/ioctl09)
stat /root/ioctl09
File: /root/ioctl09
Size: 873728 Blocks: 1712 IO Block: 4096 regular file
Device: 0,48 <<<<<< Inode: 14632 Links: 1
Access: (0755/-rwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2025-01-12 22:29:01.378310333 -0500
Modify: 2025-01-12 22:28:58.043307554 -0500
Change: 2025-01-12 22:28:58.043307554 -0500
Birth: 2025-01-12 21:37:52.621841127 -0500
More information about the ltp
mailing list