Blame tests/test-local-pull-depth.sh

Packit Service 2a3f3d
#!/bin/bash
Packit Service 2a3f3d
#
Packit Service 2a3f3d
# Copyright (C) 2015 Dan Nicholson <nicholson@endlessm.com>
Packit Service 2a3f3d
#
Packit Service 2a3f3d
# SPDX-License-Identifier: LGPL-2.0+
Packit Service 2a3f3d
#
Packit Service 2a3f3d
# This library is free software; you can redistribute it and/or
Packit Service 2a3f3d
# modify it under the terms of the GNU Lesser General Public
Packit Service 2a3f3d
# License as published by the Free Software Foundation; either
Packit Service 2a3f3d
# version 2 of the License, or (at your option) any later version.
Packit Service 2a3f3d
#
Packit Service 2a3f3d
# This library is distributed in the hope that it will be useful,
Packit Service 2a3f3d
# but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service 2a3f3d
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit Service 2a3f3d
# Lesser General Public License for more details.
Packit Service 2a3f3d
#
Packit Service 2a3f3d
# You should have received a copy of the GNU Lesser General Public
Packit Service 2a3f3d
# License along with this library; if not, write to the
Packit Service 2a3f3d
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Packit Service 2a3f3d
# Boston, MA 02111-1307, USA.
Packit Service 2a3f3d
Packit Service 2a3f3d
set -euo pipefail
Packit Service 2a3f3d
Packit Service 2a3f3d
. $(dirname $0)/libtest.sh
Packit Service 2a3f3d
Packit Service 2a3f3d
setup_test_repository "archive"
Packit Service 2a3f3d
Packit Service 2a3f3d
echo "1..1"
Packit Service 2a3f3d
Packit Service 2a3f3d
cd ${test_tmpdir}
Packit Service 2a3f3d
mkdir repo2
Packit Service 2a3f3d
ostree_repo_init repo2 --mode="archive"
Packit Service 2a3f3d
Packit Service 2a3f3d
${CMD_PREFIX} ostree --repo=repo2 pull-local repo
Packit Service 2a3f3d
find repo2/objects -name '*.commit' | wc -l > commitcount
Packit Service 2a3f3d
assert_file_has_content commitcount "^1$"
Packit Service 2a3f3d
find repo2/state -name '*.commitpartial' | wc -l > commitpartialcount
Packit Service 2a3f3d
assert_file_has_content commitpartialcount "^0$"
Packit Service 2a3f3d
Packit Service 2a3f3d
${CMD_PREFIX} ostree --repo=repo2 pull-local --depth=0 repo
Packit Service 2a3f3d
find repo2/objects -name '*.commit' | wc -l > commitcount
Packit Service 2a3f3d
assert_file_has_content commitcount "^1$"
Packit Service 2a3f3d
find repo2/state -name '*.commitpartial' | wc -l > commitpartialcount
Packit Service 2a3f3d
assert_file_has_content commitpartialcount "^0$"
Packit Service 2a3f3d
Packit Service 2a3f3d
${CMD_PREFIX} ostree --repo=repo2 pull-local --depth=1 --commit-metadata-only repo
Packit Service 2a3f3d
find repo2/objects -name '*.commit' | wc -l > commitcount
Packit Service 2a3f3d
assert_file_has_content commitcount "^2$"
Packit Service 2a3f3d
find repo2/state -name '*.commitpartial' | wc -l > commitpartialcount
Packit Service 2a3f3d
assert_file_has_content commitpartialcount "^1$"
Packit Service 2a3f3d
Packit Service 2a3f3d
${CMD_PREFIX} ostree --repo=repo2 pull-local --depth=1 repo
Packit Service 2a3f3d
find repo2/objects -name '*.commit' | wc -l > commitcount
Packit Service 2a3f3d
assert_file_has_content commitcount "^2$"
Packit Service 2a3f3d
find repo2/state -name '*.commitpartial' | wc -l > commitpartialcount
Packit Service 2a3f3d
assert_file_has_content commitpartialcount "^0$"
Packit Service 2a3f3d
Packit Service 2a3f3d
${CMD_PREFIX} ostree --repo=repo2 pull-local --depth=-1 repo
Packit Service 2a3f3d
find repo2/objects -name '*.commit' | wc -l > commitcount
Packit Service 2a3f3d
assert_file_has_content commitcount "^2$"
Packit Service 2a3f3d
find repo2/state -name '*.commitpartial' | wc -l > commitpartialcount
Packit Service 2a3f3d
assert_file_has_content commitpartialcount "^0$"
Packit Service 2a3f3d
Packit Service 2a3f3d
echo "ok local pull depth"