From: Dominik Csapak <d.csapak@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-backup 2/5] zpool_list: add tests for special pool names
Date: Wed, 8 Jul 2020 14:59:16 +0200 [thread overview]
Message-ID: <20200708125919.3622-3-d.csapak@proxmox.com> (raw)
In-Reply-To: <20200708125919.3622-1-d.csapak@proxmox.com>
those names are allowed for zpools
these will fail for now, but it will be fixed in the next commit
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
src/tools/disks/zpool_list.rs | 30 ++++++++++++++++++++++++++++--
1 file changed, 28 insertions(+), 2 deletions(-)
diff --git a/src/tools/disks/zpool_list.rs b/src/tools/disks/zpool_list.rs
index 3c65280..343ac0d 100644
--- a/src/tools/disks/zpool_list.rs
+++ b/src/tools/disks/zpool_list.rs
@@ -221,7 +221,7 @@ logs
assert_eq!(data, expect);
let output = "\
-btest 427349245952 761856 427348484096 - - 0 0 1.00 ONLINE -
+b-test 427349245952 761856 427348484096 - - 0 0 1.00 ONLINE -
mirror 213674622976 438272 213674184704 - - 0 0 - ONLINE
/dev/sda1 - - - - - - - - ONLINE
/dev/sda2 - - - - - - - - ONLINE
@@ -235,7 +235,7 @@ logs - - - - - - - - -
let data = parse_zpool_list(&output)?;
let expect = vec![
ZFSPoolInfo {
- name: String::from("btest"),
+ name: String::from("b-test"),
health: String::from("ONLINE"),
usage: Some(ZFSPoolUsage {
size: 427349245952,
@@ -261,5 +261,31 @@ logs - - - - - - - - -
assert_eq!(data, expect);
+ let output = "\
+b.test 427349245952 761856 427348484096 - - 0 0 1.00 ONLINE -
+ mirror 213674622976 438272 213674184704 - - 0 0 - ONLINE
+ /dev/sda1 - - - - - - - - ONLINE
+";
+
+ let data = parse_zpool_list(&output)?;
+ let expect = vec![
+ ZFSPoolInfo {
+ name: String::from("b.test"),
+ health: String::from("ONLINE"),
+ usage: Some(ZFSPoolUsage {
+ size: 427349245952,
+ alloc: 761856,
+ free: 427348484096,
+ dedup: 1.0,
+ frag: 0,
+ }),
+ devices: vec![
+ String::from("/dev/sda1"),
+ ]
+ },
+ ];
+
+ assert_eq!(data, expect);
+
Ok(())
}
--
2.20.1
next prev parent reply other threads:[~2020-07-08 12:59 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-08 12:59 [pbs-devel] [PATCH proxmox-backup 0/5] fix zfs/disk listings with " Dominik Csapak
2020-07-08 12:59 ` [pbs-devel] [PATCH proxmox-backup 1/5] api: add ZPOOL_NAME_SCHEMA and regex Dominik Csapak
2020-07-08 12:59 ` Dominik Csapak [this message]
2020-07-08 12:59 ` [pbs-devel] [PATCH proxmox-backup 3/5] disks/zpool_list: allow some more characters for pool list Dominik Csapak
2020-07-08 12:59 ` [pbs-devel] [PATCH proxmox-backup 4/5] disks/zpool_status: add test for pool with special character Dominik Csapak
2020-07-08 12:59 ` [pbs-devel] [PATCH proxmox-backup 5/5] get_disks: don't fail on zfs_devices Dominik Csapak
2020-07-09 11:59 ` [pbs-devel] applied: " Dietmar Maurer
2020-07-09 11:40 ` [pbs-devel] [PATCH proxmox-backup 0/5] fix zfs/disk listings with special pool names Dietmar Maurer
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=20200708125919.3622-3-d.csapak@proxmox.com \
--to=d.csapak@proxmox.com \
--cc=pbs-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.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal