aboutsummaryrefslogtreecommitdiff
path: root/test/app-operate.bats
diff options
context:
space:
mode:
Diffstat (limited to 'test/app-operate.bats')
-rwxr-xr-xtest/app-operate.bats31
1 files changed, 31 insertions, 0 deletions
diff --git a/test/app-operate.bats b/test/app-operate.bats
new file mode 100755
index 0000000..e931f3c
--- /dev/null
+++ b/test/app-operate.bats
@@ -0,0 +1,31 @@
+#!/usr/bin/env bats
+# vim: set filetype=sh:
+
+load utils
+
+@test "app-upgrade" {
+ mkzip app-a
+
+ app init -d my-app file $APPSH_HOME/test/data/app-a.zip
+
+ cd my-app
+ app status
+ eq '${lines[0]}' "Not running"
+ eq '${#lines[*]}' 1
+
+ app start
+ pid=`cat .app/pid`
+ match '${lines[0]}' "Application launched as $pid"
+ eq '${#lines[*]}' 1
+
+ app stop
+ match '${lines[0]}' "Sending TERM to $pid, waiting for shutdown.*"
+ eq '${#lines[*]}' 1
+
+ echo wat > .app/pid
+ check_status=no
+ app stop
+ eq '$status' 1
+ match '${lines[0]}' "The application crashed. Was running as wat"
+ eq '${#lines[*]}' 1
+}