diff options
author | Daniel Mueller <deso@posteo.net> | 2019-05-27 08:09:48 -0700 |
---|---|---|
committer | Daniel Mueller <deso@posteo.net> | 2019-05-27 08:09:48 -0700 |
commit | d35cdf7f0a9822f73f4e1d18494350840de2a421 (patch) | |
tree | 6d22dd85516c5363a81c9264bc30a53cf244d632 /nitrocli/src/tests/status.rs | |
parent | a7b63f8a0570f0c798af7eaadfaf6f4da14cd54c (diff) | |
download | nitrocli-d35cdf7f0a9822f73f4e1d18494350840de2a421.tar.gz nitrocli-d35cdf7f0a9822f73f4e1d18494350840de2a421.tar.bz2 |
Move storage status subcommand into status command
In an attempt to rework the structure of the storage command to better
accommodate future requirements for allowing to change the read-write
state of the unencrypted volume (as well as potentially the encrypted
one), this change removes the storage status subcommand and merges its
output into the storage command.
Diffstat (limited to 'nitrocli/src/tests/status.rs')
-rw-r--r-- | nitrocli/src/tests/status.rs | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/nitrocli/src/tests/status.rs b/nitrocli/src/tests/status.rs index 83ce61f..7aac5ad 100644 --- a/nitrocli/src/tests/status.rs +++ b/nitrocli/src/tests/status.rs @@ -37,10 +37,10 @@ fn not_found() { } #[test_device] -fn output(device: nitrokey::DeviceWrapper) -> crate::Result<()> { +fn output_pro(device: nitrokey::Pro) -> crate::Result<()> { let re = regex::Regex::new( r#"^Status: - model: (Pro|Storage) + model: Pro serial number: 0x[[:xdigit:]]{8} firmware version: \d+\.\d+ user retry count: [0-3] @@ -53,3 +53,29 @@ $"#, assert!(re.is_match(&out), out); Ok(()) } + +#[test_device] +fn output_storage(device: nitrokey::Storage) -> crate::Result<()> { + let re = regex::Regex::new( + r#"^Status: + model: Storage + serial number: 0x[[:xdigit:]]{8} + firmware version: \d+\.\d+ + user retry count: [0-3] + admin retry count: [0-3] + Storage: + SD card ID: 0x[[:xdigit:]]{8} + firmware: (un)?locked + storage keys: (not )?created + volumes: + unencrypted: (read-only|active|inactive) + encrypted: (read-only|active|inactive) + hidden: (read-only|active|inactive) +$"#, + ) + .unwrap(); + + let out = Nitrocli::with_dev(device).handle(&["status"])?; + assert!(re.is_match(&out), out); + Ok(()) +} |