Commit bcb5379
committed
cmd/runtimetest/main.go: Unify validateMountsExist and validateMountsOrder
Also increase the error message detail and continue through the
remaining mounts instead of breaking on the first missing/misordered
mount. Based on previous discussion in [1,2]. With this commit,
a configuration like:
"mounts": [
{
"destination": "/tmp",
"type": "tmpfs",
"source": "none"
},
{
"destination": "/tmp",
"type": "tmpfs",
"source": "none"
},
{
"destination": "/dev",
"type": "devtmpfs",
"source": "devtmpfs"
}
]
and mountinfo like:
$ grep -n '/dev \|/tmp ' /proc/self/mountinfo
2:19 17 0:6 / /dev rw,nosuid,relatime - devtmpfs devtmpfs rw,size=10240k,nr_inodes=2043951,mode=755
25:41 17 0:38 / /tmp rw,relatime - tmpfs none rw
will generate errors like:
* mounts[1] {/tmp tmpfs none []} does not exist
* mounts[2] {/dev devtmpfs devtmpfs []} mounted before mounts[0] {/tmp tmpfs none []}
Before this commit, the error was just:
* Mounts[1] /tmp is not mounted in order
I'd prefer errors like:
* mounts[1] {/tmp tmpfs none []} does not exist
* mounts[2] {/dev devtmpfs devtmpfs []} is system mount 1, while mounts[0] {/tmp tmpfs none []} is system mount 24
where grep reports 2 and 25 because it's counting from one, and
runtimetest reports 1 and 24 because it's counting from zero, but Ma
prefers to not mention the system-mount order [3].
[1]: #444 (comment)
[2]: #444 (comment)
[3]: #456 (comment)
Signed-off-by: W. Trevor King <[email protected]>1 parent 12b47b9 commit bcb5379
1 file changed
+54
-80
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
576 | 576 | | |
577 | 577 | | |
578 | 578 | | |
579 | | - | |
580 | | - | |
581 | | - | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
582 | 584 | | |
583 | 585 | | |
584 | | - | |
585 | | - | |
| 586 | + | |
| 587 | + | |
586 | 588 | | |
587 | 589 | | |
588 | | - | |
589 | | - | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
590 | 596 | | |
591 | 597 | | |
592 | 598 | | |
593 | 599 | | |
594 | 600 | | |
595 | | - | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
596 | 607 | | |
597 | 608 | | |
598 | 609 | | |
599 | 610 | | |
600 | 611 | | |
601 | | - | |
602 | | - | |
603 | | - | |
604 | | - | |
605 | | - | |
606 | | - | |
607 | | - | |
608 | | - | |
609 | | - | |
610 | | - | |
611 | | - | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
612 | 618 | | |
613 | 619 | | |
614 | 620 | | |
615 | 621 | | |
616 | 622 | | |
617 | 623 | | |
618 | | - | |
| 624 | + | |
619 | 625 | | |
620 | 626 | | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
621 | 633 | | |
622 | 634 | | |
623 | 635 | | |
624 | 636 | | |
625 | | - | |
626 | | - | |
627 | | - | |
628 | | - | |
629 | | - | |
630 | | - | |
631 | | - | |
632 | | - | |
633 | | - | |
634 | | - | |
635 | | - | |
636 | | - | |
637 | | - | |
638 | | - | |
639 | | - | |
640 | | - | |
641 | | - | |
642 | | - | |
643 | | - | |
644 | | - | |
645 | | - | |
646 | | - | |
647 | | - | |
648 | | - | |
649 | | - | |
650 | | - | |
651 | | - | |
652 | | - | |
653 | | - | |
654 | | - | |
655 | | - | |
656 | | - | |
657 | | - | |
658 | | - | |
659 | | - | |
660 | | - | |
661 | | - | |
662 | | - | |
663 | | - | |
664 | | - | |
665 | | - | |
666 | | - | |
667 | | - | |
668 | | - | |
669 | | - | |
670 | | - | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
671 | 646 | | |
672 | 647 | | |
673 | | - | |
674 | | - | |
675 | | - | |
676 | | - | |
677 | | - | |
678 | | - | |
679 | | - | |
680 | | - | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
681 | 659 | | |
682 | 660 | | |
683 | 661 | | |
684 | 662 | | |
685 | | - | |
| 663 | + | |
686 | 664 | | |
687 | 665 | | |
688 | 666 | | |
| |||
711 | 689 | | |
712 | 690 | | |
713 | 691 | | |
714 | | - | |
| 692 | + | |
715 | 693 | | |
716 | 694 | | |
717 | | - | |
718 | | - | |
719 | | - | |
720 | | - | |
721 | 695 | | |
722 | 696 | | |
723 | 697 | | |
| |||
0 commit comments