summaryrefslogtreecommitdiff
path: root/tests/fake_mounting_script.sh
diff options
context:
space:
mode:
authorTiago Gomes <tiago.gomes@codethink.co.uk>2013-06-17 21:57:45 +0000
committerTiago Gomes <tiago.gomes@codethink.co.uk>2013-07-01 16:50:46 +0000
commit4fb1c1b0e8ca8510c76d849e3b330c52934bca16 (patch)
tree047314f32e725fc347b211df3e009a3b024951c2 /tests/fake_mounting_script.sh
parentaac14e2efc8d427760f29ca8878552e9cb509536 (diff)
downloadtbdiff-4fb1c1b0e8ca8510c76d849e3b330c52934bca16.tar.gz
Remove test mode and provide hooks to use a test suite.
Tests will now be handled by a test suite in a future commit, so this mode will not be needed anymore. The test suite will work by replacing the mounting script by a fake mounting script that points to a directory with a systems folder. Also add trap again, now that it is more tested.
Diffstat (limited to 'tests/fake_mounting_script.sh')
-rwxr-xr-xtests/fake_mounting_script.sh36
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/fake_mounting_script.sh b/tests/fake_mounting_script.sh
new file mode 100755
index 0000000..4bb95f6
--- /dev/null
+++ b/tests/fake_mounting_script.sh
@@ -0,0 +1,36 @@
+#!/bin/sh
+#
+# Copyright (c) 2013 Codethink Ltd.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License Version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+set -eu
+
+
+usage() {
+ echo usage: "$(basename $0) fake_mounting_point" >&2
+ exit 1
+}
+
+
+
+if [ "$#" != 1 ]; then
+ usage $0
+fi
+
+
+fake_mounting_point="$1"
+
+cp -a "$mounting_script_test_dir"/* "$fake_mounting_point"
+