blueprint: test minsize and sector-size validation
This commit is contained in:
parent
90733e79f3
commit
fa15541ea5
1 changed files with 44 additions and 0 deletions
|
|
@ -285,3 +285,47 @@ func TestGetFilesystems(t *testing.T) {
|
||||||
|
|
||||||
assert.ElementsMatch(t, expectedFilesystems, retFilesystems)
|
assert.ElementsMatch(t, expectedFilesystems, retFilesystems)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestGetFilesystemsMinSize(t *testing.T) {
|
||||||
|
|
||||||
|
expectedFilesystems := []FilesystemCustomization{
|
||||||
|
{
|
||||||
|
MinSize: 1024,
|
||||||
|
Mountpoint: "/",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MinSize: 4096,
|
||||||
|
Mountpoint: "/var",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
TestCustomizations := Customizations{
|
||||||
|
Filesystem: expectedFilesystems,
|
||||||
|
}
|
||||||
|
|
||||||
|
retFilesystemsSize := TestCustomizations.GetFilesystemsMinSize()
|
||||||
|
|
||||||
|
assert.EqualValues(t, uint64(5120), retFilesystemsSize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestGetFilesystemsMinSizeNonSectorSize(t *testing.T) {
|
||||||
|
|
||||||
|
expectedFilesystems := []FilesystemCustomization{
|
||||||
|
{
|
||||||
|
MinSize: 1025,
|
||||||
|
Mountpoint: "/",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MinSize: 4097,
|
||||||
|
Mountpoint: "/var",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
TestCustomizations := Customizations{
|
||||||
|
Filesystem: expectedFilesystems,
|
||||||
|
}
|
||||||
|
|
||||||
|
retFilesystemsSize := TestCustomizations.GetFilesystemsMinSize()
|
||||||
|
|
||||||
|
assert.EqualValues(t, uint64(5632), retFilesystemsSize)
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue