modindex: getopt_long returns int not char (fix ppc64 bug)
[mit.git] / tests / test-depmod / 07complex.sh
blob233222960b747589cb30f411f3239a238867a3d5
1 #! /bin/sh
2 # Complex tests of generation of 32-bit and 64-bit modules.dep
3 # Direct dependencies:
4 # A: B C D
5 # B: E
6 # C: B E
7 # D: B
8 # E:
10 for ENDIAN in -le -be; do
11 for BITNESS in 32 64; do
13 rm -rf tests/tmp/*
15 # Create inputs
16 MODULE_DIR=tests/tmp/lib/modules/$MODTEST_UNAME
17 mkdir -p $MODULE_DIR
18 ln tests/data/$BITNESS$ENDIAN/complex/complex_a-$BITNESS.ko \
19 tests/data/$BITNESS$ENDIAN/complex/complex_b-$BITNESS.ko \
20 tests/data/$BITNESS$ENDIAN/complex/complex_c-$BITNESS.ko \
21 tests/data/$BITNESS$ENDIAN/complex/complex_d-$BITNESS.ko \
22 tests/data/$BITNESS$ENDIAN/complex/complex_e-$BITNESS.ko \
23 $MODULE_DIR
25 # Expect no output.
26 [ "`depmod 2>&1`" = "" ]
28 # Check results: expect 5 lines
29 [ `grep -vc '^#' < $MODULE_DIR/modules.dep` = 5 ]
31 # Could be a: c d b e or A: d c b e.
32 [ "`grep -w complex_a-$BITNESS.ko: $MODULE_DIR/modules.dep`" = "complex_a-$BITNESS.ko: complex_c-$BITNESS.ko complex_d-$BITNESS.ko complex_b-$BITNESS.ko complex_e-$BITNESS.ko" ] || [ "`grep -w complex_a-$BITNESS.ko: $MODULE_DIR/modules.dep`" = "complex_a-$BITNESS.ko: complex_d-$BITNESS.ko complex_c-$BITNESS.ko complex_b-$BITNESS.ko complex_e-$BITNESS.ko" ]
34 [ "`grep -w complex_b-$BITNESS.ko: $MODULE_DIR/modules.dep`" = "complex_b-$BITNESS.ko: complex_e-$BITNESS.ko" ]
36 [ "`grep -w complex_c-$BITNESS.ko: $MODULE_DIR/modules.dep`" = "complex_c-$BITNESS.ko: complex_b-$BITNESS.ko complex_e-$BITNESS.ko" ]
38 [ "`grep -w complex_d-$BITNESS.ko: $MODULE_DIR/modules.dep`" = "complex_d-$BITNESS.ko: complex_b-$BITNESS.ko complex_e-$BITNESS.ko" ]
40 [ "`grep -w complex_e-$BITNESS.ko: $MODULE_DIR/modules.dep`" = "complex_e-$BITNESS.ko:" ]
42 mv $MODULE_DIR/modules.dep $MODULE_DIR/modules.dep.old
43 mv $MODULE_DIR/modules.symbols $MODULE_DIR/modules.symbols.old
45 # Synonyms
46 [ "`depmod -a`" = "" ]
47 diff -u $MODULE_DIR/modules.dep.old $MODULE_DIR/modules.dep
48 mv $MODULE_DIR/modules.dep $MODULE_DIR/modules.dep.old
50 [ "`depmod -A`" = "" ]
51 diff -u $MODULE_DIR/modules.dep.old $MODULE_DIR/modules.dep
52 mv $MODULE_DIR/modules.dep $MODULE_DIR/modules.dep.old
54 [ "`depmod -e -A`" = "" ]
55 diff -u $MODULE_DIR/modules.dep.old $MODULE_DIR/modules.dep
56 mv $MODULE_DIR/modules.dep $MODULE_DIR/modules.dep.old
58 [ "`depmod -e -A $MODTEST_VERSION`" = "" ]
59 diff -u $MODULE_DIR/modules.dep.old $MODULE_DIR/modules.dep
60 mv $MODULE_DIR/modules.dep $MODULE_DIR/modules.dep.old
62 # Combined should form stdout versions.
63 grep -vh '^#' $MODULE_DIR/modules.dep.old $MODULE_DIR/modules.symbols.old > $MODULE_DIR/modules.all.old
65 # Stdout versions.
66 depmod -n | grep -v '^#' > $MODULE_DIR/modules.all
67 diff -u $MODULE_DIR/modules.all.old $MODULE_DIR/modules.all
68 mv $MODULE_DIR/modules.all $MODULE_DIR/modules.all.old
70 depmod -a -n | grep -v '^#' > $MODULE_DIR/modules.all
71 diff -u $MODULE_DIR/modules.all.old $MODULE_DIR/modules.all
72 mv $MODULE_DIR/modules.all $MODULE_DIR/modules.all.old
74 depmod -n -a $MODTEST_VERSION | grep -v '^#' > $MODULE_DIR/modules.all
75 diff -u $MODULE_DIR/modules.all.old $MODULE_DIR/modules.all
76 mv $MODULE_DIR/modules.all $MODULE_DIR/modules.all.old
78 depmod -e -n -A $MODTEST_VERSION | grep -v '^#' > $MODULE_DIR/modules.all
79 diff -u $MODULE_DIR/modules.all.old $MODULE_DIR/modules.all
80 mv $MODULE_DIR/modules.all $MODULE_DIR/modules.all.old
82 done
83 done