New upstream version 2017.10
This commit is contained in:
commit
592e798794
140 files changed
+4813
-1216
No files matched your search
@@ -249,3 +249,11 @@ ${CMD_PREFIX} ostree --sysroot=${deployment} remote add --set=gpg-verify=false r
|
||||
assert_not_file_has_content sysroot/ostree/repo/config remote-test-nonphysical
|
||||
assert_file_has_content ${deployment}/etc/ostree/remotes.d/remote-test-nonphysical.conf testos-repo
|
||||
echo "ok remote add nonphysical sysroot"
|
||||
|
||||
if env OSTREE_SYSROOT_DEBUG="${OSTREE_SYSROOT_DEBUG},test-fifreeze" \
|
||||
${CMD_PREFIX} ostree admin deploy --os=testos testos:testos/buildmaster/x86_64-runtime 2>err.txt; then
|
||||
fatal "fifreeze-test exited successfully?"
|
||||
fi
|
||||
assert_file_has_content err.txt "fifreeze watchdog was run"
|
||||
assert_file_has_content err.txt "During fsfreeze-thaw: aborting due to test-fifreeze"
|
||||
echo "ok fifreeze test"
|
||||
@@ -1,6 +1,9 @@
|
||||
# Core source library for shell script tests; this
|
||||
# file is intended to be the canonical source, which at
|
||||
# is copied at least into:
|
||||
# Core source library for shell script tests; the
|
||||
# canonical version lives in:
|
||||
#
|
||||
# https://github.com/ostreedev/ostree
|
||||
#
|
||||
# Known copies are in the following repos:
|
||||
#
|
||||
# - https://github.com/projectatomic/rpm-ostree
|
||||
#
|
||||
|
||||
+25
-14
@@ -363,8 +363,10 @@ setup_os_boot_grub2() {
|
||||
|
||||
setup_os_repository () {
|
||||
mode=$1
|
||||
bootmode=$2
|
||||
shift
|
||||
bootmode=$1
|
||||
shift
|
||||
bootdir=${1:-usr/lib/ostree-boot}
|
||||
|
||||
oldpwd=`pwd`
|
||||
|
||||
@@ -379,14 +381,19 @@ setup_os_repository () {
|
||||
cd ${test_tmpdir}
|
||||
mkdir osdata
|
||||
cd osdata
|
||||
mkdir -p boot usr/bin usr/lib/modules/3.6.0 usr/share usr/etc
|
||||
echo "a kernel" > boot/vmlinuz-3.6.0
|
||||
echo "an initramfs" > boot/initramfs-3.6.0
|
||||
bootcsum=$(cat boot/vmlinuz-3.6.0 boot/initramfs-3.6.0 | sha256sum | cut -f 1 -d ' ')
|
||||
mkdir -p usr/bin usr/lib/modules/3.6.0 usr/share usr/etc
|
||||
mkdir -p ${bootdir}
|
||||
echo "a kernel" > ${bootdir}/vmlinuz-3.6.0
|
||||
echo "an initramfs" > ${bootdir}/initramfs-3.6.0
|
||||
bootcsum=$(cat ${bootdir}/vmlinuz-3.6.0 ${bootdir}/initramfs-3.6.0 | sha256sum | cut -f 1 -d ' ')
|
||||
export bootcsum
|
||||
mv boot/vmlinuz-3.6.0 boot/vmlinuz-3.6.0-${bootcsum}
|
||||
mv boot/initramfs-3.6.0 boot/initramfs-3.6.0-${bootcsum}
|
||||
|
||||
# Add the checksum for legacy dirs (/boot, /usr/lib/ostree-boot), but not
|
||||
# /usr/lib/modules.
|
||||
if [[ $bootdir != usr/lib/modules ]]; then
|
||||
mv ${bootdir}/vmlinuz-3.6.0{,-${bootcsum}}
|
||||
mv ${bootdir}/initramfs-3.6.0{,-${bootcsum}}
|
||||
fi
|
||||
|
||||
echo "an executable" > usr/bin/sh
|
||||
echo "some shared data" > usr/share/langs.txt
|
||||
echo "a library" > usr/lib/libfoo.so.0
|
||||
@@ -458,13 +465,17 @@ os_repository_new_commit ()
|
||||
branch=${3:-testos/buildmaster/x86_64-runtime}
|
||||
echo "BOOT ITERATION: $boot_checksum_iteration"
|
||||
cd ${test_tmpdir}/osdata
|
||||
rm boot/*
|
||||
echo "new: a kernel ${boot_checksum_iteration}" > boot/vmlinuz-3.6.0
|
||||
echo "new: an initramfs ${boot_checksum_iteration}" > boot/initramfs-3.6.0
|
||||
bootcsum=$(cat boot/vmlinuz-3.6.0 boot/initramfs-3.6.0 | sha256sum | cut -f 1 -d ' ')
|
||||
bootdir=usr/lib/ostree-boot
|
||||
if ! test -d ${bootdir}; then
|
||||
bootdir=boot
|
||||
fi
|
||||
rm ${bootdir}/*
|
||||
echo "new: a kernel ${boot_checksum_iteration}" > ${bootdir}/vmlinuz-3.6.0
|
||||
echo "new: an initramfs ${boot_checksum_iteration}" > ${bootdir}/initramfs-3.6.0
|
||||
bootcsum=$(cat ${bootdir}/vmlinuz-3.6.0 ${bootdir}/initramfs-3.6.0 | sha256sum | cut -f 1 -d ' ')
|
||||
export bootcsum
|
||||
mv boot/vmlinuz-3.6.0 boot/vmlinuz-3.6.0-${bootcsum}
|
||||
mv boot/initramfs-3.6.0 boot/initramfs-3.6.0-${bootcsum}
|
||||
mv ${bootdir}/vmlinuz-3.6.0 ${bootdir}/vmlinuz-3.6.0-${bootcsum}
|
||||
mv ${bootdir}/initramfs-3.6.0 ${bootdir}/initramfs-3.6.0-${bootcsum}
|
||||
|
||||
echo "a new default config file" > usr/etc/a-new-default-config-file
|
||||
mkdir -p usr/etc/new-default-dir
|
||||
|
||||
+5
-1
@@ -35,7 +35,7 @@ function verify_initial_contents() {
|
||||
assert_file_has_content baz/cow '^moo$'
|
||||
}
|
||||
|
||||
echo "1..27"
|
||||
echo "1..28"
|
||||
|
||||
# Try both syntaxes
|
||||
repo_init --no-gpg-verify
|
||||
@@ -364,6 +364,10 @@ assert_not_has_file baz/saucer
|
||||
|
||||
echo "ok static delta 2"
|
||||
|
||||
cd ${test_tmpdir}
|
||||
${CMD_PREFIX} ostree --repo=repo pull origin main main@${rev} main@${rev} main main@${rev} main
|
||||
echo "ok pull specific commit array"
|
||||
|
||||
cd ${test_tmpdir}
|
||||
${CMD_PREFIX} ostree --repo=repo remote add --set=gpg-verify=false --set=unconfigured-state="Access to ExampleOS requires ONE BILLION DOLLARS." origin-subscription file://$(pwd)/ostree-srv/gnomerepo
|
||||
if ${CMD_PREFIX} ostree --repo=repo pull origin-subscription main 2>err.txt; then
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
echo "1..18"
|
||||
echo "1..19"
|
||||
|
||||
. $(dirname $0)/libtest.sh
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
echo "1..18"
|
||||
echo "1..20"
|
||||
|
||||
. $(dirname $0)/libtest.sh
|
||||
|
||||
@@ -27,3 +27,23 @@ echo "1..18"
|
||||
setup_os_repository "archive-z2" "syslinux"
|
||||
|
||||
. $(dirname $0)/admin-test.sh
|
||||
|
||||
cd ${test_tmpdir}
|
||||
rm httpd osdata testos-repo sysroot -rf
|
||||
setup_os_repository "archive-z2" "syslinux" "boot"
|
||||
|
||||
${CMD_PREFIX} ostree --repo=sysroot/ostree/repo pull-local --remote=testos testos-repo testos/buildmaster/x86_64-runtime
|
||||
rev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmaster/x86_64-runtime)
|
||||
${CMD_PREFIX} ostree admin deploy --karg=root=LABEL=MOO --karg=quiet --os=testos testos:testos/buildmaster/x86_64-runtime
|
||||
assert_file_has_content sysroot/boot/loader/entries/ostree-testos-0.conf 'options.* root=LABEL=MOO'
|
||||
assert_file_has_content sysroot/boot/loader/entries/ostree-testos-0.conf 'options.* quiet'
|
||||
assert_file_has_content sysroot/boot/ostree/testos-${bootcsum}/vmlinuz-3.6.0 'a kernel'
|
||||
assert_file_has_content sysroot/boot/ostree/testos-${bootcsum}/initramfs-3.6.0 'an initramfs'
|
||||
# kernel/initrams should also be in the tree's /boot with the checksum
|
||||
assert_file_has_content sysroot/ostree/deploy/testos/deploy/${rev}.0/boot/vmlinuz-3.6.0-${bootcsum} 'a kernel'
|
||||
assert_file_has_content sysroot/ostree/deploy/testos/deploy/${rev}.0/boot/initramfs-3.6.0-${bootcsum} 'an initramfs'
|
||||
assert_file_has_content sysroot/ostree/deploy/testos/deploy/${rev}.0/etc/os-release 'NAME=TestOS'
|
||||
assert_file_has_content sysroot/ostree/boot.1/testos/${bootcsum}/0/etc/os-release 'NAME=TestOS'
|
||||
${CMD_PREFIX} ostree admin status
|
||||
validate_bootloader
|
||||
echo "ok kernel in tree's /boot"
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
echo "1..19"
|
||||
echo "1..20"
|
||||
|
||||
. $(dirname $0)/libtest.sh
|
||||
|
||||
@@ -30,8 +30,7 @@ setup_os_repository "archive-z2" "uboot"
|
||||
. $(dirname $0)/admin-test.sh
|
||||
|
||||
cd ${test_tmpdir}
|
||||
ln -s ../../boot/ osdata/usr/lib/ostree-boot
|
||||
cat << 'EOF' > osdata/boot/uEnv.txt
|
||||
cat << 'EOF' > osdata/usr/lib/ostree-boot/uEnv.txt
|
||||
loaduimage=load mmc ${bootpart} ${loadaddr} ${kernel_image}
|
||||
loadfdt=load mmc ${bootpart} ${fdtaddr} ${bootdir}${fdtfile}
|
||||
loadramdisk=load mmc ${bootpart} ${rdaddr} ${ramdisk_image}
|
||||
|
||||
+1
-1
@@ -86,7 +86,7 @@ test_bsdiff (void)
|
||||
bsdiff_stream.opaque = out;
|
||||
g_assert_cmpint (bsdiff (old, OLD_SIZE, new, NEW_SIZE, &bsdiff_stream), ==, 0);
|
||||
|
||||
g_output_stream_close (out, NULL, NULL);
|
||||
g_assert (g_output_stream_close (out, NULL, NULL));
|
||||
|
||||
/* Now generate NEW_GENERATED from OLD and OUT. */
|
||||
{ g_autoptr(GBytes) bytes = g_memory_output_stream_steal_as_bytes (G_MEMORY_OUTPUT_STREAM (out));
|
||||
|
||||
@@ -71,11 +71,16 @@ ${CMD_PREFIX} ostree --repo=local-mirror pull --mirror os-remote os/amd64/master
|
||||
|
||||
${CMD_PREFIX} ostree --repo=local-mirror refs | wc -l > refscount
|
||||
assert_file_has_content refscount "^0$"
|
||||
ls -1 local-mirror/refs/remotes | wc -l > remotescount
|
||||
assert_file_has_content remotescount "^0$"
|
||||
|
||||
${CMD_PREFIX} ostree --repo=local-mirror refs --collections > refs
|
||||
assert_file_has_content refs "^(org.example.AppsCollection, app1)$"
|
||||
assert_file_has_content refs "^(org.example.OsCollection, os/amd64/master)$"
|
||||
|
||||
assert_file_has_content local-mirror/refs/mirrors/org.example.AppsCollection/app1 "^$(cat app1-checksum)$"
|
||||
assert_file_has_content local-mirror/refs/mirrors/org.example.OsCollection/os/amd64/master "^$(cat os-checksum)$"
|
||||
|
||||
for repo in local local-mirror; do
|
||||
# Try finding an update for an existing branch.
|
||||
${CMD_PREFIX} ostree --repo=$repo find-remotes org.example.AppsCollection app1 > find
|
||||
@@ -169,14 +174,16 @@ for repo in local-mirror; do
|
||||
assert_file_has_content pull "^Pulled 1/1 refs successfully.$"
|
||||
assert_not_file_has_content pull "Failed to pull some refs from the remotes"
|
||||
assert_ref $repo os/amd64/master $(cat os-checksum-2)
|
||||
|
||||
# We need to manually update the refs afterwards, since the original pull
|
||||
# into the local-mirror was a --mirror pull — so it wrote refs/mirrors/blah.
|
||||
# This pull was not, so it wrote refs/remotes/blah.
|
||||
${CMD_PREFIX} ostree --repo=$repo refs --collections --create org.example.OsCollection:os/amd64/master os-remote:os/amd64/master
|
||||
done
|
||||
|
||||
# Add the local mirror to the local repository as a remote, so that the local repo
|
||||
# has two configured remotes for the os-collection. Ensure its summary is up to date first.
|
||||
#${CMD_PREFIX} ostree --repo=local-mirror summary --update
|
||||
# FIXME: This `cp` can be changed to `ostree summary --update` once PR #946 lands.
|
||||
# Prior to that, we need to preserve the signatures.
|
||||
cp os-collection/summary{,.sig} local-mirror/
|
||||
${CMD_PREFIX} ostree --repo=local-mirror summary --update
|
||||
${CMD_PREFIX} ostree --repo=local remote add os-remote-local-mirror file://$(pwd)/local-mirror --collection-id org.example.OsCollection --gpg-import=${test_tmpdir}/gpghome/key2.asc
|
||||
|
||||
for repo in local; do
|
||||
@@ -212,9 +219,6 @@ for repo in local; do
|
||||
assert_file_has_content find "^Result [0-9]\+: file://$(pwd)/os-collection$"
|
||||
assert_file_has_content find "^ - Keyring: os-remote.trustedkeys.gpg$"
|
||||
assert_file_has_content find "^ - (org.example.OsCollection, os/amd64/master) = $(cat os-checksum-3)$"
|
||||
assert_file_has_content find "^Result [0-9]\+: file://$(pwd)/local-mirror$"
|
||||
assert_file_has_content find "^ - Keyring: os-remote-local-mirror.trustedkeys.gpg$"
|
||||
assert_file_has_content find "^ - (org.example.OsCollection, os/amd64/master) = $(cat os-checksum-3)$"
|
||||
assert_file_has_content find "^1/1 refs were found.$"
|
||||
assert_not_file_has_content find "^No results.$"
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ static void
|
||||
test_data_init (TestData *td)
|
||||
{
|
||||
GError *error = NULL;
|
||||
ot_cleanup_write_archive struct archive *a = archive_write_new ();
|
||||
g_autoptr(OtAutoArchiveWrite) a = archive_write_new ();
|
||||
struct archive_entry *ae;
|
||||
uid_t uid = getuid ();
|
||||
gid_t gid = getgid ();
|
||||
@@ -165,7 +165,7 @@ test_libarchive_noautocreate_empty (gconstpointer data)
|
||||
{
|
||||
TestData *td = (void*)data;
|
||||
GError *error = NULL;
|
||||
ot_cleanup_read_archive struct archive *a = archive_read_new ();
|
||||
g_autoptr(OtAutoArchiveRead) a = archive_read_new ();
|
||||
OstreeRepoImportArchiveOptions opts = { 0, };
|
||||
glnx_unref_object OstreeMutableTree *mtree = ostree_mutable_tree_new ();
|
||||
|
||||
@@ -181,7 +181,7 @@ test_libarchive_autocreate_empty (gconstpointer data)
|
||||
{
|
||||
TestData *td = (void*)data;
|
||||
g_autoptr(GError) error = NULL;
|
||||
ot_cleanup_read_archive struct archive *a = archive_read_new ();
|
||||
g_autoptr(OtAutoArchiveRead) a = archive_read_new ();
|
||||
OstreeRepoImportArchiveOptions opts = { 0, };
|
||||
glnx_unref_object OstreeMutableTree *mtree = ostree_mutable_tree_new ();
|
||||
|
||||
@@ -199,7 +199,7 @@ test_libarchive_error_device_file (gconstpointer data)
|
||||
{
|
||||
TestData *td = (void*)data;
|
||||
g_autoptr(GError) error = NULL;
|
||||
ot_cleanup_read_archive struct archive *a = archive_read_new ();
|
||||
g_autoptr(OtAutoArchiveRead) a = archive_read_new ();
|
||||
OstreeRepoImportArchiveOptions opts = { 0, };
|
||||
glnx_unref_object OstreeMutableTree *mtree = ostree_mutable_tree_new ();
|
||||
|
||||
@@ -270,7 +270,7 @@ test_libarchive_ignore_device_file (gconstpointer data)
|
||||
{
|
||||
TestData *td = (void*)data;
|
||||
g_autoptr(GError) error = NULL;
|
||||
ot_cleanup_read_archive struct archive *a = archive_read_new ();
|
||||
g_autoptr(OtAutoArchiveRead) a = archive_read_new ();
|
||||
OstreeRepoImportArchiveOptions opts = { 0, };
|
||||
|
||||
if (skip_if_no_xattr (td))
|
||||
@@ -332,7 +332,7 @@ test_libarchive_ostree_convention (gconstpointer data)
|
||||
{
|
||||
TestData *td = (void*)data;
|
||||
GError *error = NULL;
|
||||
ot_cleanup_read_archive struct archive *a = archive_read_new ();
|
||||
g_autoptr(OtAutoArchiveRead) a = archive_read_new ();
|
||||
OstreeRepoImportArchiveOptions opts = { 0, };
|
||||
|
||||
if (skip_if_no_xattr (td))
|
||||
@@ -374,7 +374,7 @@ test_libarchive_xattr_callback (gconstpointer data)
|
||||
{
|
||||
TestData *td = (void*)data;
|
||||
GError *error = NULL;
|
||||
ot_cleanup_read_archive struct archive *a = archive_read_new ();
|
||||
g_autoptr(OtAutoArchiveRead) a = archive_read_new ();
|
||||
OstreeRepoImportArchiveOptions opts = { 0 };
|
||||
OstreeRepoCommitModifier *modifier = NULL;
|
||||
char buf[7] = { 0 };
|
||||
@@ -429,7 +429,7 @@ static void
|
||||
entry_pathname_test_helper (gconstpointer data, gboolean on)
|
||||
{
|
||||
TestData *td = (void*)data; GError *error = NULL;
|
||||
ot_cleanup_read_archive struct archive *a = archive_read_new ();
|
||||
g_autoptr(OtAutoArchiveRead) a = archive_read_new ();
|
||||
OstreeRepoImportArchiveOptions opts = { 0, };
|
||||
OstreeRepoCommitModifier *modifier = NULL;
|
||||
gboolean met_etc_file = FALSE;
|
||||
@@ -491,7 +491,7 @@ test_libarchive_selinux (gconstpointer data)
|
||||
{
|
||||
TestData *td = (void*)data;
|
||||
GError *error = NULL;
|
||||
ot_cleanup_read_archive struct archive *a = archive_read_new ();
|
||||
g_autoptr(OtAutoArchiveRead) a = archive_read_new ();
|
||||
OstreeRepoImportArchiveOptions opts = { 0 };
|
||||
glnx_unref_object OstreeSePolicy *sepol = NULL;
|
||||
OstreeRepoCommitModifier *modifier = NULL;
|
||||
|
||||
+5
-6
@@ -79,13 +79,12 @@ static void
|
||||
test_lzma_random (void)
|
||||
{
|
||||
gssize i;
|
||||
const guint32 buffer_size = 4096 + 1;
|
||||
guint8 buffer[buffer_size];
|
||||
srandom (1);
|
||||
for (i = 0; i < buffer_size; i++)
|
||||
buffer[i] = random ();
|
||||
guint8 buffer[4096];
|
||||
g_autoptr(GRand) r = g_rand_new ();
|
||||
for (i = 0; i < sizeof(buffer); i++)
|
||||
buffer[i] = g_rand_int (r);
|
||||
|
||||
for (i = 2; i <= buffer_size; i *= 2)
|
||||
for (i = 2; i < (sizeof(buffer) - 1); i *= 2)
|
||||
{
|
||||
helper_test_compress_decompress (buffer, i - 1);
|
||||
helper_test_compress_decompress (buffer, i);
|
||||
|
||||
@@ -72,8 +72,10 @@ test_mutable_tree_walk (void)
|
||||
glnx_unref_object OstreeMutableTree *subdir = NULL;
|
||||
glnx_unref_object OstreeMutableTree *a = NULL;
|
||||
g_autofree char *source_checksum = NULL;
|
||||
ostree_mutable_tree_lookup (tree, "a", &source_checksum, &a, &error);
|
||||
g_assert (ostree_mutable_tree_lookup (tree, "a", &source_checksum, &a, &error));
|
||||
g_assert_no_error (error);
|
||||
g_assert (ostree_mutable_tree_walk (a, split_path, 1, &subdir, &error));
|
||||
g_assert_no_error (error);
|
||||
g_assert (subdir);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,23 +23,43 @@ set -euo pipefail
|
||||
|
||||
setup_fake_remote_repo1 "archive"
|
||||
|
||||
echo '1..1'
|
||||
echo '1..2'
|
||||
|
||||
cd ${test_tmpdir}
|
||||
gnomerepo_url="$(cat httpd-address)/ostree/gnomerepo"
|
||||
ostree_repo_init repo --mode "archive"
|
||||
|
||||
# Set up our local cache
|
||||
ostree_repo_init repo-local --mode "archive"
|
||||
for repo in repo{,-local}; do
|
||||
${CMD_PREFIX} ostree --repo=${repo} remote add --set=gpg-verify=false origin ${gnomerepo_url}
|
||||
done
|
||||
${CMD_PREFIX} ostree --repo=repo-local remote add --set=gpg-verify=false origin ${gnomerepo_url}
|
||||
|
||||
init_repo() {
|
||||
ostree_repo_init repo --mode "archive"
|
||||
${CMD_PREFIX} ostree --repo=repo remote add --set=gpg-verify=false origin ${gnomerepo_url}
|
||||
}
|
||||
|
||||
# Pull the contents to our local cache
|
||||
${CMD_PREFIX} ostree --repo=repo-local pull origin main
|
||||
rm files -rf
|
||||
${CMD_PREFIX} ostree --repo=ostree-srv/gnomerepo checkout main files
|
||||
echo anewfile > files/anewfile
|
||||
${CMD_PREFIX} ostree --repo=ostree-srv/gnomerepo commit -b main --tree=dir=files
|
||||
commit=$(${CMD_PREFIX} ostree --repo=ostree-srv/gnomerepo commit -b main --tree=dir=files)
|
||||
|
||||
${CMD_PREFIX} ostree --repo=repo pull -L repo-local origin main >out.txt
|
||||
# Check that pulling a new commit of the same tree hits our cache
|
||||
rm -rf repo
|
||||
init_repo
|
||||
${CMD_PREFIX} ostree --repo=repo pull --localcache-repo repo-local origin main >out.txt
|
||||
assert_file_has_content out.txt '3 metadata, 1 content objects fetched (4 meta, 5 content local)'
|
||||
echo "ok pull --reference"
|
||||
echo "ok pull --localcache-repo"
|
||||
|
||||
# Check that pulling the same commit works as well
|
||||
rm -rf repo
|
||||
init_repo
|
||||
${CMD_PREFIX} ostree --repo=repo-local pull origin $commit
|
||||
${CMD_PREFIX} ostree --repo=repo pull -L repo-local origin main
|
||||
commit2=$(${CMD_PREFIX} ostree --repo=repo rev-parse main)
|
||||
[[ $commit == $commit2 ]]
|
||||
# and check that it's not partial
|
||||
rm -rf files
|
||||
${CMD_PREFIX} ostree --repo=repo checkout main files
|
||||
test -f files/anewfile
|
||||
echo "ok pull --localcache-repo same commit"
|
||||
+41
-1
@@ -23,7 +23,7 @@ set -euo pipefail
|
||||
|
||||
setup_fake_remote_repo1 "archive-z2"
|
||||
|
||||
echo '1..1'
|
||||
echo '1..2'
|
||||
|
||||
cd ${test_tmpdir}
|
||||
mkdir repo
|
||||
@@ -117,3 +117,43 @@ ${CMD_PREFIX} ostree --repo=repo refs | wc -l > refscount.create6
|
||||
assert_file_has_content refscount.create6 "^11$"
|
||||
|
||||
echo "ok refs"
|
||||
|
||||
# Test symlinking a ref
|
||||
${CMD_PREFIX} ostree --repo=repo refs ctest --create=exampleos/x86_64/26/server
|
||||
${CMD_PREFIX} ostree --repo=repo refs -A exampleos/x86_64/26/server --create=exampleos/x86_64/stable/server
|
||||
${CMD_PREFIX} ostree --repo=repo summary -u
|
||||
${CMD_PREFIX} ostree --repo=repo refs > refs.txt
|
||||
for v in 26 stable; do
|
||||
assert_file_has_content refs.txt exampleos/x86_64/${v}/server
|
||||
done
|
||||
${CMD_PREFIX} ostree --repo=repo refs -A > refs.txt
|
||||
assert_file_has_content_literal refs.txt 'exampleos/x86_64/stable/server -> exampleos/x86_64/26/server'
|
||||
assert_not_file_has_content refs.txt '^exampleos/x86_64/26/server'
|
||||
stable=$(${CMD_PREFIX} ostree --repo=repo rev-parse exampleos/x86_64/stable/server)
|
||||
current=$(${CMD_PREFIX} ostree --repo=repo rev-parse exampleos/x86_64/26/server)
|
||||
assert_streq "${stable}" "${current}"
|
||||
${CMD_PREFIX} ostree --repo=repo commit -b exampleos/x86_64/26/server --tree=dir=tree
|
||||
${CMD_PREFIX} ostree --repo=repo summary -u
|
||||
newcurrent=$(${CMD_PREFIX} ostree --repo=repo rev-parse exampleos/x86_64/26/server)
|
||||
assert_not_streq "${newcurrent}" "${current}"
|
||||
newstable=$(${CMD_PREFIX} ostree --repo=repo rev-parse exampleos/x86_64/stable/server)
|
||||
assert_streq "${newcurrent}" "${newstable}"
|
||||
|
||||
# Test that we can swap the symlink
|
||||
${CMD_PREFIX} ostree --repo=repo commit -b exampleos/x86_64/27/server --tree=dir=tree
|
||||
newcurrent=$(${CMD_PREFIX} ostree --repo=repo rev-parse exampleos/x86_64/27/server)
|
||||
assert_not_streq "${newcurrent}" "${newstable}"
|
||||
${CMD_PREFIX} ostree --repo=repo refs -A exampleos/x86_64/27/server --create=exampleos/x86_64/stable/server
|
||||
newnewstable=$(${CMD_PREFIX} ostree --repo=repo rev-parse exampleos/x86_64/stable/server)
|
||||
assert_not_streq "${newnewstable}" "${newstable}"
|
||||
assert_streq "${newnewstable}" "${newcurrent}"
|
||||
${CMD_PREFIX} ostree --repo=repo refs > refs.txt
|
||||
for v in 26 27 stable; do
|
||||
assert_file_has_content refs.txt exampleos/x86_64/${v}/server
|
||||
done
|
||||
${CMD_PREFIX} ostree --repo=repo refs -A > refs.txt
|
||||
assert_file_has_content_literal refs.txt 'exampleos/x86_64/stable/server -> exampleos/x86_64/27/server'
|
||||
|
||||
${CMD_PREFIX} ostree --repo=repo summary -u
|
||||
|
||||
echo "ok ref symlink"
|
||||
@@ -70,7 +70,6 @@ static void
|
||||
teardown (Fixture *fixture,
|
||||
gconstpointer test_data)
|
||||
{
|
||||
glnx_fd_close int parent_repo_dfd = -1;
|
||||
g_autoptr(GError) error = NULL;
|
||||
|
||||
/* Recursively remove the temporary directory. */
|
||||
@@ -81,10 +80,7 @@ teardown (Fixture *fixture,
|
||||
|
||||
/* The repo also needs its source files to be removed. This is the inverse
|
||||
* of setup_test_repository() in libtest.sh. */
|
||||
g_autofree gchar *parent_repo_path = g_file_get_path (ostree_repo_get_path (fixture->parent_repo));
|
||||
glnx_opendirat (-1, parent_repo_path, TRUE, &parent_repo_dfd, &error);
|
||||
g_assert_no_error (error);
|
||||
|
||||
int parent_repo_dfd = ostree_repo_get_dfd (fixture->parent_repo);
|
||||
glnx_shutil_rm_rf_at (parent_repo_dfd, "../files", NULL, NULL);
|
||||
glnx_shutil_rm_rf_at (parent_repo_dfd, "../repo", NULL, NULL);
|
||||
|
||||
|
||||
@@ -73,7 +73,6 @@ static void
|
||||
teardown (Fixture *fixture,
|
||||
gconstpointer test_data)
|
||||
{
|
||||
glnx_fd_close int parent_repo_dfd = -1;
|
||||
g_autoptr(GError) error = NULL;
|
||||
|
||||
/* Recursively remove the temporary directory. */
|
||||
@@ -84,10 +83,7 @@ teardown (Fixture *fixture,
|
||||
|
||||
/* The repo also needs its source files to be removed. This is the inverse
|
||||
* of setup_test_repository() in libtest.sh. */
|
||||
g_autofree gchar *parent_repo_path = g_file_get_path (ostree_repo_get_path (fixture->parent_repo));
|
||||
glnx_opendirat (-1, parent_repo_path, TRUE, &parent_repo_dfd, &error);
|
||||
g_assert_no_error (error);
|
||||
|
||||
int parent_repo_dfd = ostree_repo_get_dfd (fixture->parent_repo);
|
||||
glnx_shutil_rm_rf_at (parent_repo_dfd, "../files", NULL, NULL);
|
||||
glnx_shutil_rm_rf_at (parent_repo_dfd, "../repo", NULL, NULL);
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ echo 'ok documented symbols'
|
||||
|
||||
# ONLY update this checksum in release commits!
|
||||
cat > released-sha256.txt <<EOF
|
||||
d96fc94ded6c862099654bf8eb3ea82c760ee4d6f193cb3380663f35602468d4 ${released_syms}
|
||||
c993c42dee8ee0c52b01d317b214391698818a0c20efe99c5273c60fa9278b3c ${released_syms}
|
||||
EOF
|
||||
sha256sum -c released-sha256.txt
|
||||
|
||||
|
||||
Reference in new issue
Block a user