Skip to content

Commit

Permalink
tests/bb: replace hardcoded uuid with uuid variables
Browse files Browse the repository at this point in the history
  • Loading branch information
Rahuls0720 committed Jun 21, 2018
1 parent b900857 commit f93d55e
Show file tree
Hide file tree
Showing 8 changed files with 113 additions and 113 deletions.
28 changes: 14 additions & 14 deletions tests/positive/filesystems/reformat_filesystem.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func ReformatToBTRFS_2_0_0() types.Test {
"format": "btrfs",
"create": {
"force": true,
"options": [ "--label=OEM", "--uuid=CA7D7CCB-63ED-4C53-861C-1742536059D4" ]
"options": [ "--label=OEM", "--uuid=$uuid0" ]
}
}
}]
Expand Down Expand Up @@ -85,7 +85,7 @@ func ReformatToXFS_2_0_0() types.Test {
"format": "xfs",
"create": {
"force": true,
"options": [ "-L", "OEM", "-m", "uuid=CA7D7CCB-63ED-4C53-861C-1742536059CD" ]
"options": [ "-L", "OEM", "-m", "uuid=$uuid0" ]
}
}
}]
Expand Down Expand Up @@ -121,14 +121,14 @@ func ReformatToVFAT_2_0_0() types.Test {
"format": "vfat",
"create": {
"force": true,
"options": [ "-n", "OEM", "-i", "CA7D7CCB-63ED-4C53-861C-1742536059CE" ]
"options": [ "-n", "OEM", "-i", "$uuid0" ]
}
}
}]
}
}`
out[0].Partitions.GetPartition("OEM").FilesystemType = "vfat"
out[0].Partitions.GetPartition("OEM").FilesystemUUID = "CA7D7CCB-63ED-4C53-861C-1742536059CE"
out[0].Partitions.GetPartition("OEM").FilesystemUUID = "$uuid0"

return types.Test{
Name: name,
Expand Down Expand Up @@ -158,15 +158,15 @@ func ReformatToEXT4_2_0_0() types.Test {
"format": "ext4",
"create": {
"force": true,
"options": [ "-L", "OEM", "-U", "CA7D7CCB-63ED-4C53-861C-1742536059CF" ]
"options": [ "-L", "OEM", "-U", "$uuid0" ]
}
}
}]
}
}`
in[0].Partitions.GetPartition("OEM").FilesystemType = "ext2"
out[0].Partitions.GetPartition("OEM").FilesystemType = "ext4"
out[0].Partitions.GetPartition("OEM").FilesystemUUID = "CA7D7CCB-63ED-4C53-861C-1742536059CF"
out[0].Partitions.GetPartition("OEM").FilesystemUUID = "$uuid0"

return types.Test{
Name: name,
Expand Down Expand Up @@ -195,14 +195,14 @@ func ReformatToBTRFS_2_1_0() types.Test {
"device": "$DEVICE",
"format": "btrfs",
"label": "OEM",
"uuid": "CA7D7CCB-63ED-4C53-861C-1742536059D0",
"uuid": "$uuid0",
"wipeFilesystem": true
}
}]
}
}`
out[0].Partitions.GetPartition("OEM").FilesystemType = "btrfs"
out[0].Partitions.GetPartition("OEM").FilesystemUUID = "CA7D7CCB-63ED-4C53-861C-1742536059D0"
out[0].Partitions.GetPartition("OEM").FilesystemUUID = "$uuid0"

return types.Test{
Name: name,
Expand Down Expand Up @@ -231,14 +231,14 @@ func ReformatToXFS_2_1_0() types.Test {
"device": "$DEVICE",
"format": "xfs",
"label": "OEM",
"uuid": "CA7D7CCB-63ED-4C53-861C-1742536059D1",
"uuid": "$uuid0",
"wipeFilesystem": true
}
}]
}
}`
out[0].Partitions.GetPartition("OEM").FilesystemType = "xfs"
out[0].Partitions.GetPartition("OEM").FilesystemUUID = "CA7D7CCB-63ED-4C53-861C-1742536059D1"
out[0].Partitions.GetPartition("OEM").FilesystemUUID = "$uuid0"

return types.Test{
Name: name,
Expand Down Expand Up @@ -303,15 +303,15 @@ func ReformatToEXT4_2_1_0() types.Test {
"device": "$DEVICE",
"format": "ext4",
"label": "OEM",
"uuid": "CA7D7CCB-63ED-4C53-861C-1742536059D2",
"uuid": "$uuid0",
"wipeFilesystem": true
}
}]
}
}`
in[0].Partitions.GetPartition("OEM").FilesystemType = "ext2"
out[0].Partitions.GetPartition("OEM").FilesystemType = "ext4"
out[0].Partitions.GetPartition("OEM").FilesystemUUID = "CA7D7CCB-63ED-4C53-861C-1742536059D2"
out[0].Partitions.GetPartition("OEM").FilesystemUUID = "$uuid0"

return types.Test{
Name: name,
Expand Down Expand Up @@ -340,15 +340,15 @@ func ReformatToSWAP_2_1_0() types.Test {
"device": "$DEVICE",
"format": "swap",
"label": "OEM",
"uuid": "CA7D7CCB-63ED-4C53-861C-1742536059D3",
"uuid": "$uuid0",
"wipeFilesystem": true
}
}]
}
}`
in[0].Partitions.GetPartition("OEM").FilesystemType = "ext2"
out[0].Partitions.GetPartition("OEM").FilesystemType = "swap"
out[0].Partitions.GetPartition("OEM").FilesystemUUID = "CA7D7CCB-63ED-4C53-861C-1742536059D3"
out[0].Partitions.GetPartition("OEM").FilesystemUUID = "$uuid0"

return types.Test{
Name: name,
Expand Down
6 changes: 3 additions & 3 deletions tests/positive/filesystems/reuse_filesystem.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func ReuseExistingFilesystem() types.Test {
"wipeFilesystem": false,
"format": "xfs",
"label": "data",
"uuid": "8A7A6E26-5E8F-4CCA-A654-46215D4696AC"
"uuid": "$uuid2"
}
}
]
Expand All @@ -58,7 +58,7 @@ func ReuseExistingFilesystem() types.Test {
Length: 2621440,
FilesystemType: "xfs",
FilesystemLabel: "data",
FilesystemUUID: "8A7A6E26-5E8F-4CCA-A654-46215D4696AC",
FilesystemUUID: "$uuid2",
Files: []types.File{
{
Node: types.Node{
Expand All @@ -80,7 +80,7 @@ func ReuseExistingFilesystem() types.Test {
Length: 2621440,
FilesystemType: "xfs",
FilesystemLabel: "data",
FilesystemUUID: "8A7A6E26-5E8F-4CCA-A654-46215D4696AC",
FilesystemUUID: "$uuid2",
Files: []types.File{
{
Node: types.Node{
Expand Down
44 changes: 22 additions & 22 deletions tests/positive/partitions/complex.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ func KitchenSink() types.Test {
"number": 1,
"start": 2048,
"size": 65536,
"typeGuid": "316f19f9-9e0f-431e-859e-ae6908dbe8ca",
"guid": "53f2e871-f468-437c-b90d-f3c6409df81a",
"typeGuid": "$uuid0",
"guid": "$uuid1",
"wipePartitionEntry": true
},
{
Expand All @@ -57,8 +57,8 @@ func KitchenSink() types.Test {
"number": 3,
"size": 0,
"start": 0,
"typeGuid": "6050e8fc-1e31-473b-bcc0-714e32fcb09d",
"guid": "f14984bc-6f08-4885-b668-526263469a00",
"typeGuid": "$uuid2",
"guid": "$uuid3",
"wipePartitionEntry": true
},
{
Expand All @@ -82,22 +82,22 @@ func KitchenSink() types.Test {
Label: "p1",
Number: 1,
Length: 131072,
TypeGUID: "316f19f9-9e0f-431e-859e-ae6908dbe8ca",
GUID: "3ED3993F-0016-422B-B134-09FCBA6F66EF",
TypeGUID: "$uuid0",
GUID: "$uuid4",
},
{
Label: "dont-delete",
Number: 2,
Length: 65536,
TypeGUID: "F39C522B-9966-4429-A8F8-417CD5D83E5E",
GUID: "26cc1e6a-39a2-4502-a957-28f8e0ac00e7",
TypeGUID: "$uuid5",
GUID: "$uuid6",
},
{
Label: "garbo-town",
Number: 3,
Length: 65536,
TypeGUID: "9dfde6db-a308-497b-9f8c-55db12d4d9a1",
GUID: "115ee54b-00bd-4afe-be9b-bf1912dec92d",
TypeGUID: "$uuid7",
GUID: "$uuid8",
},
{
TypeCode: "blank",
Expand All @@ -107,15 +107,15 @@ func KitchenSink() types.Test {
Label: "more-junk",
Number: 4,
Length: 65536,
TypeGUID: "ee378f79-6b7a-4f7a-8029-7a5736d12bbf",
GUID: "5e89fa40-183c-4346-b2e1-2f10fa2190e1",
TypeGUID: "$uuid9",
GUID: "$uuid10",
},
{
Label: "dont-delete2",
Number: 5,
Length: 65536,
TypeGUID: "9dd1a91a-a39a-4594-b431-60a7fb630bcb",
GUID: "39baf7ef-cb3e-4343-8bfc-c2391b8b5607",
TypeGUID: "$uuid11",
GUID: "$uuid12",
},
{
TypeCode: "blank",
Expand All @@ -130,29 +130,29 @@ func KitchenSink() types.Test {
Label: "p1",
Number: 1,
Length: 65536,
TypeGUID: "316f19f9-9e0f-431e-859e-ae6908dbe8ca",
GUID: "53f2e871-f468-437c-b90d-f3c6409df81a",
TypeGUID: "$uuid0",
GUID: "$uuid1",
},
{
Label: "dont-delete",
Number: 2,
Length: 65536,
TypeGUID: "F39C522B-9966-4429-A8F8-417CD5D83E5E",
GUID: "26cc1e6a-39a2-4502-a957-28f8e0ac00e7",
TypeGUID: "$uuid5",
GUID: "$uuid6",
},
{
Label: "new-biggest",
Number: 3,
Length: 262144,
TypeGUID: "6050e8fc-1e31-473b-bcc0-714e32fcb09d",
GUID: "f14984bc-6f08-4885-b668-526263469a00",
TypeGUID: "$uuid2",
GUID: "$uuid3",
},
{
Label: "dont-delete2",
Number: 5,
Length: 65536,
TypeGUID: "9dd1a91a-a39a-4594-b431-60a7fb630bcb",
GUID: "39baf7ef-cb3e-4343-8bfc-c2391b8b5607",
TypeGUID: "$uuid11",
GUID: "$uuid12",
},
{
TypeCode: "blank",
Expand Down
Loading

0 comments on commit f93d55e

Please sign in to comment.