pyats.aereport.runinfo package

runinfo – RunInfo

This module contains the RunInfo class that is used by several AEReport elements such as TestScript, TestSection, TestResult, etc.

class pyats.aereport.runinfo.RunInfo

Bases: AEReportElement

Class based on the following schema definition

<xs:complexType name="runinfoType">
    <xs:sequence minOccurs="0" maxOccurs="unbounded">
        <xs:element name="comment" minOccurs="0" />
        <xs:element name="diag" minOccurs="0" />
        <xs:element name="error" type="xrefType" minOccurs="0" />
        <xs:element name="pause" minOccurs="0"></xs:element>
        <xs:element name="abort" minOccurs="0"></xs:element>
        <xs:element name="device" minOccurs="0"></xs:element>
        <xs:element ref="userDef" minOccurs="0" />
    </xs:sequence>
</xs:complexType>
tag

Constant value = ‘runinfo’ to be used as xml tag.

Type:

str

comments

Optional - list of strings

Type:

list

diags

Optional - list of strings

Type:

list

errors

Optional - list of XRef

Type:

list

pauses

Optional - list of Pause

Type:

list

abort

Optional

Type:

Abort

device

Optional

Type:

Device

userDefs

Optional - list of UserDef

Type:

list

set_args(**kwargs)

Set testsuite initinfo attributes

Parameters:
  • comment (str or int) – Comment for the run

  • diag (str) – Diag for the run

  • error (str) – Error for the run

  • userdef (str) – User defined tag

  • pause (str) – pause

  • unpause (str) – Unpause

Submodules

abort – Abort Base Class

This module implements the Abort class used by RunInfo entries.

class pyats.aereport.runinfo.abort.Abort(**kwargs)

Bases: AEReportElement

Aborting a section when a given condition is met.

Class based on the following schema definition

<xs:element name="abort" minOccurs="0">
    <xs:complexType>
        <xs:sequence>
            <xs:element name="starttime"/>
            <xs:element name="condition"/>
            <xs:element name="abortfile"/>
        </xs:sequence>
    </xs:complexType>
</xs:element>
tag

Constant value = ‘report’ to be used as xml tag.

Type:

str

starttime

starttime

Type:

datetime

condition

Condition for aborting

Type:

str

abortfile

Path to abort file

Type:

str

set_args(**kwargs)

Set testsuite initinfo attributes

Parameters:
  • condition (str) – Condition of the abort

  • abortfile (str) – Abort file

device – Device Class

This module implements the Device Class used in RunInfo entries.

class pyats.aereport.runinfo.device.Device

Bases: AEReportElement

Commands sent to the device (such as ios cmds)

Class based on the following schema definition

    <xs:complexType>
        <xs:sequence>
            <xs:element name="starttime" type="xs:dateTime"/>
            <xs:element name="subcmd"></xs:element>
            <xs:element name="name"></xs:element>
            <xs:element name="libref"></xs:element>
            <xs:element name="transmit"></xs:element>
            <xs:element name="receive" type="LogFileType"></xs:element>
            <xs:element name="crash" minOccurs="0"/>
            <xs:element name="reload" minOccurs="0"/>
            <xs:element name="traceback" minOccurs="0"/>
            <xs:element name="stoptime" type="xs:dateTime"/>
            <xs:element name="runtime"></xs:element>
        </xs:sequence>
    </xs:complexType>
</xs:element>
tag

Constant value = ‘report’ to be used as xml tag.

Type:

str

starttime

Start time

Type:

datetime

subcmd

Subcommand for the device such as exec, reload, etc

Type:

str

name

Name of the device to which the command is sent

Type:

str

libref

Name of ATS library used to communicate (CSCcon, CATlib, SSCON; see CSCcon doc pages for complete list)

Type:

str

transmit

Actual command sent to the device

Type:

str

receive

File in which the command output logs are saved

Type:

LogFile

crash

Optional

Type:

str

reload

Optional

Type:

str

traceback

Optional

Type:

str

stoptime

Stop time

Type:

datetime

runtime

The time elapsed between the starttime and the stoptime

Type:

timedelta

userdef – UserDef Class

This module UserDef class used by RunInfoEntry

class pyats.aereport.runinfo.userdef.UserDef(**kwargs)

Bases: AEReportElement

UserDef provides users with the flexibility of adding custom elements that are not defined in the XSD.

Class based on the following schema definition

<xs:element name="userDef">
    <xs:annotation>
        <xs:documentation>User defined element will saved here where the name of the element is the attribute and its value is the value for UserDef.</xs:documentation>
    </xs:annotation>
    <xs:complexType>
        <xs:simpleContent>
            <xs:extension base="xs:string">
                <xs:attribute name="name"/>
            </xs:extension>
        </xs:simpleContent>
    </xs:complexType>
</xs:element>
tag

Constant value = ‘userDef’ to be used as xml tag.

Type:

str

attrs

The only key in this dictionary should be ‘name’ which is the name attribute of the userDef tag.

Type:

dict

value

The text value of the userDef element

Type:

str

generate_dom(parent)

Override the default behavior of AEReportElement.generate_dom

Parameters:

parent (AEReportElement) – The xml element that should be used as a parent for this userdef

set_args(**kwargs)

Set file and line

Parameters:
  • name (str) – Name of the userdef tag

  • value (str) – Value of the user tag.