[PATCH 2/6] tests: more tests for malformed alternatives

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Keegan McAllister <keegan@xxxxxxxxxxx>
---
 tests/test-depmod/18alternatives-syntax.sh |   26 ++++++++++++++++++++++++++
 1 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/tests/test-depmod/18alternatives-syntax.sh b/tests/test-depmod/18alternatives-syntax.sh
index 7dededb..afd3c26 100755
--- a/tests/test-depmod/18alternatives-syntax.sh
+++ b/tests/test-depmod/18alternatives-syntax.sh
@@ -57,6 +57,32 @@ config /foo
 EOF
 [ "`depmod 2>&1 || echo $?`" = "WARNING: /etc/depmod.alternatives/01alt.conf line 3: malformed alternatives file" ]
 
+# Empty moduledir
+cat > $ALT_CONF <<EOF
+moduledir
+EOF
+[ "`depmod 2>&1 || echo $?`" = "WARNING: /etc/depmod.alternatives/01alt.conf line 1: malformed alternatives file" ]
+
+# Empty moduledir (trailing spaces)
+cat > $ALT_CONF <<EOF
+moduledir   
+EOF
+[ "`depmod 2>&1 || echo $?`" = "WARNING: /etc/depmod.alternatives/01alt.conf line 1: malformed alternatives file" ]
+
+# Empty config
+cat > $ALT_CONF <<EOF
+moduledir /other_lib/modules
+config
+EOF
+[ "`depmod 2>&1 || echo $?`" = "WARNING: /etc/depmod.alternatives/01alt.conf line 2: malformed alternatives file" ]
+
+# Empty config (trailing spaces)
+cat > $ALT_CONF <<EOF
+moduledir /other_lib/modules
+config   
+EOF
+[ "`depmod 2>&1 || echo $?`" = "WARNING: /etc/depmod.alternatives/01alt.conf line 2: malformed alternatives file" ]
+
 # Unreadable file
 echo > $ALT_CONF
 chmod 000 $ALT_CONF
-- 
1.7.2.3

--
To unsubscribe from this list: send the line "unsubscribe linux-modules" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux