Horizon Runner The Horizon Runner is the component of Project Horizon that configures a computer to match an input HorizonScript.
Locate HorizonScript
Description / Priority The system needs to load the HorizonScript into memory. If the HorizonScript is a local file, the system needs to ensure it is present and readable. If the HorizonScript is remote, the system needs to proceed to Network Configuration before continuing.
Functional Requirements Runner.Locate.DetermineLocality The system shall determine if the HorizonScript is stored locally or remotely using the following algorithm: If the path to the HorizonScript is not provided, assume the HorizonScript is remote and end the calculation. Priority: Low. If the path to the HorizonScript begins with a single "/" followed by an alphanumeric character, the HorizonScript is local. If the path to the HorizonScript begins with a recognised valid protocol for downloading a HorizonScript followed by the characters "://", the HorizonScript is remote. If the path to the HorizonScript begins with an alphanumeric character, the HorizonScript is local and relative to the path /etc/horizon. If the path to the HorizonScript does not match any of the rules specified before this line, the path provided is invalid and the system shall return an error describing the specified path and the fact it is invalid. Runner.Locate.Local If the HorizonScript is local, the system shall ensure the HorizonScript specified exists at the specified path, is readable by the system, and is the correct format. Runner.Locate.Local.Failure If the HorizonScript fails the tests in Runner.Locate.Local, the system shall return an error describing the reason the HorizonScript could not be used. Runner.Locate.Remote If the HorizonScript is remote, the system shall configure the network and then ensure the HorizonScript specified is accessible, as described in the following requirements sections. Runner.Locate.Remote.Configure The system shall use the network settings configured by the Administrator on the command line, if they have been provided. Runner.Locate.Remote.Configure.Automatic If no network configuration was provided on the command line, the system shall initiate a DHCP request on each available network interface, waiting for a 15 second time out period before continuing to the next network interface. An "available network interface" is defined as a non-loopback network interface that currently has a carrier signal. Runner.Locate.Remote.Configure.AutoFailure If no network configuration can be found using DHCP, the system shall return an error describing the inability to configure a network connection. Runner.Locate.Remote.FullAuto If no HorizonScript path was provided, the system shall download the HorizonScript from a TFTP server using the filename MACADDRESS.installfile where MACADDRESS is the MAC address of the active network adaptor with colons (:) replaced by dashes (-). The system shall use the following algorithm to determine the TFTP server, using the first match. The TFTP server specified in the DHCP options, if the DHCP response provided one. The TFTP server specified on the command line, if one was provided. The DHCP server, if DHCP was used to configure the network. The default gateway IP. Runner.Locate.Remote.Verify The system shall ensure that the server where the HorizonScript is kept is reachable over the protocol specified and that the HorizonScript exists. Runner.Locate.Remote.Download The system shall download the HorizonScript from the remote server to /etc/horizon/.
Verify HorizonScript
Description / Priority The system needs to verify the validity of the supplied HorizonScript before executing it.
Functional Requirements Runner.Verify.Exception If the HorizonScript fails any verification step performed by the system, the system shall report the error. Runner.Verify.Exception.Install If the system is running in an installation environment, the system shall report verification step failure to the listening agent. Runner.Verify.Exception.Continue The system shall support a mode where the system will continue verification after encountering a verification failure, to display all verification failures for a given HorizonScript. Runner.Verify.Required The system shall verify the presence of each required keyword in the HorizonScript: mount, network, hostname, pkginstall, and rootpw. Runner.Verify.network The system shall verify that a single network entry is present in the HorizonScript, and that the value is either true or false. Runner.Verify.network.netaddress If the value in the HorizonScript for the network key is true, the system shall verify that at least one netaddress key is present. Runner.Verify.network.netaddress.NoNetwork If the value in the HorizonScript for the network key is false, the system shall verify that no netaddress key is present. Runner.Verify.network.netaddress.Validity The system shall verify that each netaddress key has a valid form of at least two values in a space-separated tuple. Runner.Verify.network.netaddress.Validity.Type The system shall verify that the second value in each netaddress tuple is either dhcp or static. Runner.Verify.network.netaddress.Validity.DHCP The system shall verify that each netaddress key is a two value tuple if the second value is dhcp. Runner.Verify.network.netaddress.Validity.Static The system shall verify that each netaddress key is either a four value tuple or a five value tuple if the second value is static. Runner.Verify.network.netaddress.Interface If the system is running in an installation environment, the system shall ensure that the interface specified as the first value in each netaddress tuple is present on the system. Failure of this requirement is a "soft" error. Runner.Verify.network.netaddress.Address If the second value of the netaddress key is static, the system shall ensure that the third value in the tuple is a valid IPv4 or IPv6 address. Runner.Verify.network.netaddress.Mask If the second value of the netaddress key is static, the system shall ensure that the fourth value in the tuple is a valid prefix, in the form of a whole number between 1 and 32 inclusive if the third value is an IPv4 address, a whole number between 1 and 64 inclusive if the third value is an IPv6 address, or a network mask in the form of four octets separated by the period (.) symbol if the third value is an IPv4 address. Runner.Verify.network.netaddress.Gateway If the second value of the netaddress key is static, and the tuple contains a fifth value, the system shall ensure that the fifth value is a valid IP address of the same type as the third value in the tuple. Runner.Verify.network.netaddress.Count The system shall verify that netaddress is not specified more than 255 times per interface. Runner.Verify.network.netssid If the value in the HorizonScript for the network key is true, the system shall verify the validity of any present netssid key. Runner.Verify.network.netssid.NoNetwork If the value in the HorizonScript for the network key is false, the system shall verify that no netssid key is present. Runner.Verify.network.netaddress.Validity The system shall verify that each netssid key has a valid form of either three values or four values in a space-separated tuple. Runner.Verify.network.netssid.Interface If the system is running in an installation environment, the system shall ensure that the interface specified as the first value in each netssid tuple is present on the system and supports wireless extensions. Runner.Verify.network.netssid.SSID The system shall verify that the second value of each netssid tuple is a valid SSID enclosed in ASCII double-quotes ("). Runner.Verify.network.netssid.Security The system shall verify that the third value of each netssid tuple is a valid security type: either none, wep, or wpa. Runner.Verify.network.netssid.Key If the third value of a netssid tuple is a valid security type and not none, the system shall ensure that the netssid tuple has a fourth value that specifies the security key. Runner.Verify.hostname The system shall verify that the HorizonScript contains exactly one hostname key. Runner.Verify.hostname.Chars The system shall verify that the value for the hostname key contains only alphanumeric and optionally one or more period (.) characters. Runner.Verify.hostname.Begin The system shall verify that the value for the hostname key begins with an alphabetical character. Runner.Verify.hostname.Length The system shall verify that the value for the hostname key does not exceed 320 characters in length. Runner.Verify.pkginstall The system shall verify that the HorizonScript contains at least one pkginstall key. Runner.Verify.rootpw The system shall verify that the HorizonScript contains exactly one rootpw key. Runner.Verify.rootpw.Crypt The system shall verify that the value for the rootpw key is in the format: $, either 2 for Blowfish or 6 for SHA-512, $, and then variant data. Runner.Verify.language The system shall verify that the HorizonScript contains at most one language key. Runner.Verify.language.Format The system shall verify that the value of the language key, if present, is a valid ISO 639-1 language code, optionally followed by an ASCII underscore (_) and ISO 3166-1 country code, optionally followed by the string literal .UTF-8. Runner.Verify.keymap The system shall verify that the HorizonScript contains at most one keymap key. Runner.Verify.keymap.Valid The system shall verify that the value of the keymap key, if present, is a valid keyboard layout available for use in an Adélie Linux system. Runner.Verify.firmware The system shall verify that the HorizonScript contains at most one firmware key. Runner.Verify.firmware.Boolean The system shall verify that the value of the firmware key, if present, is either true or false. Runner.Verify.firmware.ForceOff If the system has firmware support compiled out, the system shall verify that the value of the firmware key, if present, is false. Runner.Verify.timezone The system shall verify that the HorizonScript contains at most one timezone key. Runner.Verify.timezone.zoneinfo The system shall verify that the value of the timezone key, if present, represents a valid zoneinfo time zone name. Runner.Verify.repository The system shall verify that the HorizonScript contains zero to ten repository keys. Runner.Verify.repository.ValidPath The system shall verify that the value of each repository key is either an absolute local path beginning with an ASCII backslash (/), or a valid URL utilising the HTTP or HTTPS protocols. Runner.Verify.signingkey The system shall verify that the HorizonScript contains zero to ten signingkey keys. Runner.Verify.signingkey.ValidPath The system shall verify that the value of each signingkey key is either an absolute local path beginning with an ASCII backslash (/), or a valid URL utilising the HTTPS protocol.
Execute HorizonScript
Description / Priority The system executes the instructions provided in the HorizonScript, in the specified order. The system reports progress, and all warnings and errors, to the listening agent. Once the system has finished, it reports the completion status to the listening agent.
Functional Requirements Runner.Execute The system shall execute the instructions provided in the HorizonScript in the order described. Runner.Execute.Exception The system shall report any exception encountered during execution to the listening agent, following the specification in . Runner.Execute.Status If an operation has taken more than 10 seconds, the system shall report the status of the operation to the listening agent, following the specification in . Runner.Execute.StepBegin When the system begins a step, the system shall report the step as beginning to the listening agent, following the specification in . Runner.Execute.StepDone When the system completes a step, the system shall report the step as completed to the listening agent, following the specification in . Runner.Execute.Verify The system shall verify the HorizonScript, using the process specified in the section , before execution. Runner.Execute.Verify.Failure If the HorizonScript fails verification, the system shall report a fatal exception () and stop execution. Runner.Execute.diskid