Remove ex-container
I still think we should do this at some point, but the experiment with using `GKeyfile` for configuration is IMO a failure and the variety of data formats (treefile JSON vs YAML vs origin keyfiles vs container keyfiles) causes a lot of confusion. Prep for https://github.com/coreos/rpm-ostree/issues/2326
This commit is contained in:
parent
887d362906
commit
bee9c0f605
@ -42,7 +42,6 @@ rpm_ostree_SOURCES = src/app/main.c \
|
||||
src/app/rpmostree-builtin-status.c \
|
||||
src/app/rpmostree-builtin-ex.c \
|
||||
src/app/rpmostree-builtin-testutils.c \
|
||||
src/app/rpmostree-builtin-container.c \
|
||||
src/app/rpmostree-builtin-db.c \
|
||||
src/app/rpmostree-builtin-start-daemon.c \
|
||||
src/app/rpmostree-builtin-finalize-deployment.c \
|
||||
@ -51,8 +50,6 @@ rpm_ostree_SOURCES = src/app/main.c \
|
||||
src/app/rpmostree-db-builtin-version.c \
|
||||
src/app/rpmostree-dbus-helpers.c \
|
||||
src/app/rpmostree-dbus-helpers.h \
|
||||
src/app/rpmostree-container-builtins.h \
|
||||
src/app/rpmostree-container-builtins.c \
|
||||
src/app/rpmostree-override-builtins.h \
|
||||
src/app/rpmostree-override-builtins.c \
|
||||
src/app/rpmostree-libbuiltin.c \
|
||||
|
@ -55,7 +55,6 @@ uninstalled_test_programs = \
|
||||
|
||||
uninstalled_test_scripts = \
|
||||
tests/check/test-lib-introspection.sh \
|
||||
tests/check/test-ucontainer.sh \
|
||||
$(NULL)
|
||||
|
||||
uninstalled_test_extra_programs = \
|
||||
|
@ -1,45 +0,0 @@
|
||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
|
||||
*
|
||||
* Copyright (C) 2016 Colin Walters <walters@verbum.org>
|
||||
*
|
||||
* This program 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 licence 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.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "rpmostree-container-builtins.h"
|
||||
#include "rpmostree-rpm-util.h"
|
||||
|
||||
static RpmOstreeCommand container_subcommands[] = {
|
||||
{ "init", RPM_OSTREE_BUILTIN_FLAG_LOCAL_CMD,
|
||||
"Initialize a local container", rpmostree_container_builtin_init },
|
||||
{ "assemble", RPM_OSTREE_BUILTIN_FLAG_LOCAL_CMD,
|
||||
"Assemble a local container", rpmostree_container_builtin_assemble },
|
||||
/* { "start", rpmostree_container_builtin_start }, */
|
||||
{ "upgrade", RPM_OSTREE_BUILTIN_FLAG_LOCAL_CMD,
|
||||
"Perform a local container upgrade", rpmostree_container_builtin_upgrade },
|
||||
{ NULL, 0, NULL, NULL }
|
||||
};
|
||||
|
||||
gboolean
|
||||
rpmostree_builtin_container (int argc, char **argv,
|
||||
RpmOstreeCommandInvocation *invocation,
|
||||
GCancellable *cancellable, GError **error)
|
||||
{
|
||||
return rpmostree_handle_subcommand (argc, argv, container_subcommands,
|
||||
invocation, cancellable, error);
|
||||
}
|
||||
|
@ -26,8 +26,6 @@ static RpmOstreeCommand ex_subcommands[] = {
|
||||
{ "livefs", RPM_OSTREE_BUILTIN_FLAG_REQUIRES_ROOT,
|
||||
"Apply pending deployment changes to booted deployment",
|
||||
rpmostree_ex_builtin_livefs },
|
||||
{ "container", RPM_OSTREE_BUILTIN_FLAG_LOCAL_CMD,
|
||||
"Assemble local unprivileged containers", rpmostree_builtin_container },
|
||||
#ifdef BUILDOPT_ROJIG
|
||||
{ "commit2rojig", RPM_OSTREE_BUILTIN_FLAG_LOCAL_CMD,
|
||||
"Convert an OSTree commit into an rpm-ostree rojig", rpmostree_ex_builtin_commit2rojig },
|
||||
|
@ -1,91 +0,0 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright (C) 2016 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
|
||||
|
||||
. ${commondir}/libtest.sh
|
||||
|
||||
echo "1..2"
|
||||
|
||||
rpm-ostree ex container init
|
||||
if test -n "${OSTREE_NO_XATTRS:-}"; then
|
||||
echo -e 'disable-xattrs=true\n' >> repo/config
|
||||
fi
|
||||
|
||||
build_rpm foo
|
||||
build_rpm fake-shell provides /usr/bin/sh
|
||||
|
||||
cat > rpmmd.repos.d/test-repo.repo <<EOF
|
||||
[test-repo]
|
||||
baseurl=file://$PWD/yumrepo
|
||||
gpgcheck=0
|
||||
EOF
|
||||
|
||||
cat > foo.conf <<EOF
|
||||
[tree]
|
||||
ref=foo
|
||||
packages=foo
|
||||
repos=test-repo
|
||||
skip-sanity-check=true
|
||||
EOF
|
||||
|
||||
rpm-ostree ex container assemble foo.conf
|
||||
assert_has_dir roots/foo.0
|
||||
ostree --repo=repo rev-parse foo
|
||||
echo "ok assemble"
|
||||
|
||||
cat >nobranch.conf <<EOF
|
||||
[tree]
|
||||
packages=foo
|
||||
repos=test-repo
|
||||
EOF
|
||||
if rpm-ostree ex container assemble nobranch.conf 2>err.txt; then
|
||||
assert_not_reached "nobranch.conf"
|
||||
fi
|
||||
|
||||
cat >nopackages.conf <<EOF
|
||||
[tree]
|
||||
ref=foo
|
||||
packages=
|
||||
repos=test-repo
|
||||
EOF
|
||||
if rpm-ostree ex container assemble nopackages.conf 2>err.txt; then
|
||||
assert_not_reached "nopackages.conf"
|
||||
fi
|
||||
|
||||
cat >norepos.conf <<EOF
|
||||
[tree]
|
||||
ref=foo
|
||||
packages=foo
|
||||
EOF
|
||||
if rpm-ostree ex container assemble norepos.conf 2>err.txt; then
|
||||
assert_not_reached "norepos.conf"
|
||||
fi
|
||||
|
||||
cat >notfoundpackage.conf <<EOF
|
||||
[tree]
|
||||
ref=notfound
|
||||
packages=notfound
|
||||
repos=test-repo
|
||||
EOF
|
||||
if rpm-ostree ex container assemble notfound.conf 2>err.txt; then
|
||||
assert_not_reached "notfound.conf"
|
||||
fi
|
||||
|
||||
echo "ok error conditions"
|
@ -1,40 +0,0 @@
|
||||
#!/bin/bash
|
||||
# Tests for `rpm-ostree ex container`.
|
||||
set -xeuo pipefail
|
||||
|
||||
dn=$(cd $(dirname $0) && pwd)
|
||||
export topsrcdir=$(cd $dn/.. && pwd)
|
||||
. ${dn}/common/libtest-core.sh
|
||||
. ${dn}/common/libtestrepos.sh
|
||||
|
||||
if test "$(id -u)" = 0; then
|
||||
fatal "Don't run $0 as root"
|
||||
fi
|
||||
|
||||
LOGDIR=${LOGDIR:-$(pwd)/ex-container-logs}
|
||||
|
||||
tmpdir=$(mktemp -d /var/tmp/rpm-ostree-container.XXXXXX)
|
||||
touch ${tmpdir}/.tmpdir
|
||||
cleanup_tmp() {
|
||||
# This sanity check ensures we don't delete something else
|
||||
if test -z "${TEST_SKIP_CLEANUP:-}" && test -f ${tmpdir}/.tmpdir; then
|
||||
rm -rf ${tmpdir}
|
||||
fi
|
||||
}
|
||||
trap cleanup_tmp EXIT
|
||||
|
||||
cd ${tmpdir}
|
||||
rpm-ostree ex container init
|
||||
setup_rpmmd_repos ${tmpdir}/rpmmd.repos.d
|
||||
|
||||
echo "Results in ${LOGDIR}"
|
||||
rm ${LOGDIR} -rf
|
||||
mkdir -p ${LOGDIR}
|
||||
|
||||
# Ideally pass $(cwd) down into parallel somehow
|
||||
export test_tmpdir=${tmpdir}
|
||||
# We use -j 1 since we can't actually be parallel at the moment due
|
||||
# to locking issues with metadata downloads at least. Down the line
|
||||
# we should try to do a dry run pull first like the compose tests do.
|
||||
ls ${dn}/ex-container-tests/test-*.sh | sort |
|
||||
parallel -j 1 --tag --halt soon,fail=1 --joblog joblog --results ${LOGDIR} --line-buffer {}
|
@ -1,36 +0,0 @@
|
||||
#!/usr/bin/bash
|
||||
set -xeuo pipefail
|
||||
|
||||
cd ${test_tmpdir}
|
||||
|
||||
dn=$(cd $(dirname $0) && pwd)
|
||||
. ${dn}/../common/libtest-core.sh
|
||||
|
||||
cat >bash.conf <<EOF
|
||||
[tree]
|
||||
ref=bash
|
||||
packages=coreutils;bash;
|
||||
selinux=false
|
||||
repos=fedora;
|
||||
releasever=29
|
||||
EOF
|
||||
|
||||
rpm-ostree ex container assemble bash.conf
|
||||
ostree --repo=repo fsck -q
|
||||
ostree --repo=repo ls bash /usr/etc/shadow > shadowls.txt
|
||||
assert_file_has_content shadowls.txt '^-00400 .*/usr/etc/shadow'
|
||||
ostree --repo=repo ls bash /usr/share/doc/bash/README >/dev/null
|
||||
|
||||
cat >bash-nodocs.conf <<EOF
|
||||
[tree]
|
||||
ref=bash-nodocs
|
||||
packages=coreutils;bash;
|
||||
selinux=false
|
||||
repos=fedora;
|
||||
releasever=29
|
||||
documentation=false;
|
||||
EOF
|
||||
|
||||
rpm-ostree ex container assemble bash-nodocs.conf
|
||||
ostree --repo=repo ls bash-nodocs /usr/share/doc/bash >docs.txt
|
||||
assert_not_file_has_content docs.txt README
|
@ -1,21 +0,0 @@
|
||||
#!/usr/bin/bash
|
||||
set -xeuo pipefail
|
||||
|
||||
cd ${test_tmpdir}
|
||||
|
||||
dn=$(cd $(dirname $0) && pwd)
|
||||
. ${dn}/../common/libtest-core.sh
|
||||
|
||||
cat >httpd.conf <<EOF
|
||||
[tree]
|
||||
ref=httpd
|
||||
packages=httpd;
|
||||
selinux=false
|
||||
repos=fedora;
|
||||
releasever=29
|
||||
EOF
|
||||
|
||||
# This one has non-root ownership in some of the dependencies, but we shouldn't
|
||||
# try to apply them; see apply_rpmfi_overrides().
|
||||
rpm-ostree ex container assemble httpd.conf
|
||||
ostree --repo=repo ls httpd /usr/sbin/httpd
|
Loading…
Reference in New Issue
Block a user