]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Test elfutils output of VMCOREINFO note.
authorPetr Machata <pmachata@redhat.com>
Mon, 24 Sep 2012 14:16:27 +0000 (16:16 +0200)
committerPetr Machata <pmachata@redhat.com>
Mon, 24 Sep 2012 15:15:51 +0000 (17:15 +0200)
The test file is partial kdump image, with only headers and notes left in.

Signed-off-by: Petr Machata <pmachata@redhat.com>
tests/ChangeLog
tests/Makefile.am
tests/run-readelf-vmcoreinfo.sh [new file with mode: 0755]
tests/testfile62.bz2 [new file with mode: 0644]

index 88a33b99c6c66cbe5e1434f101be1264f4654e76..b2f6e4af50e384e6a85965cf9500577d27934831 100644 (file)
@@ -1,3 +1,10 @@
+2012-09-24  Petr Machata  <pmachata@redhat.com>
+
+       * testfile62.bz2: New testfile.
+       * run-readelf-vmcoreinfo.sh: New test.
+       * Makefile.am (TEST): Add run-readelf-vmcoreinfo.sh.
+       (EXTRA_DIST): Add testfile62.bz2 and run-readelf-vmcoreinfo.sh.
+
 2012-09-18  Petr Machata  <pmachata@redhat.com>
 
        * testfile61.bz2: New testfile.
index bee497378ed678b90062480801480c60dd1f1bb4..e67a853e18b6d74fb44282a3ffd66a1f526f1827 100644 (file)
@@ -84,7 +84,7 @@ TESTS = run-arextract.sh run-arsymtest.sh newfile test-nlist \
        run-dwarf-getstring.sh run-rerequest_tag.sh run-typeiter.sh \
        run-readelf-d.sh run-readelf-gdb_index.sh run-unstrip-n.sh \
        run-low_high_pc.sh run-macro-test.sh run-elf_cntl_gelf_getshdr.sh \
-       run-test-archive64.sh
+       run-test-archive64.sh run-readelf-vmcoreinfo.sh
 
 if !STANDALONE
 check_PROGRAMS += msg_tst md5-sha1-test
@@ -176,7 +176,8 @@ EXTRA_DIST = run-arextract.sh run-arsymtest.sh \
             run-macro-test.sh testfile-macinfo.bz2 testfile-macros.bz2 \
             run-elf_cntl_gelf_getshdr.sh \
             run-test-archive64.sh testarchive64.a.bz2 \
-            testfile60.bz2 testfile61.bz2
+            testfile60.bz2 testfile61.bz2 \
+            run-readelf-vmcoreinfo.sh testfile62.bz2
 
 installed_TESTS_ENVIRONMENT = libdir=$(DESTDIR)$(libdir) \
                              bindir=$(DESTDIR)$(bindir) \
diff --git a/tests/run-readelf-vmcoreinfo.sh b/tests/run-readelf-vmcoreinfo.sh
new file mode 100755 (executable)
index 0000000..da361c8
--- /dev/null
@@ -0,0 +1,114 @@
+#! /bin/sh
+# Copyright (C) 2012 Red Hat, Inc.
+# This file is part of elfutils.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# elfutils is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+. $srcdir/test-subr.sh
+
+testfiles testfile62
+
+testrun_compare ../src/readelf -n testfile62 <<\EOF
+
+Note segment of 2104 bytes at offset 0x158:
+  Owner          Data size  Type
+  CORE                 336  PRSTATUS
+    info.si_signo: 0, info.si_code: 0, info.si_errno: 0, cursig: 0
+    sigpend: <>
+    sighold: <>
+    pid: 3519, ppid: 0, pgrp: 0, sid: 0
+    utime: 0.000000, stime: 0.000000, cutime: 0.000000, cstime: 0.000000
+    orig_rax: -1, fpvalid: 0
+    r15:                     662  r14:                       4
+    r13:             -2119649152  r12:                       0
+    rbp:      0xffff880067e39e48  rbx:                      99
+    r11:        -131940469531936  r10:             -2124150080
+    r9:         -131940469531936  r8:                        0
+    rax:                      16  rcx:                    7813
+    rdx:                       0  rsi:                       0
+    rdi:                      99  rip:      0xffffffff812ba86f
+    rflags:   0x0000000000010096  rsp:      0xffff880067e39e48
+    fs.base:   0x00007f95a7b09720  gs.base:   0x0000000000000000
+    cs: 0x0010  ss: 0x0018  ds: 0x0000  es: 0x0000  fs: 0x0000  gs: 0x0000
+  CORE                 336  PRSTATUS
+    info.si_signo: 0, info.si_code: 0, info.si_errno: 0, cursig: 0
+    sigpend: <>
+    sighold: <>
+    pid: 0, ppid: 0, pgrp: 0, sid: 0
+    utime: 0.000000, stime: 0.000000, cutime: 0.000000, cstime: 0.000000
+    orig_rax: -1, fpvalid: 0
+    r15:                       0  r14:                       0
+    r13:     1348173392195389970  r12:                       1
+    rbp:      0xffff88007a829e48  rbx:                      16
+    r11:        -131940468065880  r10:            435505529489
+    r9:                   158960  r8:                        0
+    rax:                      16  rcx:                       1
+    rdx:                       0  rsi:                       3
+    rdi:        -131939339960320  rip:      0xffffffff810118bb
+    rflags:   0x0000000000000046  rsp:      0xffff88007a829e38
+    fs.base:   0x0000000000000000  gs.base:   0x0000000000000000
+    cs: 0x0010  ss: 0x0018  ds: 0x0000  es: 0x0000  fs: 0x0000  gs: 0x0000
+  VMCOREINFO          1366  <unknown>: 0
+    OSRELEASE=2.6.35.11-83.fc14.x86_64
+    PAGESIZE=4096
+    SYMBOL(init_uts_ns)=ffffffff81a4c5b0
+    SYMBOL(node_online_map)=ffffffff81b840b0
+    SYMBOL(swapper_pg_dir)=ffffffff81a42000
+    SYMBOL(_stext)=ffffffff81000190
+    SYMBOL(vmlist)=ffffffff81db07e8
+    SYMBOL(mem_section)=ffffffff81dbab00
+    LENGTH(mem_section)=4096
+    SIZE(mem_section)=32
+    OFFSET(mem_section.section_mem_map)=0
+    SIZE(page)=56
+    SIZE(pglist_data)=81664
+    SIZE(zone)=1792
+    SIZE(free_area)=88
+    SIZE(list_head)=16
+    SIZE(nodemask_t)=64
+    OFFSET(page.flags)=0
+    OFFSET(page._count)=8
+    OFFSET(page.mapping)=24
+    OFFSET(page.lru)=40
+    OFFSET(pglist_data.node_zones)=0
+    OFFSET(pglist_data.nr_zones)=81472
+    OFFSET(pglist_data.node_start_pfn)=81496
+    OFFSET(pglist_data.node_spanned_pages)=81512
+    OFFSET(pglist_data.node_id)=81520
+    OFFSET(zone.free_area)=112
+    OFFSET(zone.vm_stat)=1328
+    OFFSET(zone.spanned_pages)=1704
+    OFFSET(free_area.free_list)=0
+    OFFSET(list_head.next)=0
+    OFFSET(list_head.prev)=8
+    OFFSET(vm_struct.addr)=8
+    LENGTH(zone.free_area)=11
+    SYMBOL(log_buf)=ffffffff81a532a8
+    SYMBOL(log_end)=ffffffff81d0bc50
+    SYMBOL(log_buf_len)=ffffffff81a532a4
+    SYMBOL(logged_chars)=ffffffff81d0bd70
+    LENGTH(free_area.free_list)=5
+    NUMBER(NR_FREE_PAGES)=0
+    NUMBER(PG_lru)=5
+    NUMBER(PG_private)=11
+    NUMBER(PG_swapcache)=16
+    SYMBOL(phys_base)=ffffffff81a4a010
+    SYMBOL(init_level4_pgt)=ffffffff81a42000
+    SYMBOL(node_data)=ffffffff81b80df0
+    LENGTH(node_data)=512
+    CRASHTIME=1348173392
+
+EOF
+
+exit 0
diff --git a/tests/testfile62.bz2 b/tests/testfile62.bz2
new file mode 100644 (file)
index 0000000..8a42cf6
Binary files /dev/null and b/tests/testfile62.bz2 differ