github.com/singularityware/singularity@v3.1.1+incompatible/docs/2.x-tests/31-action_uris.sh (about) 1 #!/bin/bash 2 # 3 # Copyright (c) 2015-2016, Gregory M. Kurtzer. All rights reserved. 4 # 5 # "Singularity" Copyright (c) 2016, The Regents of the University of California, 6 # through Lawrence Berkeley National Laboratory (subject to receipt of any 7 # required approvals from the U.S. Dept. of Energy). All rights reserved. 8 # 9 # This software is licensed under a customized 3-clause BSD license. Please 10 # consult LICENSE file distributed with the sources of this project regarding 11 # your rights to use or distribute this software. 12 # 13 # NOTICE. This Software was developed under funding from the U.S. Department of 14 # Energy and the U.S. Government consequently retains certain rights. As such, 15 # the U.S. Government has been granted for itself and others acting on its 16 # behalf a paid-up, nonexclusive, irrevocable, worldwide license in the Software 17 # to reproduce, distribute copies to the public, prepare derivative works, and 18 # perform publicly and display publicly, and to permit other to do so. 19 # 20 # 21 22 23 24 . ./functions 25 26 test_init "Action URI tests" 27 28 29 30 CONTAINER="$SINGULARITY_TESTDIR/container.img" 31 32 NO_XZ=false 33 if [ ! $(which xz) ]; then 34 NO_XZ=true 35 echo "Not testing with xz, not installed\n" 36 fi 37 38 # Testing Docker URI 39 stest 0 singularity exec docker://busybox true 40 stest 1 singularity exec docker://busybox false 41 42 # Creating a new container 43 stest 0 sudo singularity build "$CONTAINER" "../examples/busybox/Singularity" 44 45 # Creating tarball archives 46 stest 0 sh -c "singularity image.export "$CONTAINER" | gzip -c - > \"$CONTAINER.tar.gz\"" 47 stest 0 sh -c "singularity image.export "$CONTAINER" | bzip2 -c - > \"$CONTAINER.tar.bz2\"" 48 49 $NO_XZ || stest 0 sh -c "singularity image.export "$CONTAINER" | xz -c - > \"$CONTAINER.tar.xz\"" 50 51 # Testing tarball archives 52 stest 0 singularity exec "$CONTAINER.tar.gz" true 53 stest 0 singularity exec "$CONTAINER.tar.bz2" true 54 55 $NO_XZ || stest 0 singularity exec "$CONTAINER.tar.xz" true 56 57 # Testing automatic algorithm detection 58 stest 0 mv "$CONTAINER.tar.gz" "$CONTAINER.tar.bz2" 59 stest 0 singularity exec "$CONTAINER.tar.bz2" true 60 61 62 test_cleanup 63