732e0f232a
The refspec code really needs to be cleaned up and oxidized (and unit tested more). The original intention is that if you're pinned to a commit, we say "No upgrade available" but we were crashing if one (understandably) rebased to the combination of `remote:checksum` instead of just `checksum`. But, we can't change the classifier to call this `CHECKSUM` and output an error, because that just conflicts with us accepting the syntax `rpm-ostree rebase :<checksum>`. I'm actually coming around to the idea that this `remote:checksum` syntax means "no upgrade available" is correct, whereas pinning to just `checksum` is more of an error when you try to upgrade. Closes: https://github.com/coreos/rpm-ostree/issues/2603
46 lines
1.5 KiB
Bash
Executable File
46 lines
1.5 KiB
Bash
Executable File
#!/bin/bash
|
|
#
|
|
# Copyright (C) 2018 Red Hat, Inc.
|
|
#
|
|
# This library is free software; you can redistribute it and/or
|
|
# modify it under the terms of the GNU Lesser General Public
|
|
# License as published by the Free Software Foundation; either
|
|
# version 2 of the License, or (at your option) any later version.
|
|
#
|
|
# This library is distributed in the hope that it will be useful,
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
# Lesser General Public License for more details.
|
|
#
|
|
# You should have received a copy of the GNU Lesser General Public
|
|
# License along with this library; if not, write to the
|
|
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
# Boston, MA 02111-1307, USA.
|
|
|
|
set -euo pipefail
|
|
|
|
. ${commondir}/libtest.sh
|
|
. ${commondir}/libvm.sh
|
|
|
|
set -x
|
|
|
|
checksum=$(vm_get_booted_csum)
|
|
vm_rpmostree rebase :${checksum}
|
|
vm_assert_status_jq ".deployments[0][\"origin\"] == \"${checksum}\""
|
|
vm_rpmostree status > status.txt
|
|
assert_file_has_content status.txt '^ ostree://'${checksum}
|
|
echo "ok pin to commit"
|
|
|
|
vm_rpmostree upgrade >out.txt
|
|
assert_file_has_content out.txt 'Pinned to commit; no upgrade available'
|
|
if vm_rpmostree deploy 42 2>err.txt; then
|
|
fatal "deployed version from commit?"
|
|
fi
|
|
assert_file_has_content err.txt 'Cannot look up version while pinned to commit'
|
|
|
|
# And test https://github.com/coreos/rpm-ostree/issues/2603
|
|
vm_cmd ostree remote add self --set=gpg-verify=false file:///ostree/repo
|
|
vm_rpmostree rebase self:${checksum}
|
|
vm_rpmostree upgrade
|
|
echo "ok cmds"
|