-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tests? #8
Comments
there currently are some basic unit tests using the unity test framework we probably want to get some real-world example data and make tests from that. |
I'd prefer this as well. But to get some real-world examples we need a logging facility for the real data coming from the serial port. |
Interesting. @devZer0 did you by chance open a bug for the libsml crash? |
it's a while ago that i worked with all that stuff. need to find my sources for commandline parser tool i tried to develop. if i find it and compile it against latest libsml and it still crashes, i will file a bug report. not sure why i didn't at that time.... |
what about adding my libsml-testing sml binary dumps to the volkszaehler-git repo or even add those test files to libsml repo ? think that would raise awareness.... furthermore, i found a way to somewhat simulate a serial port, even with setting a virtual baudrate - this way parser tools can be tested which do not support reading from a file or from stdin or developers can test an application with smartmeters they don't have physical access to. maybe there are even better settings for socat, didn't test into depth, but basically it works and i think this is quite interesting/useful: To simulate a eHz/Smart-Meter for development or troubleshooting, you can to the following:
|
Warum nicht einfach den. Dump einlesen? Woher die dumps- aus Deinem Repo? |
weil es tools geben könnte die nicht von file oder stdin lesen können, weil sie nur auf serielle schnittstelle ausgelegt sind? so wie sml_server bis vor kurzem? ja, ich meine die dumps aus meinem repo. wenn "testing" bei libsml ne rolle spielt wäre ansonsten ein verweis hilfreich, es wär ja schön wenn die dump-sammlung noch etwas wachsen würde... |
Dann ist das ein Designfehler :)
Gerne! Magst Du einen PR machen? |
@devZer0 I'd be happy to include your collected dumps in this repo as "real life" test data. Is that ok for you? |
I do not think that dumps belong in a lib repository. They should be kept separately with a link in the Readme.md. Reason: Not all users need this just to compile the lib ... |
I still think its a good proposal for testing. How else? |
Yes, they are. And it is good that they exist. But not needed by everyone, as I added on my last post. |
ja, aber da kann ja der endanwender nichts für oder der, der das problem eines endanwender anaylsieren will - umdesignen kann es nur der, der in seinem tool libsml implementiert hat und stdio/file-io vergessen hat... bzgl. der binary dumps würde ich mir wünschen daß sie teil des volkszaehler-repos würden oder in libsml ein verweis auf mein repo aufgenommen wird. |
Also wäre ja z. B. volkszaehler/libsml-meter-dumps ein guter Ort, oder? |
ja. schaut doch bitte neben den dumps mal über die übrigen files drüber und bewertet gerne auch das gegenwärtige verfahren so einen dump zu ziehen, wir können das repo ja auch neu aufziehen. libsml würde ich aus dem repo-namen glaube ich rauslassen weil es ja mit libsml nicht in direktem zusammenhang steht. das sind binärwürste von echten eHz die sich zufällig zum testen von libsml eignen... Vielleicht reicht "SMLBinaryDumps" als Name? |
sml-samples?
2018-01-22 11:36 GMT+01:00 devZer0 <notifications@github.com>:
… ja. schaut doch bitte neben den dumps mal über die übrigen files drüber
und bewertet gerne auch das gegenwärtige verfahren so einen dump zu ziehen,
wir können das repo ja auch neu aufziehen.
libsml würde ich aus dem repo-namen glaube ich rauslassen weil es ja mit
libsml nicht in direktem zusammenhang steht. das sind binärwürste von
echten eHz die sich zufällig zum testen von libsml eignen...
Vielleicht reicht "SMLBinaryDumps" als Name?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#8 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AALR74FyJI-gV2yERsVVWbioujwh3GmAks5tNGS_gaJpZM4DP4jF>
.
|
See proposal in #67 |
am i the first to stream and decode sml from a git repo on the internet ? :D :D :D curl -s https://github.com/devZer0/libsml-testing | grep "js-navigation-open" | grep ".bin" | awk -F'title="|" id=' '{print $2}' | while read file;do curl -s https://raw.githubusercontent.com/devZer0/libsml-testing/master/$file | ./examples/sml_server - ;done |
i have spend some thoughts on how to test libsml for stability/reliability to make sure it would not hang , get stuck and burn cpu or even crash. Maybe someone wants to take a look to decide if this one is a good approach for "data obfuscation/scrambling testing" ? what i'm doing is inserting bit-flips at random position in sml binary dump and let sml_server eat that "poisoned data" to see if it hangs or crashes
|
Would be easier to just integrate the files here and use them on travis-ci.
I imagine you would need a higher fuzzing rate or keep running this a large number of times before you would see any effect. I‘d rather add a flip percentage. |
as i have crashes of sml_server binary when my optical reader was not adjusted correctly, i assume libsml is not sufficiently crash safe wen it's being sent random data. i guess many of vzlogger crashes are a result of this. could someone recommend some tools to do "in stream data obfuscation", like swapping positions, removing/truncating/zeroing parts of the stream? update: |
Should be simple to build one. Anything that can pipe stdin to stdout and allows to configure a bit flip probability (or any other type of error situations). Could build one if you need it. |
Actually, re-reading the thread- you already have the perl script, what else is needed? |
i think more complex "scrambling" would be useful:
in other words: feed all sorts of "damaged" data to libsml to see how it behaves. does it hang? (->watchdog to kill it and restart?) |
Repeating myself here- why not simply add to the perl script above? |
if it would be simple for me, i would have done it.... |
No description provided.
The text was updated successfully, but these errors were encountered: