@@ -17,7 +17,7 @@ const (
17
17
var TestPartitionTables = map [string ]PartitionTable {
18
18
"plain" : {
19
19
UUID : "D209C89E-EA5E-4FBD-B161-B461CCE297E0" ,
20
- Type : "gpt" ,
20
+ Type : PT_GPT ,
21
21
Partitions : []Partition {
22
22
{
23
23
Size : 1 * MiB ,
@@ -69,7 +69,7 @@ var TestPartitionTables = map[string]PartitionTable{
69
69
70
70
"plain-noboot" : {
71
71
UUID : "D209C89E-EA5E-4FBD-B161-B461CCE297E0" ,
72
- Type : "gpt" ,
72
+ Type : PT_GPT ,
73
73
Partitions : []Partition {
74
74
{
75
75
Size : 1 * MiB ,
@@ -108,7 +108,7 @@ var TestPartitionTables = map[string]PartitionTable{
108
108
109
109
"luks" : {
110
110
UUID : "D209C89E-EA5E-4FBD-B161-B461CCE297E0" ,
111
- Type : "gpt" ,
111
+ Type : PT_GPT ,
112
112
Partitions : []Partition {
113
113
{
114
114
Size : 1 * MiB ,
@@ -163,7 +163,7 @@ var TestPartitionTables = map[string]PartitionTable{
163
163
},
164
164
"luks+lvm" : {
165
165
UUID : "D209C89E-EA5E-4FBD-B161-B461CCE297E0" ,
166
- Type : "gpt" ,
166
+ Type : PT_GPT ,
167
167
Partitions : []Partition {
168
168
{
169
169
Size : 1 * MiB ,
@@ -238,7 +238,7 @@ var TestPartitionTables = map[string]PartitionTable{
238
238
},
239
239
"btrfs" : {
240
240
UUID : "D209C89E-EA5E-4FBD-B161-B461CCE297E0" ,
241
- Type : "gpt" ,
241
+ Type : PT_GPT ,
242
242
Partitions : []Partition {
243
243
{
244
244
Size : 1 * MiB ,
@@ -544,7 +544,7 @@ func TestRelayout(t *testing.T) {
544
544
testCases := map [string ]testCase {
545
545
"simple-dos" : {
546
546
pt : & PartitionTable {
547
- Type : "dos" ,
547
+ Type : PT_DOS ,
548
548
Size : 100 * MiB ,
549
549
Partitions : []Partition {
550
550
{
@@ -560,7 +560,7 @@ func TestRelayout(t *testing.T) {
560
560
},
561
561
size : 100 * MiB ,
562
562
expected : & PartitionTable {
563
- Type : "dos" ,
563
+ Type : PT_DOS ,
564
564
Size : 100 * MiB ,
565
565
Partitions : []Partition {
566
566
{
@@ -579,7 +579,7 @@ func TestRelayout(t *testing.T) {
579
579
},
580
580
"simple-gpt" : {
581
581
pt : & PartitionTable {
582
- Type : "gpt" ,
582
+ Type : PT_GPT ,
583
583
Size : 100 * MiB ,
584
584
Partitions : []Partition {
585
585
{
@@ -595,7 +595,7 @@ func TestRelayout(t *testing.T) {
595
595
},
596
596
size : 100 * MiB ,
597
597
expected : & PartitionTable {
598
- Type : "gpt" ,
598
+ Type : PT_GPT ,
599
599
Size : 100 * MiB ,
600
600
Partitions : []Partition {
601
601
{
@@ -614,7 +614,7 @@ func TestRelayout(t *testing.T) {
614
614
},
615
615
"simple-gpt-root-first" : {
616
616
pt : & PartitionTable {
617
- Type : "gpt" ,
617
+ Type : PT_GPT ,
618
618
Size : 100 * MiB ,
619
619
Partitions : []Partition {
620
620
{
@@ -633,7 +633,7 @@ func TestRelayout(t *testing.T) {
633
633
},
634
634
size : 100 * MiB ,
635
635
expected : & PartitionTable {
636
- Type : "gpt" ,
636
+ Type : PT_GPT ,
637
637
Size : 100 * MiB ,
638
638
Partitions : []Partition {
639
639
{
@@ -656,7 +656,7 @@ func TestRelayout(t *testing.T) {
656
656
},
657
657
"lvm-dos" : {
658
658
pt : & PartitionTable {
659
- Type : "dos" ,
659
+ Type : PT_DOS ,
660
660
Size : 100 * MiB ,
661
661
Partitions : []Partition {
662
662
{
@@ -678,7 +678,7 @@ func TestRelayout(t *testing.T) {
678
678
},
679
679
size : 100 * MiB ,
680
680
expected : & PartitionTable {
681
- Type : "dos" ,
681
+ Type : PT_DOS ,
682
682
Size : 100 * MiB ,
683
683
Partitions : []Partition {
684
684
{
@@ -703,7 +703,7 @@ func TestRelayout(t *testing.T) {
703
703
},
704
704
"lvm-gpt" : {
705
705
pt : & PartitionTable {
706
- Type : "gpt" ,
706
+ Type : PT_GPT ,
707
707
Size : 100 * MiB ,
708
708
Partitions : []Partition {
709
709
{
@@ -726,7 +726,7 @@ func TestRelayout(t *testing.T) {
726
726
},
727
727
size : 100 * MiB ,
728
728
expected : & PartitionTable {
729
- Type : "gpt" ,
729
+ Type : PT_GPT ,
730
730
Size : 100 * MiB ,
731
731
Partitions : []Partition {
732
732
{
@@ -752,7 +752,7 @@ func TestRelayout(t *testing.T) {
752
752
},
753
753
"lvm-gpt-multilv" : {
754
754
pt : & PartitionTable {
755
- Type : "gpt" ,
755
+ Type : PT_GPT ,
756
756
Size : 100 * MiB ,
757
757
Partitions : []Partition {
758
758
{
@@ -778,7 +778,7 @@ func TestRelayout(t *testing.T) {
778
778
},
779
779
size : 100 * MiB ,
780
780
expected : & PartitionTable {
781
- Type : "gpt" ,
781
+ Type : PT_GPT ,
782
782
Size : 100 * MiB ,
783
783
Partitions : []Partition {
784
784
{
@@ -807,7 +807,7 @@ func TestRelayout(t *testing.T) {
807
807
},
808
808
"btrfs" : {
809
809
pt : & PartitionTable {
810
- Type : "gpt" ,
810
+ Type : PT_GPT ,
811
811
Size : 100 * MiB ,
812
812
Partitions : []Partition {
813
813
{
@@ -831,7 +831,7 @@ func TestRelayout(t *testing.T) {
831
831
},
832
832
size : 100 * MiB ,
833
833
expected : & PartitionTable {
834
- Type : "gpt" ,
834
+ Type : PT_GPT ,
835
835
Size : 100 * MiB ,
836
836
Partitions : []Partition {
837
837
{
@@ -858,7 +858,7 @@ func TestRelayout(t *testing.T) {
858
858
},
859
859
"simple-dos-grow-pt" : {
860
860
pt : & PartitionTable {
861
- Type : "dos" ,
861
+ Type : PT_DOS ,
862
862
Size : 100 * MiB ,
863
863
Partitions : []Partition {
864
864
{
@@ -874,7 +874,7 @@ func TestRelayout(t *testing.T) {
874
874
},
875
875
size : 100 * MiB ,
876
876
expected : & PartitionTable {
877
- Type : "dos" ,
877
+ Type : PT_DOS ,
878
878
Size : 211 * MiB , // grows to fit partitions and header
879
879
Partitions : []Partition {
880
880
{
@@ -893,7 +893,7 @@ func TestRelayout(t *testing.T) {
893
893
},
894
894
"simple-gpt-growpt" : {
895
895
pt : & PartitionTable {
896
- Type : "gpt" ,
896
+ Type : PT_GPT ,
897
897
Size : 100 * MiB ,
898
898
Partitions : []Partition {
899
899
{
@@ -909,7 +909,7 @@ func TestRelayout(t *testing.T) {
909
909
},
910
910
size : 42 * MiB ,
911
911
expected : & PartitionTable {
912
- Type : "gpt" ,
912
+ Type : PT_GPT ,
913
913
Size : 512 * MiB , // grows to fit partitions, header, and footer
914
914
Partitions : []Partition {
915
915
{
@@ -928,7 +928,7 @@ func TestRelayout(t *testing.T) {
928
928
},
929
929
"lvm-gpt-grow" : {
930
930
pt : & PartitionTable {
931
- Type : "gpt" ,
931
+ Type : PT_GPT ,
932
932
Size : 10 * MiB ,
933
933
Partitions : []Partition {
934
934
{
@@ -954,7 +954,7 @@ func TestRelayout(t *testing.T) {
954
954
},
955
955
size : 100 * MiB ,
956
956
expected : & PartitionTable {
957
- Type : "gpt" ,
957
+ Type : PT_GPT ,
958
958
Size : 702 * MiB ,
959
959
Partitions : []Partition {
960
960
{
@@ -983,7 +983,7 @@ func TestRelayout(t *testing.T) {
983
983
},
984
984
"lvm-dos-grow-rootvg" : {
985
985
pt : & PartitionTable {
986
- Type : "dos" ,
986
+ Type : PT_DOS ,
987
987
Size : 10 * MiB , // PT is smaller than the sum of Partitions
988
988
Partitions : []Partition {
989
989
{
@@ -1009,7 +1009,7 @@ func TestRelayout(t *testing.T) {
1009
1009
},
1010
1010
size : 99 * MiB ,
1011
1011
expected : & PartitionTable {
1012
- Type : "dos" ,
1012
+ Type : PT_DOS ,
1013
1013
Size : 325 * MiB ,
1014
1014
Partitions : []Partition {
1015
1015
{
@@ -1038,7 +1038,7 @@ func TestRelayout(t *testing.T) {
1038
1038
},
1039
1039
"lvm-gpt-grow-rootvg" : {
1040
1040
pt : & PartitionTable {
1041
- Type : "gpt" ,
1041
+ Type : PT_GPT ,
1042
1042
Size : 10 * MiB ,
1043
1043
Partitions : []Partition {
1044
1044
{
@@ -1064,7 +1064,7 @@ func TestRelayout(t *testing.T) {
1064
1064
},
1065
1065
size : 99 * MiB ,
1066
1066
expected : & PartitionTable {
1067
- Type : "gpt" ,
1067
+ Type : PT_GPT ,
1068
1068
Size : 326 * MiB ,
1069
1069
Partitions : []Partition {
1070
1070
{
0 commit comments