Skip to content
Snippets Groups Projects
Commit 6ce31bc2 authored by Johannes Walcher's avatar Johannes Walcher
Browse files

created tests and updated config for them

parent 73fbfc3e
No related branches found
No related tags found
No related merge requests found
[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
#!/usr/bin/env python3
import sys
for line in sys.stdin:
print("Ack")
sys.stdout.flush()
# 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"
#!/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)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment