New upstream version 2018.5+42+gecdebeb2
This commit is contained in:
commit
f92733af4a
112 files changed
+4463
-3226
No files matched your search
@@ -37,9 +37,9 @@ assert_not_reached () {
|
||||
# Some tests look for specific English strings. Use a UTF-8 version
|
||||
# of the C (POSIX) locale if we have one, or fall back to POSIX
|
||||
# (https://sourceware.org/glibc/wiki/Proposals/C.UTF-8)
|
||||
if locale -a | grep C.UTF-8 >/dev/null; then
|
||||
if locale -a | grep '^C.UTF-8$' >/dev/null; then
|
||||
export LC_ALL=C.UTF-8
|
||||
elif locale -a | grep C.utf8 >/dev/null; then
|
||||
elif locale -a | grep '^C.utf8$' >/dev/null; then
|
||||
export LC_ALL=C.utf8
|
||||
else
|
||||
export LC_ALL=C
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#include <gio/gio.h>
|
||||
#include <glib.h>
|
||||
#include <glib-object.h>
|
||||
#include <libglnx.h>
|
||||
#include <locale.h>
|
||||
|
||||
#include "ostree-autocleanups.h"
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
echo "1..8"
|
||||
echo "1..9"
|
||||
|
||||
. $(dirname $0)/libtest.sh
|
||||
|
||||
@@ -104,7 +104,7 @@ assert_not_has_file repo/state/${rev}.commitpartial
|
||||
if $OSTREE fsck -q 2>err.txt; then
|
||||
assert_not_reached "fsck unexpectedly succeeded"
|
||||
fi
|
||||
assert_file_has_content_literal err.txt "Object missing:"
|
||||
assert_file_has_content_literal err.txt "Object missing"
|
||||
assert_file_has_content_literal err.txt "Marking commit as partial: $rev"
|
||||
assert_has_file repo/state/${rev}.commitpartial
|
||||
|
||||
@@ -118,6 +118,7 @@ rev=$($OSTREE rev-parse test2)
|
||||
|
||||
filechecksum=$(ostree_file_path_to_checksum repo test2 /firstfile)
|
||||
echo corrupted >> repo/$(ostree_checksum_to_relative_object_path repo $filechecksum)
|
||||
unset filechecksum
|
||||
|
||||
assert_not_has_file repo/state/${rev}.commitpartial
|
||||
|
||||
@@ -129,3 +130,25 @@ assert_file_has_content_literal err.txt "Marking commit as partial: $rev"
|
||||
assert_has_file repo/state/${rev}.commitpartial
|
||||
|
||||
echo "ok corrupt file"
|
||||
|
||||
cd ${test_tmpdir}
|
||||
rm repo files -rf
|
||||
setup_test_repository "bare"
|
||||
|
||||
rev=$($OSTREE rev-parse test2)
|
||||
firstfilechecksum=$(ostree_file_path_to_checksum repo test2 /firstfile)
|
||||
echo corrupted >> repo/$(ostree_checksum_to_relative_object_path repo $firstfilechecksum)
|
||||
secondfilechecksum=$(ostree_file_path_to_checksum repo test2 /baz/cow)
|
||||
echo corrupted >> repo/$(ostree_checksum_to_relative_object_path repo $secondfilechecksum)
|
||||
|
||||
assert_not_has_file repo/state/${rev}.commitpartial
|
||||
|
||||
if $OSTREE fsck -a --delete 2>err.txt; then
|
||||
assert_not_reached "fsck unexpectedly succeeded"
|
||||
fi
|
||||
assert_file_has_content err.txt "Corrupted file object.*${firstfilechecksum}"
|
||||
assert_file_has_content err.txt "Corrupted file object.*${secondfilechecksum}"
|
||||
assert_file_has_content_literal err.txt "Marking commit as partial: $rev"
|
||||
assert_has_file repo/state/${rev}.commitpartial
|
||||
|
||||
echo "ok fsck --all"
|
||||
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Copyright © 2018 Endless Mobile, Inc.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.0+
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* Authors:
|
||||
* - Matthew Leeds <matthew.leeds@endlessm.com>
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <glib.h>
|
||||
#include <locale.h>
|
||||
#include <ostree.h>
|
||||
|
||||
static void
|
||||
test_include_ostree_h_compiled (void)
|
||||
{
|
||||
}
|
||||
|
||||
/* Just ensure that we can compile with ostree.h included */
|
||||
int main (int argc, char **argv)
|
||||
{
|
||||
setlocale (LC_ALL, "");
|
||||
g_test_init (&argc, &argv, NULL);
|
||||
|
||||
g_test_add_func ("/include-ostree-h/compiled", test_include_ostree_h_compiled);
|
||||
|
||||
return g_test_run();
|
||||
}
|
||||
@@ -23,12 +23,14 @@ set -euo pipefail
|
||||
|
||||
. $(dirname $0)/libtest.sh
|
||||
|
||||
echo "1..1"
|
||||
echo "1..2"
|
||||
|
||||
COMMIT_SIGN="--gpg-homedir=${TEST_GPG_KEYHOME} --gpg-sign=${TEST_GPG_KEYID_1}"
|
||||
|
||||
# Test pulling from a repo which gives error 500 (internal server error) a lot of the time.
|
||||
setup_fake_remote_repo1 "archive" "${COMMIT_SIGN}" --random-500s=50
|
||||
|
||||
cd ${test_tmpdir}
|
||||
pushd ${test_tmpdir}
|
||||
ostree_repo_init repo --mode=archive
|
||||
${CMD_PREFIX} ostree --repo=repo remote add --set=gpg-verify=false origin $(cat httpd-address)/ostree/gnomerepo
|
||||
for x in $(seq 200); do
|
||||
@@ -42,4 +44,26 @@ done
|
||||
${CMD_PREFIX} ostree --repo=repo fsck
|
||||
${CMD_PREFIX} ostree --repo=repo rev-parse main
|
||||
|
||||
popd
|
||||
echo "ok repeated pull after 500s"
|
||||
|
||||
# Now test from a repo which gives error 408 (request timeout) a lot of the time.
|
||||
rm ostree-srv httpd repo -rf
|
||||
setup_fake_remote_repo1 "archive" "${COMMIT_SIGN}" --random-408s=50
|
||||
|
||||
pushd ${test_tmpdir}
|
||||
ostree_repo_init repo --mode=archive
|
||||
${CMD_PREFIX} ostree --repo=repo remote add --set=gpg-verify=false origin $(cat httpd-address)/ostree/gnomerepo
|
||||
for x in $(seq 40); do
|
||||
if ${CMD_PREFIX} ostree --repo=repo pull --mirror origin main 2>err.txt; then
|
||||
echo "Success on iteration ${x}"
|
||||
break;
|
||||
fi
|
||||
assert_file_has_content err.txt "\(408.*Request Timeout\)\|\(HTTP 408\)"
|
||||
done
|
||||
|
||||
${CMD_PREFIX} ostree --repo=repo fsck
|
||||
${CMD_PREFIX} ostree --repo=repo rev-parse main
|
||||
|
||||
popd
|
||||
echo "ok repeated pull after 408s"
|
||||
@@ -27,6 +27,7 @@
|
||||
#include <gio/gio.h>
|
||||
#include <glib.h>
|
||||
#include <glib-object.h>
|
||||
#include <libglnx.h>
|
||||
#include <locale.h>
|
||||
|
||||
#include "libostreetest.h"
|
||||
|
||||
Reference in new issue
Block a user