Part of lp.hardwaredb.tests.test_hwdb_submission_validation View In Hierarchy
Method | setUp | Setup the test environment. |
Method | runValidator | Run the Relax NG validator. |
Method | insertSampledata | Insert text into the sample data data . |
Method | replaceSampledata | Replace text in the sample data data . |
Method | testNoXMLData | The raw submission data must be XML. |
Method | testInvalidRootNode | The root node must be <system>. |
Method | testBadDataInCommentNode | Many submissions contain ESC symbols in <comment> nodes. |
Method | test_fixFrequentErrors_two_comments | Undocumented |
Method | test_bad_data_does_not_oops | Undocumented |
Method | testInvalidFormatVersion | The attribute format of the root node must be 1.0 . |
Method | testMissingFormatVersion | The root node must have the attribute version . |
Method | testAsciiEncoding | Validation of ASCII encoded XML data. |
Method | testISO8859_1_Encoding | XML data with ISO-8859-1 may have bytes with bit 7 set. |
Method | testUTF8Encoding | UTF-8 encoded data is properly detected and parsed. |
Method | assertErrorMessage | Search for message in the log entries for submission_key. |
Method | testAssertErrorMessage | Test the assertErrorMessage method. |
Method | testSubtagsOfSystem | The root node <system> requires a fixed set of sub-tags. |
Method | testSummaryRequiredTags | The <summary> section requires a fixed set of sub-tags. |
Method | testAdditionalSummaryTags | Arbitrary tags are forbidden as sub-tags of <summary>. |
Method | testSummaryValidationOfBooleanSubtags | Validation of boolean tags in the <summary> section. |
Method | testDateCreatedParsing | Parsing of the date_created value. |
Method | assertDateErrorIsDetected | Run a single test for an invalid datetime. |
Method | assertValidDateTime | Run a single test for a valid datetime. |
Method | testClientTagAttributes | Validation of <client> tag attributes. |
Method | testSubTagsOfClient | The only allowed sub-tag of <client> is <plugin>. |
Method | testClientPluginAttributes | Validation of <plugin> tag attributes. |
Method | testHardwareSubTagHalOrUdev | The <hardware> tag requires data about hardware devices. |
Method | testHardwareSubTagUdevIncomplete | The <hardware> tag has a fixed set of allowed sub-tags. |
Method | testHardwareSubTagHalMixedWithUdev | Mixing <hal> with <udev>, <dmi>, <sysfs-attributes> is impossible. |
Method | testHardwareOtherSubTags | The <hardware> tag has a fixed set of allowed sub-tags. |
Method | testHalAttributes | Validation of <hal> tag attributes. |
Method | testHalSubtags | Validation of sub-tags of <hal>. |
Method | testDeviceAttributes | Validation of the attributes of the <device> tag. |
Method | testDeviceContent | <device> tags may only contain <property> tags. |
Method | testBooleanProperties | Undocumented |
Method | testStringProperties | Validation of string properties. |
Method | testIntegerProperties | Validation of integer properties. |
Method | testDecimalProperties | Validation of dbus.Double and float properties. |
Method | assertAcceptsEmptyProperty | Validation of empty list properties. |
Method | assertRejectsNonValueSubtag | Other sub-tags than <value> are not allowed in lists and dicts. |
Method | assertValidatesTextValue | Validation of tags with CData values |
Method | testListAndDictProperties | Validation of dbus.Array and list properties. |
Method | testProcessorsTag | Validation of the <processors> tag. |
Method | testProcessorTag | Validation of the <processors> tag. |
Method | testAliasesTag | Validation of the <aliases> tag. |
Method | testAliasTagAttributes | Validation of the <alias> tag. |
Method | testAliasTagContent | Undocumented |
Method | testAliasVendorTag | Validation of the <vendor> tag in <alias>. |
Method | testAliasModelTag | Validation of the <model> tag in <alias>. |
Method | testSoftwareTagAttributes | Test the attribute validation of the <software> tag. |
Method | testAllowedSubtagsOfSoftware | Test the validation of allowed sub-tags of <software>. |
Method | testInvalidContentOfSoftwareTag | Test the validation of invalid content of <software>. |
Method | testLsbreleaseTagAttributes | Test the validation of the <lsbrelease> attributes. |
Method | testLsbreleaseTagValidSubtag | Test the validation of <lsbrelease> sub-tags. |
Method | testLsbreleaseTagInvalidContent | Test of the validation of invalid <lsbrelease> content. |
Method | testPackagesTagAttributes | Test of the validation of <packages> tag attributes. |
Method | testEmptyPackagesTag | Test of the validation of <packages> tag attributes. |
Method | testPackagesTagWithInvalidContent | Test the validation of <packages> tag attributes. |
Method | testPackageTagAttributes | Test the validation of <package> tag attributes. |
Method | testPackageTagSubtags | Test the validation of sub-tags of <package>. |
Method | testPackageTagCData | Test the validation of CDATA content in <package>. |
Method | testXorgTagAttributes | Test the validation of <xorg> attributes. |
Method | testXorgTagSubTags | Test the validation of <xorg> sub-tags. |
Method | testXorgTagCData | Test the validation of <xorg> CDATA content. |
Method | testXorgDriverTagRequiredAttributes | Test the validation of attributes of <driver> within <xorg>. |
Method | testXorgDriverTagOptionalAttributes | Test the validation of attributes of <driver> within <xorg>. |
Method | testXorgDriverTagInvalidAttributes | Test the validation of attributes of <driver> within <xorg>. |
Method | testXorgDriverTagSubtags | Test the validation of sub-tags of <driver> within <xorg>. |
Method | testXorgDriverTagCData | Test the validation of sub-tags of <driver> within <xorg>. |
Method | testQuestionsTagAttributes | Test the validation of <questions> tag attributes. |
Method | testQuestionsTagAttributesSubTags | Test the validation of the <questions> sub-tags. |
Method | testQuestionsTagCData | Test the validation of CDATA in <questions> tag. |
Method | testQuestionTagValidAttributes | Test the validation of valid <question> tag attributes. |
Method | testQuestionTagInvalidAttributes | Test the validation of invalid <question> tag attributes. |
Method | testQuestionTagValidSubtags | Test the validation of valid <question> tag sub-tags. |
Method | testQuestionTagInValidSubtags | Test the validation of invalid <question> tag sub-tags. |
Method | testAnswerCommandTag | Test the validation of the <command> tag. |
Method | testAnswerTagAttributes | Test the validation of <answer> tag attributes. |
Method | testAnswerTagContent | Test the validation of <answer> content. |
Method | testAnswerChoicesTagAttributes | Test the validation of <answer_choices> attributes. |
Method | testAnswerChoicesTagCData | Test the validation of <answer_choices> CDATA content. |
Method | testAnswerChoicesTagSubTags | Test the validation of <answer_choices> sub-tags. |
Method | testTargetTagAttributes | Test the validation of <target> tag attributes. |
Method | testTargetTagCData | Test the validation of <target> tag CDATA content. |
Method | testTargetTagValidSubtag | Test the validation of the valid <target> sub-tag <driver>. |
Method | testTargetTagInvalidSubtag | Test the validation of an invalid <target> sub-tag. |
Method | testTargetDriverTag | Test the validation of the <driver> sub-tag of <target>. |
Method | testMissingContextNode | Validation of the <context> node. |
Method | testContextNodeAttributes | Validation of the <context> node attributes. |
Method | testContextSubnodes | Validation of sub-nodes of <context>. |
Method | testContextNodeCData | Validation of the <context> node containing CData. |
Method | testInfoNodeAttributes | Validation of <info> attributes. |
Method | testInfoNodeSubnodes | Validation of an <info> containing a sub-node. |
Method | test_natty_reports_validate | Undocumented |
Method | _setEncoding | Set the encoding in the sample data to encoding . |
Method | _testPropertyMissingNameAttribute | The name attribute is required for all property variants. |
Method | _testBooleanProperty | Validation of a boolean type property or value. |
Method | _testStringProperty | Validation of a string property. |
Method | _testEmptyIntegerContent | Detection of an empty property with integer content. |
Method | _testInvalidIntegerContent | Detection of invalid content of a property with integer content. |
Method | _testMinMaxIntegerValue | Detection of integer values outside of the allowed range. |
Method | _testIntegerProperty | Validation of an integer property. |
Method | _testEmptyDecimalContent | Detection of an empty property with number content. |
Method | _testInvalidDecimalContent | Detection of invalid content of a property with number content. |
Method | _testDecimalProperty | Validation of an integer property. |
Method | _testListAndDictPropertyCDataContent | List and dict properties may not have CDATA content. |
Method | _wrapValue | Wrap a <value> tag into a <property> tag. |
Method | _testBooleanValueTagValues | Validation of the CDATA values of a <value> tag. |
Method | _setupValueTagTemplates | Return templates for value tags with/without a name attribute. |
Method | _setupContainerTag | Setup a template for a property or value tag with sub-tags. |
Method | _testBooleanValueTags | Validation of boolean-like <value> tags. |
Method | _testStringValueTags | Validation of string-like <value> tags. |
Method | _makeSampleDataForValueTag | Undocumented |
Method | _testIntegerLimit | Validation of the smallest or largest value of an int type. |
Method | _testIntegerValueTag | Valudation of a <value> tag wwith integral content. |
Method | _testIntegerValueTags | Validation of <value> tags with integral content. |
Method | _testFloatValueTag | Validation of a <value> tag with float-number content. |
Method | _testFloatValueTags | Validation of <value> tags with float-number content. |
Method | _testListOrDictValueTag | Validation of a list or dict-like value tag. |
Method | _testListAndDictValueTags | Validation of list and dict-like values. |
Method | _testValueTags | Tests of <value> sub-tags of <property type="property_type">. |
Method | _testListOrDictProperty | Validation of a list property. |
Method | _getXorgDriverTag | Build a <driver> tag with attributes specified in "attributes." |
Inherited from TestCase:
Method | becomeDbUser | Commit, then log into the database as dbuser . |
Method | __str__ | The string representation of a test is its id. |
Method | useContext | Use the supplied context in this test. |
Method | makeTemporaryDirectory | Create a temporary directory, and return its path. |
Method | installKarmaRecorder | Set up and return a KarmaRecorder . |
Method | assertProvides | Assert 'obj' correctly provides 'interface'. |
Method | assertNotifies | Assert that a callable performs a given notification. |
Method | assertNoNotification | Assert that no notifications are generated by the callable. |
Method | assertSqlAttributeEqualsDate | Fail unless the value of the attribute is equal to the date. |
Method | assertTextMatchesExpressionIgnoreWhitespace | Undocumented |
Method | assertIsInstance | Assert that an instance is an instance of assert_class. |
Method | assertIsNot | Assert that expected is not the same object as observed . |
Method | assertContentEqual | Assert that 'iter1' has the same content as 'iter2'. |
Method | assertRaisesWithContent | Check if the given exception is raised with given content. |
Method | assertBetween | Assert that 'variable' is strictly between two boundaries. |
Method | assertVectorEqual | Apply assertEqual to all given pairs in one go. |
Method | expectedLog | Expect a log to be written that matches the regex. |
Method | pushConfig | Push some key-value pairs into a section of the config. |
Method | attachOopses | Undocumented |
Method | attachLibrarianLog | Include the logChunks from fixture in the test details. |
Method | assertStatementCount | Assert that the expected number of SQL statements occurred. |
Method | useTempDir | Use a temporary directory for this test. |
Method | assertEmailHeadersEqual | Assert that two email headers are equal. |
Method | assertStartsWith | Undocumented |
Method | assertEndsWith | Asserts that s ends with suffix. |
Method | checkPermissions | Check if the used_permissions match expected_permissions. |
Method | assertEmailQueueLength | Pop the email queue, assert its length, and return it. |
Method | _unfoldEmailHeader | Unfold a multiline email header. |
Create a unique submission ID to ensure that an error message expected in a test is indeed created by this test.
data
.
Insert the text insert_text
before the first occurrence of
where
in data
.
data
.
Search for the first occurrence of from_text
in data, and for the
first occurrence of to_text
(after from_text
) in data
.
Replace the text between from_text
and to_text
by replace_text
.
The strings from_text
are to_text
are part of the text which is
replaced.
The cElementTree parser does not accept this; The processing script deals with this by emptying all <comment> nodes before building the element tree. (Note that we don't process data from this node at all.)
Bytes with bit 7 set must be detected as invalid.
Search for message in the log entries for submission_key. assertErrorMessage requires that (a) a log message starts with "Parsing submisson <submission_key>:" (b) the error message passed as the parameter message appears in a log string that matches (a) (c) result, which is supposed to contain an object representing the result of parsing a submission, is None. If all three criteria match, assertErrormessage does not raise any exception.
If any of these tags is omitted, the submission data becomes invalid.
The only allowed tags are specified by the Relax NG schema: live_cd, system_id, distribution, distroseries, architecture, private, contactable, date_created (tested in testSummaryRequiredTags()), and the optional tag <kernel-release>.
These tags may only have the attribute 'value', and the value of this attribute must be 'True' or 'False'.
The parser expects a valid datetime value (ISO format) in the date_created tag, like
"2007-01-01T01:02:03.400000" "2007-01-01T01:02:03Z" "2007-01-01T01:02:03:600+01:00"
The fractional part of the seconds is optional as well as the time zone information ('Z' for UTC or an offset in hh:mm).
The <client> tag requires the attributes 'name' and 'version'; other attributes are not allowed.
The <plugin> tag requires the attributes 'name' and 'version'; other attributes are not allowed.
This data is stored either in the sub-tag <hal> or in the three tags <udev>, <dmi>, <sysfs-attributes>.
Valid sub-tags are <hal>, <udev>, <dmi>, <sysfs-attributes>, <processors>, <aliases>. <aliases> is optional, <processors> is required, and either <hal> or all three tags <udev>, <dmi>, <sysfs-attributes> must be present.
The <hal> tag must have the 'version' attribute; other attributes are not allowed.
<hal> must contain at least one <device> sub-tag. All other sub-tags are invalid.
<device> must have the attributes 'id' and 'udi'; the attribute 'parent' is optional. The latter is already shown by
<device id="130" udi="/org/freedesktop/Hal/devices/computer">
in the standard sample data.
The values of 'id' and 'parent' must be integers. "id" must not be emtpy.
tag must be either 'property' or 'value'
name is the value of the name attribute of the template, or None, if the template shall not have the attribute name.
container_type must be one of 'list', 'dbus.List', 'dict', 'dbus.Dictionary'.
Return: A tag template for this property/value type and a flag, if value tags within this tag need a name attribute.
This tag has no attributes. The only allowed sub-tag is <processor>. At least one <processor> tag must be present.
The attributes "name" and "class" are required.
The attributes "device" and "version" are optional.
Attributes other than name, version, class, device are invalid.