12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- #
- # Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies).
- # All rights reserved.
- # This component and the accompanying materials are made available
- # under the terms of the License "Eclipse Public License v1.0"
- # which accompanies this distribution, and is available
- # at the URL "http://www.eclipse.org/legal/epl-v10.html".
- #
- # Initial Contributors:
- # Nokia Corporation - initial contribution.
- #
- # Contributors:
- #
- # Description:
- #
- # Test environment setup script for caseless fuse filesystem.
- # This script should be sourced rather than executed (hence
- # no #! at the top).
- # The functions cleanup and init are used to set up and tear
- # down the test directories and mounts.
- # the doit function is used to wrap tests
- CFBIN=./caseless-fuse
- MOUNTSOURCE=$PWD/test_source
- MOUNTPOINT=$PWD/test_mount
- FUSEOPTS="-o big_writes,direct_io,max_write=$[ 1024*1024*1024 ]"
- export CFBIN MOUNTSOURCE MOUNTPOINT FUSEOPTS
- doit() {
- FSTESTNAME="$1"
- echo "$1 : {"
- CMDS=""
- read C
- while [ $? -eq 0 ]; do
- CMDS="$CMDS $C"
- read C
- done
- set -x
- eval "$CMDS"
- rv=$?
- set +x
- echo "}"
- return $rv
- }
- init() {
- doit "init" <<EOT1
- mkdir "$MOUNTPOINT" &&
- mkdir "$MOUNTSOURCE" && set -x &&
- "$CFBIN" $FUSEOPTS "$MOUNTPOINT" "$MOUNTSOURCE" ; echo "init state: $?"
- EOT1
- }
- cleanup() {
- doit "cleanup" <<EOT2
- fusermount -u "$MOUNTPOINT";
- rm -rf "$MOUNTPOINT"
- rm -rf "$MOUNTSOURCE"
- EOT2
- }
|