mirror of
https://github.com/rclone/rclone.git
synced 2025-08-18 17:38:52 +02:00
testserver: Make Test{FTP,SFTP,Webdav}Rclone run the current rclone
Before this change the tests were run against the previous stable rclone/rclone docker image. This unfortunately masked errors in the integration test server. This change uses the currently installed rclone to run "rclone serve ftp" etc. This is installed out of the current code by the integration test server so will make a better test.
This commit is contained in:
41
fstest/testserver/init.d/rclone-serve.bash
Normal file
41
fstest/testserver/init.d/rclone-serve.bash
Normal file
@@ -0,0 +1,41 @@
|
||||
#!/bin/bash
|
||||
|
||||
# start an "rclone serve" server
|
||||
|
||||
PIDFILE=/tmp/${NAME}.pid
|
||||
DATADIR=/tmp/${NAME}-data
|
||||
|
||||
stop() {
|
||||
if status ; then
|
||||
pid=$(cat ${PIDFILE})
|
||||
kill $pid
|
||||
rm ${PIDFILE}
|
||||
echo "$NAME stopped"
|
||||
fi
|
||||
}
|
||||
|
||||
status() {
|
||||
if [ -e ${PIDFILE} ]; then
|
||||
pid=$(cat ${PIDFILE})
|
||||
if kill -0 &>1 > /dev/null $pid; then
|
||||
# echo "$NAME running"
|
||||
return 0
|
||||
else
|
||||
rm ${PIDFILE}
|
||||
fi
|
||||
fi
|
||||
# echo "$NAME not running"
|
||||
return 1
|
||||
}
|
||||
|
||||
run() {
|
||||
if ! status ; then
|
||||
mkdir -p ${DATADIR}
|
||||
nohup "$@" >>/tmp/${NAME}.log 2>&1 </dev/null &
|
||||
pid=$!
|
||||
echo $pid > ${PIDFILE}
|
||||
disown $pid
|
||||
fi
|
||||
}
|
||||
|
||||
. $(dirname "$0")/run.bash
|
Reference in New Issue
Block a user