1 <!-- Copyright 2021 Canonical Ltd.
3 Licensed under the Apache License, Version 2.0 (the "License"); you may
4 not use this file except in compliance with the License. You may obtain
5 a copy of the License at
7 http://www.apache.org/licenses/LICENSE-2.0
9 Unless required by applicable law or agreed to in writing, software
10 distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11 WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12 License for the specific language governing permissions and limitations
15 For those usages not covered by the Apache License, Version 2.0 please
16 contact: legal@canonical.com
18 To get in touch with the maintainers, please contact:
19 osm-charmers@lists.launchpad.net -->
23 Zookeeper for Juju CAAS
28 The tests of this charm are done using tox and Zaza.
32 ### Prepare environment
34 The machine in which the tests are run needs access to a juju k8s controller. The easiest way to approach this is by executing the following commands:
37 sudo apt install tox -y
38 sudo snap install microk8s --classic
39 sudo snap install juju
41 microk8s.status --wait-ready
42 microk8s.enable storage dashboard dns
44 juju bootstrap microk8s k8s-cloud
47 If /usr/bin/python does not exist, you should probably need to do this:
49 sudo ln -s /usr/bin/python3 /usr/bin/python
54 **Download dependencies:**
56 mkdir -p ~/charm/layers ~/charm/builds
58 git clone https://git.launchpad.net/charm-k8s-zookeeper zookeeper-k8s
59 git clone https://git.launchpad.net/charm-osm-common osm-common
69 │ ├── spec_template.yaml
72 ├── test-requirements.txt
74 │ ├── basic_deployment.py
76 │ │ ├── zookeeper-ha.yaml
77 │ │ └── zookeeper.yaml
82 **Setup environment variables:**
85 export CHARM_LAYERS_DIR=~/charm/layers
86 export CHARM_BUILD_DIR=~/charm/builds
91 charm build ~/charm/layers/zookeeper-k8s
92 mkdir ~/charm/layers/zookeeper-k8s/tests/build/
93 mv ~/charm/builds/zookeeper-k8s ~/charm/layers/zookeeper-k8s/tests/build/
96 ### Test charm with Tox
99 cd ~/charm/layers/zookeeper-k8s