Merge ~mertkirpici/charm-sysconfig:lp/1915167 into charm-sysconfig:master

Proposed by Mert Kirpici
Status: Merged
Approved by: Giuseppe Petralia
Approved revision: 25976113a0adea86b59d8dcc1f05e04ff5bef936
Merged at revision: d0a9456208b09d9e2b6497ee875cc7ac61f29520
Proposed branch: ~mertkirpici/charm-sysconfig:lp/1915167
Merge into: charm-sysconfig:master
Diff against target: 49 lines (+16/-0)
3 files modified
src/reactive/sysconfig.py (+1/-0)
src/tests/functional/juju_tools.py (+11/-0)
src/tests/functional/test_deploy.py (+4/-0)
Reviewer Review Type Date Requested Status
Giuseppe Petralia Approve
Eric Chen Approve
Review via email: mp+428023@code.launchpad.net

Commit message

reactive/sysconfig.py: create sysctl config file upon installation

Description of the change

See commit messages

To post a comment you must log in.
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

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

Revision history for this message
Eric Chen (eric-chen) :
review: Needs Information
Revision history for this message
Mert Kirpici (mertkirpici) :
Revision history for this message
Eric Chen (eric-chen) :
review: Approve
Revision history for this message
Mustafa Kemal Gilor (mustafakemalgilor) :
Revision history for this message
Giuseppe Petralia (peppepetra) wrote :

lgtm, thanks

review: Approve
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

Change successfully merged at revision d0a9456208b09d9e2b6497ee875cc7ac61f29520

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/src/reactive/sysconfig.py b/src/reactive/sysconfig.py
2index 7ac0a44..1137304 100644
3--- a/src/reactive/sysconfig.py
4+++ b/src/reactive/sysconfig.py
5@@ -64,6 +64,7 @@ def install_sysconfig():
6 syshelper.update_systemd_system_file()
7 syshelper.update_systemd_resolved()
8 syshelper.update_irqbalance()
9+ syshelper.update_sysctl()
10 set_flag("sysconfig.installed")
11 update_status()
12
13diff --git a/src/tests/functional/juju_tools.py b/src/tests/functional/juju_tools.py
14index 71b4aac..9989734 100644
15--- a/src/tests/functional/juju_tools.py
16+++ b/src/tests/functional/juju_tools.py
17@@ -64,6 +64,17 @@ class JujuTools:
18 print("Calling remote cmd: " + python_cmd)
19 return await self.remote_object(imports, python_cmd, target)
20
21+ async def file_exists(self, path, target):
22+ """Run os.path.isfile() on a file.
23+
24+ :param path: File path
25+ :param target: Unit object or unit name string
26+ """
27+ imports = "import os;"
28+ python_cmd = 'os.path.isfile("{}")'.format(path)
29+ print("Calling remote cmd: " + python_cmd)
30+ return await self.remote_object(imports, python_cmd, target)
31+
32 async def file_contents(self, path, target):
33 """Return the contents of a file.
34
35diff --git a/src/tests/functional/test_deploy.py b/src/tests/functional/test_deploy.py
36index 28a52ef..cc74f4c 100644
37--- a/src/tests/functional/test_deploy.py
38+++ b/src/tests/functional/test_deploy.py
39@@ -126,6 +126,10 @@ async def test_default_config(app, jujutools):
40 assert "GRUB_DEFAULT" not in grub_content
41 assert "default_hugepagesz" not in grub_content
42
43+ sysctl_path = '/etc/sysctl.d/90-charm-sysconfig.conf'
44+ sysctl_exists = await jujutools.file_exists(sysctl_path, unit)
45+ assert sysctl_exists
46+
47 systemd_path = "/etc/systemd/system.conf"
48 systemd_content = await jujutools.file_contents(systemd_path, unit)
49 systemd_valid = True

Subscribers

People subscribed via source and target branches

to all changes: