IF Commons GitHub

logical/routes

Written to: 1 requirement: 1 proved, 0 partly, 0 failing, 0 with no test recorded. 0003-netboot-logical FR-005

What a request for a path is: a boot file, the menu of the network GRUB, the installer image, the menu of one MAC, or one of the files and posts of an install (/install/<host>/<token>/<mac>/<what>). TFTP and HTTP use the same classification, so that PXE and HTTP boot get the same files. Pure.

import { classify } from "./routes.ts";
classify("/boot/hosts/aa:bb:cc:dd:ee:ff.cfg").kind; // "mac-menu"

Source: commons/netboot/src/logical/routes.ts

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

logical.INSTALL_FILESconstno test imports it
const INSTALL_FILES: readonly ["user-data", "preseed.cfg", "ks.cfg", "autoinst.xml", "meta-data", "vendor-data", "guard.sh", "facts", "event", "done"]

The install's own names under its URL.

logical.InstallFiletypeno test imports it
type InstallFile = (typeof INSTALL_FILES)[number];

A name under an install's URL.

logical.Routetypeno test imports it
type Route = | { readonly kind: "boot-file"; readonly name: string } | { readonly kind: "main-menu" } | { readonly… (463 characters)
type Route =
  | { readonly kind: "boot-file"; readonly name: string }
  | { readonly kind: "main-menu" }
  | { readonly kind: "mac-menu"; readonly mac: string }
  | { readonly kind: "host-boot-file"; readonly host: string; readonly name: string }
  | { readonly kind: "iso"; readonly name: string }
  | { readonly kind: "install"; readonly host: string; readonly token: string; readonly mac: string; readonly file: InstallFile }
  | { readonly kind: "unknown" };

What a path is.

logical.classifyfunctionno test imports it
function classify(path: string, bootFiles?: readonly string[]): Route

The kind of route a path is. bootFiles are the names of the files the server holds (bootx64.efi, grubx64.efi, linux, initrd).

INSTALL_FILESconstno test imports it
const INSTALL_FILES: readonly ["user-data", "preseed.cfg", "ks.cfg", "autoinst.xml", "meta-data", "vendor-data", "guard.sh", "facts", "event", "done"]

The install's own names under its URL.

InstallFiletypeno test imports it
type InstallFile = (typeof INSTALL_FILES)[number];

A name under an install's URL.

Routetypeno test imports it
type Route = | { readonly kind: "boot-file"; readonly name: string } | { readonly kind: "main-menu" } | { readonly… (463 characters)
type Route =
  | { readonly kind: "boot-file"; readonly name: string }
  | { readonly kind: "main-menu" }
  | { readonly kind: "mac-menu"; readonly mac: string }
  | { readonly kind: "host-boot-file"; readonly host: string; readonly name: string }
  | { readonly kind: "iso"; readonly name: string }
  | { readonly kind: "install"; readonly host: string; readonly token: string; readonly mac: string; readonly file: InstallFile }
  | { readonly kind: "unknown" };

What a path is.

classifyfunction
function classify(path: string, bootFiles?: readonly string[]): Route

The kind of route a path is. bootFiles are the names of the files the server holds (bootx64.efi, grubx64.efi, linux, initrd).

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

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