6 - 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
8 - sudo apt-get update -q
9 - sudo apt-get remove -qy lxd lxd-client
10 - sudo apt-get install snapd libsodium-dev -y
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
16 - sudo snap install juju-wait --classic || true
17 - pip install tox-travis
20 TEST_AGENTS='{"agents":[{"url":"https://api.staging.jujucharms.com/identity","username":"libjuju-ci@yellow"}],"key":{"private":"88OOCxIHQNguRG7zFg2y2Hx5Ob0SeVKKBRnjyehverc=","public":"fDn20+5FGyN2hYO7z0rFUyoHGUnfrleslUNtoYsjNSs="}}'
21 PATH="/snap/bin:$PATH"
26 env: JUJU_CHANNEL=edge
28 env: JUJU_CHANNEL=stable
30 env: JUJU_CHANNEL=stable
32 env: JUJU_CHANNEL=edge
34 # Run lint before performing more expensive operations (fail fast/early)
38 - sudo lxd waitready --timeout 30
39 - sudo chmod 666 /var/snap/lxd/common/lxd/unix.socket
40 - lxd init --auto --network-address='[::]' --network-port=8443 --storage-backend=dir
42 # Horrible workaround to LP Bug #1738614
43 - sudo mkdir /var/snap/lxd/common/lxd/storage-pools/juju-zfs
44 - lxc storage create juju-zfs dir source=/var/snap/lxd/common/lxd/storage-pools/juju-zfs
47 - juju bootstrap localhost test --config 'identity-url=https://api.staging.jujucharms.com/identity' --config 'allow-model-access=true'
48 - tox -e py3,integration,serial