github.com/blixtra/rkt@v0.8.1-0.20160204105720-ab0d1add1a43/tests/cloudinit/centos.cloudinit (about)

     1  #!/bin/bash
     2  cat > /var/tmp/rkt-test.sh <<TESTEOF
     3  #!/bin/bash
     4  
     5  set -e
     6  set -x
     7  
     8  # Sometimes journald does not work on CentOS :-(
     9  exec > >(tee -a "/var/tmp/rkt-test.log") 2>&1
    10  
    11  groupadd rkt
    12  gpasswd -a centos rkt
    13  
    14  #yum update -y
    15  yum -y -v install epel-release # Needed for golang-vet and golang-cover
    16  yum -y -v groupinstall "Development Tools"
    17  yum -y -v install wget squashfs-tools patch glibc-static gnupg golang libacl-devel golang-vet golang-cover
    18  
    19  # # No need to do that with CentOS's go1.4.2
    20  # # https://github.com/coreos/rkt/pull/1877#issuecomment-169614067
    21  # GOPATH=/tmp /usr/bin/go get golang.org/x/tools/cmd/vet
    22  # GOPATH=/tmp /usr/bin/go get golang.org/x/tools/cmd/cover
    23  
    24  /usr/sbin/setenforce 0
    25  
    26  # unsquashfs is in /usr/sbin
    27  export PATH=/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/centos/.local/bin:/home/centos/bin
    28  
    29  # sudo/su without tty is disabled on old CentOS.
    30  # https://bugzilla.redhat.com/show_bug.cgi?id=1020147
    31  # Cannot workaround with /usr/bin/expect because this would need expect > 2.27
    32  sed -i 's/ requiretty$/ !requiretty/g' /etc/sudoers
    33  
    34  su - centos --command="cd /var/tmp ; git clone --branch @GIT_BRANCH@ @GIT_URL@ rkt"
    35  su - centos --command="PATH=\$PATH ; cd /var/tmp/rkt ; ./tests/run-build.sh coreos"
    36  TESTEOF
    37  
    38  chmod +x /var/tmp/rkt-test.sh
    39  
    40  systemd-run --unit=rkt-test /var/tmp/rkt-test.sh