From aa84d08ef6e7cf604754d8d83a341b6af6abe744 Mon Sep 17 00:00:00 2001 From: Alexandre Pujol Date: Mon, 13 Nov 2023 23:40:51 +0000 Subject: [PATCH] tests: improve tests image content. --- .../packer/init/archlinux-gnome.user-data.yml | 2 -- tests/packer/init/archlinux-kde.user-data.yml | 2 -- .../packer/init/ubuntu-desktop.user-data.yml | 29 ++++++++++++------- tests/packer/init/ubuntu-server.user-data.yml | 3 +- 4 files changed, 20 insertions(+), 16 deletions(-) diff --git a/tests/packer/init/archlinux-gnome.user-data.yml b/tests/packer/init/archlinux-gnome.user-data.yml index 4a5cdb10..a7c1afa9 100644 --- a/tests/packer/init/archlinux-gnome.user-data.yml +++ b/tests/packer/init/archlinux-gnome.user-data.yml @@ -59,8 +59,6 @@ runcmd: # Regenerate grub.cfg - [ grub-mkconfig, -o, /boot/grub/grub.cfg ] - # Enable firewall - # Enable core services - [ systemctl, enable, apparmor ] - [ systemctl, enable, auditd ] diff --git a/tests/packer/init/archlinux-kde.user-data.yml b/tests/packer/init/archlinux-kde.user-data.yml index 435bf4c5..fc276586 100644 --- a/tests/packer/init/archlinux-kde.user-data.yml +++ b/tests/packer/init/archlinux-kde.user-data.yml @@ -61,8 +61,6 @@ runcmd: # Regenerate grub.cfg - [ grub-mkconfig, -o, /boot/grub/grub.cfg ] - # Enable firewall - # Enable core services - [ systemctl, enable, apparmor ] - [ systemctl, enable, auditd ] diff --git a/tests/packer/init/ubuntu-desktop.user-data.yml b/tests/packer/init/ubuntu-desktop.user-data.yml index d66e9680..937b84d2 100644 --- a/tests/packer/init/ubuntu-desktop.user-data.yml +++ b/tests/packer/init/ubuntu-desktop.user-data.yml @@ -43,30 +43,37 @@ snap: runcmd: - # Let NetworkManager handle network - - rm /etc/netplan/* - - >- - printf "network:\n version: 2\n renderer: NetworkManager" > /etc/netplan/01-network-manager.yaml - # Remove default filesystem and related tools not used with the suggested # storage layout. These may yet be required if different partitioning schemes # are used. - - apt-get -y remove btrfs-progs cryptsetup* lvm2 xfsprogs + - apt-get -y purge btrfs-progs cryptsetup* lvm2 xfsprogs # Remove other packages present by default in Ubuntu Server but not # normally present in Ubuntu Desktop. - >- - apt-get -y remove - ubuntu-server ubuntu-server-minimal + apt-get -y purge + ubuntu-server ubuntu-server-minimal netplan.io cloud-init binutils byobu curl dmeventd finalrd gawk kpartx mdadm ncurses-term needrestart open-iscsi sg3-utils ssh-import-id sssd thin-provisioning-tools tmux sosreport screen open-vm-tools motd-news-config lxd-agent-loader landscape-common fonts-ubuntu-console ethtool - # Keep cloud-init, as it performs some of the installation on first boot. - - apt-get -y install cloud-init - # Finally, remove things only installed as dependencies of other things # we have already removed. - apt-get -y autoremove + +write_files: + + - path: /etc/systemd/network/20-wired.network + owner: 'root:root' + permissions: '0644' + content: | + [Match] + Name=en* + + [Network] + DHCP=yes + + [DHCPv4] + RouteMetric=10 diff --git a/tests/packer/init/ubuntu-server.user-data.yml b/tests/packer/init/ubuntu-server.user-data.yml index 1e40f32d..64fecc85 100644 --- a/tests/packer/init/ubuntu-server.user-data.yml +++ b/tests/packer/init/ubuntu-server.user-data.yml @@ -20,7 +20,8 @@ package_upgrade: true package_reboot_if_required: false packages: - apparmor-profiles - - build-essential + - auditd + - build-essential - config-package-dev - debhelper - devscripts