github.com/singularityware/singularity@v3.1.1+incompatible/docs/2.x-tests/23-pull.sh (about) 1 #!/bin/bash 2 # 3 # Copyright (c) 2017-2018, SyLabs, Inc. All rights reserved. 4 # Copyright (c) 2017, SingularityWare, LLC. All rights reserved. 5 # 6 # See the COPYRIGHT.md file at the top-level directory of this distribution and at 7 # https://github.com/sylabs/singularity/blob/master/COPYRIGHT.md. 8 # 9 # This file is part of the Singularity Linux container project. It is subject to the license 10 # terms in the LICENSE.md file found in the top-level directory of this distribution and 11 # at https://github.com/sylabs/singularity/blob/master/LICENSE.md. No part 12 # of Singularity, including this file, may be copied, modified, propagated, or distributed 13 # except according to the terms contained in the LICENSE.md file. 14 # 15 # 16 17 18 . ./functions 19 20 test_init "Pull tests" 21 22 cd "$SINGULARITY_TESTDIR" 23 24 stest 0 sudo singularity pull --size 10 docker://busybox 25 CONTAINER=busybox.simg 26 stest 0 singularity exec "$CONTAINER" true 27 stest 1 singularity exec "$CONTAINER" false 28 stest 0 singularity exec "$CONTAINER" test -f /.singularity.d/runscript 29 stest 0 singularity exec "$CONTAINER" test -f /.singularity.d/env/01-base.sh 30 stest 0 singularity exec "$CONTAINER" test -f /.singularity.d/actions/shell 31 stest 0 singularity exec "$CONTAINER" test -f /.singularity.d/actions/exec 32 stest 0 singularity exec "$CONTAINER" test -f /.singularity.d/actions/run 33 stest 0 singularity exec "$CONTAINER" test -L /environment 34 stest 0 singularity exec "$CONTAINER" test -L /singularity 35 36 # should fail b/c we already pulled busybox 37 stest 1 sudo singularity pull --size 10 docker://busybox 38 39 # force should fix 40 stest 0 sudo singularity pull --force --size 10 docker://busybox 41 42 stest 0 sudo rm -rf "${CONTAINER}" 43 44 stest 1 singularity pull docker://this_should_not/exist 45 46 test_cleanup