github.com/singularityware/singularity@v3.1.1+incompatible/docs/2.x-tests/25-environment.sh (about)

     1  #!/bin/bash
     2  # 
     3  # Copyright (c) 2017-2018, SyLabs, Inc. All rights reserved.
     4  # 
     5  # See the COPYRIGHT.md file at the top-level directory of this distribution and at
     6  # https://github.com/sylabs/singularity/blob/master/COPYRIGHT.md.
     7  # 
     8  # This file is part of the Singularity Linux container project. It is subject to the license
     9  # terms in the LICENSE.md file found in the top-level directory of this distribution and
    10  # at https://github.com/sylabs/singularity/blob/master/LICENSE.md. No part
    11  # of Singularity, including this file, may be copied, modified, propagated, or distributed
    12  # except according to the terms contained in the LICENSE.md file.
    13  #
    14  #
    15  
    16  . ./functions
    17  
    18  test_init "Environment tests"
    19  
    20  # No Dockerfile custom path, No SINGULARITYENV_* variables 
    21  stest 0 singularity exec docker://alpine:3.8 env | grep -q \
    22      PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
    23  
    24  # Dockerfile custom path, No SINGULARITYENV_* variables 
    25  stest 0 singularity exec docker://godlovedc/lolcow env | grep -q \
    26      PATH=/usr/games:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
    27  
    28  # No Dockerfile custom path, Set SINGULARITYENV_PREPEND_PATH
    29  export SINGULARITYENV_PREPEND_PATH=/foo
    30  stest 0 singularity exec docker://alpine:3.8 env | grep -q \
    31      PATH=/foo:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
    32  
    33  # Dockerfile custom path, Set SINGULARITYENV_PREPEND_PATH
    34  stest 0 singularity exec docker://godlovedc/lolcow env | grep -q \
    35      PATH=/foo:/usr/games:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
    36  
    37  # No Dockerfile custom path, Set SINGULARITYENV_APPEND_PATH
    38  export SINGULARITYENV_APPEND_PATH=/bar
    39  stest 0 singularity exec docker://alpine:3.8 env | grep -q \
    40      PATH=/foo:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/bar
    41  
    42  # Dockerfile custom path, Set SINGULARITYENV_APPEND_PATH
    43  stest 0 singularity exec docker://godlovedc/lolcow env | grep -q \
    44      PATH=/foo:/usr/games:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/bar
    45  
    46  # No Dockerfile custom path, Set SINGULARITYENV_PATH
    47  export SINGULARITYENV_PATH=/usr/bin:/bin
    48  stest 0 singularity exec docker://alpine:3.8 env | grep -q \
    49      PATH=/usr/bin:/bin
    50  
    51  # Dockerfile custom path, Set SINGULARITYENV_PATH
    52  stest 0 singularity exec docker://godlovedc/lolcow env | grep -q \
    53      PATH=/usr/bin:/bin
    54  
    55  test_cleanup