Skip to content

Commit

Permalink
test(block_storage): add test_volume_create_with_fields
Browse files Browse the repository at this point in the history
Signed-off-by: Sandro-Alessio Gierens <[email protected]>
  • Loading branch information
gierens committed Mar 16, 2024
1 parent 2a4595a commit 8748625
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/integration-block-storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,22 @@ async fn test_volume_create_get_delete_simple() {
let volume3 = os.get_volume(id).await;
assert!(volume3.is_err());
}

#[tokio::test]
async fn test_volume_create_with_fields() {
let os = set_up().await;

let volume = os
.new_volume(1 as u64)
.with_name("test_volume")
.with_description("test_description")
.create()
.await
.expect("Could not create volume");
assert_eq!(volume.name(), "test_volume");
assert_eq!(*volume.description(), Some("test_description".to_string()));
assert_eq!(*volume.size(), 1 as u64);
assert_eq!(*volume.status(), VolumeStatus::Available);

volume.delete().await.expect("Could not delete volume");
}

0 comments on commit 8748625

Please sign in to comment.