Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ubuntu/jammy: fix dailies #5712

Merged
merged 3 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions debian/patches/no-single-process.patch
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Last-Update: 2024-08-02
--- a/systemd/cloud-config.service.tmpl
+++ b/systemd/cloud-config.service.tmpl
@@ -10,14 +10,7 @@

[Service]
Type=oneshot
-# This service is a shim which preserves systemd ordering while allowing a
Expand All @@ -21,11 +21,11 @@ Last-Update: 2024-08-02
+ExecStart=/usr/bin/cloud-init modules --mode=config
RemainAfterExit=yes
TimeoutSec=0

--- a/systemd/cloud-final.service.tmpl
+++ b/systemd/cloud-final.service.tmpl
@@ -15,16 +15,10 @@

[Service]
Type=oneshot
-# This service is a shim which preserves systemd ordering while allowing a
Expand All @@ -40,9 +40,9 @@ Last-Update: 2024-08-02
RemainAfterExit=yes
TimeoutSec=0
+KillMode=process
{% if variant in ["almalinux", "cloudlinux", "rhel"] %}
# Restart NetworkManager if it is present and running.
ExecStartPost=/bin/sh -c 'u=NetworkManager.service; \
TasksMax=infinity
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this right?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes


# Output needs to appear in instance console output
--- a/systemd/cloud-init-local.service.tmpl
+++ b/systemd/cloud-init-local.service.tmpl
@@ -7,6 +7,7 @@
Expand All @@ -68,7 +68,7 @@ Last-Update: 2024-08-02
+ExecStart=/usr/bin/cloud-init init --local
RemainAfterExit=yes
TimeoutSec=0

--- a/systemd/cloud-init-main.service.tmpl
+++ /dev/null
@@ -1,51 +0,0 @@
Expand Down Expand Up @@ -294,7 +294,7 @@ Last-Update: 2024-08-02
--- a/systemd/cloud-config.target
+++ b/systemd/cloud-config.target
@@ -14,5 +14,5 @@

[Unit]
Description=Cloud-config availability
-Wants=cloud-init-local.service cloud-init-network.service
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,22 +147,21 @@ Last-Update: 2024-02-14
install = cc.distro.install_packages

for backend, cmd, package in BACKEND_DEF:
@@ -88,23 +84,21 @@ class TestLxd(t_help.CiTestCase):
if backend == "lvm":
self.assertEqual(
[
@@ -85,22 +81,14 @@ class TestLxd(t_help.CiTestCase):
subp.call_args_list,
)

- if backend == "lvm":
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this right?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is... confusing. The original test checks to make sure that the semaphore exists when waiting for snap. But on jammy, I'm not sure why we are still testing for this call. Am I missing something?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we were testing the dm-thin-pool.ko that was just removed, so I removed that as well.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we were testing the dm-thin-pool.ko that was just removed, so I removed that as well.

I know, I'm commenting on the remaining test. I don't think that it tests anything valuable, but I guess it doesn't hurt anything either.

- self.assertEqual(
- [
- mock.call(sem_file),
mock.call(
"/lib/modules/mykernel/"
"kernel/drivers/md/dm-thin-pool.ko"
- ),
+ )
],
exists.call_args_list,
)
else:
- ],
- exists.call_args_list,
- )
- else:
- self.assertEqual([mock.call(sem_file)], exists.call_args_list)
- del_file(sem_file)
+ if backend != "lvm":
+ self.assertEqual([], exists.call_args_list)

@mock.patch("cloudinit.config.cc_lxd.maybe_cleanup_default")
Expand All @@ -174,7 +173,7 @@ Last-Update: 2024-02-14
cc.distro = mock.MagicMock()
mock_subp.which.return_value = None
cc_lxd.handle("cc_lxd", LXD_INIT_CFG, cc, [])
@@ -118,7 +112,7 @@ class TestLxd(t_help.CiTestCase):
@@ -114,7 +102,7 @@ class TestLxd(t_help.CiTestCase):
@mock.patch("cloudinit.config.cc_lxd.maybe_cleanup_default")
@mock.patch("cloudinit.config.cc_lxd.subp")
def test_no_init_does_nothing(self, mock_subp, m_maybe_clean):
Expand All @@ -183,7 +182,7 @@ Last-Update: 2024-02-14
cc.distro = mock.MagicMock()
cc_lxd.handle("cc_lxd", {"lxd": {}}, cc, [])
self.assertFalse(cc.distro.install_packages.called)
@@ -128,17 +122,16 @@ class TestLxd(t_help.CiTestCase):
@@ -124,17 +112,16 @@ class TestLxd(t_help.CiTestCase):
@mock.patch("cloudinit.config.cc_lxd.maybe_cleanup_default")
@mock.patch("cloudinit.config.cc_lxd.subp")
def test_no_lxd_does_nothing(self, mock_subp, m_maybe_clean):
Expand All @@ -204,7 +203,7 @@ Last-Update: 2024-02-14
cc.distro = mock.MagicMock()
cc_lxd.handle(
"cc_lxd",
@@ -153,7 +146,6 @@ class TestLxd(t_help.CiTestCase):
@@ -149,7 +136,6 @@ class TestLxd(t_help.CiTestCase):
],
mock_subp.subp.call_args_list,
)
Expand Down