diff options
-rw-r--r-- | tests/libtest.sh | 4 | ||||
-rwxr-xr-x | tests/make-test-app.sh | 4 | ||||
-rwxr-xr-x | tests/test-run.sh | 22 |
3 files changed, 28 insertions, 2 deletions
diff --git a/tests/libtest.sh b/tests/libtest.sh index 0717af2..74ef142 100644 --- a/tests/libtest.sh +++ b/tests/libtest.sh @@ -149,6 +149,10 @@ setup_repo () { flatpak remote-add --user --no-gpg-verify test-repo repo } +make_updated_app () { + . $(dirname $0)/make-test-app.sh UPDATED > /dev/null +} + setup_sdk_repo () { . $(dirname $0)/make-test-runtime.sh org.test.Sdk bash ls cat echo readlink make mkdir cp touch > /dev/null } diff --git a/tests/make-test-app.sh b/tests/make-test-app.sh index e0f927e..92d4012 100755 --- a/tests/make-test-app.sh +++ b/tests/make-test-app.sh @@ -4,13 +4,15 @@ set -e DIR=`mktemp -d` +EXTRA="${1-}" + # Init dir flatpak build-init ${DIR} org.test.Hello org.test.Platform org.test.Platform mkdir -p ${DIR}/files/bin cat > ${DIR}/files/bin/hello.sh <<EOF #!/bin/sh -echo "Hello world, from a sandbox" +echo "Hello world, from a sandbox$EXTRA" EOF chmod a+x ${DIR}/files/bin/hello.sh diff --git a/tests/test-run.sh b/tests/test-run.sh index c10912a..6a62dd7 100755 --- a/tests/test-run.sh +++ b/tests/test-run.sh @@ -21,7 +21,7 @@ set -euo pipefail . $(dirname $0)/libtest.sh -echo "1..5" +echo "1..6" setup_repo install_repo @@ -101,3 +101,23 @@ if run_sh cat $(dirname $0)/package_version.txt &> /dev/null; then fi echo "ok overrides" + + +OLD_COMMIT=`${FLATPAK} --user info --show-commit org.test.Hello` +${FLATPAK} --user update org.test.Hello +ALSO_OLD_COMMIT=`${FLATPAK} --user info --show-commit org.test.Hello` + +assert_streq "$OLD_COMMIT" "$ALSO_OLD_COMMIT" + +make_updated_app + +${FLATPAK} --user update org.test.Hello + +NEW_COMMIT=`${FLATPAK} --user info --show-commit org.test.Hello` + +assert_not_streq "$OLD_COMMIT" "$NEW_COMMIT" + +run org.test.Hello > hello_out +assert_file_has_content hello_out '^Hello world, from a sandboxUPDATED$' + +echo "ok update" |