summaryrefslogtreecommitdiff
path: root/test/appstore-server-sync.bats
diff options
context:
space:
mode:
Diffstat (limited to 'test/appstore-server-sync.bats')
-rw-r--r--test/appstore-server-sync.bats48
1 files changed, 48 insertions, 0 deletions
diff --git a/test/appstore-server-sync.bats b/test/appstore-server-sync.bats
new file mode 100644
index 0000000..7295f3d
--- /dev/null
+++ b/test/appstore-server-sync.bats
@@ -0,0 +1,48 @@
+#!/usr/bin/env bats
+# vim: set filetype=sh:
+
+load utils
+
+@test "Full test" {
+ cd $BATS_TMPDIR
+ rm -rf appstore-server-sync
+ mkdir -p appstore-server-sync/{repos,appstores,wc}
+ cd appstore-server-sync
+
+ appstore server-init `pwd`/{repos,appstores} my-store
+
+ git clone repos/my-store wc
+ cd wc
+ git config user.name "Test Case"
+ git config user.email tester@example.org
+ appstore add-app app-a file $BATS_TEST_DIRNAME/data/my-app.zip 1.0-SNAPSHOT disabled
+ git commit -a -m wip
+ cd ..
+
+ appstore server-sync `pwd`/wc `pwd`/appstores/my-store
+
+ # Check that the installed conf matches the one from the app
+ (
+ cd appstores/my-store
+ app cat-conf -g my-app -f app-a/.app/config
+ eq '${lines[0]}' "my-app.awesome=true"
+ eq '${#lines[*]}' 1
+ )
+
+ # Add some configuration to be merged into the app
+ (
+ cd wc
+ echo my-app.extra=true >> app-a.config
+ git commit -a -m "extra config"
+ )
+
+ appstore server-sync `pwd`/wc `pwd`/appstores/my-store
+
+ (
+ cd appstores/my-store
+ app cat-conf -g my-app -f app-a/.app/config
+ eq '${lines[0]}' "my-app.awesome=true"
+ eq '${lines[1]}' "my-app.extra=true"
+ eq '${#lines[*]}' 2
+ )
+}