[pve-devel] [PATCH installer 1/4] auto-installer: tests: add tests for raid level case-insensitivity

Christoph Heiss c.heiss at proxmox.com
Tue Dec 3 13:23:25 CET 2024


This was fixed as a regression for ZFS and Btrfs in [0] and [1],
respectively - to ensure it won't happen again, add some tests as it
should be.

[0] a9e5f37 ("common: allow lowercase and uppercase zfs raid levels")
[1] 33d53b9 ("common: allow lowercase and uppercase btrfs raid levels")

Signed-off-by: Christoph Heiss <c.heiss at proxmox.com>
---
 .../btrfs_raid_level_uppercase.json           | 23 ++++++++++++++
 .../btrfs_raid_level_uppercase.toml           | 15 ++++++++++
 .../zfs_raid_level_uppercase.json             | 30 +++++++++++++++++++
 .../zfs_raid_level_uppercase.toml             | 15 ++++++++++
 4 files changed, 83 insertions(+)
 create mode 100644 proxmox-auto-installer/tests/resources/parse_answer/btrfs_raid_level_uppercase.json
 create mode 100644 proxmox-auto-installer/tests/resources/parse_answer/btrfs_raid_level_uppercase.toml
 create mode 100644 proxmox-auto-installer/tests/resources/parse_answer/zfs_raid_level_uppercase.json
 create mode 100644 proxmox-auto-installer/tests/resources/parse_answer/zfs_raid_level_uppercase.toml

diff --git a/proxmox-auto-installer/tests/resources/parse_answer/btrfs_raid_level_uppercase.json b/proxmox-auto-installer/tests/resources/parse_answer/btrfs_raid_level_uppercase.json
new file mode 100644
index 0000000..0c5e9d0
--- /dev/null
+++ b/proxmox-auto-installer/tests/resources/parse_answer/btrfs_raid_level_uppercase.json
@@ -0,0 +1,23 @@
+{
+  "autoreboot": 1,
+  "cidr": "192.168.1.114/24",
+  "country": "at",
+  "dns": "192.168.1.254",
+  "domain": "testinstall",
+  "disk_selection": {
+    "6": "6",
+    "7": "7"
+  },
+  "filesys": "btrfs (RAID1)",
+  "gateway": "192.168.1.1",
+  "hdsize": 223.57088470458984,
+  "existing_storage_auto_rename": 1,
+  "hostname": "pveauto",
+  "keymap": "de",
+  "mailto": "mail at no.invalid",
+  "mngmt_nic": "eno1",
+  "root_password": { "plain": "123456" },
+  "timezone": "Europe/Vienna",
+  "btrfs_opts": { "compress": "off" },
+  "first_boot": { "enabled": 0 }
+}
diff --git a/proxmox-auto-installer/tests/resources/parse_answer/btrfs_raid_level_uppercase.toml b/proxmox-auto-installer/tests/resources/parse_answer/btrfs_raid_level_uppercase.toml
new file mode 100644
index 0000000..17799af
--- /dev/null
+++ b/proxmox-auto-installer/tests/resources/parse_answer/btrfs_raid_level_uppercase.toml
@@ -0,0 +1,15 @@
+[global]
+keyboard = "de"
+country = "at"
+fqdn = "pveauto.testinstall"
+mailto = "mail at no.invalid"
+timezone = "Europe/Vienna"
+root_password = "123456"
+
+[network]
+source = "from-dhcp"
+
+[disk-setup]
+filesystem = "btrfs"
+disk_list = ["sda", "sdb"]
+btrfs.raid = "RAID1"
diff --git a/proxmox-auto-installer/tests/resources/parse_answer/zfs_raid_level_uppercase.json b/proxmox-auto-installer/tests/resources/parse_answer/zfs_raid_level_uppercase.json
new file mode 100644
index 0000000..a8b182c
--- /dev/null
+++ b/proxmox-auto-installer/tests/resources/parse_answer/zfs_raid_level_uppercase.json
@@ -0,0 +1,30 @@
+{
+  "autoreboot": 1,
+  "cidr": "192.168.1.114/24",
+  "country": "at",
+  "dns": "192.168.1.254",
+  "domain": "testinstall",
+  "disk_selection": {
+    "6": "6",
+    "7": "7",
+    "8": "8"
+  },
+  "filesys": "zfs (RAIDZ-1)",
+  "gateway": "192.168.1.1",
+  "hdsize": 223.57088470458984,
+  "existing_storage_auto_rename": 1,
+  "hostname": "pveauto",
+  "keymap": "de",
+  "mailto": "mail at no.invalid",
+  "mngmt_nic": "eno1",
+  "root_password": { "plain": "123456" },
+  "timezone": "Europe/Vienna",
+  "zfs_opts": {
+    "arc_max": 2048,
+    "ashift": 12,
+    "checksum": "on",
+    "compress": "on",
+    "copies": 1
+  },
+  "first_boot": { "enabled": 0 }
+}
diff --git a/proxmox-auto-installer/tests/resources/parse_answer/zfs_raid_level_uppercase.toml b/proxmox-auto-installer/tests/resources/parse_answer/zfs_raid_level_uppercase.toml
new file mode 100644
index 0000000..b797b00
--- /dev/null
+++ b/proxmox-auto-installer/tests/resources/parse_answer/zfs_raid_level_uppercase.toml
@@ -0,0 +1,15 @@
+[global]
+keyboard = "de"
+country = "at"
+fqdn = "pveauto.testinstall"
+mailto = "mail at no.invalid"
+timezone = "Europe/Vienna"
+root_password = "123456"
+
+[network]
+source = "from-dhcp"
+
+[disk-setup]
+filesystem = "zfs"
+disk_list = ["sda", "sdb", "sdc"]
+zfs.raid = "RAIDZ-1"
-- 
2.47.0





More information about the pve-devel mailing list