FakeHost
class FakeHost(val platform: String = "fake", val os: String = "linux", val arch: String = "x86_64", env: Map<String, String> = emptyMap(), files: Map<String, String> = emptyMap(), commands: Map<List<String>, CommandResult> = emptyMap(), canRun: Boolean = true, facts: List<Attribute> = emptyList(), val capabilities: Set<Capability> = Capability.entries.toSet(), sync: List<Long>? = null) : Host(source)
Constructors
Link copied to clipboard
constructor(platform: String = "fake", os: String = "linux", arch: String = "x86_64", env: Map<String, String> = emptyMap(), files: Map<String, String> = emptyMap(), commands: Map<List<String>, CommandResult> = emptyMap(), canRun: Boolean = true, facts: List<Attribute> = emptyList(), capabilities: Set<Capability> = Capability.entries.toSet(), sync: List<Long>? = null)
Functions
Link copied to clipboard
Null off Linux, without cgroup v2, or when none of the four counters can be read.
Link copied to clipboard
open fun run(argv: List<String>, timeoutMillis: Long? = null, onOutput: (String) -> Unit): CommandResult?
Like run, but hands the merged output to onOutput while the process runs. The result carries the exit code and an empty output; the callback has seen all of it. Past timeoutMillis the child is killed and the result carries TIMED_OUT_EXIT_CODE. A host that can measure the child fills CommandResult.usage.