New upstream version 2022.4
This commit is contained in:
commit
5968aa5ff6
65 files changed
+7003
-5453
No files matched your search
@@ -24,7 +24,7 @@ set -euo pipefail
|
||||
# Exports OSTREE_SYSROOT so --sysroot not needed.
|
||||
setup_os_repository "archive" "syslinux"
|
||||
|
||||
echo "1..3"
|
||||
echo "1..4"
|
||||
|
||||
${CMD_PREFIX} ostree --repo=sysroot/ostree/repo pull-local --remote=testos testos-repo testos/buildmain/x86_64-runtime
|
||||
rev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmain/x86_64-runtime)
|
||||
@@ -69,3 +69,13 @@ ${CMD_PREFIX} ostree admin deploy --os=testos --karg-append=FOO=TESTORDERED --k
|
||||
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"
|
||||
|
||||
assert_file_has_content sysroot/boot/loader/entries/ostree-2-testos.conf 'options.*quiet .*TESTARG=TESTVALUE .*APPENDARG=VALAPPEND .*APPENDARG=2NDAPPEND'
|
||||
${CMD_PREFIX} ostree admin deploy --os=testos --karg-delete=TESTARG=TESTVALUE testos:testos/buildmain/x86_64-runtime
|
||||
assert_not_file_has_content sysroot/boot/loader/entries/ostree-2-testos.conf 'options.*TESTARG=TESTVALUE'
|
||||
${CMD_PREFIX} ostree admin deploy --os=testos --karg-delete=quiet testos:testos/buildmain/x86_64-runtime
|
||||
assert_not_file_has_content sysroot/boot/loader/entries/ostree-2-testos.conf 'options.*quiet'
|
||||
${CMD_PREFIX} ostree admin deploy --os=testos --karg-delete=APPENDARG=VALAPPEND testos:testos/buildmain/x86_64-runtime
|
||||
assert_not_file_has_content sysroot/boot/loader/entries/ostree-2-testos.conf 'options.*APPENDARG=VALAPPEND'
|
||||
|
||||
echo "ok deploy --karg-delete"
|
||||
@@ -20,6 +20,7 @@
|
||||
#include "config.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdbool.h>
|
||||
#include <gio/gio.h>
|
||||
#include <string.h>
|
||||
#include <err.h>
|
||||
@@ -476,6 +477,76 @@ test_big_metadata (void)
|
||||
g_assert (ret);
|
||||
}
|
||||
|
||||
static void
|
||||
compare_xattrs (GVariant *orig, GVariant *new)
|
||||
{
|
||||
g_assert_cmpint (g_variant_n_children (orig) + 1, ==, g_variant_n_children (new));
|
||||
GVariant *kp, *vp;
|
||||
GVariantIter iter;
|
||||
g_variant_iter_init (&iter, new);
|
||||
bool found = false;
|
||||
while (g_variant_iter_loop (&iter, "(@ay@ay)", &kp, &vp))
|
||||
{
|
||||
const char *k = g_variant_get_bytestring (kp);
|
||||
if (!g_str_equal (k, "user.ostreetesting"))
|
||||
continue;
|
||||
g_assert_cmpint (g_variant_get_size (vp), ==, 4);
|
||||
found = true;
|
||||
}
|
||||
g_assert (found);
|
||||
}
|
||||
|
||||
static void
|
||||
test_read_xattrs (void)
|
||||
{
|
||||
g_autoptr(GError) local_error = NULL;
|
||||
GError **error = &local_error;
|
||||
|
||||
g_auto(GLnxTmpDir) tmpd = { 0, };
|
||||
// Use /var/tmp to hope we get xattr support
|
||||
glnx_mkdtempat (AT_FDCWD, "/var/tmp/ostree-xattrs-test.XXXXXX", 0700, &tmpd, error);
|
||||
g_assert_no_error (local_error);
|
||||
|
||||
const char value[] = "foo";
|
||||
|
||||
{
|
||||
g_autoptr(GVariant) current_xattrs = ostree_fs_get_all_xattrs (tmpd.fd, NULL, error);
|
||||
g_assert_no_error (local_error);
|
||||
|
||||
int r = fsetxattr (tmpd.fd, "user.ostreetesting", value, sizeof (value), 0);
|
||||
g_assert_cmpint (r, ==, 0);
|
||||
|
||||
g_autoptr(GVariant) new_xattrs = ostree_fs_get_all_xattrs (tmpd.fd, NULL, error);
|
||||
g_assert_no_error (local_error);
|
||||
|
||||
compare_xattrs (current_xattrs, new_xattrs);
|
||||
}
|
||||
|
||||
{
|
||||
if (symlinkat ("nosuchtarget", tmpd.fd, "somelink") < 0)
|
||||
glnx_throw_errno_prefix (error, "symlinkat");
|
||||
g_assert_no_error (local_error);
|
||||
|
||||
g_autoptr(GVariant) current_xattrs = ostree_fs_get_all_xattrs_at (tmpd.fd, "somelink", NULL, error);
|
||||
g_assert_no_error (local_error);
|
||||
(void) current_xattrs;
|
||||
|
||||
// OK, can't do user. xattrs on symlinks unfortunately.
|
||||
|
||||
// char pathbuf[PATH_MAX];
|
||||
// snprintf (pathbuf, sizeof (pathbuf), "/proc/self/fd/%d/%s", tmpd.fd, "somelink");
|
||||
// int r = lsetxattr (pathbuf, "user.ostreetesting", value, sizeof (value), 0);
|
||||
// if (r < 0)
|
||||
// glnx_throw_errno_prefix (error, "lsetxattr");
|
||||
// g_assert_no_error (local_error);
|
||||
|
||||
// g_autoptr(GVariant) new_xattrs = ostree_fs_get_all_xattrs_at (tmpd.fd, "somelink", NULL, error);
|
||||
// g_assert_no_error (local_error);
|
||||
|
||||
// compare_xattrs (current_xattrs, new_xattrs);
|
||||
}
|
||||
}
|
||||
|
||||
int main (int argc, char **argv)
|
||||
{
|
||||
g_autoptr(GError) error = NULL;
|
||||
@@ -494,6 +565,7 @@ int main (int argc, char **argv)
|
||||
g_test_add_func ("/break-hardlink", test_break_hardlink);
|
||||
g_test_add_func ("/remotename", test_validate_remotename);
|
||||
g_test_add_func ("/big-metadata", test_big_metadata);
|
||||
g_test_add_func ("/read-xattrs", test_read_xattrs);
|
||||
|
||||
return g_test_run();
|
||||
out:
|
||||
|
||||
@@ -54,7 +54,7 @@ echo 'ok documented symbols'
|
||||
|
||||
# ONLY update this checksum in release commits!
|
||||
cat > released-sha256.txt <<EOF
|
||||
4f0600ad7af4ba937f463dc0bdc38aef6f53b154e88730b935552330c6a19a3f ${released_syms}
|
||||
fb66f84d9af5270ed34fdf9f70f97e59394336a9559f493917704bdffa19027d ${released_syms}
|
||||
EOF
|
||||
sha256sum -c released-sha256.txt
|
||||
|
||||
|
||||
Reference in new issue
Block a user