From: Dominik Csapak <d.csapak@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-backup] tape/changer/mtx: add mtx parser test
Date: Tue, 26 Jan 2021 11:49:39 +0100 [thread overview]
Message-ID: <20210126104939.30218-1-d.csapak@proxmox.com> (raw)
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
src/tape/changer/mtx/parse_mtx_status.rs | 37 ++++++++++++++++++++++++
1 file changed, 37 insertions(+)
diff --git a/src/tape/changer/mtx/parse_mtx_status.rs b/src/tape/changer/mtx/parse_mtx_status.rs
index cdfcba76..c042c318 100644
--- a/src/tape/changer/mtx/parse_mtx_status.rs
+++ b/src/tape/changer/mtx/parse_mtx_status.rs
@@ -172,3 +172,40 @@ pub fn parse_mtx_status(i: &str) -> Result<MtxStatus, Error> {
Ok(status)
}
+
+#[test]
+fn test_changer_status() -> Result<(), Error> {
+
+ let output = r###" Storage Changer /dev/tape/by-id/scsi-387408F60F0000:2 Drives, 24 Slots ( 4 Import/Export )
+Data Transfer Element 0:Empty
+Data Transfer Element 1:Empty
+ Storage Element 1:Full :VolumeTag=CLN002CU
+ Storage Element 2:Full :VolumeTag=test22L1
+ Storage Element 3:Full :VolumeTag=test23L1
+ Storage Element 4:Full :VolumeTag=CLN001CU
+ Storage Element 5:Full :VolumeTag=test1
+ Storage Element 6:Empty
+ Storage Element 7:Empty
+ Storage Element 8:Empty
+ Storage Element 9:Empty
+ Storage Element 10:Empty
+ Storage Element 11:Empty
+ Storage Element 12:Empty
+ Storage Element 13:Empty
+ Storage Element 14:Empty
+ Storage Element 15:Empty
+ Storage Element 16:Empty
+ Storage Element 17:Empty
+ Storage Element 18:Empty
+ Storage Element 19:Empty
+ Storage Element 20:Empty
+ Storage Element 21 IMPORT/EXPORT:Empty
+ Storage Element 22 IMPORT/EXPORT:Empty
+ Storage Element 23 IMPORT/EXPORT:Empty
+ Storage Element 24 IMPORT/EXPORT:Empty
+"###;
+
+ let _ = parse_mtx_status(&output)?;
+
+ Ok(())
+}
--
2.20.1
next reply other threads:[~2021-01-26 10:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-26 10:49 Dominik Csapak [this message]
2021-01-26 11:54 ` 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=20210126104939.30218-1-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox