@@ -15,14 +15,6 @@ use crate::{get_bck_command, get_test_image};
15
15
pub fn test_libvirt_list_functionality ( ) {
16
16
let bck = get_bck_command ( ) . unwrap ( ) ;
17
17
18
- // Check if virsh is available
19
- let virsh_check = Command :: new ( "which" ) . arg ( "virsh" ) . output ( ) ;
20
-
21
- if virsh_check. is_err ( ) || !virsh_check. unwrap ( ) . status . success ( ) {
22
- println ! ( "Skipping libvirt list test - virsh not available" ) ;
23
- return ;
24
- }
25
-
26
18
let output = Command :: new ( & bck)
27
19
. args ( [ "libvirt" , "list" ] )
28
20
. output ( )
@@ -197,12 +189,6 @@ pub fn test_libvirt_ssh_integration() {
197
189
198
190
/// Test full libvirt run + SSH workflow like run_ephemeral SSH tests
199
191
pub fn test_libvirt_run_ssh_full_workflow ( ) {
200
- // Skip if running in CI/container environment without libvirt
201
- if std:: env:: var ( "CI" ) . is_ok ( ) || !std:: path:: Path :: new ( "/usr/bin/virsh" ) . exists ( ) {
202
- println ! ( "Skipping full SSH workflow test - no libvirt available" ) ;
203
- return ;
204
- }
205
-
206
192
let bck = get_bck_command ( ) . unwrap ( ) ;
207
193
let test_image = get_test_image ( ) ;
208
194
@@ -254,36 +240,6 @@ pub fn test_libvirt_run_ssh_full_workflow() {
254
240
if !create_output. status . success ( ) {
255
241
cleanup_domain ( & domain_name) ;
256
242
257
- // Check for acceptable failures (no libvirt, permissions, etc.)
258
- let acceptable_failures = [
259
- "pool" ,
260
- "connect" ,
261
- "Permission denied" ,
262
- "libvirt" ,
263
- "KVM" ,
264
- "kvm" ,
265
- "nested" ,
266
- "hardware" ,
267
- "acceleration" ,
268
- "Storage pool" ,
269
- "qemu" ,
270
- "network" ,
271
- ] ;
272
-
273
- let is_acceptable = acceptable_failures. iter ( ) . any ( |& pattern| {
274
- create_stderr
275
- . to_lowercase ( )
276
- . contains ( & pattern. to_lowercase ( ) )
277
- } ) ;
278
-
279
- if is_acceptable {
280
- println ! (
281
- "Skipping full SSH workflow test - libvirt not properly configured: {}" ,
282
- create_stderr
283
- ) ;
284
- return ;
285
- }
286
-
287
243
panic ! ( "Failed to create domain with SSH: {}" , create_stderr) ;
288
244
}
289
245
@@ -320,31 +276,7 @@ pub fn test_libvirt_run_ssh_full_workflow() {
320
276
321
277
// Check SSH results
322
278
if !ssh_output. status . success ( ) {
323
- // SSH might fail due to VM not being ready, network issues, etc.
324
- let acceptable_ssh_failures = [
325
- "connection" ,
326
- "timeout" ,
327
- "refused" ,
328
- "network" ,
329
- "ssh" ,
330
- "not running" ,
331
- "boot" ,
332
- ] ;
333
-
334
- let is_acceptable = acceptable_ssh_failures
335
- . iter ( )
336
- . any ( |& pattern| ssh_stderr. to_lowercase ( ) . contains ( & pattern. to_lowercase ( ) ) ) ;
337
-
338
- if is_acceptable {
339
- println ! (
340
- "SSH connection failed (may be expected in test environment): {}" ,
341
- ssh_stderr
342
- ) ;
343
- println ! ( "Full workflow test completed - domain creation and SSH integration working" ) ;
344
- return ;
345
- }
346
-
347
- panic ! ( "SSH connection failed unexpectedly: {}" , ssh_stderr) ;
279
+ panic ! ( "SSH connection failed: {}" , ssh_stderr) ;
348
280
}
349
281
350
282
// Verify we got the expected output
@@ -436,12 +368,6 @@ fn wait_for_ssh_available(
436
368
437
369
/// Test VM startup and shutdown with libvirt run
438
370
pub fn test_libvirt_vm_lifecycle ( ) {
439
- // Skip if running in CI/container environment without libvirt
440
- if std:: env:: var ( "CI" ) . is_ok ( ) || !std:: path:: Path :: new ( "/usr/bin/virsh" ) . exists ( ) {
441
- println ! ( "Skipping VM lifecycle test - no libvirt available" ) ;
442
- return ;
443
- }
444
-
445
371
let bck = get_bck_command ( ) . unwrap ( ) ;
446
372
let test_volume = "test-vm-lifecycle" ;
447
373
let domain_name = format ! ( "bootc-{}" , test_volume) ;
@@ -473,18 +399,7 @@ pub fn test_libvirt_vm_lifecycle() {
473
399
474
400
if !output. status . success ( ) {
475
401
let stderr = String :: from_utf8_lossy ( & output. stderr ) ;
476
- println ! ( "Create failed (expected in CI): {}" , stderr) ;
477
-
478
- // If creation fails (e.g., no libvirt storage), skip the test
479
- if stderr. contains ( "pool" )
480
- || stderr. contains ( "connect" )
481
- || stderr. contains ( "Permission denied" )
482
- {
483
- println ! ( "Skipping VM lifecycle test - libvirt not properly configured" ) ;
484
- return ;
485
- }
486
-
487
- panic ! ( "Unexpected failure in VM creation: {}" , stderr) ;
402
+ panic ! ( "Failed to create VM: {}" , stderr) ;
488
403
}
489
404
490
405
println ! ( "Created VM domain: {}" , domain_name) ;
@@ -524,27 +439,7 @@ pub fn test_libvirt_vm_lifecycle() {
524
439
}
525
440
} else {
526
441
let stderr = String :: from_utf8_lossy ( & start_output. stderr ) ;
527
- println ! ( "VM start failed (may be expected): {}" , stderr) ;
528
-
529
- // Some failures are acceptable (no KVM, nested virtualization, etc.)
530
- let acceptable_failures = [
531
- "KVM" ,
532
- "kvm" ,
533
- "nested" ,
534
- "hardware" ,
535
- "acceleration" ,
536
- "permission" ,
537
- "qemu" ,
538
- "network" ,
539
- ] ;
540
-
541
- let is_acceptable = acceptable_failures
542
- . iter ( )
543
- . any ( |& pattern| stderr. to_lowercase ( ) . contains ( pattern) ) ;
544
-
545
- if !is_acceptable {
546
- panic ! ( "Unexpected VM start failure: {}" , stderr) ;
547
- }
442
+ panic ! ( "VM start failed: {}" , stderr) ;
548
443
}
549
444
550
445
// Cleanup - remove the domain
0 commit comments