launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #29935
[Merge] ~pelpsi/lpci:policy-rc-preventing-services-from-running into lpci:main
Simone Pelosi has proposed merging ~pelpsi/lpci:policy-rc-preventing-services-from-running into lpci:main.
Commit message:
Removed policy-rc.d
The presence of the following file is preventing services from running in CI.
LP: #1995954
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
Related bugs:
Bug #1995954 in lpci: "local policy-rc.d file preventing services from running in CI"
https://bugs.launchpad.net/lpci/+bug/1995954
For more details, see:
https://code.launchpad.net/~pelpsi/lpci/+git/lpcraft/+merge/441458
--
Your team Launchpad code reviewers is requested to review the proposed merge of ~pelpsi/lpci:policy-rc-preventing-services-from-running into lpci:main.
diff --git a/lpci/providers/_lxd.py b/lpci/providers/_lxd.py
index 45ef5ff..0568a0d 100644
--- a/lpci/providers/_lxd.py
+++ b/lpci/providers/_lxd.py
@@ -348,6 +348,12 @@ class LXDProvider(Provider):
],
check=True,
)
+ self._internal_execute_run(
+ instance,
+ instance_name,
+ ["rm", "/usr/local/sbin/policy-rc.d"],
+ check=True,
+ )
except subprocess.CalledProcessError as error:
raise CommandError(str(error)) from error
finally:
diff --git a/lpci/providers/tests/test_lxd.py b/lpci/providers/tests/test_lxd.py
index 39a0245..af7d4f4 100644
--- a/lpci/providers/tests/test_lxd.py
+++ b/lpci/providers/tests/test_lxd.py
@@ -498,6 +498,17 @@ class TestLXDProvider(TestCase):
runner=subprocess.run,
check=True,
),
+ call().lxc.exec(
+ instance_name=expected_instance_name,
+ command=[
+ "rm",
+ "/usr/local/sbin/policy-rc.d",
+ ],
+ project="test-project",
+ remote="test-remote",
+ runner=subprocess.run,
+ check=True,
+ ),
call().unmount(target=Path("/root/tmp-project")),
],
mock_launcher.mock_calls,