From bee9c0f60566d8abb00a77a659d46eb19befd23b Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Tue, 1 Dec 2020 21:55:12 +0000 Subject: [PATCH] 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 --- Makefile-rpm-ostree.am | 3 - Makefile-tests.am | 1 - src/app/rpmostree-builtin-container.c | 45 ------------- src/app/rpmostree-builtin-ex.c | 2 - tests/check/test-ucontainer.sh | 91 -------------------------- tests/ex-container | 40 ----------- tests/ex-container-tests/test-bash.sh | 36 ---------- tests/ex-container-tests/test-httpd.sh | 21 ------ 8 files changed, 239 deletions(-) delete mode 100644 src/app/rpmostree-builtin-container.c delete mode 100755 tests/check/test-ucontainer.sh delete mode 100755 tests/ex-container delete mode 100755 tests/ex-container-tests/test-bash.sh delete mode 100755 tests/ex-container-tests/test-httpd.sh diff --git a/Makefile-rpm-ostree.am b/Makefile-rpm-ostree.am index 24ab96b8..a34d4166 100644 --- a/Makefile-rpm-ostree.am +++ b/Makefile-rpm-ostree.am @@ -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 \ diff --git a/Makefile-tests.am b/Makefile-tests.am index a333c197..db1efa92 100644 --- a/Makefile-tests.am +++ b/Makefile-tests.am @@ -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 = \ diff --git a/src/app/rpmostree-builtin-container.c b/src/app/rpmostree-builtin-container.c deleted file mode 100644 index 5d07d765..00000000 --- a/src/app/rpmostree-builtin-container.c +++ /dev/null @@ -1,45 +0,0 @@ -/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- - * - * Copyright (C) 2016 Colin Walters - * - * 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); -} - diff --git a/src/app/rpmostree-builtin-ex.c b/src/app/rpmostree-builtin-ex.c index ac9cde5d..c3569e05 100644 --- a/src/app/rpmostree-builtin-ex.c +++ b/src/app/rpmostree-builtin-ex.c @@ -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 }, diff --git a/tests/check/test-ucontainer.sh b/tests/check/test-ucontainer.sh deleted file mode 100755 index 73ff5851..00000000 --- a/tests/check/test-ucontainer.sh +++ /dev/null @@ -1,91 +0,0 @@ -#!/bin/bash -# -# Copyright (C) 2016 Colin Walters -# -# 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 < foo.conf <nobranch.conf <err.txt; then - assert_not_reached "nobranch.conf" -fi - -cat >nopackages.conf <err.txt; then - assert_not_reached "nopackages.conf" -fi - -cat >norepos.conf <err.txt; then - assert_not_reached "norepos.conf" -fi - -cat >notfoundpackage.conf <err.txt; then - assert_not_reached "notfound.conf" -fi - -echo "ok error conditions" diff --git a/tests/ex-container b/tests/ex-container deleted file mode 100755 index 32e99d24..00000000 --- a/tests/ex-container +++ /dev/null @@ -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 {} diff --git a/tests/ex-container-tests/test-bash.sh b/tests/ex-container-tests/test-bash.sh deleted file mode 100755 index 24f97af6..00000000 --- a/tests/ex-container-tests/test-bash.sh +++ /dev/null @@ -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 < 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 <docs.txt -assert_not_file_has_content docs.txt README diff --git a/tests/ex-container-tests/test-httpd.sh b/tests/ex-container-tests/test-httpd.sh deleted file mode 100755 index 776d6aaa..00000000 --- a/tests/ex-container-tests/test-httpd.sh +++ /dev/null @@ -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 <