From: Christoph Heiss <c.heiss@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH installer 1/4] auto-installer: tests: add tests for raid level case-insensitivity
Date: Tue, 3 Dec 2024 13:23:25 +0100 [thread overview]
Message-ID: <20241203122331.383398-2-c.heiss@proxmox.com> (raw)
In-Reply-To: <20241203122331.383398-1-c.heiss@proxmox.com>
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@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@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@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@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@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
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
next prev parent reply other threads:[~2024-12-03 12:23 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-03 12:23 [pve-devel] [PATCH installer 0/4] auto, tui: improve rust unit test setup Christoph Heiss
2024-12-03 12:23 ` Christoph Heiss [this message]
2024-12-03 12:23 ` [pve-devel] [PATCH installer 2/4] auto-installer: tests: create separate unit test for each answer file Christoph Heiss
2024-12-03 12:23 ` [pve-devel] [PATCH installer 3/4] auto-installer: tests: add diff'ed assertions for answer parsing tests Christoph Heiss
2024-12-03 12:23 ` [pve-devel] [PATCH installer 4/4] tui: use pretty_assertions for object equal asserts Christoph Heiss
2024-12-03 17:20 ` [pve-devel] applied-series: [PATCH installer 0/4] auto, tui: improve rust unit test setup Thomas Lamprecht
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241203122331.383398-2-c.heiss@proxmox.com \
--to=c.heiss@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.