summaryrefslogblamecommitdiff
path: root/devel/requirements/3b_runner.xml
blob: 7bb3a827c5ab789aa56c8c8e5dbdd70ea1f047d7 (plain) (tree)











































































                                                                                                                                                                                                                                                                                                                                                                                                           











                                                                                                                                                                                                                       

                                                         
























































                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
                             



















                                                                                                                                                                                                                                                                         





                                                     
                                                                                                                                                                                                                                                                                                   


                                                      


                                                                                                                                
                             



                                                                                                                                                                                          



















                                                                                                                                                                                                                           



                                                        


                      
    <section id="runner">
        <title>Horizon Runner</title>
        <para>The Horizon Runner is the component of Project Horizon that configures a computer to match an input HorizonScript.</para>
        <section id="runner_locate">
            <title>Locate HorizonScript</title>
            <section id="runner_locate_meta">
                <title>Description / Priority</title>
                <para>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.</para>
            </section>
            <section id="runner_locate_req">
                <title>Functional Requirements</title>
                <formalpara id="Runner.Locate.DetermineLocality">
                    <title>Runner.Locate.DetermineLocality</title>
                    <para>The system shall determine if the HorizonScript is stored locally or remotely using the following algorithm:
                        <orderedlist id="Runner.Locate.DetermineLocality.Algo">
                            <listitem><para>If the path to the HorizonScript is not provided, assume the HorizonScript is remote and end the calculation.  Priority: Low.</para></listitem>
                            <listitem><para>If the path to the HorizonScript begins with a single "/" followed by an alphanumeric character, the HorizonScript is local.</para></listitem>
                            <listitem><para>If the path to the HorizonScript begins with a recognised valid protocol for downloading a HorizonScript followed by the characters "://", the HorizonScript is remote.</para></listitem>
                            <listitem><para>If the path to the HorizonScript begins with an alphanumeric character, the HorizonScript is local and relative to the path <filename class="directory">/etc/horizon</filename>.</para></listitem>
                            <listitem><para>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.</para></listitem>
                        </orderedlist>
                    </para>
                </formalpara>
                <formalpara id="Runner.Locate.Local">
                    <title>Runner.Locate.Local</title>
                    <para>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.</para>
                </formalpara>
                <formalpara id="Runner.Locate.Local.Failure">
                    <title>Runner.Locate.Local.Failure</title>
                    <para>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.</para>
                </formalpara>
                <formalpara id="Runner.Locate.Remote">
                    <title>Runner.Locate.Remote</title>
                    <para>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.</para>
                </formalpara>
                <formalpara id="Runner.Locate.Remote.Configure">
                    <title>Runner.Locate.Remote.Configure</title>
                    <para>The system shall use the network settings configured by the Administrator on the command line, if they have been provided.</para>
                </formalpara>
                <formalpara id="Runner.Locate.Remote.Configure.Automatic">
                    <title>Runner.Locate.Remote.Configure.Automatic</title>
                    <para>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.</para>
                </formalpara>
                <formalpara id="Runner.Locate.Remote.Configure.AutoFailure">
                    <title>Runner.Locate.Remote.Configure.AutoFailure</title>
                    <para>If no network configuration can be found using DHCP, the system shall return an error describing the inability to configure a network connection.</para>
                </formalpara>
                <formalpara id="Runner.Locate.Remote.FullAuto">
                    <title>Runner.Locate.Remote.FullAuto</title>
                    <para>If no HorizonScript path was provided, the system shall download the HorizonScript from a TFTP server using the filename <filename>MACADDRESS.installfile</filename> 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.
                        <orderedlist id="Runner.Locate.Remote.FullAuto.Algo">
                            <listitem><para>The TFTP server specified in the DHCP options, if the DHCP response provided one.</para></listitem>
                            <listitem><para>The TFTP server specified on the command line, if one was provided.</para></listitem>
                            <listitem><para>The DHCP server, if DHCP was used to configure the network.</para></listitem>
                            <listitem><para>The default gateway IP.</para></listitem>
                        </orderedlist>
                    </para>
                </formalpara>
                <formalpara id="Runner.Locate.Remote.Verify">
                    <title>Runner.Locate.Remote.Verify</title>
                    <para>The system shall ensure that the server where the HorizonScript is kept is reachable over the protocol specified and that the HorizonScript exists.</para>
                </formalpara>
                <formalpara id="Runner.Locate.Remote.Download">
                    <title>Runner.Locate.Remote.Download</title>
                    <para>The system shall download the HorizonScript from the remote server to <filename class="directory">/etc/horizon/</filename>.</para>
                </formalpara>
            </section>
        </section>
        <section id="runner_verify">
            <title>Verify HorizonScript</title>
            <section id="runner_verify_meta">
                <title>Description / Priority</title>
                <para>The system needs to verify the validity of the supplied HorizonScript before executing it.</para>
            </section>
            <section id="runner_verify_req">
                <title>Functional Requirements</title>
                <formalpara id="Runner.Verify.Exception">
                    <title>Runner.Verify.Exception</title>
                    <para>If the HorizonScript fails any verification step performed by the system, the system shall report the error.</para>
                </formalpara>
                <formalpara id="Runner.Verify.Exception.Install">
                    <title>Runner.Verify.Exception.Install</title>
                    <para>If the system is running in an installation environment, the system shall report verification step failure to the listening agent.</para>
                </formalpara>
                <formalpara id="Runner.Verify.Exception.Continue">
                    <title>Runner.Verify.Exception.Continue</title>
                    <para>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.</para>
                </formalpara>
                <formalpara id="Runner.Verify.Required">
                    <title>Runner.Verify.Required</title>
                    <para>The system shall verify the presence of each required keyword in the HorizonScript: <literal>mount</literal>, <literal>network</literal>, <literal>hostname</literal>, <literal>pkginstall</literal>, and <literal>rootpw</literal>.</para>
                </formalpara>
                <formalpara id="Runner.Verify.network">
                    <title>Runner.Verify.network</title>
                    <para>The system shall verify that a single <literal>network</literal> entry is present in the HorizonScript, and that the value is either <literal>true</literal> or <literal>false</literal>.</para>
                </formalpara>
                <formalpara id="Runner.Verify.network.netaddress">
                    <title>Runner.Verify.network.netaddress</title>
                    <para>If the value in the HorizonScript for the <literal>network</literal> key is <literal>true</literal>, the system shall verify that at least one <literal>netaddress</literal> key is present.</para>
                </formalpara>
                <formalpara id="Runner.Verify.network.netaddress.NoNetwork">
                    <title>Runner.Verify.network.netaddress.NoNetwork</title>
                    <para>If the value in the HorizonScript for the <literal>network</literal> key is <literal>false</literal>, the system shall verify that no <literal>netaddress</literal> key is present.</para>
                </formalpara>
                <formalpara id="Runner.Verify.network.netaddress.Validity">
                    <title>Runner.Verify.network.netaddress.Validity</title>
                    <para>The system shall verify that each <literal>netaddress</literal> key has a valid form of at least two values in a space-separated tuple.</para>
                </formalpara>
                <formalpara id="Runner.Verify.network.netaddress.Validity.Type">
                    <title>Runner.Verify.network.netaddress.Validity.Type</title>
                    <para>The system shall verify that the second value in each <literal>netaddress</literal> tuple is either <literal>dhcp</literal> or <literal>static</literal>.</para>
                </formalpara>
                <formalpara id="Runner.Verify.network.netaddress.Validity.DHCP">
                    <title>Runner.Verify.network.netaddress.Validity.DHCP</title>
                    <para>The system shall verify that each <literal>netaddress</literal> key is a two value tuple if the second value is <literal>dhcp</literal>.</para>
                </formalpara>
                <formalpara id="Runner.Verify.network.netaddress.Validity.Static">
                    <title>Runner.Verify.network.netaddress.Validity.Static</title>
                    <para>The system shall verify that each <literal>netaddress</literal> key is either a four value tuple or a five value tuple if the second value is <literal>static</literal>.</para>
                </formalpara>
                <formalpara id="Runner.Verify.network.netaddress.Interface">
                    <title>Runner.Verify.network.netaddress.Interface</title>
                    <para>If the system is running in an installation environment, the system shall ensure that the interface specified as the first value in each <literal>netaddress</literal> tuple is present on the system.  Failure of this requirement is a "soft" error.</para>
                </formalpara>
                <formalpara id="Runner.Verify.network.netaddress.Address">
                    <title>Runner.Verify.network.netaddress.Address</title>
                    <para>If the second value of the <literal>netaddress</literal> key is <literal>static</literal>, the system shall ensure that the third value in the tuple is a valid IPv4 or IPv6 address.</para>
                </formalpara>
                <formalpara id="Runner.Verify.network.netaddress.Mask">
                    <title>Runner.Verify.network.netaddress.Mask</title>
                    <para>If the second value of the <literal>netaddress</literal> key is <literal>static</literal>, 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 (<literal>.</literal>) symbol if the third value is an IPv4 address.</para>
                </formalpara>
                <formalpara id="Runner.Verify.network.netaddress.Gateway">
                    <title>Runner.Verify.network.netaddress.Gateway</title>
                    <para>If the second value of the <literal>netaddress</literal> key is <literal>static</literal>, 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.</para>
                </formalpara>
                <formalpara id="Runner.Verify.network.netaddress.Count">
                    <title>Runner.Verify.network.netaddress.Count</title>
                    <para>The system shall verify that <literal>netaddress</literal> is not specified more than 255 times per interface.</para>
                </formalpara>
                <formalpara id="Runner.Verify.network.netssid">
                    <title>Runner.Verify.network.netssid</title>
                    <para>If the value in the HorizonScript for the <literal>network</literal> key is <literal>true</literal>, the system shall verify the validity of any present <literal>netssid</literal> key.</para>
                </formalpara>
                <formalpara id="Runner.Verify.network.netssid.NoNetwork">
                    <title>Runner.Verify.network.netssid.NoNetwork</title>
                    <para>If the value in the HorizonScript for the <literal>network</literal> key is <literal>false</literal>, the system shall verify that no <literal>netssid</literal> key is present.</para>
                </formalpara>
                <formalpara id="Runner.Verify.network.netssid.Validity">
                    <title>Runner.Verify.network.netaddress.Validity</title>
                    <para>The system shall verify that each <literal>netssid</literal> key has a valid form of either three values or four values in a space-separated tuple.</para>
                </formalpara>
                <formalpara id="Runner.Verify.network.netssid.Interface">
                    <title>Runner.Verify.network.netssid.Interface</title>
                    <para>If the system is running in an installation environment, the system shall ensure that the interface specified as the first value in each <literal>netssid</literal> tuple is present on the system and supports wireless extensions.</para>
                </formalpara>
                <formalpara id="Runner.Verify.network.netssid.SSID">
                    <title>Runner.Verify.network.netssid.SSID</title>
                    <para>The system shall verify that the second value of each <literal>netssid</literal> tuple is a valid SSID enclosed in ASCII double-quotes (<literal>"</literal>).</para>
                </formalpara>
                <formalpara id="Runner.Verify.network.netssid.Security">
                    <title>Runner.Verify.network.netssid.Security</title>
                    <para>The system shall verify that the third value of each <literal>netssid</literal> tuple is a valid security type: either <literal>none</literal>, <literal>wep</literal>, or <literal>wpa</literal>.</para>
                </formalpara>
                <formalpara id="Runner.Verify.network.netssid.Key">
                    <title>Runner.Verify.network.netssid.Key</title>
                    <para>If the third value of a <literal>netssid</literal> tuple is a valid security type and not <literal>none</literal>, the system shall ensure that the <literal>netssid</literal> tuple has a fourth value that specifies the security key.</para>
                </formalpara>
            </section>
        </section>
        <section id="runner_execute">
            <title>Execute HorizonScript</title>
            <section id="runner_execute_meta">
                <title>Description / Priority</title>
                <para>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.</para>
            </section>
            <section id="runner_execute_req">
                <title>Functional Requirements</title>
                <formalpara id="Runner.Execute">
                    <title>Runner.Execute</title>
                    <para>The system shall execute the instructions provided in the HorizonScript in the order described.</para>
                </formalpara>
                <formalpara id="Runner.Execute.Exception">
                    <title>Runner.Execute.Exception</title>
                    <para>The system shall report any exception encountered during execution to the listening agent, following the specification in <xref linkend="runner_agent"/>.</para>
                </formalpara>
                <formalpara id="Runner.Execute.Status">
                    <title>Runner.Execute.Status</title>
                    <para>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 <xref linkend="runner_agent"/>.</para>
                </formalpara>
                <formalpara id="Runner.Execute.StepBegin">
                    <title>Runner.Execute.StepBegin</title>
                    <para>When the system begins a step, the system shall report the step as beginning to the listening agent, following the specification in <xref linkend="runner_agent"/>.</para>
                </formalpara>
                <formalpara id="Runner.Execute.StepDone">
                    <title>Runner.Execute.StepDone</title>
                    <para>When the system completes a step, the system shall report the step as completed to the listening agent, following the specification in <xref linkend="runner_agent"/>.</para>
                </formalpara>
                <formalpara id="Runner.Execute.Verify">
                    <title>Runner.Execute.Verify</title>
                    <para>The system shall verify the HorizonScript, using the process specified in the section <xref linkend="runner_verify"/>, before execution.</para>
                </formalpara>
                <formalpara id="Runner.Execute.Verify.Failure">
                    <title>Runner.Execute.Verify.Failure</title>
                    <para>If the HorizonScript fails verification, the system shall report a fatal exception (<xref linkend="Runner.Execute.Exception"/>) and stop execution.</para>
                </formalpara>
                <formalpara id="Runner.Execute.diskid">
                    <title>Runner.Execute.diskid</title>
                    <para></para>
                </formalpara>
            </section>
        </section>
    </section>