Skip to content

Commit 570b58e

Browse files
committed
Skip usbfs_ioctl_pcap on sparc64
Calling Ioctl.USBDEVFS_REAPURB in the test causes a SIGBUS error on sparc64. It's actually surprising that this test passes on a lot of architectures -- the pcap file was recorded on x86_64, and there may be some unaligned access there. I don't know enough about compilers, alignment, and pcap files to actually fix this. But the more pressing issue is to fix the package build on sparc64. Fixes #218
1 parent 15b4fed commit 570b58e

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed

meson.build

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ python = find_program('python3', 'python', required: false)
101101
vapi_posix = valac.find_library('posix')
102102
vapi_linux = valac.find_library('linux')
103103
vapi_linux_fixes = valac.find_library('linux_fixes', dirs: srcdir)
104+
vapi_glibc = valac.find_library('glibc', dirs: srcdir)
104105
vala_libudev = cc.find_library('udev')
105106
vala_libutil = cc.find_library('util')
106107

@@ -278,7 +279,7 @@ if gudev.found()
278279

279280
test('umockdev-vala', executable('test-umockdev-vala',
280281
'tests/test-umockdev-vala.vala',
281-
dependencies: [glib, gobject, gio, gudev, vapi_posix, vapi_assertions, vapi_ioctl, vapi_selinux, selinux],
282+
dependencies: [glib, gobject, gio, gudev, vapi_posix, vapi_assertions, vapi_ioctl, vapi_glibc, vapi_selinux, selinux],
282283
link_with: [umockdev_lib, umockdev_utils_lib],
283284
vala_args: optional_defines),
284285
depends: [preload_lib],

src/glibc.vapi

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[CCode (cheader_filename = "sys/utsname.h")]
2+
namespace GLibc {
3+
[CCode (cname = "struct utsname", destroy_function="")]
4+
public struct Utsname {
5+
unowned string sysname;
6+
unowned string nodename;
7+
unowned string release;
8+
unowned string version;
9+
unowned string machine;
10+
}
11+
12+
[CCode (cname = "uname")]
13+
public void uname (out Utsname buf);
14+
}

tests/test-umockdev-vala.vala

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

2121
using UMockdevUtils;
2222
using Assertions;
23+
using GLibc;
2324

2425
#if HAVE_SELINUX
2526
using Selinux;
@@ -549,6 +550,13 @@ t_usbfs_ioctl_pcap ()
549550
string device;
550551
Ioctl.usbdevfs_urb* urb_reap = null;
551552

553+
GLibc.Utsname utsbuf;
554+
GLibc.uname (out utsbuf);
555+
if (utsbuf.machine == "sparc64") {
556+
stdout.printf ("[SKIP pre-recorded pcap does not work on sparc64]\n");
557+
return;
558+
}
559+
552560
/* NOTE: This test is a bit ugly. It wasn't the best idea to use a USB keyboard. */
553561

554562
checked_file_get_contents (Path.build_filename(rootdir + "/devices/input/usbkbd.pcap.umockdev"), out device);

0 commit comments

Comments
 (0)