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

feat(24.04): netplan.io and dependencies #276

Open
wants to merge 7 commits into
base: ubuntu-24.04
Choose a base branch
from
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
66 changes: 66 additions & 0 deletions slices/iproute2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
package: iproute2

essential:
- iproute2_copyright

slices:
bins:
essential:
- iproute2_config
- iproute2_libs
- libbpf1_libs
- libc6_libs
- libcap2-bin_bins
- libcap2_libs
- libdb5.3t64_libs
- libelf1t64_libs
- libmnl0_libs
- libselinux1_libs
- libtirpc3t64_libs
- libxtables12_libs
contents:
/bin/ip:
/bin/ss:
/sbin/bridge:
/sbin/dcb:
/sbin/devlink:
/sbin/ip:
/sbin/rtacct:
/sbin/rtmon:
/sbin/tc:
/sbin/tipc:
/sbin/vdpa:
/usr/bin/ctstat:
/usr/bin/lnstat:
/usr/bin/nstat:
/usr/bin/rdma:
/usr/bin/routel:
/usr/bin/rtstat:
/usr/sbin/arpd:
/usr/sbin/genl:

config:
contents:
/etc/iproute2/bpf_pinning:
/etc/iproute2/ematch_map:
/etc/iproute2/group:
/etc/iproute2/nl_protos:
/etc/iproute2/rt_dsfield:
/etc/iproute2/rt_protos:
/etc/iproute2/rt_realms:
/etc/iproute2/rt_scopes:
/etc/iproute2/rt_tables:

libs:
contents:
/usr/lib/*-linux-*/tc/experimental.dist:
/usr/lib/*-linux-*/tc/m_ipt.so:
/usr/lib/*-linux-*/tc/m_xt.so:
/usr/lib/*-linux-*/tc/normal.dist:
/usr/lib/*-linux-*/tc/pareto.dist:
/usr/lib/*-linux-*/tc/paretonormal.dist:
/usr/lib/*-linux-*/tc/q_atm.so:

copyright:
contents:
/usr/share/doc/iproute2/copyright:
17 changes: 17 additions & 0 deletions slices/libbpf1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package: libbpf1

essential:
- libbpf1_copyright

slices:
libs:
essential:
- libc6_libs
- libelf1t64_libs
- zlib1g_libs
contents:
/usr/lib/*-linux-*/libbpf.so.1*:

copyright:
contents:
/usr/share/doc/libbpf1/copyright:
15 changes: 15 additions & 0 deletions slices/libmnl0.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package: libmnl0

essential:
- libmnl0_copyright

slices:
libs:
essential:
- libc6_libs
contents:
/usr/lib/*-linux-*/libmnl.so.0*:

copyright:
contents:
/usr/share/doc/libmnl0/copyright:
18 changes: 18 additions & 0 deletions slices/libnetplan1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package: libnetplan1

essential:
- libnetplan1_copyright

slices:
libs:
essential:
- libc6_libs
- libglib2.0-0t64_libs
- libuuid1_libs
- libyaml-0-2_libs
contents:
/usr/lib/*-linux-*/libnetplan.so.1*:

copyright:
contents:
/usr/share/doc/libnetplan1/copyright:
15 changes: 15 additions & 0 deletions slices/libxtables12.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package: libxtables12

essential:
- libxtables12_copyright

slices:
libs:
essential:
- libc6_libs
contents:
/usr/lib/*-linux-*/libxtables.so.12*:

copyright:
contents:
/usr/share/doc/libxtables12/copyright:
27 changes: 27 additions & 0 deletions slices/netplan-generator.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package: netplan-generator

essential:
- netplan-generator_copyright

slices:
bins:
essential:
- libc6_libs
- libglib2.0-0t64_libs
- libnetplan1_libs
- systemd_bins
contents:
/usr/lib/systemd/system-generators/netplan:
/usr/libexec/netplan/generate:

# the generator needs the folder and thus carry
# a placeholder file, it will be removed and a
# symlink to /usr/libexec/netplan/generate will
# be created in this folder
placeholder:
contents:
/usr/lib/netplan/PLACEHOLDER:

copyright:
contents:
/usr/share/doc/netplan-generator/copyright:
38 changes: 38 additions & 0 deletions slices/netplan.io.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package: netplan.io

essential:
- netplan.io_copyright

slices:
bins:
essential:
- iproute2_bins
- libc6_libs
- libglib2.0-0t64_libs
- libnetplan1_libs
- libsystemd0_libs
- netplan-generator_bins
- netplan.io_scripts
- python3-dbus_data
- python3-netifaces_data
- python3-netplan_data
- python3-yaml_data
- python3.12_standard
- systemd_bins
contents:
/usr/sbin/netplan:

scripts:
contents:
/usr/share/netplan/netplan.script:
/usr/share/netplan/netplan_cli/**:

dbus-service:
contents:
/usr/libexec/netplan/netplan-dbus:
/usr/share/dbus-1/system-services/io.netplan.Netplan.service:
/usr/share/dbus-1/system.d/io.netplan.Netplan.conf:

copyright:
contents:
/usr/share/doc/netplan.io/copyright:
17 changes: 17 additions & 0 deletions slices/python3-cffi-backend.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package: python3-cffi-backend

essential:
- python3-cffi-backend_copyright

slices:
data:
essential:
- libc6_libs
- libffi8_libs
- python3.12_standard
contents:
/usr/lib/python3/dist-packages/_cffi_backend.cpython-*-linux-*.so:

copyright:
contents:
/usr/share/doc/python3-cffi-backend/copyright:
24 changes: 24 additions & 0 deletions slices/python3-dbus.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package: python3-dbus

essential:
- python3-dbus_copyright

slices:
data:
essential:
- libc6_libs
- libdbus-1-3_libs
- libglib2.0-0t64_libs
- python3.12_standard
contents:
/usr/lib/python3/dist-packages/_dbus_bindings.cpython-*-linux-*.so:
/usr/lib/python3/dist-packages/_dbus_glib_bindings.cpython-*-linux-*.so:
/usr/lib/python3/dist-packages/dbus/**:
/usr/lib/python3/dist-packages/dbus_python-1.3.2.egg-info/PKG-INFO:
/usr/lib/python3/dist-packages/dbus_python-1.3.2.egg-info/dependency_links.txt:
/usr/lib/python3/dist-packages/dbus_python-1.3.2.egg-info/not-zip-safe:
/usr/lib/python3/dist-packages/dbus_python-1.3.2.egg-info/top_level.txt:

copyright:
contents:
/usr/share/doc/python3-dbus/copyright:
20 changes: 20 additions & 0 deletions slices/python3-netifaces.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package: python3-netifaces

essential:
- python3-netifaces_copyright

slices:
data:
essential:
- libc6_libs
- python3.12_standard
contents:
/usr/lib/python3/dist-packages/netifaces-0.11.0.egg-info/PKG-INFO:
/usr/lib/python3/dist-packages/netifaces-0.11.0.egg-info/dependency_links.txt:
/usr/lib/python3/dist-packages/netifaces-0.11.0.egg-info/top_level.txt:
/usr/lib/python3/dist-packages/netifaces-0.11.0.egg-info/zip-safe:
/usr/lib/python3/dist-packages/netifaces.cpython-*.so:

copyright:
contents:
/usr/share/doc/python3-netifaces/copyright:
18 changes: 18 additions & 0 deletions slices/python3-netplan.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package: python3-netplan

essential:
- python3-netplan_copyright

slices:
data:
essential:
- libc6_libs
- libnetplan1_libs
- python3-cffi-backend_data
- python3.12_standard
contents:
/usr/lib/python3/dist-packages/netplan/**:

copyright:
contents:
/usr/share/doc/python3-netplan/copyright:
22 changes: 22 additions & 0 deletions slices/python3-yaml.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package: python3-yaml

essential:
- python3-yaml_copyright

slices:
data:
essential:
- libc6_libs
- libyaml-0-2_libs
- python3.12_standard
contents:
/usr/lib/python3/dist-packages/PyYAML-6.0.1.dist-info/INSTALLER:
/usr/lib/python3/dist-packages/PyYAML-6.0.1.dist-info/METADATA:
/usr/lib/python3/dist-packages/PyYAML-6.0.1.dist-info/WHEEL:
/usr/lib/python3/dist-packages/PyYAML-6.0.1.dist-info/top_level.txt:
/usr/lib/python3/dist-packages/_yaml/__init__.py:
/usr/lib/python3/dist-packages/yaml/**:

copyright:
contents:
/usr/share/doc/python3-yaml/copyright:
15 changes: 15 additions & 0 deletions tests/spread/integration/iproute2/task.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
summary: Integration tests for iproute2

execute: |
# Chisel a minimum number of slices to give us a runnable system that we can
# test in.
rootfs="$(install-slices bash_bins passwd_config base-files_base grep_bins iproute2_bins)"

# iproute2 needs dev mounted
mkdir "${rootfs}"/dev
mount --rbind /dev "${rootfs}"/dev

cp test.sh "${rootfs}/"
chroot "${rootfs}/" /test.sh

umount -l "${rootfs}"/dev
13 changes: 13 additions & 0 deletions tests/spread/integration/iproute2/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

# smoketest ip commands
ip --help | grep "Usage:"

# test some basic commands and against loopback that
# we can kinda expect is there
ip link | grep "LOOPBACK,UP"
Copy link
Collaborator

Choose a reason for hiding this comment

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

can you please also test the other binaries being installed? I know it might be tedious, but that's the only way we can ensure the slice has all it needs for them to behave properly

ip addr | grep "inet 127.0.0.1"
ip route | grep -E "default via [0-9\.]+"

# iproute carries many binaries
# so maybe extend as needed
19 changes: 19 additions & 0 deletions tests/spread/integration/netplan.io/task.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
summary: Integration tests for netplan.io

execute: |
# Chisel a minimum number of slices to give us a runnable system that we can
# test in.
rootfs="$(install-slices bash_bins coreutils_bins passwd_config base-files_base grep_bins netplan.io_bins)"

# netplan needs proc and dev mounted
mkdir "${rootfs}"/proc
mount -t proc /proc "${rootfs}"/proc

mkdir "${rootfs}"/dev
mount --rbind /dev "${rootfs}"/dev

cp test.sh "${rootfs}/"
chroot "${rootfs}/" /test.sh

umount -l "${rootfs}"/dev
umount "${rootfs}"/proc
12 changes: 12 additions & 0 deletions tests/spread/integration/netplan.io/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash
Copy link
Collaborator

Choose a reason for hiding this comment

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

are any of the scripts testable?


# create python3 symlink
ln -s /usr/bin/python3.12 /usr/bin/python3

# smoketest a couple of netplan commands
netplan --help | grep "Network configuration in YAML"
netplan info | grep "features"

# 'netplan generate' needs udevadm to work
# 'netplan apply' needs udevadm to work
# 'netplan status' does not properly work inside chroot
Loading