Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
1 change: 0 additions & 1 deletion .github/workflows/autopkgtest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ jobs:
cp -r netplan.io-*/debian .
mv deb-tmp/tests/cloud-init.sh debian/tests/cloud-init.sh
rm -r debian/patches/ # clear any distro patches
sed -i 's|systemd (>= 257.2-3ubuntu1~),|systemd (>= 248~),|g' debian/control # see https://github.com/canonical/netplan/pull/535
echo 'usr/libexec/netplan/configure' >> debian/netplan-generator.install
echo 'usr/lib/systemd/system/netplan-configure.service' >> debian/netplan-generator.install
sed -i 's|libexec/netplan/generate|libexec/netplan/configure|g' debian/netplan-generator.postinst
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/network-manager.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ jobs:
pull-lp-source netplan.io
cp -r netplan.io-*/debian .
rm -r debian/patches/ # clear any distro patches
sed -i 's|systemd (>= 257.2-3ubuntu1~),|systemd (>= 248~),|g' debian/control # see https://github.com/canonical/netplan/pull/535
echo 'usr/libexec/netplan/configure' >> debian/netplan-generator.install
echo 'usr/lib/systemd/system/netplan-configure.service' >> debian/netplan-generator.install
sed -i 's|libexec/netplan/generate|libexec/netplan/configure|g' debian/netplan-generator.postinst
Expand Down
13 changes: 13 additions & 0 deletions netplan_cli/cli/commands/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,19 @@ def command_generate(self):
generator_dir = os.path.join(self.root_dir, 'run', 'systemd', 'generator')
generator_early_dir = os.path.join(self.root_dir, 'run', 'systemd', 'generator.early')
generator_late_dir = os.path.join(self.root_dir, 'run', 'systemd', 'generator.late')
# Ensure necessary directories exist
for d in (os.path.dirname(sd_generator), generator_dir, generator_early_dir, generator_late_dir):
try:
os.makedirs(d, exist_ok=True)
except OSError as e: # pragma: nocover (testing only)
logging.debug(f'Could not create directory {d}: {e}')
# Ensure sd_generator exists and points to the real generator
real_generator = utils.get_generator_path()
try: # pragma: nocover (testing only)
if not os.path.exists(sd_generator):
os.symlink(real_generator, sd_generator)
except OSError as e: # pragma: nocover (testing only)
logging.debug(f'Could not create symlink {sd_generator} -> {real_generator}: {e}')
subprocess.check_call([sd_generator, '--root-dir', self.root_dir,
generator_dir, generator_early_dir, generator_late_dir])
else: # pragma: nocover (covered by autopkgtests)
Expand Down
4 changes: 2 additions & 2 deletions tests/cli_legacy.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ def test_no_config(self):
os.listdir(os.path.join(self.workdir.name, 'usr', 'lib', 'systemd', 'system-generators')),
['netplan'])
self.assertEqual(
os.listdir(os.path.join(self.workdir.name, 'run', 'systemd')),
['generator.late'])
sorted(os.listdir(os.path.join(self.workdir.name, 'run', 'systemd'))),
['generator', 'generator.early', 'generator.late'])

def test_with_empty_config(self):
c = os.path.join(self.workdir.name, 'etc', 'netplan')
Expand Down
3 changes: 1 addition & 2 deletions tests/integration/ethernets.py
Original file line number Diff line number Diff line change
Expand Up @@ -486,8 +486,7 @@ def test_systemd_networkd_wait_online(self):
ExecStart=/lib/systemd/systemd-networkd-wait-online --any --dns -o routable -i %(e2c)s -i br0
''' % {'e2c': self.dev_e2_client})
# Restart sd-nd-wait-online.service and check that it was launched correctly.
# XXX: Enable extra testing once systemd#34640 is available on the SUT (i.e. systemd v258+).
# subprocess.check_call(['systemctl', 'restart', 'systemd-networkd-wait-online.service'])
subprocess.check_call(['systemctl', 'restart', 'systemd-networkd-wait-online.service'])


@unittest.skipIf("NetworkManager" not in test_backends,
Expand Down
Loading