diff --git a/tests/test-history.sh b/tests/test-history.sh index 9c3f1e530..75a6ff5c2 100755 --- a/tests/test-history.sh +++ b/tests/test-history.sh @@ -57,7 +57,28 @@ if ! ${FLATPAK} --installation=history-installation history --since="${HISTORY_S exit 1 fi -diff history-log - >&2 << EOF +# Pulls are logged when system helper is compiled out as they do +# not go to the temp child repo anymore +if [ "${HAVE_SYSTEM_HELPER:-1}" = "0" ]; then + cat > expected-log << 'EOF' +add remote system (history-installation) test-repo +pull org.test.Hello.Locale master system (history-installation) test-repo +deploy install org.test.Hello.Locale master system (history-installation) test-repo +pull org.test.Platform master system (history-installation) test-repo +deploy install org.test.Platform master system (history-installation) test-repo +pull org.test.Hello master system (history-installation) test-repo +deploy install org.test.Hello master system (history-installation) test-repo +pull org.test.Hello.Locale master system (history-installation) test-repo +deploy update org.test.Hello.Locale master system (history-installation) test-repo +pull org.test.Hello master system (history-installation) test-repo +deploy update org.test.Hello master system (history-installation) test-repo +uninstall org.test.Hello master system (history-installation) +uninstall org.test.Platform master system (history-installation) +uninstall org.test.Hello.Locale master system (history-installation) +remove remote system (history-installation) test-repo +EOF +else + cat > expected-log << 'EOF' add remote system (history-installation) test-repo deploy install org.test.Hello.Locale master system (history-installation) test-repo deploy install org.test.Platform master system (history-installation) test-repo @@ -69,6 +90,9 @@ uninstall org.test.Platform master system (history-installation) uninstall org.test.Hello.Locale master system (history-installation) remove remote system (history-installation) test-repo EOF +fi + +diff history-log expected-log >&2 if ! ${FLATPAK} --installation=history-installation history --since="${HISTORY_START_TIME}" \ --columns=change,application,branch,installation,remote --json > history-log 2>&1; then @@ -77,7 +101,120 @@ if ! ${FLATPAK} --installation=history-installation history --since="${HISTORY_S exit 1 fi -diff history-log - >&2 << EOF +# Pulls are logged when system helper is compiled out as they do +# not go to the temp child repo anymore +if [ "${HAVE_SYSTEM_HELPER:-1}" = "0" ]; then + cat > expected-log << 'EOF' +[ + { + "change" : "add remote", + "application" : "", + "branch" : "", + "installation" : "system (history-installation)", + "remote" : "test-repo" + }, + { + "change" : "pull", + "application" : "org.test.Hello.Locale", + "branch" : "master", + "installation" : "system (history-installation)", + "remote" : "test-repo" + }, + { + "change" : "deploy install", + "application" : "org.test.Hello.Locale", + "branch" : "master", + "installation" : "system (history-installation)", + "remote" : "test-repo" + }, + { + "change" : "pull", + "application" : "org.test.Platform", + "branch" : "master", + "installation" : "system (history-installation)", + "remote" : "test-repo" + }, + { + "change" : "deploy install", + "application" : "org.test.Platform", + "branch" : "master", + "installation" : "system (history-installation)", + "remote" : "test-repo" + }, + { + "change" : "pull", + "application" : "org.test.Hello", + "branch" : "master", + "installation" : "system (history-installation)", + "remote" : "test-repo" + }, + { + "change" : "deploy install", + "application" : "org.test.Hello", + "branch" : "master", + "installation" : "system (history-installation)", + "remote" : "test-repo" + }, + { + "change" : "pull", + "application" : "org.test.Hello.Locale", + "branch" : "master", + "installation" : "system (history-installation)", + "remote" : "test-repo" + }, + { + "change" : "deploy update", + "application" : "org.test.Hello.Locale", + "branch" : "master", + "installation" : "system (history-installation)", + "remote" : "test-repo" + }, + { + "change" : "pull", + "application" : "org.test.Hello", + "branch" : "master", + "installation" : "system (history-installation)", + "remote" : "test-repo" + }, + { + "change" : "deploy update", + "application" : "org.test.Hello", + "branch" : "master", + "installation" : "system (history-installation)", + "remote" : "test-repo" + }, + { + "change" : "uninstall", + "application" : "org.test.Hello", + "branch" : "master", + "installation" : "system (history-installation)", + "remote" : "" + }, + { + "change" : "uninstall", + "application" : "org.test.Platform", + "branch" : "master", + "installation" : "system (history-installation)", + "remote" : "" + }, + { + "change" : "uninstall", + "application" : "org.test.Hello.Locale", + "branch" : "master", + "installation" : "system (history-installation)", + "remote" : "" + }, + { + "change" : "remove remote", + "application" : "", + "branch" : "", + "installation" : "system (history-installation)", + "remote" : "test-repo" + } +] +EOF +else + cat > expected-log << 'EOF' [ { "change" : "add remote", @@ -151,6 +288,9 @@ diff history-log - >&2 << EOF } ] EOF +fi + +diff history-log expected-log >&2 rm -f ${FLATPAK_CONFIG_DIR}/installations.d/history-inst.conf rm -rf ${TEST_DATA_DIR}/system-history-installation