summaryrefslogtreecommitdiff
path: root/tests/09_chardev_add_remove.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/09_chardev_add_remove.sh')
-rwxr-xr-xtests/09_chardev_add_remove.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/09_chardev_add_remove.sh b/tests/09_chardev_add_remove.sh
new file mode 100755
index 0000000..cb4212c
--- /dev/null
+++ b/tests/09_chardev_add_remove.sh
@@ -0,0 +1,27 @@
+#!/bin/bash
+
+TEST_ID="09"
+TEST_NAME="Character device add and remove"
+
+CREATE=`pwd`/$1
+DEPLOY=`pwd`/$2
+TEST_TOOLS=$3
+
+. ./test_lib.sh
+
+############# Test specific code ############
+
+setup () {
+ #make a node with the same numbers as /dev/null
+ setup_block_major_minor="`stat /dev/null -c '%t %T'`"
+ mknod $ORIGIN/toremove c $setup_block_major_minor
+ mknod $TARGET/toadd c $setup_block_major_minor
+}
+
+check_results () {
+ test -c $ORIGIN/toadd &&
+ test ! -c $ORIGIN/toremove
+}
+
+#############################################
+main $@