tests: Fix installed tests

tingping/wmclass
Alexander Larsson 2016-05-02 16:16:06 +02:00
parent d680da8d59
commit b3d854f507
5 changed files with 21 additions and 16 deletions

View File

@ -50,6 +50,7 @@ tests/test-basic.sh: tests/package_version.txt
installed_test_SCRIPTS += \
buildutil/tap-driver.sh \
tests/configure.test \
tests/package_version.txt \
tests/make-test-app.sh \
tests/make-test-runtime.sh \
@ -59,7 +60,7 @@ installed_test_SCRIPTS += \
installed_test_data = \
tests/org.test.Hello.png \
tests/configure.test \
tests/test.json \
tests/session.conf.in \
$(NULL)

View File

@ -36,6 +36,6 @@ assert_file_has_content help_out "^Usage:$"
echo "ok help"
${XDG_APP} --default-arch
${XDG_APP} --default-arch > /dev/null
echo "ok default arch"

View File

@ -28,9 +28,13 @@ install_repo
setup_sdk_repo
install_sdk_repo
# Need /var/tmp cwd for xattrs
REPO=`pwd`/repo
cd $TEST_DATA_DIR/
cp -a $(dirname $0)/configure.test .
echo "version1" > app-data
xdg-app-builder --repo=repo --force-clean appdir $(dirname $0)/test.json
xdg-app-builder --repo=$REPO --force-clean appdir $(dirname $0)/test.json > /dev/null
assert_file_has_content appdir/files/share/app-data version1
assert_file_has_content appdir/metadata shared=network;
@ -56,7 +60,7 @@ assert_file_has_content app_data_1 version1
echo "ok install+run"
echo "version2" > app-data
xdg-app-builder --repo=repo --force-clean appdir $(dirname $0)/test.json
xdg-app-builder --repo=$REPO --force-clean appdir $(dirname $0)/test.json > /dev/null
assert_file_has_content appdir/files/share/app-data version2
${XDG_APP} --user update org.test.Hello2 master

View File

@ -49,14 +49,14 @@ assert_file_has_content $USERDIR/exports/share/applications/mimeinfo.cache x-tes
assert_has_file $USERDIR/exports/share/icons/hicolor/icon-theme.cache
assert_has_file $USERDIR/exports/share/icons/hicolor/index.theme
$XDG_APP list --user | grep org.test.Hello
$XDG_APP list --user -d | grep org.test.Hello | grep test-repo
$XDG_APP list --user -d | grep org.test.Hello | grep current
$XDG_APP list --user -d | grep org.test.Hello | grep ${ID:0:12}
$XDG_APP list --user | grep org.test.Hello > /dev/null
$XDG_APP list --user -d | grep org.test.Hello | grep test-repo > /dev/null
$XDG_APP list --user -d | grep org.test.Hello | grep current > /dev/null
$XDG_APP list --user -d | grep org.test.Hello | grep ${ID:0:12} > /dev/null
$XDG_APP info --user org.test.Hello
$XDG_APP info --user org.test.Hello | grep test-repo
$XDG_APP info --user org.test.Hello | grep $ID
$XDG_APP info --user org.test.Hello > /dev/null
$XDG_APP info --user org.test.Hello | grep test-repo > /dev/null
$XDG_APP info --user org.test.Hello | grep $ID > /dev/null
echo "ok install"
@ -80,7 +80,7 @@ ARGS="--share=ipc" run_sh readlink /proc/self/ns/ipc > shared_ipc_ns
assert_not_streq `cat unshared_ipc_ns` `readlink /proc/self/ns/ipc`
assert_streq `cat shared_ipc_ns` `readlink /proc/self/ns/ipc`
if run_sh cat $(dirname $0)/package_version.txt; then
if run_sh cat $(dirname $0)/package_version.txt &> /dev/null; then
assert_not_reached "Unexpectedly allowed to access file"
fi
@ -90,13 +90,13 @@ ARGS="--filesystem=host" run_sh cat $(dirname $0)/package_version.txt > /dev/nul
echo "ok namespaces"
$XDG_APP override --user --filesystem=host org.test.Hello
run_sh cat $(dirname $0)/package_version.txt > /dev/null
if ARGS="--nofilesystem=host" run_sh cat $(dirname $0)/package_version.txt > /dev/null; then
run_sh cat $(dirname $0)/package_version.txt &> /dev/null
if ARGS="--nofilesystem=host" run_sh cat $(dirname $0)/package_version.txt &> /dev/null; then
assert_not_reached "Unexpectedly allowed to access --nofilesystem=host file"
fi
$XDG_APP override --user --nofilesystem=host org.test.Hello
if run_sh cat $(dirname $0)/package_version.txt > /dev/null; then
if run_sh cat $(dirname $0)/package_version.txt &> /dev/null; then
assert_not_reached "Unexpectedly allowed to access file"
fi

View File

@ -29,7 +29,7 @@
"type": "file",
"path": "configure.test",
"dest-filename": "configure",
"sha256": "fb62c2826dbd2fda27e878490e3f1f9081b1b69a2211e125ae79cf552a7a2254"
"sha256": "ce0a7014057cc45ac6cfa4b84fe848d46b1225f4ce03f1b52d5ab73521816cbf"
},
{
"type": "file",