IF Commons GitHub

physical/observe

Written to: 2 requirements: 2 proved, 0 partly, 0 failing, 0 with no test recorded. 0003-linux-observe-observe FR-001, 0003-linux-observe-observe FR-002

Observing a Linux machine with no change: for each requirement, the programs that read what it declares (getent, id, stat, cat, systemctl is-active, systemctl is-enabled, dpkg-query, readlink) are run through the way of running a program that is given (here, over ssh, in a container or on the machine itself), with the prefix that raises rights where there is one, and what they print is read by the shapes of the Logical layer. A resource that is not there has no entry. Observation is by this library and change is by a dialect: nothing here writes.

import { READERS } from "./observe.ts";
READERS.includes("getent"); // true

Source: commons/linux-observe/src/physical/observe.ts

3 of 6 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.

physical.READERSconstno test imports it
const READERS: readonly ["getent", "id", "stat", "cat", "systemctl", "dpkg-query", "rpm", "pacman", "readlink", "uname"]

The programs that observation runs, and no others: every one of them only reads.

physical.observeRequirementsfunctionno test imports it
function observeRequirements(executor: Executor, requirements: readonly Requirement[], elevate?: readonly string[], family?: "arch" | "debian" | "rhel" | "suse"): Promise<ReadonlyMap<RequirementId, JsonValue>>

What is on the machine, in the shape of each requirement's desired state, read with no change: a resource that is not there has no entry.

physical.observePlatformfunctionno test imports it
function observePlatform(executor: Executor, elevate?: readonly string[]): Promise<Result<Observed, string>>

The platform of the machine, read with no change from /etc/os-release and uname -m, or why it is not one Archon knows.

READERSconst
const READERS: readonly ["getent", "id", "stat", "cat", "systemctl", "dpkg-query", "rpm", "pacman", "readlink", "uname"]

The programs that observation runs, and no others: every one of them only reads.

Imported by 5 tests of the run (5 passed, 0 failed): the library's results

observeRequirementsfunction
function observeRequirements(executor: Executor, requirements: readonly Requirement[], elevate?: readonly string[], family?: "arch" | "debian" | "rhel" | "suse"): Promise<ReadonlyMap<RequirementId, JsonValue>>

What is on the machine, in the shape of each requirement's desired state, read with no change: a resource that is not there has no entry.

Imported by 8 tests of the run (8 passed, 0 failed): the library's results

observePlatformfunction
function observePlatform(executor: Executor, elevate?: readonly string[]): Promise<Result<Observed, string>>

The platform of the machine, read with no change from /etc/os-release and uname -m, or why it is not one Archon knows.

Imported by 3 tests of the run (3 passed, 0 failed): the library's results

Titles, headings, exports, tables, columns and requirements. Esc closes.