]> git.ipfire.org Git - thirdparty/kmod.git/blame - testsuite/test-depmod.c
kmod 14
[thirdparty/kmod.git] / testsuite / test-depmod.c
CommitLineData
b0c9fc85 1/*
e6b0e49b 2 * Copyright (C) 2012-2013 ProFUSION embedded systems
b0c9fc85
LDM
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18
19#include <stdio.h>
20#include <stdlib.h>
21#include <stddef.h>
22#include <errno.h>
23#include <unistd.h>
24#include <inttypes.h>
25#include <string.h>
26
27#include "testsuite.h"
28
29#define MODULES_ORDER_UNAME "3.5.4-1-ARCH"
30#define MODULES_ORDER_ROOTFS TESTSUITE_ROOTFS "test-depmod/modules-order-compressed"
31#define MODULES_ORDER_LIB_MODULES MODULES_ORDER_ROOTFS "/lib/modules/" MODULES_ORDER_UNAME
32static __noreturn int depmod_modules_order_for_compressed(const struct test *t)
33{
9de9e07d 34 const char *progname = ABS_TOP_BUILDDIR "/tools/test/depmod";
b0c9fc85
LDM
35 const char *const args[] = {
36 progname,
37 NULL,
38 };
39
40 test_spawn_prog(progname, args);
41 exit(EXIT_FAILURE);
42}
43static DEFINE_TEST(depmod_modules_order_for_compressed,
44 .description = "check if depmod let aliases in right order when using compressed modules",
45 .config = {
46 [TC_UNAME_R] = MODULES_ORDER_UNAME,
47 [TC_ROOTFS] = MODULES_ORDER_ROOTFS,
48 },
49 .output = {
50 .files = (const struct keyval[]) {
51 { MODULES_ORDER_LIB_MODULES "/correct-modules.alias",
52 MODULES_ORDER_LIB_MODULES "/modules.alias" },
53 { }
54 },
55 });
56
57
58static const struct test *tests[] = {
59 &sdepmod_modules_order_for_compressed,
60 NULL,
61};
62
63TESTSUITE_MAIN(tests);