Skip to content

Commit

Permalink
tests[pidfile.bats]: test new option to wait for server is started
Browse files Browse the repository at this point in the history
  • Loading branch information
sidey79 committed Apr 1, 2024
1 parent c709cab commit 17e2f13
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/tests/bats/pidfile.bats
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ teardown() {

# Prüfen ob PIDFILE korrekt angelegt wird
/entry.sh start &>> ${LOG_FILE} &
sleep 6
sleep 8
export ENTRY_PID=$!
assert_file_contains ${FHEM_CFG_FILE} '/run/lock/fhem.pid' grep
assert_file_exists /run/lock/fhem.pid
Expand All @@ -107,8 +107,9 @@ teardown() {

# Prüfen ob PIDFILE korrekt angelegt wird
/entry.sh start &>> ${LOG_FILE} &
sleep 6
export ENTRY_PID=$!
waitForTextInFile ${LOG_FILE} "Server started" 15 # wait max 15 seconds


assert_file_contains ${LOG_FILE} 'From the FHEM_GLOBALATTR environment: attr global pidfilename /var/run/lock/fhem.pid' grep
assert_file_not_contains ${FHEM_CFG_FILE} 'attr global pidfilename /var/run/lock/fhem.pid' grep # pidfile should not be set in configfile
Expand Down

0 comments on commit 17e2f13

Please sign in to comment.