2 changed files with 57 additions and 167 deletions
@ -9,8 +9,8 @@ version="150715" |
|||||
|
|
||||
# Notification Email |
# Notification Email |
||||
# (on|off) |
# (on|off) |
||||
emailnotification="off" |
emailnotification="on" |
||||
email="[email protected]" |
email="[email protected]" |
||||
|
|
||||
# Steam login |
# Steam login |
||||
steamuser="anonymous" |
steamuser="anonymous" |
||||
@ -103,14 +103,24 @@ fn_setstatus(){ |
|||||
|
|
||||
echo"" |
echo"" |
||||
echo "Required status: ${requiredstatus}" |
echo "Required status: ${requiredstatus}" |
||||
|
counter=0 |
||||
while [ "${requiredstatus}" != "${currentstatus}" ]; do |
while [ "${requiredstatus}" != "${currentstatus}" ]; do |
||||
|
counter=$((counter+1)) |
||||
fn_currentstatus |
fn_currentstatus |
||||
|
|
||||
echo -ne "Current status: ${currentstatus}\\r" |
echo -ne "Current status: ${currentstatus}\\r" |
||||
if [ "${requiredstatus}" == "ONLINE" ]; then |
if [ "${requiredstatus}" == "ONLINE" ]; then |
||||
(fn_start > /dev/null 2>&1) |
(fn_start > /dev/null 2>&1) |
||||
else |
else |
||||
(fn_stop > /dev/null 2>&1) |
(fn_stop > /dev/null 2>&1) |
||||
fi |
fi |
||||
|
if [ "${counter}" -gt "5" ]; then |
||||
|
currentstatus="FAIL" |
||||
|
echo "Current status: ${currentstatus}" |
||||
|
echo "" |
||||
|
echo "Unable to start or stop server." |
||||
|
exit |
||||
|
fi |
||||
done |
done |
||||
echo -ne "Current status: ${currentstatus}\\r" |
echo -ne "Current status: ${currentstatus}\\r" |
||||
echo -e "\n" |
echo -e "\n" |
||||
@ -119,6 +129,16 @@ fn_setstatus(){ |
|||||
sleep 0.5 |
sleep 0.5 |
||||
} |
} |
||||
|
|
||||
|
echo "=================================" |
||||
|
echo "TravisCI Tests" |
||||
|
echo "Linux Game Server Manager" |
||||
|
echo "by Daniel Gibbs" |
||||
|
echo "http://gameservermanagers.com" |
||||
|
echo "=================================" |
||||
|
echo "" |
||||
|
|
||||
|
|
||||
|
|
||||
echo "1.0 - start - no files" |
echo "1.0 - start - no files" |
||||
echo "=================================" |
echo "=================================" |
||||
echo "Description:" |
echo "Description:" |
||||
@ -130,6 +150,9 @@ echo "" |
|||||
echo "Test complete!" |
echo "Test complete!" |
||||
sleep 1 |
sleep 1 |
||||
echo "" |
echo "" |
||||
|
|
||||
|
|
||||
|
|
||||
echo "2.0 - install" |
echo "2.0 - install" |
||||
echo "=================================" |
echo "=================================" |
||||
echo "Description:" |
echo "Description:" |
||||
@ -141,6 +164,9 @@ echo "" |
|||||
echo "Test complete!" |
echo "Test complete!" |
||||
sleep 1 |
sleep 1 |
||||
echo "" |
echo "" |
||||
|
|
||||
|
|
||||
|
|
||||
echo "3.1 - start" |
echo "3.1 - start" |
||||
echo "=================================" |
echo "=================================" |
||||
echo "Description:" |
echo "Description:" |
||||
@ -208,6 +234,8 @@ echo "Test complete!" |
|||||
sleep 1 |
sleep 1 |
||||
echo "" |
echo "" |
||||
|
|
||||
|
|
||||
|
|
||||
echo "4.1 - update" |
echo "4.1 - update" |
||||
echo "=================================" |
echo "=================================" |
||||
echo "Description:" |
echo "Description:" |
||||
@ -302,6 +330,9 @@ echo "" |
|||||
echo "Test complete!" |
echo "Test complete!" |
||||
sleep 1 |
sleep 1 |
||||
echo "" |
echo "" |
||||
|
|
||||
|
|
||||
|
|
||||
echo "5.1 - monitor - online" |
echo "5.1 - monitor - online" |
||||
echo "=================================" |
echo "=================================" |
||||
echo "Description:" |
echo "Description:" |
||||
@ -316,7 +347,7 @@ echo "" |
|||||
echo "5.2 - monitor - offline - no lockfile" |
echo "5.2 - monitor - offline - no lockfile" |
||||
echo "=================================" |
echo "=================================" |
||||
echo "Description:" |
echo "Description:" |
||||
echo "run monitor while server is offline with no lockfile" |
echo "run monitor while server is offline with no lockfile." |
||||
requiredstatus="OFFLINE" |
requiredstatus="OFFLINE" |
||||
fn_setstatus |
fn_setstatus |
||||
(fn_monitor) |
(fn_monitor) |
||||
@ -324,10 +355,10 @@ echo "" |
|||||
echo "Test complete!" |
echo "Test complete!" |
||||
sleep 1 |
sleep 1 |
||||
echo "" |
echo "" |
||||
echo "5.2 - monitor - offline - with lockfile" |
echo "5.3 - monitor - offline - with lockfile" |
||||
echo "=================================" |
echo "=================================" |
||||
echo "Description:" |
echo "Description:" |
||||
echo "run monitor while server is offline with no lockfile" |
echo "run monitor while server is offline with no lockfile." |
||||
requiredstatus="OFFLINE" |
requiredstatus="OFFLINE" |
||||
fn_setstatus |
fn_setstatus |
||||
fn_printinfonl "creating lockfile." |
fn_printinfonl "creating lockfile." |
||||
@ -337,17 +368,32 @@ echo "" |
|||||
echo "Test complete!" |
echo "Test complete!" |
||||
sleep 1 |
sleep 1 |
||||
echo "" |
echo "" |
||||
echo "5.2 - monitor - gsquery.py failure" |
echo "5.4 - monitor - gsquery.py failure" |
||||
echo "=================================" |
echo "=================================" |
||||
echo "Description:" |
echo "Description:" |
||||
echo "gsquery.py will fail to query port" |
echo "gsquery.py will fail to query port." |
||||
requiredstatus="ONLINE" |
requiredstatus="ONLINE" |
||||
fn_setstatus |
fn_setstatus |
||||
port=${port+1} |
sed -i 's/[0-9]\+/0/' "${servercfgfullpath}" |
||||
(fn_monitor) |
fn_monitor |
||||
port=${port-1} |
echo "" |
||||
|
fn_printinfonl "Reseting ${servercfg}." |
||||
|
fn_install_config |
||||
echo "" |
echo "" |
||||
echo "Test complete!" |
echo "Test complete!" |
||||
sleep 1 |
sleep 1 |
||||
echo "" |
echo "" |
||||
|
|
||||
|
|
||||
|
|
||||
|
echo "6.0 - details" |
||||
|
echo "=================================" |
||||
|
echo "Description:" |
||||
|
echo "gsquery.py will fail to query port." |
||||
|
requiredstatus="ONLINE" |
||||
|
fn_setstatus |
||||
|
fn_details |
||||
|
echo "" |
||||
|
echo "Test complete!" |
||||
|
sleep 1 |
||||
|
echo "" |
Loading…
Reference in new issue