github.com/singularityware/singularity@v3.1.1+incompatible/docs/2.x-tests/35-userbinds.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 "Testing user binds" 27 28 29 30 CONTAINER="$SINGULARITY_TESTDIR/container.img" 31 32 # Creating a new container 33 stest 0 sudo singularity build "$CONTAINER" "../examples/busybox/Singularity" 34 35 stest 0 touch /tmp/hello_world_test 36 stest 0 singularity exec -B /tmp:/var/tmp "$CONTAINER" test -f /var/tmp/hello_world_test 37 38 if [ "x${SINGULARITY_OVERLAY_FS}" = "x1" ]; then 39 stest 0 singularity exec -B /tmp:/nonexistent "$CONTAINER" test -f /nonexistent/hello_world_test 40 fi 41 42 stest 0 rm -f /tmp/hello_world_test 43 44 test_cleanup 45