github.com/ssube/gitlab-ci-multi-runner@v1.2.1-0.20160607142738-b8d1285632e6/tests/test_script.sh (about)

     1  #!/bin/bash
     2  
     3  set -e
     4  USER="$1"
     5  
     6  status() {
     7  	pidof gitlab-ci-multi-runner
     8  }
     9  
    10  echo Checking existence of $USER...
    11  id -u "$USER"
    12  
    13  echo Check if /etc/gitlab-runner/config.toml is created...
    14  if [[ -f /etc/gitlab-runner/config.toml ]]; then
    15  	CONFIG=$(ls -al /etc/gitlab-runner | grep config.toml)
    16  	echo $CONFIG | grep "\-rw-------"
    17  	echo $CONFIG | grep "root root"
    18  fi
    19  
    20  echo List of processes:
    21  ps auxf
    22  echo
    23  
    24  echo Checking if runner is running...
    25  status
    26  echo
    27  
    28  echo Testing help...
    29  gitlab-runner --help > /dev/null
    30  echo
    31  
    32  echo Stopping runner...
    33  gitlab-runner stop
    34  ! status
    35  echo
    36  
    37  echo Starting runner...
    38  gitlab-runner start
    39  sleep 1s
    40  status
    41  echo
    42  
    43  #echo Registering runner...
    44  #gitlab-runner register -n -u https://ci.gitlab.com/ -r 51cc1fe15c0ac7d3d5564e24ada4d1
    45  #echo
    46  
    47  echo Checking su...
    48  echo id | su --shell /bin/bash --login "$USER"