2015-04-02 13:33:07 +03:00
#!/bin/bash
#
# Copyright (C) 2011 Colin Walters <walters@verbum.org>
# Copyright (C) 2015 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.
2016-01-27 19:44:10 +03:00
set -euo pipefail
2015-04-02 13:33:07 +03:00
2016-03-02 18:28:04 +03:00
echo "1..4"
2015-04-02 13:33:07 +03:00
. $( dirname $0 ) /libtest.sh
setup_test_repository "bare"
echo "ok setup"
mkdir test
echo hello > test/a
2016-05-13 21:38:50 +03:00
$OSTREE commit -b test -s "A commit" test
2015-04-02 13:33:07 +03:00
echo "ok commit 1"
2016-05-13 21:38:50 +03:00
$OSTREE summary --update
2015-04-02 13:33:07 +03:00
OLD_MD5 = $( md5sum repo/summary)
echo hello2 > test/a
2016-05-13 21:38:50 +03:00
$OSTREE commit -b test -s "Another commit" test
2015-04-02 13:33:07 +03:00
echo "ok commit 2"
2015-04-24 16:42:28 +03:00
assert_streq " $OLD_MD5 " " $( md5sum repo/summary) "
2015-04-02 13:33:07 +03:00
2016-05-13 21:38:50 +03:00
$OSTREE --repo= repo config set core.commit-update-summary true
2015-04-02 13:33:07 +03:00
echo hello3 > test/a
2016-05-13 21:38:50 +03:00
$OSTREE commit -b test -s "Another commit..." test
2015-04-02 13:33:07 +03:00
echo "ok commit 3"
2015-04-24 16:42:28 +03:00
assert_not_streq " $OLD_MD5 " " $( md5sum repo/summary) "
2015-05-04 12:05:23 +03:00
# Check that summary --update deletes the .sig file
touch repo/summary.sig
2016-05-13 21:38:50 +03:00
$OSTREE summary --update
2015-05-04 12:05:23 +03:00
assert_not_has_file repo/summary.sig