From: Christoph Heiss <c.heiss@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH installer 1/6] tui: options: simplify unit-test setup
Date: Mon, 9 Dec 2024 13:45:54 +0100 [thread overview]
Message-ID: <20241209124601.1272122-2-c.heiss@proxmox.com> (raw)
In-Reply-To: <20241209124601.1272122-1-c.heiss@proxmox.com>
We already have `SetupInfo::mocked()` since commit c3c9282 ("common: add
mocked variants for setup and ISO related info structs"), so use that.
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
---
proxmox-tui-installer/src/options.rs | 26 +++-----------------------
1 file changed, 3 insertions(+), 23 deletions(-)
diff --git a/proxmox-tui-installer/src/options.rs b/proxmox-tui-installer/src/options.rs
index e2116d2..8c882b7 100644
--- a/proxmox-tui-installer/src/options.rs
+++ b/proxmox-tui-installer/src/options.rs
@@ -84,35 +84,15 @@ impl InstallerOptions {
mod tests {
use super::*;
use proxmox_installer_common::{
- setup::{
- Dns, Gateway, Interface, InterfaceState, IsoInfo, IsoLocations, NetworkInfo,
- ProductConfig, ProxmoxProduct, Routes, SetupInfo,
- },
+ setup::{Dns, Gateway, Interface, InterfaceState, NetworkInfo, Routes, SetupInfo},
utils::{CidrAddress, Fqdn},
};
+ use std::collections::BTreeMap;
use std::net::{IpAddr, Ipv4Addr};
- use std::{collections::BTreeMap, path::PathBuf};
-
- fn dummy_setup_info() -> SetupInfo {
- SetupInfo {
- config: ProductConfig {
- fullname: "Proxmox VE".to_owned(),
- product: ProxmoxProduct::PVE,
- enable_btrfs: true,
- },
- iso_info: IsoInfo {
- release: String::new(),
- isorelease: String::new(),
- },
- locations: IsoLocations {
- iso: PathBuf::new(),
- },
- }
- }
#[test]
fn network_options_from_setup_network_info() {
- let setup = dummy_setup_info();
+ let setup = SetupInfo::mocked();
let mut interfaces = BTreeMap::new();
interfaces.insert(
--
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-09 12:46 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-09 12:45 [pve-devel] [PATCH installer 0/6] assistant: properly validate answer file settings Christoph Heiss
2024-12-09 12:45 ` Christoph Heiss [this message]
2024-12-09 12:45 ` [pve-devel] [PATCH installer 2/6] country.pl: generate final structure as json at build time directly Christoph Heiss
2024-12-09 12:45 ` [pve-devel] [PATCH installer 3/6] common: setup: read locale info as shipped by the installer directly Christoph Heiss
2024-12-09 12:45 ` [pve-devel] [PATCH installer 4/6] common: setup: include path in error message if file could not be read Christoph Heiss
2024-12-09 12:45 ` [pve-devel] [PATCH installer 5/6] fix #5889: assistant: validate answer email & root password settings Christoph Heiss
2024-12-09 12:45 ` [pve-devel] [PATCH installer 6/6] assistant: validate answer first-boot hook and locale settings Christoph Heiss
2024-12-10 17:37 ` [pve-devel] applied-series: [PATCH installer 0/6] assistant: properly validate answer file settings 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=20241209124601.1272122-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox