Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
temperature-daemon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
th
temperature-daemon
Commits
6ce31bc2
Commit
6ce31bc2
authored
6 years ago
by
Johannes Walcher
Browse files
Options
Downloads
Patches
Plain Diff
created tests and updated config for them
parent
73fbfc3e
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
tempermon.ini
+18
-2
18 additions, 2 deletions
tempermon.ini
test/collectdmock.py
+7
-0
7 additions, 0 deletions
test/collectdmock.py
test/run_tests.sh
+5
-0
5 additions, 0 deletions
test/run_tests.sh
test/test.py
+69
-0
69 additions, 0 deletions
test/test.py
with
99 additions
and
2 deletions
tempermon.ini
+
18
−
2
View file @
6ce31bc2
[serial]
port
=
/dev/ttyUSB0
#port=/dev/ttyUSB0
port
=
/tmp/temperature_pts
baudrate
=
115200
timeout
=
100
[collectd]
socketpath
=
/var/run/collectd-unixsock
#socketpath=/var/run/collectd-unixsock
socketpath
=
/tmp/collectd_sock
hostname
=
hugin
interval
=
1
[mail]
from
=
Temperman <root@temperator.stusta.de>
...
...
@@ -13,6 +16,19 @@ to=jw@stusta.de,markus.hefele@stusta.de
to_urgent
=
jw@stusta.de,markus.hefele@stusta.de
min_delay_between_messages
=
3600
[warning]
floor_sensors
=
Test
ceiling_sensors
=
Test2
min_ceiling_warning
=
35
floor_ceiling_diff
=
15
ceiling_warning_level
=
40
[testsensor]
name
=
Test
calibration
=
5
[sensortest]
name
=
Test2
calibration
=
5
This diff is collapsed.
Click to expand it.
test/collectdmock.py
0 → 100755
+
7
−
0
View file @
6ce31bc2
#!/usr/bin/env python3
import
sys
for
line
in
sys
.
stdin
:
print
(
"
Ack
"
)
sys
.
stdout
.
flush
()
This diff is collapsed.
Click to expand it.
test/run_tests.sh
0 → 100755
+
5
−
0
View file @
6ce31bc2
# IMPORTANT: Set the config to use the right socket path
socat
-d
PTY,link
=
/tmp/temperature_pts,echo
=
0
"EXEC:python3 test.py ...,pty,raw"
,echo
=
0 &
socat UNIX-LISTEN:/tmp/collectd_sock,fork EXEC:
"python3 collectdmock.py"
This diff is collapsed.
Click to expand it.
test/test.py
0 → 100755
+
69
−
0
View file @
6ce31bc2
#!/usr/bin/env python3
import
random
import
time
import
sys
delay
=
0.1
while
True
:
for
_
in
range
(
3
):
print
(
"
testsensor {}
"
.
format
(
random
.
random
()
*
40
))
print
(
"
sensortest {}
"
.
format
(
random
.
random
()
*
40
))
print
()
time
.
sleep
(
delay
)
print
(
"
Sensor Error test
"
,
file
=
sys
.
stderr
)
print
(
"
testsensor {}
"
.
format
(
9001
))
print
(
"
sensortest {}
"
.
format
(
random
.
random
()
*
40
))
print
()
time
.
sleep
(
delay
)
for
_
in
range
(
3
):
print
(
"
testsensor {}
"
.
format
(
random
.
random
()
*
40
))
print
(
"
sensortest {}
"
.
format
(
random
.
random
()
*
40
))
print
()
time
.
sleep
(
delay
)
print
(
"
Missing sensor test
"
,
file
=
sys
.
stderr
)
print
(
"
sensortest {}
"
.
format
(
random
.
random
()
*
40
))
print
()
time
.
sleep
(
delay
)
for
_
in
range
(
3
):
print
(
"
testsensor {}
"
.
format
(
random
.
random
()
*
40
))
print
(
"
sensortest {}
"
.
format
(
random
.
random
()
*
40
))
print
()
time
.
sleep
(
delay
)
print
(
"
Extra sensor test
"
,
file
=
sys
.
stderr
)
print
(
"
idonotexist {}
"
.
format
(
random
.
random
()
*
40
))
print
(
"
testsensor {}
"
.
format
(
random
.
random
()
*
40
))
print
(
"
sensortest {}
"
.
format
(
random
.
random
()
*
40
))
print
()
time
.
sleep
(
delay
)
for
_
in
range
(
3
):
print
(
"
testsensor {}
"
.
format
(
random
.
random
()
*
40
))
print
(
"
sensortest {}
"
.
format
(
random
.
random
()
*
40
))
print
()
time
.
sleep
(
delay
)
print
(
"
Too Hot Test
"
,
file
=
sys
.
stderr
)
print
(
"
testsensor {}
"
.
format
(
45
))
print
(
"
sensortest {}
"
.
format
(
40
))
print
()
time
.
sleep
(
delay
)
for
_
in
range
(
3
):
print
(
"
testsensor {}
"
.
format
(
random
.
random
()
*
40
))
print
(
"
sensortest {}
"
.
format
(
random
.
random
()
*
40
))
print
()
time
.
sleep
(
delay
)
print
(
"
high diff test
"
,
file
=
sys
.
stderr
)
print
(
"
testsensor {}
"
.
format
(
45
))
print
(
"
sensortest {}
"
.
format
(
25
))
print
()
time
.
sleep
(
delay
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment