Merge ~afreiberger/charm-juju-controller:functional-test-lxd-profile into charm-juju-controller:master

Proposed by Drew Freiberger
Status: Merged
Approved by: Alvaro Uria
Approved revision: c7987cce5857a4c91d200cce3a44e4f16a9d98cc
Merged at revision: 923c8e1b4d8cb3f948315c78b2bead4e414d54ae
Proposed branch: ~afreiberger/charm-juju-controller:functional-test-lxd-profile
Merge into: charm-juju-controller:master
Diff against target: 75 lines (+17/-3)
6 files modified
Makefile (+5/-0)
src/tests/functional/lxd-profile.yaml (+4/-0)
src/tests/functional/tests/bundles/base.yaml (+0/-1)
src/tests/functional/tests/bundles/overlays/local-charm-overlay.yaml.j2 (+3/-0)
src/tests/functional/tests/tests_juju_controller.py (+2/-1)
src/tests/unit/conftest.py (+3/-1)
Reviewer Review Type Date Requested Status
Alvaro Uria Approve
Review via email: mp+392542@code.launchpad.net

Commit message

Added lxd-profile for functional testing

To post a comment you must log in.
Drew Freiberger (afreiberger) wrote :

This creates an ubuntu charm with nested lxd-profile.yaml for functional testing in a lxd environment.

This merge proposal is being monitored by mergebot. Change the status to Approved to merge.

Drew Freiberger (afreiberger) wrote :

passed functional tests with the release of ~bootstack-charmers-next/juju-local from MR 392541.

Alvaro Uria (aluria) wrote :

lgtm.

review: Approve

Change successfully merged at revision 923c8e1b4d8cb3f948315c78b2bead4e414d54ae

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/Makefile b/Makefile
2index 0a84b5f..69cd363 100644
3--- a/Makefile
4+++ b/Makefile
5@@ -70,6 +70,11 @@ unittests:
6 @cd src && tox -e unit
7
8 functional: build
9+ @echo "Pulling prereqs for functional testing"
10+ @-rm -rf testing-charms # ignore errors as this may not exist
11+ @mkdir testing-charms
12+ @cd testing-charms && charm pull cs:ubuntu ubuntu-lxd-profile && cd ..
13+ @cp src/tests/functional/lxd-profile.yaml testing-charms/ubuntu-lxd-profile
14 @echo "Executing functional tests in ${CHARM_BUILD_DIR}"
15 @cd src && CHARM_BUILD_DIR=${CHARM_BUILD_DIR} tox -e func
16
17diff --git a/src/tests/functional/lxd-profile.yaml b/src/tests/functional/lxd-profile.yaml
18new file mode 100644
19index 0000000..56f8e4d
20--- /dev/null
21+++ b/src/tests/functional/lxd-profile.yaml
22@@ -0,0 +1,4 @@
23+# LXD Profile supporting privileged container for juju controller lxd on lxd
24+config:
25+ security.privileged: "true"
26+ security.nesting: "true"
27diff --git a/src/tests/functional/tests/bundles/base.yaml b/src/tests/functional/tests/bundles/base.yaml
28index 81a95d1..d87988f 100644
29--- a/src/tests/functional/tests/bundles/base.yaml
30+++ b/src/tests/functional/tests/bundles/base.yaml
31@@ -1,7 +1,6 @@
32 description: "juju-controller charm test bundle"
33 applications:
34 ubuntu:
35- charm: "ubuntu"
36 num_units: 1
37 juju-local:
38 charm: "cs:~bootstack-charmers-next/juju-local"
39diff --git a/src/tests/functional/tests/bundles/overlays/local-charm-overlay.yaml.j2 b/src/tests/functional/tests/bundles/overlays/local-charm-overlay.yaml.j2
40new file mode 100644
41index 0000000..4d6e8b6
42--- /dev/null
43+++ b/src/tests/functional/tests/bundles/overlays/local-charm-overlay.yaml.j2
44@@ -0,0 +1,3 @@
45+applications:
46+ ubuntu:
47+ charm: {{ CHARM_BUILD_DIR }}/../testing-charms/ubuntu-lxd-profile
48diff --git a/src/tests/functional/tests/tests_juju_controller.py b/src/tests/functional/tests/tests_juju_controller.py
49index da69629..110cb20 100644
50--- a/src/tests/functional/tests/tests_juju_controller.py
51+++ b/src/tests/functional/tests/tests_juju_controller.py
52@@ -86,7 +86,8 @@ class JujuControllerTestBase(unittest.TestCase):
53 """Deploy juju-controller charm."""
54 model.scp_to_unit(cls.unit, str(BUILT_CHARM), "/home/ubuntu", scp_opts="-r")
55 cls.run_remote_juju(
56- "deploy", "-n 3 --to 0,1,2 /home/ubuntu/juju-controller juju-controller",
57+ "deploy",
58+ "-n 3 --to 0,1,2 /home/ubuntu/juju-controller juju-controller",
59 )
60 block_until_inner_app(cls.unit, "controller", "juju-controller")
61
62diff --git a/src/tests/unit/conftest.py b/src/tests/unit/conftest.py
63index 64f110c..620a77d 100644
64--- a/src/tests/unit/conftest.py
65+++ b/src/tests/unit/conftest.py
66@@ -95,7 +95,9 @@ def agent_conf_sample(agent_conf_sample_path):
67
68 @pytest.fixture
69 def jujucontroller(
70- mock_hookenv_config, monkeypatch, agent_conf_sample,
71+ mock_hookenv_config,
72+ monkeypatch,
73+ agent_conf_sample,
74 ):
75 """Mock the JujuControllerHelper.
76

Subscribers

People subscribed via source and target branches