From a3ce3f7eabbb746aa9ced430bcd55391742c738b Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Tue, 16 Oct 2012 23:57:41 +0200 Subject: o Improved completion (again). o Consistent usage of APPSH_HOME and BASEDIR. --- test/data/app-a/root/bin/app-a | 9 +++++++++ test/data/app-a/root/etc/app.conf | 1 + test/it-install-remove.bats | 25 +++++++++++++++++++++++++ test/utils.bash | 3 ++- 4 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 test/data/app-a/root/etc/app.conf create mode 100755 test/it-install-remove.bats (limited to 'test') 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 "$@") } -- cgit v1.2.3