Commit bdc607f1 authored by Paul Cammish's avatar Paul Cammish
Browse files

Tweak restarting pure-ftpd

parent 9f35c20b
......@@ -19,14 +19,14 @@ class TestFTP < Test::Unit::TestCase
@domain.create()
# Hack to disable TLS enforcement, as the ruby lib doesnt support it
system 'echo 1 > /etc/pure-ftpd/conf/TLS ; sync ; systemctl stop pure-ftpd.service ; date=$(date "+%Y-%m-%d %H:%M:%S") ; systemctl start pure-ftpd.service ; timeout 120 journalctl -u pure-ftpd.service --since="$date" --follow | while read line ; do if [ $( echo $line | grep -c "Started pure-ftpd.service" ) -eq 1 ]; then killall "journalctl" 2>&1 >/dev/null ; fi ; done ; sleep 1'
system 'echo 1 > /etc/pure-ftpd/conf/TLS ; sync ; systemctl stop pure-ftpd.service ; date=$(date "+%Y-%m-%d %H:%M:%S") ; systemctl start pure-ftpd.service ; timeout 120 journalctl -u pure-ftpd.service --since="$date" --follow | while read line ; do if [ $( echo $line | grep -c "Started pure-ftpd.service" ) -eq 1 ]; then killall -w -s 9 -q "journalctl" 2>&1 >/dev/null ; fi ; done ; sleep 1'
end
def teardown
# Re-enable TLS enforcement
system 'echo 2 > /etc/pure-ftpd/conf/TLS ; sync ; systemctl stop pure-ftpd.service ; date=$(date "+%Y-%m-%d %H:%M:%S") ; systemctl start pure-ftpd.service ; timeout 120 journalctl -u pure-ftpd.service --since="$date" --follow | while read line ; do if [ $( echo $line | grep -c "Started pure-ftpd.service" ) -eq 1 ]; then killall "journalctl" 2>&1 >/dev/null ; fi ; done ; sleep 1'
system 'echo 2 > /etc/pure-ftpd/conf/TLS ; sync ; systemctl stop pure-ftpd.service ; date=$(date "+%Y-%m-%d %H:%M:%S") ; systemctl start pure-ftpd.service ; timeout 120 journalctl -u pure-ftpd.service --since="$date" --follow | while read line ; do if [ $( echo $line | grep -c "Started pure-ftpd.service" ) -eq 1 ]; then killall -w -s 9 -q "journalctl" 2>&1 >/dev/null ; fi ; done ; sleep 1'
#
# Delete the temporary domain
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment