github.com/cvmfs/docker-graphdriver@v0.0.0-20181206110523-155ec6df0521/tests/run.sh (about) 1 #!/bin/bash 2 export DOCKER_VERSIONS=( 3 "17.05.0-ce" 4 "17.04.0-ce" 5 "17.03.1-ce" 6 "17.03.0-ce" 7 "1.13.1" 8 # "1.13.0" 9 ) 10 11 export GRAPHDRIVERS=( 12 "aufs_cvmfs" 13 "overlay2_cvmfs" 14 ) 15 16 function init() { 17 export ROOT_DIR="$(git rev-parse --show-toplevel)" 18 export BINARIES="$ROOT_DIR/binaries" 19 20 export TESTS="$ROOT_DIR/tests" 21 export WORKSPACE="$ROOT_DIR/workspace" 22 23 export CACHE="$WORKSPACE/cache" 24 export SCRATCH="$WORKSPACE/scratch" 25 26 export GOPATH="$CACHE/gopath" 27 28 export GRAPHDRIVERS_REPO_URL="github.com/cvmfs/docker-graphdriver" 29 export GRAPH_PLUGIN_ROOTFS_TAR="$CACHE/data/ubuntu_cvmfs-2.4.x_rootfs-2.tar.bz2" 30 export GRAPH_PLUGIN_CONFIG="$CACHE/data/config.json" 31 export DOCKERHUB_URL="nhardi-cc7-ansible.cern.ch" 32 33 mkdir -p "$CACHE" "$SCRATCH" "$GOPATH" 34 35 . "$TESTS/utils/docker.sh" 36 . "$TESTS/utils/graph.sh" 37 . "$TESTS/utils/discovery.sh" 38 39 download_rootfs 40 } 41 42 function destroy() { 43 sudo rm -rf $SCRATCH/* 44 sudo rm -rf /usr/local/bin/* 45 } 46 47 function scratch_cleanup() { 48 sudo rm -rf $SCRATCH/* 49 } 50 51 # run tests 52 # - normal 53 # - paranoid 54 # - full 55 function run_tests() { 56 local filter="$1" 57 status=0 58 59 for docker_v in ${DOCKER_VERSIONS[@]} 60 do 61 echo "Using docker: $docker_v" 62 63 scratch_cleanup 64 setup_docker "$docker_v" 65 66 for graphdriver_plugin in "${GRAPHDRIVERS[@]}" 67 do 68 export PLUGIN_NAME="atlantic777/$graphdriver_plugin" 69 echo "Using plugin: $PLUGIN_NAME" 70 71 setup_graphdriver "$graphdriver_plugin" 72 run_test_suite "$filter" 73 let "status += $?" 74 done 75 done 76 } 77 78 filter="$1" 79 init 80 run_tests "$filter" 81 destroy 82 83 if [ "x$status" != "x0" ] 84 then 85 exit -1 86 else 87 exit 0 88 fi