|
7 | 7 | //! - base-disks prune command |
8 | 8 |
|
9 | 9 | use color_eyre::Result; |
| 10 | +use integration_tests::integration_test; |
10 | 11 | use linkme::distributed_slice; |
| 12 | + |
11 | 13 | use regex::Regex; |
12 | 14 | use std::process::Command; |
13 | 15 |
|
14 | | -use crate::{get_bck_command, get_test_image, run_bcvk, IntegrationTest, INTEGRATION_TESTS}; |
15 | | - |
16 | | -#[distributed_slice(INTEGRATION_TESTS)] |
17 | | -static TEST_BASE_DISK_CREATION_AND_REUSE: IntegrationTest = IntegrationTest::new( |
18 | | - "test_base_disk_creation_and_reuse", |
19 | | - test_base_disk_creation_and_reuse, |
20 | | -); |
| 16 | +use crate::{get_bck_command, get_test_image, run_bcvk}; |
21 | 17 |
|
22 | 18 | /// Test that base disk is created and reused for multiple VMs |
23 | 19 | fn test_base_disk_creation_and_reuse() -> Result<()> { |
@@ -99,10 +95,7 @@ fn test_base_disk_creation_and_reuse() -> Result<()> { |
99 | 95 | println!("✓ Base disk creation and reuse test passed"); |
100 | 96 | Ok(()) |
101 | 97 | } |
102 | | - |
103 | | -#[distributed_slice(INTEGRATION_TESTS)] |
104 | | -static TEST_BASE_DISKS_LIST_COMMAND: IntegrationTest = |
105 | | - IntegrationTest::new("test_base_disks_list_command", test_base_disks_list_command); |
| 98 | +integration_test!(test_base_disk_creation_and_reuse); |
106 | 99 |
|
107 | 100 | /// Test base-disks list command |
108 | 101 | fn test_base_disks_list_command() -> Result<()> { |
@@ -143,12 +136,7 @@ fn test_base_disks_list_command() -> Result<()> { |
143 | 136 | } |
144 | 137 | Ok(()) |
145 | 138 | } |
146 | | - |
147 | | -#[distributed_slice(INTEGRATION_TESTS)] |
148 | | -static TEST_BASE_DISKS_LIST_SHOWS_TIMESTAMP: IntegrationTest = IntegrationTest::new( |
149 | | - "test_base_disks_list_shows_timestamp", |
150 | | - test_base_disks_list_shows_timestamp, |
151 | | -); |
| 139 | +integration_test!(test_base_disks_list_command); |
152 | 140 |
|
153 | 141 | /// Test base-disks list shows creation timestamp |
154 | 142 | fn test_base_disks_list_shows_timestamp() -> Result<()> { |
@@ -218,12 +206,7 @@ fn test_base_disks_list_shows_timestamp() -> Result<()> { |
218 | 206 | } |
219 | 207 | Ok(()) |
220 | 208 | } |
221 | | - |
222 | | -#[distributed_slice(INTEGRATION_TESTS)] |
223 | | -static TEST_BASE_DISKS_PRUNE_DRY_RUN: IntegrationTest = IntegrationTest::new( |
224 | | - "test_base_disks_prune_dry_run", |
225 | | - test_base_disks_prune_dry_run, |
226 | | -); |
| 209 | +integration_test!(test_base_disks_list_shows_timestamp); |
227 | 210 |
|
228 | 211 | /// Test base-disks prune command with dry-run |
229 | 212 | fn test_base_disks_prune_dry_run() -> Result<()> { |
@@ -260,10 +243,7 @@ fn test_base_disks_prune_dry_run() -> Result<()> { |
260 | 243 | } |
261 | 244 | Ok(()) |
262 | 245 | } |
263 | | - |
264 | | -#[distributed_slice(INTEGRATION_TESTS)] |
265 | | -static TEST_VM_DISK_REFERENCES_BASE: IntegrationTest = |
266 | | - IntegrationTest::new("test_vm_disk_references_base", test_vm_disk_references_base); |
| 246 | +integration_test!(test_base_disks_prune_dry_run); |
267 | 247 |
|
268 | 248 | /// Test that VM disks reference base disks correctly |
269 | 249 | fn test_vm_disk_references_base() -> Result<()> { |
@@ -336,6 +316,7 @@ fn test_vm_disk_references_base() -> Result<()> { |
336 | 316 | println!("✓ VM disk reference test passed"); |
337 | 317 | Ok(()) |
338 | 318 | } |
| 319 | +integration_test!(test_vm_disk_references_base); |
339 | 320 |
|
340 | 321 | /// Helper function to cleanup domain and its disk |
341 | 322 | fn cleanup_domain(domain_name: &str) { |
|
0 commit comments