diff options
author | Jonathan Lebon <jonathan@jlebon.com> | 2022-01-21 13:41:32 -0500 |
---|---|---|
committer | Jonathan Lebon <jonathan@jlebon.com> | 2022-01-25 16:44:39 -0500 |
commit | 5bf57ec062b446a45de60de639e974ce06f028cd (patch) | |
tree | 4272b84d69b7c9858ce2af09f2979e88d4da810b /tests/kolainst/libinsttest.sh | |
parent | baf838de229a7934e4ee0cf27a10a54d6aac28fd (diff) | |
download | ostree-5bf57ec062b446a45de60de639e974ce06f028cd.tar.gz |
tests/kolainst: Avoid recursive symlinks
`kola` now follows symlinks when archiving an external test's `data/`
dir. So the recursive `data` symlink we have here breaks it.
Let's just move the shared files in its own directory and update the
symlinks.
Diffstat (limited to 'tests/kolainst/libinsttest.sh')
-rw-r--r-- | tests/kolainst/libinsttest.sh | 82 |
1 files changed, 0 insertions, 82 deletions
diff --git a/tests/kolainst/libinsttest.sh b/tests/kolainst/libinsttest.sh deleted file mode 100644 index 927dc5e1..00000000 --- a/tests/kolainst/libinsttest.sh +++ /dev/null @@ -1,82 +0,0 @@ -# Common definitions for installed, privileged tests -# -# Copyright (C) 2017 Colin Walters <walters@verbum.org> -# -# 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, see <https://www.gnu.org/licenses/>. - -. ${KOLA_EXT_DATA}/libtest-core.sh - -# Copy of bits from tap-test -test_tmpdir= -function _tmpdir_cleanup () { - if test -z "${TEST_SKIP_CLEANUP:-}" && - test -n "${test_tmpdir}" && test -f ${test_tmpdir}/.testtmp; then - rm "${test_tmpdir}" -rf - fi -} -prepare_tmpdir() { - local tmpdir=${1:-/var/tmp} - test_tmpdir=$(mktemp -p ${tmpdir} -d ostree-insttest.XXXXXXXX) - touch ${test_tmpdir}/.testtmp - cd ${test_tmpdir} -} - -# This is copied from flatpak/flatpak/tests/test-webserver.sh -run_tmp_webserver() { - dir=$1 - - port=8000 - podman create --name ostree-httpd --privileged --user root -ti --net=host -v "${dir}":/srv --workdir /srv \ - quay.io/coreos-assembler/fcos-buildroot:testing-devel python3 -m http.server "${port}" - podman generate systemd ostree-httpd > /etc/systemd/system/ostree-httpd.service - systemctl daemon-reload - systemctl start ostree-httpd.service - - address="http://127.0.0.1:${port}" - while ! curl --head "${address}" &>/dev/null; do sleep 1; done - echo "${address}" > ${test_tmpdir}/httpd-address -} - -# Yeah this is a hack. Doing this better requires more first class support -# for creating derived commits in ostree potentially. Or barring that, -# just recommend to people to use `unshare -m` or equivalent and -# mount -o remount,rw /sysroot in their code. -require_writable_sysroot() { - if ! test -w /sysroot; then - mount -o remount,rw /sysroot - fi -} - -nth_boot() { - journalctl --list-boots | wc -l -} - -# Determine our origin refspec - we'll use this as a test base -rpmostree=$(which rpm-ostree 2>/dev/null) -if test -z "${rpmostree}"; then - skip "no rpm-ostree, at some point point this to raw ostree too" -fi - -# We need to be root -assert_streq $(id -u) 0 - -rpmostree_query_json() { - query=$1 - rpm-ostree status --json | jq -r "${query}" -} -host_refspec=$(rpmostree_query_json '.deployments[0].origin') -host_commit=$(rpmostree_query_json '.deployments[0].checksum') -host_osname=$(rpmostree_query_json '.deployments[0].osname') |