aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2012-10-16 23:57:41 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2012-10-16 23:57:41 +0200
commita3ce3f7eabbb746aa9ced430bcd55391742c738b (patch)
treee4dcab1586b725508a57bfce83f3067a95b26a89 /test
parentf563dc165ce1ee8747eea647231bf8e295d8af3f (diff)
downloadapp.sh-a3ce3f7eabbb746aa9ced430bcd55391742c738b.tar.gz
app.sh-a3ce3f7eabbb746aa9ced430bcd55391742c738b.tar.bz2
app.sh-a3ce3f7eabbb746aa9ced430bcd55391742c738b.tar.xz
app.sh-a3ce3f7eabbb746aa9ced430bcd55391742c738b.zip
o Improved completion (again).
o Consistent usage of APPSH_HOME and BASEDIR.
Diffstat (limited to 'test')
-rw-r--r--test/data/app-a/root/bin/app-a9
-rw-r--r--test/data/app-a/root/etc/app.conf1
-rwxr-xr-xtest/it-install-remove.bats25
-rw-r--r--test/utils.bash3
4 files changed, 37 insertions, 1 deletions
diff --git a/test/data/app-a/root/bin/app-a b/test/data/app-a/root/bin/app-a
index e69de29..7d251a0 100644
--- a/test/data/app-a/root/bin/app-a
+++ b/test/data/app-a/root/bin/app-a
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+me=`basename $0`
+
+for i in {1..10}
+do
+ echo "#$i: `date`" >> $me.log
+ sleep 1
+done
diff --git a/test/data/app-a/root/etc/app.conf b/test/data/app-a/root/etc/app.conf
new file mode 100644
index 0000000..d2c3f48
--- /dev/null
+++ b/test/data/app-a/root/etc/app.conf
@@ -0,0 +1 @@
+app.bin=bin/app-a
diff --git a/test/it-install-remove.bats b/test/it-install-remove.bats
new file mode 100755
index 0000000..98a79c9
--- /dev/null
+++ b/test/it-install-remove.bats
@@ -0,0 +1,25 @@
+#!/usr/bin/env bats
+# vim: set filetype=sh:
+
+load utils
+
+@test "install remove roundtrip" {
+ mkzip "app-a"
+ a="-n app-a -i prod"
+ app instance install \
+ -r file \
+ -u $BATS_TEST_DIRNAME/data/app-a.zip \
+ $a
+
+ [ ! -r .app/var/pid/$name-$instance.pid ]
+ app $a operate start; echo_lines
+ [ -r .app/var/pid/$name-$instance.pid ]
+
+ app $a operate stop; echo_lines
+ [ ! -r .app/var/pid/$name-$instance.pid ]
+
+# app instance install \
+# -r file \
+# -u $HOME/.m2/repository/io/trygvis/appsh/examples/jenkins/1.0-SNAPSHOT/jenkins-1.0-SNAPSHOT.zip \
+# -n jenkins -i env-a
+}
diff --git a/test/utils.bash b/test/utils.bash
index 0edead8..03871f8 100644
--- a/test/utils.bash
+++ b/test/utils.bash
@@ -30,5 +30,6 @@ mkzip() {
}
app() {
- run ./app "$@"
+ (set -x
+ run ./app "$@")
}