diff options
author | Alexander Larsson <alexl@redhat.com> | 2016-05-02 10:47:59 +0200 |
---|---|---|
committer | Alexander Larsson <alexl@redhat.com> | 2016-05-02 10:47:59 +0200 |
commit | 123f32015dd852ea788ea699accef1331dc8fa56 (patch) | |
tree | 75d9cffe3f9845fd72c51fe6d724279101c573d9 /tests/test-run.sh | |
parent | 2f465215e23f956419b9ae905ae3c94717bc2de1 (diff) | |
download | xdg-app-123f32015dd852ea788ea699accef1331dc8fa56.tar.gz |
tests/test-run.sh: Add tests for proper installation
Diffstat (limited to 'tests/test-run.sh')
-rwxr-xr-x | tests/test-run.sh | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/tests/test-run.sh b/tests/test-run.sh index 328be2e..836b2fe 100755 --- a/tests/test-run.sh +++ b/tests/test-run.sh @@ -21,12 +21,41 @@ set -euo pipefail . $(dirname $0)/libtest.sh -echo "1..1" +echo "1..3" setup_repo install_repo +# Verify that app is correctly installed + +assert_has_dir $USERDIR/app/org.test.Hello +assert_has_symlink $USERDIR/app/org.test.Hello/current +assert_symlink_has_content $USERDIR/app/org.test.Hello/current ^$ARCH/master$ +assert_has_dir $USERDIR/app/org.test.Hello/$ARCH/master +assert_has_symlink $USERDIR/app/org.test.Hello/$ARCH/master/active +assert_has_file $USERDIR/app/org.test.Hello/$ARCH/master/active/deploy +assert_has_file $USERDIR/app/org.test.Hello/$ARCH/master/active/metadata +assert_has_dir $USERDIR/app/org.test.Hello/$ARCH/master/active/files +assert_has_dir $USERDIR/app/org.test.Hello/$ARCH/master/active/export +assert_has_file $USERDIR/exports/share/applications/org.test.Hello.desktop +# Ensure Exec key is rewritten +assert_file_has_content $USERDIR/exports/share/applications/org.test.Hello.desktop "^Exec=.*/xdg-app run --branch=master --arch=$ARCH --command=hello.sh org.test.Hello$" +assert_has_file $USERDIR/exports/share/icons/hicolor/64x64/apps/org.test.Hello.png + +# Ensure triggers ran +assert_has_file $USERDIR/exports/share/applications/mimeinfo.cache +assert_file_has_content $USERDIR/exports/share/applications/mimeinfo.cache x-test/Hello +assert_has_file $USERDIR/exports/share/icons/hicolor/icon-theme.cache +assert_has_file $USERDIR/exports/share/icons/hicolor/index.theme + +echo "ok install" + run org.test.Hello > hello_out assert_file_has_content hello_out '^Hello world, from a sandbox$' echo "ok hello" + +run_sh cat /run/user/`id -u`/xdg-app-info > xai +assert_file_has_content xai '^name=org.test.Hello$' + +echo "ok xdg-app-info" |