blob: 4389c8e4b8b494cbb4b89ded0c46f8701e2297d3 [file] [log] [blame]
Adam Israelb0943662018-08-02 15:32:00 -04001dist: xenial
Adam Israeldcdf82b2017-08-15 15:26:43 -04002sudo: required
3language: python
Adam Israelb0943662018-08-02 15:32:00 -04004cache: pip
Adam Israeldcdf82b2017-08-15 15:26:43 -04005before_install:
Adam Israelb0943662018-08-02 15:32:00 -04006 - if [[ $TRAVIS_PYTHON_VERSION == '3.6' ]]; then sudo add-apt-repository -y ppa:jonathonf/python-3.6; fi
7 - if [[ $TRAVIS_PYTHON_VERSION == '3.7-dev' ]]; then sudo add-apt-repository -y ppa:deadsnakes/ppa; fi
Adam Israeldcdf82b2017-08-15 15:26:43 -04008 - sudo apt-get update -q
Adam Israelc3e6c2e2018-03-01 09:31:50 -05009 - sudo apt-get remove -qy lxd lxd-client
10 - sudo apt-get install snapd libsodium-dev -y
Adam Israelb0943662018-08-02 15:32:00 -040011install:
12 - sudo snap install lxd || true # ignore failures so that unit tests will still run, at least
13 - sudo sh -c 'echo PATH=/snap/bin:$PATH >> /etc/environment';
14 - sudo snap install jq || true
15 - sudo snap install juju --classic --$JUJU_CHANNEL || true
Adam Israelc3e6c2e2018-03-01 09:31:50 -050016 - sudo snap install juju-wait --classic || true
Adam Israelb0943662018-08-02 15:32:00 -040017 - pip install tox-travis
Adam Israeldcdf82b2017-08-15 15:26:43 -040018env:
Adam Israelc3e6c2e2018-03-01 09:31:50 -050019 global: >
20 TEST_AGENTS='{"agents":[{"url":"https://api.staging.jujucharms.com/identity","username":"libjuju-ci@yellow"}],"key":{"private":"88OOCxIHQNguRG7zFg2y2Hx5Ob0SeVKKBRnjyehverc=","public":"fDn20+5FGyN2hYO7z0rFUyoHGUnfrleslUNtoYsjNSs="}}'
Adam Israelb0943662018-08-02 15:32:00 -040021 LXD_PASSWORD="password"
22 PATH="/snap/bin:$PATH"
23
24matrix:
25 include:
26 - python: 3.6
27 env: JUJU_CHANNEL=edge
28 - python: 3.6
29 env: JUJU_CHANNEL=stable
30 - python: 3.7-dev
31 env: JUJU_CHANNEL=stable
32 - python: 3.7-dev
33 env: JUJU_CHANNEL=edge
34before_script:
35 - sudo lxd waitready --timeout 30
36 - sudo lxc storage create default dir
37 - sudo lxd init --auto --trust-password="${LXD_PASSWORD}" --network-address='[::]' --network-port=8443
38
39 # I suspect these could be integrated into the lxd init call
40 - sudo sudo mkdir /var/snap/lxd/common/lxd/storage-pools/juju-zfs
41 - sudo lxc storage create juju-zfs dir source=/var/snap/lxd/common/lxd/storage-pools/juju-zfs # Horrible workaround to LP Bug #1738614
42
43 - sudo addgroup lxd || true
44 - sudo usermod -a -G lxd $USER || true
45 # Trigger generation of the client certificates
46 - sg lxd -c "echo y|lxc remote add "$USER" https://0.0.0.0:8443 --accept-certificate --password='${LXD_PASSWORD}'"
47
Adam Israeldcdf82b2017-08-15 15:26:43 -040048script:
Adam Israelb0943662018-08-02 15:32:00 -040049 - sudo -E sudo -u $USER -E juju bootstrap localhost test --config 'identity-url=https://api.staging.jujucharms.com/identity' --config 'allow-model-access=true'
50 - tox -e py3,integration,serial