depmod: fix tabs in help output
[module-init-tools.git] / tests / test-depmod / 09alias.sh
blob05741fcb400959ffc6930cfd92e2784c7018f730
1 #! /bin/sh
3 # Test alias generation.
4 for ENDIAN in $TEST_ENDIAN; do
5 for BITNESS in $TEST_BITS; do
7 rm -rf tests/tmp/*
9 # Create inputs
10 MODULE_DIR=tests/tmp/lib/modules/$MODTEST_UNAME
11 mkdir -p $MODULE_DIR
12 ln tests/data/$BITNESS$ENDIAN/alias/alias-$BITNESS.ko \
13 $MODULE_DIR
15 # Expect no normal output.
16 [ "`depmod 2>&1`" = "" ]
18 # Check results: expect 2 lines.
19 [ `grep -vc '^#' < $MODULE_DIR/modules.alias` = 2 ]
21 [ "`grep alias1 < $MODULE_DIR/modules.alias`" = "alias alias1 alias_$BITNESS" ]
22 [ "`grep alias2 < $MODULE_DIR/modules.alias`" = "alias alias2 alias_$BITNESS" ]
24 # Version with stuff in .modinfo section.
26 rm -rf tests/tmp/*
28 mkdir -p $MODULE_DIR
29 ln tests/data/$BITNESS$ENDIAN/modinfo/modinfo-$BITNESS.ko \
30 $MODULE_DIR
32 # Expect no normal output.
33 [ "`depmod 2>&1`" = "" ]
35 # Check results: expect 2 lines.
36 [ `grep -vc '^#' < $MODULE_DIR/modules.alias` = 2 ]
38 [ "`grep ALIAS1 < $MODULE_DIR/modules.alias`" = "alias ALIAS1 modinfo_$BITNESS" ]
39 [ "`grep ALIAS2 < $MODULE_DIR/modules.alias`" = "alias ALIAS2 modinfo_$BITNESS" ]
41 done
42 done