@@ -477,7 +477,9 @@ teardown() {
477
477
478
478
@test " list: Containers and images" {
479
479
local default_image
480
+ local fedora34image
480
481
default_image=" $( get_default_image) "
482
+ fedora34image=" registry.fedoraproject.org/fedora-toolbox:34"
481
483
482
484
local default_container
483
485
default_container=" $( get_system_id) -toolbox-$( get_system_version) "
@@ -498,9 +500,15 @@ teardown() {
498
500
# Check images
499
501
run --keep-empty-lines --separate-stderr " $TOOLBOX " list --images
500
502
503
+ # Alphabetize images
504
+ local image1
505
+ local image2
506
+ image1=" $( printf " $fedora34image \n$default_image " | sort | head -n 1) "
507
+ image2=" $( printf " $fedora34image \n$default_image " | sort | tail -n 1) "
508
+
501
509
assert_success
502
- assert_line --index 1 --partial " registry.fedoraproject.org/fedora-toolbox:34 "
503
- assert_line --index 2 --partial " $default_image "
510
+ assert_line --index 1 --partial " $image1 "
511
+ assert_line --index 2 --partial " $image2 "
504
512
505
513
if check_bats_version 1.10.0; then
506
514
assert [ ${# lines[@]} -eq 3 ]
@@ -513,10 +521,18 @@ teardown() {
513
521
# Check containers
514
522
run --keep-empty-lines --separate-stderr " $TOOLBOX " list --containers
515
523
524
+ # Alphabetize containers
525
+ local container1
526
+ local container2
527
+ local container3
528
+ container1=" $( printf " $default_container \nnon-default-one\nnon-default-two" | sort | head -n 1) "
529
+ container2=" $( printf " $default_container \nnon-default-one\nnon-default-two" | sort | head -n 2 | tail -n 1) "
530
+ container3=" $( printf " $default_container \nnon-default-one\nnon-default-two" | sort | tail -n 1) "
531
+
516
532
assert_success
517
- assert_line --index 1 --partial " $default_container "
518
- assert_line --index 2 --partial " non-default-one "
519
- assert_line --index 3 --partial " non-default-two "
533
+ assert_line --index 1 --partial " $container1 "
534
+ assert_line --index 2 --partial " $container2 "
535
+ assert_line --index 3 --partial " $container3 "
520
536
521
537
if check_bats_version 1.10.0; then
522
538
assert [ ${# lines[@]} -eq 4 ]
@@ -530,11 +546,11 @@ teardown() {
530
546
run --keep-empty-lines --separate-stderr " $TOOLBOX " list
531
547
532
548
assert_success
533
- assert_line --index 1 --partial " registry.fedoraproject.org/fedora-toolbox:34 "
534
- assert_line --index 2 --partial " $default_image "
535
- assert_line --index 5 --partial " $default_container "
536
- assert_line --index 6 --partial " non-default-one "
537
- assert_line --index 7 --partial " non-default-two "
549
+ assert_line --index 1 --partial " $image1 "
550
+ assert_line --index 2 --partial " $image2 "
551
+ assert_line --index 5 --partial " $container1 "
552
+ assert_line --index 6 --partial " $container2 "
553
+ assert_line --index 7 --partial " $container3 "
538
554
539
555
if check_bats_version 1.10.0; then
540
556
assert [ ${# lines[@]} -eq 8 ]
@@ -547,7 +563,9 @@ teardown() {
547
563
548
564
@test " list: Images with and without names" {
549
565
local default_image
566
+ local fedora34image
550
567
default_image=" $( get_default_image) "
568
+ fedora34image=" registry.fedoraproject.org/fedora-toolbox:34"
551
569
552
570
pull_default_image
553
571
pull_distro_image fedora 34
@@ -559,10 +577,16 @@ teardown() {
559
577
560
578
run --keep-empty-lines --separate-stderr " $TOOLBOX " list
561
579
580
+ # Alphabetize images
581
+ local image1
582
+ local image2
583
+ image1=" $( printf " $fedora34image \n$default_image " | sort | head -n 1) "
584
+ image2=" $( printf " $fedora34image \n$default_image " | sort | tail -n 1) "
585
+
562
586
assert_success
563
587
assert_line --index 1 --partial " <none>"
564
- assert_line --index 2 --partial " registry.fedoraproject.org/fedora-toolbox:34 "
565
- assert_line --index 3 --partial " $default_image "
588
+ assert_line --index 2 --partial " $image1 "
589
+ assert_line --index 3 --partial " $image2 "
566
590
567
591
if check_bats_version 1.10.0; then
568
592
assert [ ${# lines[@]} -eq 4 ]
@@ -575,18 +599,26 @@ teardown() {
575
599
576
600
@test " list: Images with and without names (using --images)" {
577
601
local default_image
602
+ local fedora34image
578
603
default_image=" $( get_default_image) "
604
+ fedora34image=" registry.fedoraproject.org/fedora-toolbox:34"
579
605
580
606
pull_default_image
581
607
pull_distro_image fedora 34
582
608
build_image_without_name > /dev/null
583
609
584
610
run --keep-empty-lines --separate-stderr " $TOOLBOX " list --images
585
611
612
+ # Alphabetize images
613
+ local image1
614
+ local image2
615
+ image1=" $( printf " $fedora34image \n$default_image " | sort | head -n 1) "
616
+ image2=" $( printf " $fedora34image \n$default_image " | sort | tail -n 1) "
617
+
586
618
assert_success
587
619
assert_line --index 1 --partial " <none>"
588
- assert_line --index 2 --partial " registry.fedoraproject.org/fedora-toolbox:34 "
589
- assert_line --index 3 --partial " $default_image "
620
+ assert_line --index 2 --partial " $image1 "
621
+ assert_line --index 3 --partial " $image2 "
590
622
591
623
if check_bats_version 1.10.0; then
592
624
assert [ ${# lines[@]} -eq 4 ]
0 commit comments