New upstream version 2019.6

This commit is contained in:
Simon McVittie committed 2019-12-14 10:47:26 +00:00
commit 4a3cae5aba
48 files changed
+997 -280

No files matched your search

+8 -6
View File
@@ -35,14 +35,16 @@ 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
# of the C (POSIX) locale if we have one, or fall back to en_US.UTF-8
# (https://sourceware.org/glibc/wiki/Proposals/C.UTF-8)
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
export LC_ALL=C.utf8
#
# If we can't find the locale command assume we have support for C.UTF-8
# (e.g. musl based systems)
if type -p locale >/dev/null; then
export LC_ALL=$(locale -a | grep -Ee '\.(UTF-8|utf8)' | grep -iEe '^(C|en_US)' | head -1 || true)
if [ -z "${LC_ALL}" ]; then fatal "Can't find suitable UTF-8 locale"; fi
else
export LC_ALL=C
export LC_ALL=C.UTF-8
fi
# A GNU extension, used whenever LC_ALL is not C
unset LANGUAGE
+3 -1
View File
@@ -440,7 +440,9 @@ EOF
${CMD_PREFIX} ostree --repo=${test_tmpdir}/testos-repo commit --add-metadata-string version=1.0.10 -b testos/buildmaster/x86_64-runtime -s "Build"
cd ${test_tmpdir}
cp -a osdata osdata-devel
rm -rf osdata-devel
mkdir osdata-devel
tar -C osdata -cf - . | tar -C osdata-devel -xf -
cd osdata-devel
mkdir -p usr/include
echo "a development header" > usr/include/foo.h
+1 -1
View File
@@ -177,7 +177,7 @@ if ! skip_one_without_user_xattrs; then
${CMD_PREFIX} ostree --repo=cacherepo pull-local ostree-srv/gnomerepo main
rev=$(ostree --repo=cacherepo rev-parse main)
${CMD_PREFIX} ostree --repo=cacherepo ls -R -C main > ls.txt
regfile_hash=$(grep -E -e '^-0' ls.txt | head -1 | awk '{ print $5 }')
regfile_hash=$((grep -E -e '^-0' ls.txt || true) | head -1 | awk '{ print $5 }')
${CMD_PREFIX} ostree --repo=repo remote add --set=gpg-verify=false corruptrepo $(cat httpd-address)/ostree/corruptrepo
# Make this a loop so in the future we can add more object types like commit etc.
for object in ${regfile_hash}.file; do
+4
View File
@@ -66,4 +66,8 @@ assert_file_has_content sysroot/boot/loader/entries/ostree-2-testos.conf 'option
assert_file_has_content sysroot/boot/loader/entries/ostree-2-testos.conf 'options.*TESTARG=TESTVALUE'
assert_file_has_content sysroot/boot/loader/entries/ostree-2-testos.conf 'options.*APPENDARG=VALAPPEND .*APPENDARG=2NDAPPEND'
# Check correct ordering of different-valued args of the same key.
${CMD_PREFIX} ostree admin deploy --os=testos --karg-append=FOO=TESTORDERED --karg-append=APPENDARG=3RDAPPEND testos:testos/buildmaster/x86_64-runtime
assert_file_has_content sysroot/boot/loader/entries/ostree-2-testos.conf 'options.*APPENDARG=VALAPPEND .*APPENDARG=2NDAPPEND .*FOO=TESTORDERED .*APPENDARG=3RDAPPEND'
echo "ok deploy --karg-append"
+3 -1
View File
@@ -90,7 +90,9 @@ EOF
${CMD_PREFIX} ostree --repo=${test_tmpdir}/testos-repo commit --add-metadata-string version=1.0.10 -b testos/buildmaster/x86_64-runtime -s "Build" --gpg-sign=$keyid --gpg-homedir=${test_tmpdir}/gpghome
cd ${test_tmpdir}
cp -a osdata osdata-devel
rm -rf osdata-devel
mkdir osdata-devel
tar -C osdata -cf - . | tar -C osdata-devel -xf -
cd osdata-devel
mkdir -p usr/include
echo "a development header" > usr/include/foo.h
+24 -15
View File
@@ -32,6 +32,22 @@ check_string_existance (OstreeKernelArgs *karg,
return g_strv_contains ((const char* const*) string_list, string_to_find);
}
static gboolean
kernel_args_entry_value_equal (gconstpointer data,
gconstpointer value)
{
const OstreeKernelArgsEntry *e = data;
return g_strcmp0 (_ostree_kernel_args_entry_get_value (e), value) == 0;
}
static gboolean
kernel_args_entry_key_equal (gconstpointer data,
gconstpointer key)
{
const OstreeKernelArgsEntry *e = data;
return g_strcmp0 (_ostree_kernel_args_entry_get_key (e), key) == 0;
}
static void
test_kargs_delete (void)
{
@@ -82,7 +98,7 @@ test_kargs_delete (void)
g_assert (ret);
/* verify the value array is properly updated */
GPtrArray *kargs_array = _ostree_kernel_arg_get_key_array (karg);
g_assert (!ot_ptr_array_find_with_equal_func (kargs_array, "single_key", g_str_equal, NULL));
g_assert (!ot_ptr_array_find_with_equal_func (kargs_array, "single_key", kernel_args_entry_value_equal, NULL));
g_assert (!check_string_existance (karg, "single_key"));
/* Delete specific key/value pair */
@@ -177,13 +193,6 @@ test_kargs_replace (void)
g_assert (check_string_existance (karg, "test=newval"));
}
static gboolean
strcmp0_equal (gconstpointer v1,
gconstpointer v2)
{
return g_strcmp0 (v1, v2) == 0;
}
/* In this function, we want to verify that ostree_kernel_args_append
* and ostree_kernel_args_to_string is correct. After that
* we will use these two functions(append and tostring) in other tests: delete and replace
@@ -208,22 +217,22 @@ test_kargs_append (void)
{
if (g_str_equal (key, "test"))
{
g_assert (ot_ptr_array_find_with_equal_func (value_array, "valid", strcmp0_equal, NULL));
g_assert (ot_ptr_array_find_with_equal_func (value_array, "secondvalid", strcmp0_equal, NULL));
g_assert (ot_ptr_array_find_with_equal_func (value_array, "", strcmp0_equal, NULL));
g_assert (ot_ptr_array_find_with_equal_func (value_array, NULL, strcmp0_equal, NULL));
g_assert (ot_ptr_array_find_with_equal_func (value_array, "valid", kernel_args_entry_value_equal, NULL));
g_assert (ot_ptr_array_find_with_equal_func (value_array, "secondvalid", kernel_args_entry_value_equal, NULL));
g_assert (ot_ptr_array_find_with_equal_func (value_array, "", kernel_args_entry_value_equal, NULL));
g_assert (ot_ptr_array_find_with_equal_func (value_array, NULL, kernel_args_entry_value_equal, NULL));
}
else
{
g_assert_cmpstr (key, ==, "second_test");
g_assert (ot_ptr_array_find_with_equal_func (value_array, NULL, strcmp0_equal, NULL));
g_assert (ot_ptr_array_find_with_equal_func (value_array, NULL, kernel_args_entry_value_equal, NULL));
}
}
/* verify the value array is properly updated */
GPtrArray *kargs_array = _ostree_kernel_arg_get_key_array (append_arg);
g_assert (ot_ptr_array_find_with_equal_func (kargs_array, "test", g_str_equal, NULL));
g_assert (ot_ptr_array_find_with_equal_func (kargs_array, "second_test", g_str_equal, NULL));
g_assert (ot_ptr_array_find_with_equal_func (kargs_array, "test", kernel_args_entry_key_equal, NULL));
g_assert (ot_ptr_array_find_with_equal_func (kargs_array, "second_test", kernel_args_entry_key_equal, NULL));
/* Up till this point, we verified that the above was all correct, we then
* check ostree_kernel_args_to_string has the right result
+13 -13
View File
@@ -60,12 +60,12 @@ test_get_boolean_with_default (void)
g_assert_true (out);
g_clear_error (&error);
g_assert_false (ot_keyfile_get_boolean_with_default (g_keyfile,
"a_fake_section",
"a_boolean_true",
FALSE,
&out,
&error));
g_assert (ot_keyfile_get_boolean_with_default (g_keyfile,
"a_fake_section",
"a_boolean_true",
FALSE,
&out,
&error));
}
static void
@@ -122,13 +122,13 @@ test_get_value_with_default (void)
g_assert_cmpstr (out, ==, "correct");
g_clear_pointer (&out, g_free);
g_assert_false (ot_keyfile_get_value_with_default (g_keyfile,
"a_fake_section",
"a_value_true",
"no value",
&out,
&error));
g_clear_error (&error);
g_assert (ot_keyfile_get_value_with_default (g_keyfile,
"a_fake_section",
"a_value_true",
"no value",
&out,
&error));
g_assert_cmpstr (out, ==, "no value");
g_clear_pointer (&out, g_free);
}
+55
View File
@@ -0,0 +1,55 @@
#!/bin/bash
#
# Copyright (C) 2017 Colin Walters <walters@verbum.org>
#
# 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
. $(dirname $0)/libtest.sh
setup_fake_remote_repo1 "archive" "" "--require-basic-auth"
echo '1..3'
repopath=${test_tmpdir}/ostree-srv/gnomerepo
cp -a ${repopath} ${repopath}.orig
cd ${test_tmpdir}
rm repo -rf
ostree_repo_init repo
unauthaddress=$(cat httpd-address)
badauthaddress=$(echo $unauthaddress | sed -e 's,http://,http://foo:bar@,')
goodauthaddress=$(echo $unauthaddress | sed -e 's,http://,http://foouser:barpw@,')
${CMD_PREFIX} ostree --repo=repo remote add --set=gpg-verify=false origin-unauth ${unauthaddress}/ostree/gnomerepo
${CMD_PREFIX} ostree --repo=repo remote add --set=gpg-verify=false origin-badauth ${badauthaddress}/ostree/gnomerepo
${CMD_PREFIX} ostree --repo=repo remote add --set=gpg-verify=false origin-goodauth ${goodauthaddress}/ostree/gnomerepo
if ${CMD_PREFIX} ostree --repo=repo pull origin-unauth main 2>err.txt; then
fatal "Pulled via unauth"
fi
assert_file_has_content err.txt "401"
echo "ok unauth"
rm -f err.txt
if ${CMD_PREFIX} ostree --repo=repo pull origin-badauth main 2>err.txt; then
fatal "Pulled via badauth"
fi
assert_file_has_content err.txt "401"
rm -f err.txt
echo "ok badauth"
${CMD_PREFIX} ostree --repo=repo pull origin-goodauth main
echo "ok basic auth"
+2 -2
View File
@@ -47,12 +47,12 @@ setup_mirror content_mirror3
# Let's delete a file from 1 so that it falls back on 2
cd ${test_tmpdir}/content_mirror1/ostree/gnomerepo
filez=$(find objects/ -name '*.filez' | head -n 1)
filez=$((find objects/ -name '*.filez' || true) | head -n 1)
rm ${filez}
# Let's delete a file from 1 and 2 so that it falls back on 3
cd ${test_tmpdir}/content_mirror1/ostree/gnomerepo
filez=$(find objects/ -name '*.filez' | head -n 1)
filez=$((find objects/ -name '*.filez' || true) | head -n 1)
rm ${filez}
cd ${test_tmpdir}/content_mirror2/ostree/gnomerepo
rm ${filez}
+5 -4
View File
@@ -62,7 +62,9 @@ setup (Fixture *fixture,
g_clear_error (&error);
g_assert_no_error (error);
fixture->working_dir = g_file_new_for_path (fixture->tmpdir.path);
/* Realpath since at least coretoolbox makes /tmp a symlink to /host/tmp */
g_autofree char *tmpdir_real_path = realpath (fixture->tmpdir.path, NULL);
fixture->working_dir = g_file_new_for_path (tmpdir_real_path);
fixture->parent_repo = ot_test_setup_repo (NULL, &error);
g_assert_no_error (error);
@@ -443,9 +445,8 @@ test_repo_finder_mount_mixed_mounts (Fixture *fixture,
}
else
{
g_test_message ("Unknown result ‘%s’ with keyring ‘%s’.",
result->remote->name, result->remote->keyring);
g_assert_not_reached ();
g_error ("Unknown result ‘%s’ with keyring ‘%s’",
result->remote->name, result->remote->keyring);
}
}
+1 -1
View File
@@ -54,7 +54,7 @@ echo 'ok documented symbols'
# ONLY update this checksum in release commits!
cat > released-sha256.txt <<EOF
a8efa9b08106b973dc3341b52f42fd858ac8db66084586711cc78f12a0bab630 ${released_syms}
cba152efd13b9e80c35edfccde26ecd7f9555968239c5a275c9e411ad27e5183 ${released_syms}
EOF
sha256sum -c released-sha256.txt