OS Check
There are the following options for configuration:
- Min OS Version
- Banned model
- Banned board
- Banned bootloader
- Banned CPUs
- Banned device
- Banned hardware
- Banned host
Configuration​
- Default
- Reporting
All the checks we can add:
minOsVersionCheck(minOSVersion: Int)
notManufacturerCheck(manufacturerName: String)
bannedModelCheck(bannedModel: String)
bannedBoardCheck(bannedBoard: String)
bannedCpusCheck(cpuAbi: String)
bannedBootloaderCheck(bannedBootloader: String)
bannedDeviceCheck(device: String)
bannedHardwareCheck(hardware: String)
bannedHostCheck(host: String)
Configuration looks like this:
safeToRun(buildSafeToRunCheckList {
add {
safeToRunCombinedCheck(
listOf(
{ bannedHardwareCheck("hardware") },
{ bannedBoardCheck("board") }
)
)
}
})
The gist of the configuration is to build a 'Conditional'. We have two rules
and
and or
(with is the same as and
)
// This adds a rule so that both minOsVersion and notManufacturer
// are failable rules
failIf(minOsVersion(22))
failIf(notManufacturer("Abc"))
// This rule will not fail if the notManufacturer rule passes
// because if a single 'unless' passes, it doesn't matter how many
// failIfs fail
// This will fail if the minOsVersion is 22, or if the
// manufacturer is "Def" unless the manufacturer is NOT
// "ABC" in which case it'll pass every time
failIf(minOsVersion(22))
failIf(notManufacturer("Def"))
unless(notManufacturer("Abc")
Here are all the checks you can use :
minOsVersion(123)
notManufacturer("")
bannedBoard("")
bannedBootloader("")
bannedCpus("")
bannedDevice("")
bannedHardware("")
bannedHost("")
bannedModel("")
// OS Blacklist version
osDetectionCheck(
conditionalBuilder {
with(minOsVersion(22))
and(notManufacturer("Abc"))
}
).warn()