Merge ~pelpsi/lpci:policy-rc-preventing-services-from-running into lpci:main

Proposed by Simone Pelosi
Status: Merged
Approved by: Simone Pelosi
Approved revision: cd5d60a6b9f475dbe84ace470b32c1740c7b228a
Merge reported by: Simone Pelosi
Merged at revision: cd5d60a6b9f475dbe84ace470b32c1740c7b228a
Proposed branch: ~pelpsi/lpci:policy-rc-preventing-services-from-running
Merge into: lpci:main
Diff against target: 54 lines (+21/-0)
3 files modified
NEWS.rst (+3/-0)
lpci/providers/_lxd.py (+6/-0)
lpci/providers/tests/test_lxd.py (+12/-0)
Reviewer Review Type Date Requested Status
Colin Watson (community) Approve
Review via email: mp+441458@code.launchpad.net

Commit message

Removed policy-rc.d

The presence of the following file is preventing services from running in CI.

LP: #1995954

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/NEWS.rst b/NEWS.rst
2index 1b964bc..ba2012b 100644
3--- a/NEWS.rst
4+++ b/NEWS.rst
5@@ -6,6 +6,9 @@ Version history
6 ==================
7 - Fix the yaml formatting in the snap deprecated format warning.
8
9+- Fix ``policy-rc.d`` issue preventing services
10+ from running into the container.
11+
12 0.1.0 (2023-04-18)
13 ==================
14
15diff --git a/lpci/providers/_lxd.py b/lpci/providers/_lxd.py
16index 45ef5ff..1a20c92 100644
17--- a/lpci/providers/_lxd.py
18+++ b/lpci/providers/_lxd.py
19@@ -348,6 +348,12 @@ class LXDProvider(Provider):
20 ],
21 check=True,
22 )
23+ self._internal_execute_run(
24+ instance,
25+ instance_name,
26+ ["rm", "-f", "/usr/local/sbin/policy-rc.d"],
27+ check=True,
28+ )
29 except subprocess.CalledProcessError as error:
30 raise CommandError(str(error)) from error
31 finally:
32diff --git a/lpci/providers/tests/test_lxd.py b/lpci/providers/tests/test_lxd.py
33index 39a0245..0a4f803 100644
34--- a/lpci/providers/tests/test_lxd.py
35+++ b/lpci/providers/tests/test_lxd.py
36@@ -498,6 +498,18 @@ class TestLXDProvider(TestCase):
37 runner=subprocess.run,
38 check=True,
39 ),
40+ call().lxc.exec(
41+ instance_name=expected_instance_name,
42+ command=[
43+ "rm",
44+ "-f",
45+ "/usr/local/sbin/policy-rc.d",
46+ ],
47+ project="test-project",
48+ remote="test-remote",
49+ runner=subprocess.run,
50+ check=True,
51+ ),
52 call().unmount(target=Path("/root/tmp-project")),
53 ],
54 mock_launcher.mock_calls,

Subscribers

People subscribed via source and target branches