testsuite: add test for softdep loops
authorLucas De Marchi <lucas.demarchi@profusion.mobi>
Mon, 4 Jun 2012 23:45:24 +0000 (20:45 -0300)
committerLucas De Marchi <lucas.de.marchi@gmail.com>
Tue, 5 Jun 2012 03:57:47 +0000 (00:57 -0300)
13 files changed:
testsuite/rootfs-pristine/test-modprobe/softdep-loop/etc/modprobe.d/dumb-softdep.conf [new file with mode: 0644]
testsuite/rootfs-pristine/test-modprobe/softdep-loop/lib/modules/4.4.4/kernel/drivers/bluetooth/btusb.ko [new file with mode: 0644]
testsuite/rootfs-pristine/test-modprobe/softdep-loop/lib/modules/4.4.4/kernel/drivers/input/mouse/psmouse.ko [new file with mode: 0644]
testsuite/rootfs-pristine/test-modprobe/softdep-loop/lib/modules/4.4.4/kernel/net/bluetooth/bluetooth.ko [new file with mode: 0644]
testsuite/rootfs-pristine/test-modprobe/softdep-loop/lib/modules/4.4.4/modules.alias [new file with mode: 0644]
testsuite/rootfs-pristine/test-modprobe/softdep-loop/lib/modules/4.4.4/modules.alias.bin [new file with mode: 0644]
testsuite/rootfs-pristine/test-modprobe/softdep-loop/lib/modules/4.4.4/modules.dep [new file with mode: 0644]
testsuite/rootfs-pristine/test-modprobe/softdep-loop/lib/modules/4.4.4/modules.dep.bin [new file with mode: 0644]
testsuite/rootfs-pristine/test-modprobe/softdep-loop/lib/modules/4.4.4/modules.devname [new file with mode: 0644]
testsuite/rootfs-pristine/test-modprobe/softdep-loop/lib/modules/4.4.4/modules.softdep [new file with mode: 0644]
testsuite/rootfs-pristine/test-modprobe/softdep-loop/lib/modules/4.4.4/modules.symbols [new file with mode: 0644]
testsuite/rootfs-pristine/test-modprobe/softdep-loop/lib/modules/4.4.4/modules.symbols.bin [new file with mode: 0644]
testsuite/test-modprobe.c

diff --git a/testsuite/rootfs-pristine/test-modprobe/softdep-loop/etc/modprobe.d/dumb-softdep.conf b/testsuite/rootfs-pristine/test-modprobe/softdep-loop/etc/modprobe.d/dumb-softdep.conf
new file mode 100644 (file)
index 0000000..fa41143
--- /dev/null
@@ -0,0 +1 @@
+softdep bluetooth post: btusb
diff --git a/testsuite/rootfs-pristine/test-modprobe/softdep-loop/lib/modules/4.4.4/kernel/drivers/bluetooth/btusb.ko b/testsuite/rootfs-pristine/test-modprobe/softdep-loop/lib/modules/4.4.4/kernel/drivers/bluetooth/btusb.ko
new file mode 100644 (file)
index 0000000..f4e21e0
Binary files /dev/null and b/testsuite/rootfs-pristine/test-modprobe/softdep-loop/lib/modules/4.4.4/kernel/drivers/bluetooth/btusb.ko differ
diff --git a/testsuite/rootfs-pristine/test-modprobe/softdep-loop/lib/modules/4.4.4/kernel/drivers/input/mouse/psmouse.ko b/testsuite/rootfs-pristine/test-modprobe/softdep-loop/lib/modules/4.4.4/kernel/drivers/input/mouse/psmouse.ko
new file mode 100644 (file)
index 0000000..4eac2a3
Binary files /dev/null and b/testsuite/rootfs-pristine/test-modprobe/softdep-loop/lib/modules/4.4.4/kernel/drivers/input/mouse/psmouse.ko differ
diff --git a/testsuite/rootfs-pristine/test-modprobe/softdep-loop/lib/modules/4.4.4/kernel/net/bluetooth/bluetooth.ko b/testsuite/rootfs-pristine/test-modprobe/softdep-loop/lib/modules/4.4.4/kernel/net/bluetooth/bluetooth.ko
new file mode 100644 (file)
index 0000000..a8949a6
Binary files /dev/null and b/testsuite/rootfs-pristine/test-modprobe/softdep-loop/lib/modules/4.4.4/kernel/net/bluetooth/bluetooth.ko differ
diff --git a/testsuite/rootfs-pristine/test-modprobe/softdep-loop/lib/modules/4.4.4/modules.alias b/testsuite/rootfs-pristine/test-modprobe/softdep-loop/lib/modules/4.4.4/modules.alias
new file mode 100644 (file)
index 0000000..94804f1
--- /dev/null
@@ -0,0 +1,21 @@
+# Aliases extracted from modules themselves.
+alias usb:v413Cp8197d*dc*dsc*dp*ic*isc*ip* btusb
+alias usb:v0A5Cp21E3d*dc*dsc*dp*ic*isc*ip* btusb
+alias usb:v0C10p0000d*dc*dsc*dp*ic*isc*ip* btusb
+alias usb:v0BDBp1002d*dc*dsc*dp*ic*isc*ip* btusb
+alias usb:v044Ep3002d*dc*dsc*dp*ic*isc*ip* btusb
+alias usb:v044Ep3001d*dc*dsc*dp*ic*isc*ip* btusb
+alias usb:v04BFp030Ad*dc*dsc*dp*ic*isc*ip* btusb
+alias usb:v057Cp3800d*dc*dsc*dp*ic*isc*ip* btusb
+alias usb:v05ACp8281d*dc*dsc*dp*ic*isc*ip* btusb
+alias usb:v05ACp821Ad*dc*dsc*dp*ic*isc*ip* btusb
+alias usb:v05ACp821Fd*dc*dsc*dp*ic*isc*ip* btusb
+alias usb:v05ACp821Bd*dc*dsc*dp*ic*isc*ip* btusb
+alias usb:v05ACp8218d*dc*dsc*dp*ic*isc*ip* btusb
+alias usb:v05ACp8215d*dc*dsc*dp*ic*isc*ip* btusb
+alias usb:v05ACp8213d*dc*dsc*dp*ic*isc*ip* btusb
+alias usb:v05ACp21E1d*dc*dsc*dp*ic*isc*ip* btusb
+alias usb:v*p*d*dcE0dsc01dp01ic*isc*ip* btusb
+alias serio:ty05pr*id*ex* psmouse
+alias serio:ty01pr*id*ex* psmouse
+alias net-pf-31 bluetooth
diff --git a/testsuite/rootfs-pristine/test-modprobe/softdep-loop/lib/modules/4.4.4/modules.alias.bin b/testsuite/rootfs-pristine/test-modprobe/softdep-loop/lib/modules/4.4.4/modules.alias.bin
new file mode 100644 (file)
index 0000000..86481a4
Binary files /dev/null and b/testsuite/rootfs-pristine/test-modprobe/softdep-loop/lib/modules/4.4.4/modules.alias.bin differ
diff --git a/testsuite/rootfs-pristine/test-modprobe/softdep-loop/lib/modules/4.4.4/modules.dep b/testsuite/rootfs-pristine/test-modprobe/softdep-loop/lib/modules/4.4.4/modules.dep
new file mode 100644 (file)
index 0000000..a34af87
--- /dev/null
@@ -0,0 +1,3 @@
+kernel/drivers/bluetooth/btusb.ko: kernel/net/bluetooth/bluetooth.ko
+kernel/drivers/input/mouse/psmouse.ko:
+kernel/net/bluetooth/bluetooth.ko:
diff --git a/testsuite/rootfs-pristine/test-modprobe/softdep-loop/lib/modules/4.4.4/modules.dep.bin b/testsuite/rootfs-pristine/test-modprobe/softdep-loop/lib/modules/4.4.4/modules.dep.bin
new file mode 100644 (file)
index 0000000..3382706
Binary files /dev/null and b/testsuite/rootfs-pristine/test-modprobe/softdep-loop/lib/modules/4.4.4/modules.dep.bin differ
diff --git a/testsuite/rootfs-pristine/test-modprobe/softdep-loop/lib/modules/4.4.4/modules.devname b/testsuite/rootfs-pristine/test-modprobe/softdep-loop/lib/modules/4.4.4/modules.devname
new file mode 100644 (file)
index 0000000..58f6d6d
--- /dev/null
@@ -0,0 +1 @@
+# Device nodes to trigger on-demand module loading.
diff --git a/testsuite/rootfs-pristine/test-modprobe/softdep-loop/lib/modules/4.4.4/modules.softdep b/testsuite/rootfs-pristine/test-modprobe/softdep-loop/lib/modules/4.4.4/modules.softdep
new file mode 100644 (file)
index 0000000..3cc0512
--- /dev/null
@@ -0,0 +1,2 @@
+# Soft dependencies extracted from modules themselves.
+# Copy, with a .conf extension, to /etc/modprobe.d to use it with modprobe.
diff --git a/testsuite/rootfs-pristine/test-modprobe/softdep-loop/lib/modules/4.4.4/modules.symbols b/testsuite/rootfs-pristine/test-modprobe/softdep-loop/lib/modules/4.4.4/modules.symbols
new file mode 100644 (file)
index 0000000..b970b60
--- /dev/null
@@ -0,0 +1,45 @@
+# Aliases for symbols, used by symbol_request().
+alias symbol:hci_conn_check_secure bluetooth
+alias symbol:hci_send_acl bluetooth
+alias symbol:hci_recv_fragment bluetooth
+alias symbol:hci_recv_frame bluetooth
+alias symbol:hci_le_ltk_reply bluetooth
+alias symbol:hci_send_sco bluetooth
+alias symbol:bt_debugfs bluetooth
+alias symbol:bt_accept_unlink bluetooth
+alias symbol:bt_sock_recvmsg bluetooth
+alias symbol:bt_sock_ioctl bluetooth
+alias symbol:hci_le_conn_update bluetooth
+alias symbol:hci_unregister_cb bluetooth
+alias symbol:hci_connect bluetooth
+alias symbol:hci_le_start_enc bluetooth
+alias symbol:bt_sock_link bluetooth
+alias symbol:bt_printk bluetooth
+alias symbol:hci_alloc_dev bluetooth
+alias symbol:baswap bluetooth
+alias symbol:hci_conn_switch_role bluetooth
+alias symbol:hci_resume_dev bluetooth
+alias symbol:bt_sock_stream_recvmsg bluetooth
+alias symbol:hci_conn_check_link_mode bluetooth
+alias symbol:hci_conn_hold_device bluetooth
+alias symbol:hci_conn_change_link_key bluetooth
+alias symbol:hci_conn_put_device bluetooth
+alias symbol:batostr bluetooth
+alias symbol:bt_to_errno bluetooth
+alias symbol:bt_accept_dequeue bluetooth
+alias symbol:hci_free_dev bluetooth
+alias symbol:bt_accept_enqueue bluetooth
+alias symbol:hci_find_link_key_type bluetooth
+alias symbol:hci_find_ltk bluetooth
+alias symbol:hci_recv_stream_fragment bluetooth
+alias symbol:bt_sock_register bluetooth
+alias symbol:hci_get_route bluetooth
+alias symbol:hci_register_dev bluetooth
+alias symbol:hci_unregister_dev bluetooth
+alias symbol:bt_sock_poll bluetooth
+alias symbol:bt_sock_wait_state bluetooth
+alias symbol:bt_sock_unlink bluetooth
+alias symbol:bt_sock_unregister bluetooth
+alias symbol:hci_register_cb bluetooth
+alias symbol:hci_suspend_dev bluetooth
+alias symbol:hci_conn_security bluetooth
diff --git a/testsuite/rootfs-pristine/test-modprobe/softdep-loop/lib/modules/4.4.4/modules.symbols.bin b/testsuite/rootfs-pristine/test-modprobe/softdep-loop/lib/modules/4.4.4/modules.symbols.bin
new file mode 100644 (file)
index 0000000..156a61f
Binary files /dev/null and b/testsuite/rootfs-pristine/test-modprobe/softdep-loop/lib/modules/4.4.4/modules.symbols.bin differ
index 3aebcae..e7d61d8 100644 (file)
@@ -88,10 +88,31 @@ static DEFINE_TEST(modprobe_builtin,
                [TC_ROOTFS] = TESTSUITE_ROOTFS "test-modprobe/builtin",
        });
 
+static __noreturn int modprobe_softdep_loop(const struct test *t)
+{
+       const char *progname = ABS_TOP_BUILDDIR "/tools/modprobe";
+       const char *const args[] = {
+               progname,
+               "bluetooth",
+               NULL,
+       };
+
+       test_spawn_prog(progname, args);
+       exit(EXIT_FAILURE);
+}
+static DEFINE_TEST(modprobe_softdep_loop,
+       .description = "check if modprobe breaks softdep loop",
+       .config = {
+               [TC_UNAME_R] = "4.4.4",
+               [TC_ROOTFS] = TESTSUITE_ROOTFS "test-modprobe/softdep-loop",
+               [TC_INIT_MODULE_RETCODES] = "",
+       });
+
 static const struct test *tests[] = {
        &smodprobe_show_depends,
        &smodprobe_show_depends2,
        &smodprobe_builtin,
+       &smodprobe_softdep_loop,
        NULL,
 };