Repository navigation
sadf: XML: Accept negative sensor values in XSD document - #465
Merged
sysstat merged 2 commits intoNov 15, 2026
Merged
Conversation
Temperature and voltage input values may be negative. Their percentages (percent-temp and percent-in) can be negative too, for example when the value is below the minimum value of the sensor. So update XSD document to accept negative values for attributes degC, percent-temp, inV and percent-in.
Test 00407 only gets negative sensor values when the machine running the tests has a sensor that reports one. Add an XML sample with negative values for degC, percent-temp, inV and percent-in, and validate it against the XSD document in test 00425. The sample is "sadf -x -- -m TEMP,IN" output for a data file collected with a fake hwmon chip.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
sadf -xoutput doesn't validate againstxml/sysstat.xsdwhen a sensor reports a negative temperature or voltage.degC,percent-temp,inVandpercent-inusehundredth-type, whose pattern doesn't allow a sign.That's what fails in CI on #464. Test 00069 reads the machine's real sensors, and test 00407 then validates the XML:
I've switched the four attributes to
negative-hundredth-type, like 4c01e42 did for the batteryvariationattribute. The DTD hasCDATAfor them, so it's fine as is.The second commit adds test 00425, which validates a small XML sample with negative values, so CI covers this on any runner. I made the sample with
sadf -xfrom a fake hwmon chip, since none of my sensors report a negative value.