Permalink
Browse files

Run the tests in a xenial LXC.

LP: #1532213
  • Loading branch information...
1 parent 3b8fd95 commit eab93d52b4cd5fdca8191b8e25a17285683615f9 @elopio committed Jan 6, 2016
View
@@ -18,12 +18,30 @@ env:
- TEST_SUITE="examples --skip-install"
install:
- # PPA for plainbox.
- - sudo apt-add-repository -y ppa:hardware-certification/public
+ - sudo apt-add-repository -y ppa:ubuntu-lxc/lxd-stable
- sudo apt-get update -qq
- - sudo apt-get install -qq build-essential squashfs-tools dpkg-dev plainbox pyflakes python3-apt python3-docopt python3-coverage python3-fixtures python3-jsonschema python3-mccabe python3-pep8 python3-requests python3-testscenarios python3-testtools python3-yaml python3-lxml
+ - sudo apt-get -o Dpkg::Options::="--force-confnew" -y dist-upgrade
+ - sudo apt-get install -qq lxd lxcfs
+ # newgrp will ask for a password. Use usermod and sudo -E instead, as
+ # explained in the travis docs:
+ # https://docs.travis-ci.com/user/trusty-ci-environment/#Group-membership
+ - sudo usermod -a -G lxd $USER
+before_script:
+ - sudo -E su $USER -c "lxd-images import ubuntu xenial --stream daily --alias ubuntu"
+ - sudo -E su $USER -c "lxc launch ubuntu xenial"
+ # Wait for the container to get an IP address.
+ - while ! sudo lxc info xenial | grep -q eth0.*IPV4; do sleep 5s; done
+ # Allow the container user to do everything on the repository.
+ - sudo chmod -R 777 $(pwd)
+ # Mount the repository directory in the container.
+ - sudo -E su $USER -c "lxc config device add xenial /dev/sda1 disk source=$(pwd) path=/home/ubuntu"
+ - sudo -E su $USER -c "lxc exec xenial -- apt-get update"
+ - sudo -E su $USER -c "lxc exec xenial -- apt-get install -y build-essential bzr dpkg-dev git mercurial pyflakes python3.4 python3-apt python3-docopt python3-coverage python3-fixtures python3-jsonschema python3-mccabe python3-pep8 python3-pip python3-requests python3-testscenarios python3-testtools python3-yaml python3-lxml squashfs-tools"
script:
- - ./runtests.sh $TEST_SUITE
+ - sudo -E su $USER -c "lxc exec xenial -- su - ubuntu -c 'cd /home/ubuntu; ./runtests.sh $TEST_SUITE'"
after_success:
+ - sudo apt-get install -qq python3-docopt python3-coverage python3-requests
- pip install coveralls
+ - sudo chmod 777 .coverage
+ - sudo chown $USER:$USER .coverage
- COVERALLS_REPO_TOKEN=$COVERALLS_TOKEN coveralls
View
@@ -19,6 +19,7 @@ set -e
export PATH=$(pwd)/bin:$PATH
export PYTHONPATH=$(pwd):$PYTHONPATH
+export LC_ALL=en_US.UTF-8
parseargs(){
if [[ "$#" -eq 0 ]] || [[ "$1" == "all" ]]; then
@@ -1,6 +1,6 @@
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
-# Copyright © 2015 Canonical Ltd
+# Copyright (C) 2015, 2016 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
@@ -1,6 +1,6 @@
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
-# Copyright © 2015 Canonical Ltd
+# Copyright (C) 2015, 2016 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
@@ -1,6 +1,6 @@
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
-# Copyright © 2015 Canonical Ltd
+# Copyright (C) 2015, 2016 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
@@ -1 +0,0 @@
-snapcraft/normal/.*

0 comments on commit eab93d5

Please sign in to comment.