mirror of
https://github.com/flatpak/flatpak.git
synced 2026-05-10 09:00:20 -04:00
tests/repo: Make a test more robust by checking files for diff
Instead of trying to read them into variables, which could fail if there
were null bytes in the key.
Fixes: 43642337 ("dir: Try to delete the remote if we failed to add it entirely")
This commit is contained in:
@@ -138,12 +138,12 @@ port=$(cat httpd-port)
|
||||
echo "bad key" > badkey
|
||||
|
||||
gpg2_repo_url=$(ostree config --repo=$FL_DIR/repo get --group 'remote "test-gpg2-repo"' url)
|
||||
gpg2_repo_key=$(cat "$FL_DIR/repo/test-gpg2-repo.trustedkeys.gpg")
|
||||
cp "$FL_DIR/repo/test-gpg2-repo.trustedkeys.gpg" gpg2_repo_key
|
||||
${FLATPAK} ${U} remote-modify --gpg-import=badkey test-gpg2-repo >&2 || true
|
||||
gpg2_repo_url2=$(ostree config --repo=$FL_DIR/repo get --group 'remote "test-gpg2-repo"' url)
|
||||
gpg2_repo_key2=$(cat "$FL_DIR/repo/test-gpg2-repo.trustedkeys.gpg")
|
||||
cp "$FL_DIR/repo/test-gpg2-repo.trustedkeys.gpg" gpg2_repo_key2
|
||||
|
||||
if [[ "${gpg2_repo_url}" != "${gpg2_repo_url2}" || "${gpg2_repo_key}" != "${gpg2_repo_key2}" ]]; then
|
||||
if [[ "${gpg2_repo_url}" != "${gpg2_repo_url2}" ]] || ! diff -q gpg2_repo_key gpg2_repo_key2 > /dev/null 2>&1; then
|
||||
assert_not_reached "remote-modify failed but remote was modified"
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user