<xsd:complexType name="TestType">
<xsd:annotation>
<xsd:documentation>The base type of every test includes an optional notes element and five attributes. The notes section of a test should be used to hold information that might be helpful to someone examining the technical aspects of the test. For example, why certain values have been used by the test, or maybe a link to where further information can be found. Please refer to the description of the NotesType complex type for more information about the notes element.</xsd:documentation>
<xsd:documentation>The required id attribute uniquely identifies each test, and must conform to the format specified by the testidPattern simple type. The required version attribute holds the current version of the test. Versions are integers, starting at 1 and incrementing every time a test is modified. The optional check_existence attribute determines how many items in the specified set must exists for the test to evaluate to true. For example, if a value of 'all_exist' is given, every item defined by the OVAL Object must exist on the system for the test to evaluate to true. If the OVAL Object uses a variable reference, then every value of that variable must exist. Note that a pattern match defines a set of matching objects found on a system. So when check_existence = 'all_exist' and a regex matches anything on a system the test will evaluate to true. (since all matching objects on the system were found on the system) When check_existence = 'all_exist' and a regex does not match anything on a system the test will evaluate to false. The required check attribute determines how many of the existing objects must satisfy the state requirements. (For example: Should the test check that all files match a specified version or that at least one file matches the specified version?) The valid check values are explained in the description of the CheckEnumeration simple type. Note that if the test does not contain any references to OVAL States, then the check attribute has no meaning and can be ignored during evaluation. Also note that both the 'check' and 'check_existence' attributes must be satisfied during evaluation for the test to return true. For example, if the check_existence fails then there is no need to evaluate the check since the test will have a result of false no matter what. The required comment attribute provides a short description of the test. The optional deprecated attribute signifies that an id is no longer to be used or referenced but the information has been kept around for historic purposes.</xsd:documentation>
<xsd:appinfo>
<sch:pattern id="test_type" xmlns:sch="http://purl.oclc.org/dsdl/schematron">
<sch:rule context="/oval-def:oval_definitions/oval-def:tests/*[@check_existence='none_exist']">
<sch:assert test="not(*[name()='state'])">
<sch:value-of select="@id" /> - No state should be referenced when check_existence has a value of 'none_exist'.</sch:assert>
</sch:rule>
</sch:pattern>
</xsd:appinfo>
</xsd:annotation>
<xsd:sequence>
<xsd:element ref="ds:Signature" minOccurs="0" maxOccurs="1" />
<xsd:element name="notes" type="oval-def:NotesType" minOccurs="0" maxOccurs="1" />
</xsd:sequence>
<xsd:attribute name="id" type="oval:TestIDPattern" use="required" />
<xsd:attribute name="version" type="xsd:nonNegativeInteger" use="required" />
<xsd:attribute name="check_existence" type="oval:ExistenceEnumeration" use="optional" default="at_least_one_exists" />
<xsd:attribute name="check" type="oval:CheckEnumeration" use="required" />
<xsd:attribute name="comment" type="oval:NonEmptyStringType" use="required" />
<xsd:attribute name="deprecated" type="xsd:boolean" use="optional" default="false" />
</xsd:complexType>
|