Blame docker-run_tests.sh

Athmane Madjoudj 00760a
#!/bin/bash 
Athmane Madjoudj 00760a
# A script to test the official CentOS docker-images.
Athmane Madjoudj 00760a
# Author: Athmane Madjoudj <athmane@fedoraproject.org>
Athmane Madjoudj 00760a
Athmane Madjoudj 00760a
EPEL6_RELEASE_URL = "http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm"
Athmane Madjoudj 00760a
EPEL6_GPGKEY_URL = "https://fedoraproject.org/static/0608B895.txt"
Athmane Madjoudj 00760a
Athmane Madjoudj 00760a
enable_epel() {
Athmane Madjoudj 00760a
    yum -y install wget openssh-clients
Athmane Madjoudj 00760a
    cd /root 
Athmane Madjoudj 00760a
    wget  "$EPEL6_RELEASE_URL"
Athmane Madjoudj 00760a
    rpm --import  "$EPEL6_GPGKEY_URL"
Athmane Madjoudj 00760a
    yum -y localinstall /root/epel-release*.rpm
Athmane Madjoudj 00760a
}
Athmane Madjoudj 00760a
Athmane Madjoudj 00760a
setup_docker() {
Athmane Madjoudj 00760a
    yum -y install docker-io
Athmane Madjoudj 00760a
    service docker start
Athmane Madjoudj 00760a
    chkconfig docker on
Athmane Madjoudj 00760a
}
Athmane Madjoudj 00760a
Athmane Madjoudj 00760a
test_get_centos_img() {
Athmane Madjoudj 00760a
    docker pull centos
Athmane Madjoudj 00760a
}
Athmane Madjoudj 00760a
Athmane Madjoudj 00760a
test_centos_img_runcmd() {
Athmane Madjoudj 00760a
    docker run centos cat /etc/centos-release | grep 'CentOS'
Athmane Madjoudj 00760a
}
Athmane Madjoudj 00760a
Athmane Madjoudj 00760a
run_tests() {
Athmane Madjoudj 00760a
    test_get_centos_img
Athmane Madjoudj 00760a
    test_centos_img_runcmd
Athmane Madjoudj 00760a
}
Athmane Madjoudj 00760a
Athmane Madjoudj 00760a
# Main
Athmane Madjoudj 00760a
Athmane Madjoudj 00760a
enable_epel
Athmane Madjoudj 00760a
setup_docker
Athmane Madjoudj 00760a
run_tests
Athmane Madjoudj 00760a