Skip to content

Commit

Permalink
Merge branch 'travisdocker-mine' into 'travis-docker'
Browse files Browse the repository at this point in the history
  • Loading branch information
remram44 committed May 7, 2015
2 parents 7394248 + c0a6860 commit b74b85d
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 1 deletion.
9 changes: 9 additions & 0 deletions .travis/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@ in
/tmp/rpz2.7/bin/pip install ./reprozip
fi
sudo apt-get update -qq
sudo sh -c "wget -qO- https://get.docker.io/gpg | apt-key add -"
sudo sh -c "echo deb http://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
sudo apt-get update
sudo mkdir -p /var/lib/docker
echo exit 101 | sudo tee /usr/sbin/policy-rc.d
sudo chmod +x /usr/sbin/policy-rc.d
sudo apt-get install -y slirp lxc lxc-docker aufs-tools cgroup-lite
curl -sLo linux https://github.com/jpetazzo/sekexe/raw/master/uml
chmod +x linux
sudo apt-get install -qq libc6-dev-i386 gcc-multilib
pip install 'git+https://github.com/remram44/rpaths.git#egg=rpaths'
pip install 'git+https://github.com/remram44/usagestats.git#egg=usagestats'
Expand Down
2 changes: 1 addition & 1 deletion .travis/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ in
export PYTHONUNBUFFERED=1
if [ "$TEST_MODE" = "coverage_py" ]; then export COVER="coverage run --append --source=$PWD/reprozip/reprozip,$PWD/reprounzip/reprounzip,$PWD/reprounzip-vagrant/reprounzip --branch"; fi
if [ $TRAVIS_PYTHON_VERSION = "2.6" ]; then export REPROZIP_PYTHON=/tmp/rpz2.7/bin/python; fi
python tests
sudo ./linux quiet mem=2G rootfstype=hostfs rw eth0=slirp,,/usr/bin/slirp-fullbolt init=$(pwd)/.travis/uml.sh WORKDIR=$(pwd) HOME=$HOME
;;
check_style)
flake8 --ignore=E126,E731 reprozip/reprozip reprounzip/reprounzip reprounzip-*/reprounzip
Expand Down
65 changes: 65 additions & 0 deletions .travis/uml.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#!/bin/bash

# Exit on first error
set -e


save_and_shutdown() {
# save built for host result
# force clean shutdown
halt -f
}

# make sure we shut down cleanly
trap save_and_shutdown EXIT SIGINT SIGTERM

# go back to where we were invoked
cd $WORKDIR

# configure path to include /usr/local
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

# can't do much without proc!
mount -t proc none /proc

# pseudo-terminal devices
mkdir -p /dev/pts
mount -t devpts none /dev/pts

# shared memory a good idea
mkdir -p /dev/shm
mount -t tmpfs none /dev/shm

# sysfs a good idea
mount -t sysfs none /sys

# pidfiles and such like
mkdir -p /var/run
mount -t tmpfs none /var/run

# takes the pain out of cgroups
cgroups-mount

# mount /var/lib/docker with a tmpfs
mount -t tmpfs none /var/lib/docker

# enable ipv4 forwarding for docker
echo 1 > /proc/sys/net/ipv4/ip_forward

# configure networking
ip addr add 127.0.0.1 dev lo
ip link set lo up
ip addr add 10.1.1.1/24 dev eth0
ip link set eth0 up
ip route add default via 10.1.1.254

# configure dns (google public)
mkdir -p /run/resolvconf
echo 'nameserver 8.8.8.8' > /run/resolvconf/resolv.conf
mount --bind /run/resolvconf/resolv.conf /etc/resolv.conf

# Start docker daemon
docker -d &
sleep 5

python tests --run-docker

0 comments on commit b74b85d

Please sign in to comment.