<xsd:complexType name="TestType">
<xsd:annotation>
<xsd:documentation>The TestType complex type provides a reference to every item that matched the object section of the original test as well as providing an overall test result based on these items. The optional message element holds an error message or some other string that the analysis engine wishes to pass along. The optional tested_variable elements hold the value of each variable used by the test during evaluation. This includes the values used in both OVAL Objects and OVAL States. If a variable represents an array of values, then multiple tested_variable elements would exist with the same variable_id attribute. Please refer to the description of TestedVariableType for more information.</xsd:documentation>
<xsd:documentation>The required test_id attribute identifies the test, and must conform to the format specified by the testidPattern simple type. The required version attribute is the specific version of the OVAL Test used during analysis. The optional variable_instance attribute differentiates between unique instances of a test. This can happen when a test includes a variable reference and different values for that variable are used by different definitions. The required check_existance attribute is used in determining the overall result by signifying how many matching items must exist. The optional check_state attribute is also used in determining the overall result and is used to define how many of the matching items must meet the supplied OVAL State. (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 values for both the check_existance and check_state attribute are explained in the simple type declarations found in the common schema.</xsd:documentation>
<xsd:documentation> The required result attribute holds the result of the evaluation. Please refer to the description of the resultEnumeration for details about the different result values. The overall result of the test is determined by the results of each matching item and the different check attributes. If you are using an OVAL System Characteristics file, then the following rules apply: If a collected_object is not found the result for the OVAL Test should be "unknown". When the flag attribute of the collected_object is “error” the result for the OVAL Test should be set to “error”. When the flag attribute is “complete” the result of the test is determined by first evaluating the check_existance attribute on the test and then evaluating the check_state attribute. The check_state attribute only needs to be considered if the result of evaluating the check_existance attribute is “true”. When the flag attribute is “does not exist” the result of the test is determined by examining the check_existance attribute’s value, if the check_existance attribute is “none_exist” or “any_exist” the Test should evaluate to “true”, for all other values of the check_existance attribute the Test should evaluate to “false”. When the flag attribute is “not collected” the result of the test should be set to “unknown”. When the flag attribute is “not applicable” the result for the Test should be set to “not applicable”. When the flag attribute is “incomplete” it may not be possible to determine a result other than “unknown” for the test. However, in some cases it will be possible to determine a result. These cases are: 1) when the check_existance attribute on a test is set to “none_exist” and the collected object has 1 or more item references with a status of "exists" a result of “false” should be reported 2) when the check_existance attribute is set to “only_one_exists” the collected object has more than 1 item reference with a status of "exists" a result of “false” should be reported 3) if after evaluating the check_existance attribute a non "true" result has not been determined the check_state attribute must be considered. As follows: 3a) if the check_state attribute evaluation results in "false" then the OVAL Test result should be set to "false" 3b) if the check_state attribute is set to "at_least_one_satisfies" and its evaluation results in "true" the OVAL Test result should be set to "true". For all other cases when the collected_object flag is "incompete" the OVAL Test result should be set to "unknown".</xsd:documentation>
<xsd:appinfo>
<sch:pattern id="testids" xmlns:sch="http://purl.oclc.org/dsdl/schematron">
<sch:rule context="oval-res:test">
<sch:assert test="@test_id = ../../oval-res:definitions//oval-res:criterion/@test_ref">
<sch:value-of select="@test_id" /> - the specific test is not used in any definition's criteria</sch:assert>
</sch:rule>
</sch:pattern>
</xsd:appinfo>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="message" type="oval:MessageType" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="tested_item" type="oval-res:TestedItemType" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="tested_variable" type="oval-res:TestedVariableType" minOccurs="0" maxOccurs="unbounded" />
</xsd:sequence>
<xsd:attribute name="test_id" type="oval:TestIDPattern" use="required" />
<xsd:attribute name="version" type="xsd:nonNegativeInteger" use="required" />
<xsd:attribute name="variable_instance" type="xsd:nonNegativeInteger" use="optional" default="1" />
<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="result" type="oval-res:ResultEnumeration" use="required" />
</xsd:complexType>
|