diff --git a/Makefile.am b/Makefile.am
index 0db1f28c594..b4d9a5c1618 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -156,7 +156,6 @@ WEBPACK_PACKAGES = \
kubernetes \
machines \
networkmanager \
- ostree \
ovirt \
pcp \
packagekit \
diff --git a/bots/image-prepare b/bots/image-prepare
index 0e568423e1e..e5e06fd8881 100755
--- a/bots/image-prepare
+++ b/bots/image-prepare
@@ -125,8 +125,6 @@ def run_install_script(machine, do_build, do_install, skips, arg, args):
skips = list(skips or [])
if "atomic" in machine.image:
skips.append("cockpit-kubernetes")
- else:
- skips.append("cockpit-ostree")
skip_args = [" --skip '%s'" % skip for skip in skips]
cmd = "cd /var/tmp; ./%s.install%s%s%s%s%s%s" % (machine.image,
diff --git a/bots/images/scripts/lib/atomic.install b/bots/images/scripts/lib/atomic.install
index cef7d26186e..5462cdf9acc 100755
--- a/bots/images/scripts/lib/atomic.install
+++ b/bots/images/scripts/lib/atomic.install
@@ -46,7 +46,6 @@ class AtomicCockpitInstaller:
"cockpit-docker",
"cockpit-kdump",
"cockpit-networkmanager",
- "cockpit-ostree",
"cockpit-sosreport" ]
def __init__(self, rpms=None, verbose=False):
diff --git a/doc/guide/Makefile-guide.am b/doc/guide/Makefile-guide.am
index 9b75371b729..eaea5dafbb7 100644
--- a/doc/guide/Makefile-guide.am
+++ b/doc/guide/Makefile-guide.am
@@ -29,7 +29,6 @@ GUIDE_INCLUDES = \
doc/guide/feature-kubernetes.xml \
doc/guide/feature-machines.xml \
doc/guide/feature-networkmanager.xml \
- doc/guide/feature-ostree.xml \
doc/guide/feature-packagekit.xml \
doc/guide/feature-pcp.xml \
doc/guide/feature-realmd.xml \
diff --git a/doc/guide/cockpit-guide.xml b/doc/guide/cockpit-guide.xml
index c9ccfb21576..1e83beac34d 100644
--- a/doc/guide/cockpit-guide.xml
+++ b/doc/guide/cockpit-guide.xml
@@ -49,7 +49,6 @@
-
diff --git a/doc/guide/feature-ostree.xml b/doc/guide/feature-ostree.xml
deleted file mode 100644
index 76543377002..00000000000
--- a/doc/guide/feature-ostree.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
- RPM OSTree
-
- Cockpit uses the RPM OSTree DBUS API to update the software on atomic systems.
- To perform similar tasks from the command line, use the rpm-ostree
command.
-
-
diff --git a/pkg/ostree/app.js b/pkg/ostree/app.js
deleted file mode 100644
index fb50812062e..00000000000
--- a/pkg/ostree/app.js
+++ /dev/null
@@ -1,496 +0,0 @@
-(function() {
- "use strict";
-
- var cockpit = require('cockpit');
- var moment = require('moment');
-
- var angular = require('angular');
- require('angular-dialog.js');
- require('angular-route');
- require('angular-gettext/dist/angular-gettext.js');
- require('angular-bootstrap-npm/dist/angular-bootstrap.js');
-
- var client = require('./client');
- require('./remotes');
-
- var _ = cockpit.gettext;
- cockpit.translate();
-
- function track_id(item) {
- if (!item)
- return;
-
- var key = item.osname.v;
- if (item.id)
- key = key + item.id.v;
-
- if (item.checksum)
- key = key + item.checksum.v;
-
- return key;
- }
-
- function notify_result(promise, scope) {
- promise
- .progress(function(msg) {
- scope.$applyAsync(function() {
- scope.progressMsg = msg;
- });
- })
- .fail(function(ex) {
- scope.$applyAsync(function() {
- scope.error = cockpit.format(cockpit.message(ex));
- });
- })
- .always(function(ex) {
- scope.$applyAsync(function() {
- scope.progressMsg = null;
- });
- });
- }
-
- angular.module('ostree', [
- 'ngRoute',
- 'gettext',
- 'ui.cockpit',
- 'ostree.remotes',
- ])
- .config([
- '$routeProvider',
- function($routeProvider) {
- $routeProvider.when('/', {
- templateUrl: 'index.html',
- controller: 'indexController'
- });
- }
- ])
-
- .controller('mainController', [
- '$scope',
- '$timeout',
- function($scope, $timeout) {
-
- function set_curtains(curtains) {
- $scope.$applyAsync(function() {
- $scope.curtains = curtains;
- });
- }
-
- function show_failure(ex) {
- var message = null;
- var final = false;
- if (ex.problem === "access-denied") {
- message = _("Not authorized to update software on this system");
- } else if (ex.problem === "not-found") {
- message = _("OSTree is not available on this system");
- final = true;
- } else {
- message = cockpit.message(ex);
- }
-
- set_curtains({ state: 'failed',
- failure: ex,
- message: message,
- final: final });
- }
-
- var timeout;
- function check_empty() {
- window.clearTimeout(timeout);
- timeout = null;
- if (client.os_list && client.os_list.length === 0) {
- set_curtains({
- "state" : "empty",
- "message" : _("No OSTree deployments found"),
- "failure" : true
- });
- } else if ($scope.curtains !== null) {
- set_curtains(null);
- }
- }
-
- $scope.curtains = { state: 'silent' };
- timeout = window.setTimeout(function() {
- set_curtains({ state: 'connecting' });
- document.body.removeAttribute('hidden');
- timeout = null;
- }, 1000);
-
- function handle(promise) {
- promise
- .always(function() {
- document.body.removeAttribute('hidden');
- window.clearTimeout(timeout);
- timeout = null;
- })
- .done(function(connection) {
- timeout = window.setTimeout(check_empty, 1000);
- })
- .fail(show_failure);
- }
-
- function on_connection_lost(event, ex) {
- show_failure(ex);
- }
- client.addEventListener("connectionLost", on_connection_lost);
- client.addEventListener("changed", check_empty);
-
- handle(client.connect());
- $scope.reconnect = function reconnect() {
- set_curtains({ state: 'connecting' });
- handle(client.connect());
- };
-
- $scope.$on("$destroy", function() {
- client.removeEventListener("connectionLost", on_connection_lost);
- client.removeEventListener("changed", check_empty);
- });
- }
- ])
-
- .controller('indexController', [
- '$scope',
- function($scope) {
- $scope.os = null;
- $scope.track_id = track_id;
-
- $scope.displayOS = function(os) {
- $scope.os = os;
- $scope.currentOrigin = client.get_default_origin(os);
- };
-
- $scope.knownVersions = function() {
- var origin = $scope.currentOrigin || {};
- return client.known_versions_for($scope.os,
- origin.remote,
- origin.branch);
- };
-
- $scope.itemMatches = function(item, proxy_arg) {
- return client.item_matches(item, proxy_arg);
- };
-
- $scope.$on("changeOrigin", function (ev, remote, branch) {
- $scope.$applyAsync(function() {
- var origin = {
- "remote": remote,
- "branch": branch,
- };
-
- var defaultOrigin = client.get_default_origin($scope.os) || {};
- if (!origin.branch)
- origin.branch = defaultOrigin.branch;
- if (!origin.remote)
- origin.remote = defaultOrigin.remote;
-
- $scope.currentOrigin = origin;
- });
- });
-
- function on_changed() {
- $scope.$applyAsync(function() {
- $scope.runningMethod = client.running_method;
- $scope.os_list = client.os_list;
- if (client.os_list) {
- if (!$scope.os || !client.get_os_proxy($scope.os))
- $scope.displayOS(client.os_list[0]);
- } else {
- $scope.displayOS(null);
- }
- });
- }
-
- client.connect().
- done(function () {
- client.addEventListener("changed", on_changed);
- on_changed();
- });
-
- $scope.$on("$destroy", function() {
- client.removeEventListener("changed", on_changed);
- });
- }])
-
- /* Override the default angularjs exception handler */
- .factory('$exceptionHandler', ['$log', function($log) {
- return function(exception, cause) {
-
- /* Displays an oops if we're running in cockpit */
- cockpit.oops();
-
- /* And log with the default implementation */
- $log.error.apply($log, arguments);
- };
- }])
-
- .directive('ostreeCheck', [
- '$modal',
- "remoteActions",
- function($modal, remoteActions) {
- return {
- restrict: 'E',
- templateUrl: "ostree-check.html",
- scope: {
- os: "=",
- runningMethod: "=",
- currentOrigin: "="
- },
- link: function(scope, element, attrs) {
- scope.error = null;
- scope.progressMsg = null;
- scope.isRunning = false;
- scope.branches = {};
-
- function updateBranchCache(remote, branch) {
- scope.isRunning = true;
-
- /* We want to populate the list with already downloaded updates
- * but this can error if there are no new updates or the remote
- * hasn't yes been downloaded from so we ignore errors.
- * If there is a real error, the use will see if when they
- * check for updates.
- */
- client.cache_update_for(scope.os,
- remote,
- branch)
- .always(function () {
- scope.$applyAsync(function () {
- scope.isRunning = false;
- });
- });
- }
-
- scope.$watch("currentOrigin.remote", function (newValue) {
- var branches = {
- remote: newValue
- };
-
- if (!newValue) {
- scope.branches = {};
- return;
- }
-
- // Only run when remote is changed by loading new OS
- // dialog takes care of this when changed there
- if (scope.branches.remote === newValue)
- return;
-
- scope.isRunning = true;
- remoteActions.listBranches(newValue)
- .then(function (data) {
- branches.list = data;
- }, function (ex) {
- branches.error = cockpit.message(ex);
- })
- .then(function () {
- scope.$applyAsync(function() {
- scope.branches = branches;
- scope.isRunning = false;
- });
- });
- });
-
- scope.$watch("runningMethod", function() {
- var expected = "DownloadUpdateRpmDiff:" + scope.os;
- var expected2 = "DownloadRebaseRpmDiff:" + scope.os;
- scope.isRunning = expected === client.running_method ||
- expected2 === client.running_method;
- });
-
- scope.checkForUpgrades = function() {
- var origin = scope.currentOrigin || {};
- scope.error = null;
- scope.progressMsg = _("Checking for updates");
-
- var promise = client.check_for_updates(scope.os,
- origin.remote,
- origin.branch);
- notify_result(promise, scope);
- };
-
- scope.switchBranch = function(branch) {
- if (!scope.currentOrigin)
- return;
-
- scope.error = null;
-
- updateBranchCache(scope.currentOrigin.remote, branch);
- scope.$emit("changeOrigin", scope.currentOrigin.remote, branch);
- };
-
- scope.changeRepository = function() {
- scope.error = null;
- var promise = $modal.open({
- animation: false,
- controller: 'ChangeRepositoryCtrl',
- templateUrl: 'repository-dialog.html',
- resolve: {
- dialogData: function() {
- var origin = scope.currentOrigin || {};
- return {
- "remote": origin.remote,
- "branch": origin.branch,
- "os": scope.os
- };
- }
- },
- }).result;
-
- /* If the change is successful */
- promise.then(function(result) {
- scope.branches = result.branches;
- scope.$emit("changeOrigin", result.remote, result.branch);
- });
- return promise;
- };
- }
- };
- }
- ])
-
- .directive('ostreeItem', [
- function() {
- return {
- restrict: 'E',
- templateUrl: "ostree-item.html",
- scope: {
- item: "=",
- runningMethod: "="
- },
- link: function(scope, element, attrs) {
- function set_running() {
- var expected = "";
- if (client.item_matches(scope.item, "CachedUpdate"))
- expected = "Deploy:";
- else if (client.item_matches(scope.item, "RollbackDeployment"))
- expected = "Rollback:";
- else if (!scope.item.id)
- expected = "Rebase:";
-
- if (scope.item && scope.item.osname)
- expected = expected + scope.item.osname.v;
-
- scope.isRunning = expected === client.running_method;
- }
-
- scope.error = null;
- scope.progressMsg = null;
- scope.id = track_id(scope.item);
- scope.active = 'tree';
-
- function on_changed() {
- scope.$digest();
- }
-
- scope.matches = function (proxy_arg) {
- return client.item_matches(scope.item, proxy_arg);
- };
-
- scope.packages = client.packages(scope.item);
- scope.packages.addEventListener("changed", on_changed);
- scope.$on("$destroy", function() {
- scope.packages.removeEventListener("changed", on_changed);
- });
-
- scope.signature_obj = client.signature_obj;
-
- scope.isRunning = false;
- set_running();
- scope.$watch("runningMethod", set_running);
-
- scope.isUpdate = function () {
- return scope.matches('CachedUpdate') && !scope.matches('DefaultDeployment');
- };
-
- scope.isRollback = function() {
- return scope.matches('RollbackDeployment') &&
- !scope.matches('CachedUpdate');
- };
-
- scope.isRebase = function() {
- return scope.item && !scope.item.id &&
- !client.item_matches(scope.item, 'BootedDeployment', 'origin') &&
- !scope.matches('RollbackDeployment') &&
- !scope.matches('DefaultDeployment');
- };
-
- scope.switchTab = function(data) {
- scope.active = data;
- };
-
- scope.activeTab = function(data) {
- return scope.active === data;
- };
-
- scope.doRollback = function(os) {
- scope.error = null;
- var args = {
- "reboot" : cockpit.variant("b", true)
- };
- var promise = client.run_transaction("Rollback", [args], os);
- notify_result(promise, scope);
- };
-
- scope.doUpgrade = function(os, hash) {
- scope.error = null;
- var args = {
- "reboot" : cockpit.variant("b", true)
- };
- var promise = client.run_transaction("Deploy", [hash, args], os);
- notify_result(promise, scope);
- };
-
- scope.doRebase = function(os, origin, hash) {
- scope.error = null;
- var args = {
- "reboot" : cockpit.variant("b", true),
- "revision" : cockpit.variant("s", hash),
- };
- var promise = client.run_transaction("Rebase", [args, origin, []], os);
- notify_result(promise, scope);
- };
- }
- };
- }
- ])
-
- .filter('packages', function() {
- return function(number) {
- var format = cockpit.ngettext(_("$0 package"), _("$0 packages"), number);
- return cockpit.format(format, number);
- };
- })
-
- .filter('releaseName', function() {
- return function(deployment) {
- var formated = "";
- if (!deployment || !deployment.osname)
- return;
-
- if (deployment.version)
- formated = deployment.version.v;
-
- return cockpit.format("$0 $1", deployment.osname.v, formated);
- };
- })
-
- .filter("timeAgo", function() {
- return function(when) {
- if (when) {
- return moment.unix(when).fromNow();
- }
- return "";
- };
- })
-
- .filter('dateFormat', function() {
- return function(when) {
- var formated;
- if (when) {
- var d = new Date(when * 1000);
- return d.toString();
- }
- return formated;
- };
- });
-}());
diff --git a/pkg/ostree/client.js b/pkg/ostree/client.js
deleted file mode 100644
index 5b6c7b91d89..00000000000
--- a/pkg/ostree/client.js
+++ /dev/null
@@ -1,731 +0,0 @@
-var cockpit = require('cockpit');
-var _ = cockpit.gettext;
-
-var DEST = 'org.projectatomic.rpmostree1';
-var PATH = '/org/projectatomic/rpmostree1';
-
-var SYSROOT = 'org.projectatomic.rpmostree1.Sysroot';
-var SYSROOT_PATH = '/org/projectatomic/rpmostree1/Sysroot';
-
-var OS = 'org.projectatomic.rpmostree1.OS';
-var TRANSACTION = 'org.projectatomic.rpmostree1.Transaction';
-
-/*
- * Breaks down progress messages into
- * a string that can be displayed
- * Similar to the cli output but simplier.
- * We don't display object counts or bytes/s.
- * Percentages are only possible when
- * we actually know what is going to be pulled.
- *
- * progress_arg is a tuple of 6 tuples
- * with the following values:
- *
- * time data (tt): (start time, elapsed seconds)
- * outstanding data counts (uu): (outstanding fetches,
- * outstanding writes)
- * metadata counts (uuu): (scanned, fetched, outstanding)
- * delta data (uuut): (total parts, fetched parts,
- * total super blocks, total size)
- * content objects (uu): (fetched objects, requested objects)
- * transfer data (tt): (bytes transfered, bytes/s)
- */
-
-function build_progress_line(progress_arg) {
- if (!progress_arg || progress_arg.length != 6 ||
- progress_arg[0].length != 2 || progress_arg[1].length != 2 ||
- progress_arg[2].length != 3 || progress_arg[3].length != 4 ||
- progress_arg[4].length != 2 || progress_arg[5].length != 2) {
- console.warn("Unknown progress data", progress_arg);
- return;
- }
-
- var line;
- var outstanding_fetches = progress_arg[1][0];
- var outstanding_writes = progress_arg[1][0];
-
- var outstanding_metadata_fetches = progress_arg[2][2];
-
- var total_delta_parts = progress_arg[3][0];
-
- var fetched = progress_arg[4][0];
- var requested = progress_arg[4][1];
-
- if (outstanding_fetches) {
- if (total_delta_parts > 0) {
- line = _("Receiving delta parts");
- } else if (outstanding_metadata_fetches) {
- line = _("Receiving metadata objects");
- } else {
- var percent = (fetched / requested) * 100;
- line = cockpit.format(_("Receiving objects: $0%"), percent.toFixed(2));
- }
- } else if (outstanding_writes) {
- line = _("Writing objects");
- } else {
- line = _("Scanning metadata");
- }
- return line;
-}
-
-function process_diff_list(result) {
- var key_names = ["adds", "removes", "up", "down"];
- var list = result[0];
- var diffs = {};
- for (var i = 0; i < list.length; i++) {
- var key = key_names[list[i][1]];
-
- if (!diffs[key])
- diffs[key] = [];
-
- var obj = {
- name: list[i][0],
- type: list[i][1],
- };
-
- if (obj.type === 1) {
- obj.version = list[i][2]["PreviousPackage"]["v"][1];
- obj.arch = list[i][2]["PreviousPackage"]["v"][2];
- } else {
- obj.version = list[i][2]["NewPackage"]["v"][1];
- obj.arch = list[i][2]["NewPackage"]["v"][2];
- }
-
- diffs[key].push(obj);
- }
- return diffs;
-}
-
-function process_rpm_list(result) {
- var data = [];
- result.split("\n").forEach(function(v) {
- if (v) {
- data.push({
- 'name': v,
- });
- }
- });
- data.sort(function(a, b) {
- var n1 = a.name ? a.name : "";
- var n2 = b.name ? b.name : "";
-
- return n1.toLowerCase().localeCompare(n2.toLowerCase());
- });
-
- if (data.length < 1)
- return;
-
- var half = Math.floor(data.length / 2);
- if (data.length % 2)
- half = half + 1;
-
- return {
- rpms1: data.slice(0, half+1),
- rpms2: data.slice(half+1),
- };
-}
-
-function Packages(promise, transform) {
- var self = this;
- self.error = null;
- self.ready = false;
- self.empty = false;
-
- cockpit.event_target(self);
-
- promise
- .done(function(result) {
- var empty = true;
- if (transform)
- result = transform(result);
-
- for (var k in result) {
- self[k] = result[k];
- empty = false;
- }
-
- self.empty = empty;
- self.valid = true;
- })
- .fail(function(ex) {
- self.error = cockpit.message(ex);
- })
- .always(function() {
- self.ready = true;
- self.dispatchEvent("changed");
- });
-}
-
-function RPMOSTreeDBusClient() {
- var self = this;
-
- cockpit.event_target(self);
-
- self.connection_error = null;
- self.os_list = [];
-
- var sysroot = null;
- var os_proxies = {};
- var os_proxies_added = null;
-
- var os_names = {};
- var packages_cache = {};
- var update_cache = {};
-
- var local_running = null;
- var booted_id = null;
-
- var client = null;
- var waits = null;
- var timer = null;
- var skipped = false;
-
- Object.defineProperty(this, "running_method", {
- enumerable: false,
- get: function() {
- if (local_running) {
- return local_running;
- } else if (sysroot && sysroot.ActiveTransaction) {
- var active = sysroot.ActiveTransaction[0];
- var proxy = os_proxies[sysroot.ActiveTransaction[2]];
-
- if (proxy && active)
- active = active + ":" + proxy.Name;
-
- return active;
- } else {
- return null;
- }
- }
- });
-
- function resolve_nested(obj, path) {
- return path.split('.').reduce( function( prev, curr ) {
- if (prev !== undefined)
- return prev[curr];
- else
- return prev;
- }, obj || {} );
- }
-
- function trigger_changed() {
- if (!timer) {
- self.dispatchEvent("changed");
- timer = window.setTimeout(function() {
- timer = null;
- if (skipped)
- self.dispatchEvent("changed");
- skipped = false;
- }, 300);
- } else {
- skipped = true;
- }
- }
-
-
- function get_client() {
- if (!client) {
- self.connection_error = null;
- self.os_list = [];
-
- sysroot = null;
- os_proxies = {};
- os_proxies_added = null;
-
- os_names = {};
- packages_cache = {};
- update_cache = {};
-
- local_running = null;
- booted_id = null;
-
- waits = cockpit.defer();
- waits.promise.done(function () {
- if (sysroot && sysroot.valid)
- build_os_list(sysroot.Deployments);
- else
- trigger_changed();
- });
-
- client = cockpit.dbus(DEST, {"superuser" : true,
- "capabilities" : ["address"]});
-
- /* Watch before listening for close because watch fires first */
- client.watch(PATH).fail(tear_down);
- client.addEventListener("close", closing);
-
- sysroot = client.proxy(SYSROOT, SYSROOT_PATH);
- sysroot.addEventListener("changed", on_sysroot_changed);
- sysroot.wait(function() {
- if (client) {
- os_proxies = client.proxies(OS, PATH);
- os_proxies_added = function(event, proxy) {
- if (proxy.Name)
- os_names[proxy.Name] = proxy.path;
- };
- os_proxies.addEventListener("changed", trigger_changed);
- os_proxies.addEventListener("added", os_proxies_added);
-
- os_proxies.wait(function() {
- for (var path in os_proxies) {
- var proxy = os_proxies[path];
- os_names[proxy.Name] = path;
- }
- waits.resolve();
- });
- } else {
- waits.resolve();
- }
- });
-
-
-
- }
- return client;
- }
-
- function tear_down(ex) {
- client = null;
- self.connection_error = ex;
- if (sysroot) {
- sysroot.removeEventListener("changed", on_sysroot_changed);
- sysroot = null;
- }
- if (os_proxies) {
- if (os_proxies_added)
- os_proxies.removeEventListener("added", os_proxies_added);
- os_proxies_added = null;
- os_proxies = {};
- }
- }
-
- function closing(event, ex) {
- tear_down(ex);
- self.dispatchEvent("connectionLost", [ ex ]);
- }
-
- /* The order of deployments indicates
- * the order the OS names should be in.
- */
- function build_os_list(data) {
- var seen = {};
- var os_list = [];
- var i;
-
- if (data) {
- for (i = 0; i < data.length; i++) {
- var deployment = data[i];
- var os = deployment.osname.v;
-
- if (!seen[os])
- os_list.push(os);
- seen[os] = true;
- }
- }
-
- self.os_list = os_list;
- trigger_changed();
- }
-
- function on_sysroot_changed(ev, data) {
- if (data["Deployments"]) {
- build_os_list(data["Deployments"]);
- } else if ("ActiveTransaction" in data) {
- trigger_changed();
- }
- }
-
- function get_os_origin (os) {
- var origin;
- var proxy = self.get_os_proxy(os);
-
- if (!proxy && sysroot)
- proxy = os_proxies[sysroot.Booted];
-
- if (proxy) {
- origin = resolve_nested(proxy, "BootedDeployment.origin.v");
- if (!origin)
- origin = resolve_nested(proxy, "DefaultDeployment.origin.v");
- }
-
- return origin;
- }
-
- function build_change_refspec(os, remote, branch) {
- var current_origin = self.get_default_origin(os);
-
- if (!remote && current_origin)
- remote = current_origin.remote;
-
- if (!branch && current_origin)
- branch = current_origin.branch;
-
- if (current_origin && current_origin.branch == branch && current_origin.remote == remote)
- return;
-
- if (!remote || !branch)
- return;
-
- return remote + ":" + branch;
- }
-
- self.connect = function() {
- var dp = cockpit.defer();
- get_client();
- waits.promise.done(function() {
- if (self.connection_error)
- dp.reject(self.connection_error);
- else
- dp.resolve(client);
- });
- return dp.promise;
- };
-
- self.known_versions_for = function(os_name, remote, branch) {
- /* The number of deployments should always be a small
- * number. If that turns out to not be the case we
- * can cache this on a local property.
- */
- var deployments = sysroot ? sysroot.Deployments : [];
- var list = [];
- var upgrade_checksum;
- var update, cached_origin;
- var alt_refspec = build_change_refspec(os_name, remote, branch);
-
- var proxy = self.get_os_proxy(os_name);
- if (proxy) {
- cached_origin = resolve_nested(proxy, "CachedUpdate.origin.v");
- if (cached_origin)
- update_cache[cached_origin] = proxy.CachedUpdate;
- }
-
- update = alt_refspec ? update_cache[alt_refspec] : update_cache[cached_origin];
-
- if (update)
- upgrade_checksum = resolve_nested(update, "checksum.v");
-
- for (var i = 0; i < deployments.length; i++) {
- var deployment = deployments[i];
- var checksum = resolve_nested(deployment, "checksum.v");
-
- if (deployment.id && resolve_nested(deployment, "osname.v") != os_name)
- continue;
-
- // always show the default deployment,
- // skip showing the upgrade if it is the
- // same as the default.
- if (self.item_matches(deployment, "DefaultDeployment")) {
- if (upgrade_checksum && checksum !== upgrade_checksum)
- list.push(update);
- list.push(deployment);
-
- // skip other deployments if it is the same as the upgrade
- } else if (resolve_nested(deployment, "checksum.v") !== upgrade_checksum) {
- list.push(deployment);
- }
- }
-
- return list;
- };
-
- self.get_default_origin = function (os) {
- var parts;
- var origin = get_os_origin(os);
-
- if (origin) {
- parts = origin.split(':');
- if (parts.length > 1) {
- origin = { "remote": parts[0] };
- parts.shift();
- origin.branch = parts.join(':');
- }
- }
-
- return origin;
- };
-
- self.get_os_proxy = function(os_name) {
- var path = os_names[os_name];
- var proxy = null;
- if (path)
- proxy = os_proxies[path];
- return proxy;
- };
-
- /* This is a little fragile because the
- * the dbus varient is simply 'av'.
- * Ostree promises to not remove or change the
- * order of any of these attributes.
- * https://github.com/ostreedev/ostree/commit/4a2733f9e7e2ca127ff27433c045c977000ca346#diff-c38f32cb7112030f3326b43e305f2accR424
- * Here's the definition this relies on
- * - bool valid
- * - bool is sig expired
- * - bool is key expired
- * - bool is key revoked
- * - bool is key missing
- * - str key fingerprint
- * - int signature timestamp
- * - int signature expiry timestamp
- * - str key algo name
- * - str key hash algo name
- * - str key user name
- * - str key user email
- */
- self.signature_obj = function(signature) {
- if (!signature.v)
- return;
-
- var by = signature.v[11];
- if (signature.v[10])
- by = by ? cockpit.format("$0 <$1>", signature.v[10], by) : signature.v[10];
-
- return {
- 'fp' : signature.v[5],
- 'fp_name' : signature.v[8] ? cockpit.format(_("$0 key ID"), signature.v[8]) : null,
- 'expired' : signature.v[1] || signature.v[2],
- 'valid' : signature.v[0],
- 'timestamp' : signature.v[6],
- 'by' : by
- };
- };
-
- /* Because all our deployment package diffs can only
- * change when the machine is rebooted we
- * fetch and store them once here and
- * never fetch them again.
- * Pending updates are tracked by checksum since those
- * can change.
- */
- self.packages = function(item) {
- var id = resolve_nested(item, "id.v");
- var checksum = resolve_nested(item, "checksum.v");
- var key = id;
-
- if (!id && checksum)
- key = checksum;
-
- if (!booted_id) {
- var root_proxy = os_proxies[sysroot.Booted];
- if (root_proxy)
- booted_id = root_proxy.BootedDeployment.id.v;
- else
- return;
- }
-
- if (key && !packages_cache[key]) {
- var proxy = self.get_os_proxy(item.osname.v);
- var packages;
- var promise;
- if (proxy) {
- if (id === booted_id) {
- promise = cockpit.spawn(['rpm', '-qa']);
- packages = new Packages(promise,
- process_rpm_list);
- } else if (id) {
- promise = proxy.call("GetDeploymentsRpmDiff",
- [booted_id, id]);
- packages = new Packages(promise,
- process_diff_list);
- } else if (item.origin.v === get_os_origin(proxy.Name)) {
- promise = proxy.call("GetCachedUpdateRpmDiff", [""]);
- packages = new Packages(promise,
- process_diff_list);
- }
- packages_cache[key] = packages;
- }
- }
- return packages_cache[key];
- };
-
- self.item_matches = function(item, proxy_attr, attr) {
- var os_name = resolve_nested(item, "osname.v");
- var proxy = null;
- var item2 = null;
-
- if (!os_name)
- return false;
-
- proxy = self.get_os_proxy(os_name);
- item2 = resolve_nested(proxy, proxy_attr);
-
- if (!attr)
- attr = "checksum";
- attr = attr + ".v";
- return resolve_nested(item, attr) === resolve_nested(item2, attr);
- };
-
- self.cache_update_for = function(os, remote, branch) {
- var dp = cockpit.defer();
- var refspec = build_change_refspec(os, remote, branch);
- var proxy = self.get_os_proxy(os);
-
- if (proxy) {
- if (!refspec)
- return cockpit.when(proxy.CachedUpdate);
-
- proxy.call("GetCachedRebaseRpmDiff", [refspec, []])
- .done(function (data) {
- var item;
- if (data && data.length == 2 && resolve_nested(data[1], "checksum.v")) {
- item = data[1];
- update_cache[refspec] = item;
- packages_cache[item.checksum.v] = new Packages(cockpit.when([data[0]]),
- process_diff_list);
- }
-
- if (item)
- dp.resolve(item);
- else
- dp.reject({ "problem" : "protocol-error"});
- })
- .fail(function (ex) {
- dp.reject(ex);
- });
- } else {
- dp.reject(cockpit.format(_("OS $0 not found"), os));
- }
-
- return dp.promise();
- };
-
- self.check_for_updates = function(os, remote, branch) {
- var promise;
- var refspec = build_change_refspec(os, remote, branch);
- if (refspec) {
- promise = self.run_transaction("DownloadRebaseRpmDiff",
- [refspec, []], os)
- .then(function () {
- // Need to get and store the cached data.
- // Make it like this is part of the download
- // call.
- local_running = "DownloadRebaseRpmDiff" + ":" + os;
- return self.cache_update_for(os, remote, branch)
- .always(function () {
- local_running = null;
- trigger_changed();
- });
- });
- } else {
- promise = self.run_transaction("DownloadUpdateRpmDiff",
- null, os);
- }
- return promise;
- };
-
- self.reload = function () {
- var dp = cockpit.defer();
- /* Not all Systems support this so just skip if not
- * known.
- */
- if (sysroot && sysroot.ReloadConfig) {
- sysroot.ReloadConfig()
- .fail(function (ex) {
- console.warn ("Error reloading config:", ex);
- })
- .always(function () {
- dp.resolve();
- });
- } else {
- dp.resolve();
- }
- return dp.promise();
- };
-
- self.run_transaction = function(method, method_args, os) {
- local_running = method + ":" + os;
- var transaction_client = null;
- var subscription = null;
- var dp = cockpit.defer();
- var i;
- var reboot = false;
-
- if (Array.isArray(method_args)) {
- for (i = 0; i < method_args.length; i++) {
- var val = method_args[i];
- if (val !== null && typeof val === 'object' && "reboot" in val) {
- reboot = method_args[i].reboot;
- break;
- }
- }
- }
-
- function cleanup(ex) {
- local_running = null;
- if (transaction_client) {
- if (subscription)
- subscription.remove();
-
- transaction_client.removeEventListener("close", on_close);
- transaction_client.close();
- }
- transaction_client = null;
- subscription = null;
- trigger_changed();
- }
-
- function fail(ex) {
- dp.reject(ex);
- cleanup();
- }
-
- function on_close(event, ex) {
- fail(ex);
- }
-
- self.connect()
- .fail(fail)
- .done(function () {
- var proxy = self.get_os_proxy(os);
-
- if (!proxy)
- return fail(cockpit.format(_("OS $0 not found"), os));
-
- self.reload().done(function () {
- proxy.call(method, method_args)
- .fail(fail)
- .done(function(result) {
- var connect_args = {
- "superuser" : true,
- "address": result[0],
- "bus": "none"
- };
-
- if (reboot)
- cockpit.hint('restart');
-
- transaction_client = cockpit.dbus(null, connect_args);
- transaction_client.addEventListener("close", on_close);
-
- subscription = transaction_client.subscribe({ 'path' : "/", },
- function(path, iface, signal, args) {
- if (signal == "DownloadProgress") {
- var line = build_progress_line(args);
- if (line)
- dp.notify(line);
- } else if (signal == "Message") {
- dp.notify(args[0]);
- } else if (signal == "Finished") {
- if (args) {
- if (args[0]) {
- dp.resolve(args[1]);
- cleanup();
- } else {
- fail(args[1]);
- }
- } else {
- console.warn("Unexpected transaction response", args);
- fail({ "problem": "protocol-error" });
- }
- }
- });
- transaction_client.call("/", TRANSACTION, "Start");
- });
- });
- });
-
- return dp.promise();
- };
-}
-
-/* singleton client instance */
-module.exports = new RPMOSTreeDBusClient();
diff --git a/pkg/ostree/index.html b/pkg/ostree/index.html
deleted file mode 100644
index 5b27af6348e..00000000000
--- a/pkg/ostree/index.html
+++ /dev/null
@@ -1,429 +0,0 @@
-
-
-
-
-
- Software Updates
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Connecting to OSTree
-
Unable to communicate with OSTree
-
No Deployments
-
{{curtains.message}}
-
-
-
-
-
-
-
-
diff --git a/pkg/ostree/manifest.json.in b/pkg/ostree/manifest.json.in
deleted file mode 100644
index 67094f3440f..00000000000
--- a/pkg/ostree/manifest.json.in
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "version": "@VERSION@",
- "name": "updates",
- "requires": {
- "cockpit": "124.x"
- },
-
- "tools": {
- "ostree": {
- "label": "Software Updates",
- "path": "index.html"
- }
- }
-}
diff --git a/pkg/ostree/ostree.less b/pkg/ostree/ostree.less
deleted file mode 100644
index c2b9534210f..00000000000
--- a/pkg/ostree/ostree.less
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * This file is part of Cockpit.
- *
- * Copyright (C) 2013 Red Hat, Inc.
- *
- * Cockpit 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.1 of the License, or
- * (at your option) any later version.
- *
- * Cockpit 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 Cockpit; If not, see .
- */
-
-/* ---------------------------------------------------------------------------------------------------- */
-
-@import (less) "../lib/page.css";
-@import "../lib/listing.less";
-@import (less) "../lib/timeline.css";
-@import (less) "../lib/table.css";
-
-/* Used to hide angular elements until they are ready */
-[ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak {
- display: none !important;
-}
-
-#ostree-software-update {
- max-width: 1000px;
-}
-
-.ostree-progress {
- max-width: 300px;
- max-height: 15px;
- line-height: 1;
- font-size: 13px;
- overflow: hidden;
- padding-bottom: 10px;
- text-overflow: ellipsis;
- text-align: right;
- float: right;
-}
-
-.container-fluid {
- margin-top: 0;
-}
-
-.listing-ct {
- width: 100%
-}
-
-table.listing-ct.listingtop thead h3 {
- padding-top: 0;
- margin-top: 0;
-}
-
-.listing-ct-panel dt:first-child {
- padding-top: 0px;
-}
-
-.hidden.active {
- display: block !important;
-}
-
-.listing-ct-head .display-inline {
- display: inline;
-}
-
-.listing-ct-head .listing-ct-actions {
- margin-top: -3px;
-}
-
-.btn-repository {
- margin-top: -3px;
- margin-left: 5px;
-}
-
-.listing-ct-maybe .listing-ct-head ul.dropdown-menu li div.alert {
- margin-top: 0;
-}
-
-.listing-ct-maybe .listing-ct-head .alert {
- margin-top: 20px;
- margin-bottom: 0;
-}
-
-.modal-body .form-table-ct label span {
- vertical-align: inherit;
-}
-
-.os-list {
- margin-bottom: 15px;
-}
diff --git a/pkg/ostree/remotes.js b/pkg/ostree/remotes.js
deleted file mode 100644
index c353187b4bf..00000000000
--- a/pkg/ostree/remotes.js
+++ /dev/null
@@ -1,416 +0,0 @@
-/*
- * This file is part of Cockpit.
- *
- * Copyright (C) 2016 Red Hat, Inc.
- *
- * Cockpit 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.1 of the License, or
- * (at your option) any later version.
- *
- * Cockpit 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 Cockpit; If not, see .
- */
-
-var cockpit = require('cockpit');
-var angular = require('angular');
-
-require('angular-dialog.js');
-require('./utils');
-
-var _ = cockpit.gettext;
-var client = require('./client');
-
-angular.module('ostree.remotes', [
- 'ui.cockpit',
- 'ostree.utils',
-])
-
-.factory("remoteActions", [
- "$q",
- "$timeout",
- "config",
- function($q, $timeout, config) {
- function listRemotes() {
- return cockpit.spawn(["ostree", "remote", "list"],
- { "superuser" : "try", "err" : "message"}).
- then(function(data) {
- var d = [];
- angular.forEach(data.trim().split(/\r\n|\r|\n/), function (v, k) {
- if (v)
- d.push(v);
- });
- return d.sort();
- });
- }
-
- function listBranches(remote) {
- return client.reload().then(function () {
- return cockpit.spawn(["ostree", "remote", "refs", remote],
- { "superuser" : "try", "err" : "message"}).
- then(function(data) {
- var d = [];
- angular.forEach(data.trim().split(/\r\n|\r|\n/), function (v, k) {
- var parts = v.split(":");
- if (parts.length > 1)
- d.push(parts.slice(1).join(":"));
- else if (v)
- d.push(v);
- });
- return d.sort();
- });
- });
- }
-
- function addRemote(name, url, gpg) {
- var cmd = ["ostree", "remote", "add" ];
- if (gpg)
- cmd.push("--set=gpg-verify=true");
- else
- cmd.push("--set=gpg-verify=false");
- cmd.push(name, url);
-
- return cockpit.spawn(cmd, { "superuser" : "try", "err" : "message"});
- }
-
- function deleteRemote(name) {
- return cockpit.spawn(["ostree", "remote", "delete", name],
- { "superuser" : "try", "err" : "message"});
- }
-
- function importGPGKey(name, key) {
- var process = cockpit.spawn(["ostree", "remote", "gpg-import", "--stdin", name],
- { "superuser" : "try", "err" : "message"});
- process.input(key);
- return process;
- }
-
- function getRemoteSettingsFile(name) {
- return cockpit.file("/etc/ostree/remotes.d/" + name + ".conf",
- { "superuser" : "try"});
- }
-
- function getSectionName(name) {
- return 'remote "' + name + '"';
- }
-
- function loadRemoteSettings(name) {
- var file = getRemoteSettingsFile(name);
- var section = getSectionName(name);
- var d = $q.defer();
- file.read()
- .done(function (content, tag) {
- var data = config.parseData(content);
- if (data[section])
- d.resolve(data[section]);
- else
- d.reject(_("No configuration data found"));
- })
- .fail(function (ex) {
- d.reject(ex);
- })
- .always(function () {
- file.close();
- });
-
- return d.promise;
- }
-
- function updateRemoteSettings(name, options) {
- var file = getRemoteSettingsFile(name);
- var section = getSectionName(name);
- var d = $q.defer();
-
- function mutate(content) {
- return config.changeData (content, section, options);
- }
-
- file.modify(mutate)
- .done(function (content, tag) {
- d.resolve();
- })
- .fail(function (ex) {
- d.reject(ex);
- })
- .always(function () {
- file.close();
- });
-
- return d.promise;
- }
-
- return {
- listRemotes: listRemotes,
- listBranches: listBranches,
- loadRemoteSettings: loadRemoteSettings,
- updateRemoteSettings: updateRemoteSettings,
- addRemote: addRemote,
- deleteRemote: deleteRemote,
- importGPGKey: importGPGKey,
- };
- }
-])
-
-.directive("editRemote", [
- "$q",
- "remoteActions",
- function($q, remoteActions) {
- return {
- restrict: "E",
- scope: {
- remote: '=remote'
- },
- link: function($scope, element, attrs) {
- $scope.fields = null;
- $scope.showGpgData = false;
- $scope.modalGroupButtonSel = ".group-buttons";
- $scope.modalGroupErrorAfter = true;
-
- remoteActions.loadRemoteSettings($scope.remote)
- .then(function (fields) {
- var verify = fields['gpg-verify'] ? fields['gpg-verify'].toLowerCase() : "";
- $scope.fields = fields;
- $scope.fields.gpgVerify = verify == 'true' || verify == '1';
- $scope.$applyAsync();
- }, function (ex) {
- $scope.failure(cockpit.format(_("Couldn't load settings for '$0': $1"),
- $scope.remote, cockpit.message(ex)));
- });
-
- $scope.cancel = function () {
- $scope.$emit("formFinished");
- };
-
- $scope.result = function (success, result) {
- $scope.$emit("formFinished", success);
- };
-
- $scope.update = function() {
- if (!$scope.fields)
- return;
-
- $scope.$emit("formRunning");
-
- /* Currently we only touch the gpgVerify field */
- var verify = !!$scope.fields.gpgVerify;
- var p = $q.when([]);
- if (verify && $scope.fields.gpgData) {
- p = $q.when(remoteActions.importGPGKey($scope.remote,
- $scope.fields.gpgData));
- }
-
- return p.then(function () {
- return remoteActions.updateRemoteSettings($scope.remote,
- { "gpg-verify": verify });
- });
- };
-
- $scope.delete = function() {
- $scope.$emit("formRunning");
- return remoteActions.deleteRemote($scope.remote);
- };
-
- $scope.toggleGpgData = function() {
- if (!$scope.fields)
- return;
-
- $scope.showGpgData = !$scope.showGpgData;
- if ($scope.showGpgData)
- $scope.fields.gpgVerify = true;
- };
- },
- templateUrl: "edit-remote.html"
- };
- }
-])
-
-.directive("addRemote", [
- "$q",
- "remoteActions",
- function($q, remoteActions) {
- return {
- restrict: "E",
- scope: true,
- link: function($scope, element, attrs) {
- $scope.fields = {};
- $scope.modalGroupButtonSel = ".group-buttons";
- $scope.modalGroupErrorAfter = true;
-
- function validate(fields) {
- var errors = [];
- var ex;
- var name_re = /^[a-z0-9_\.\-]+$/i;
- var space_re = /\s/;
-
- $scope.fields.name = $scope.fields.name ? $scope.fields.name.trim() : null;
- $scope.fields.url = $scope.fields.url ? $scope.fields.url.trim() : null;
-
- if (!$scope.fields.name || !name_re.test($scope.fields.name.toLowerCase())) {
- ex = new Error(_("Please provide a valid name"));
- ex.target = "#remote-name";
- errors.push(ex);
- ex = null;
- }
-
- if (!$scope.fields.url || space_re.test($scope.fields.url)) {
- ex = new Error(_("Please provide a valid URL"));
- ex.target = "#remote-url";
- errors.push(ex);
- ex = null;
- }
-
- if (errors.length > 0)
- return $q.reject(errors);
-
- return $q.when({
- name: $scope.fields.name,
- url: $scope.fields.url,
- verify: !!$scope.fields['gpgVerify']
- });
- }
-
- $scope.add = function add(cluster) {
- $scope.$emit("formRunning");
- return validate().then(function(data) {
- return remoteActions.addRemote(data.name,
- data.url,
- data.verify);
- });
- };
-
- $scope.cancel = function () {
- $scope.$emit("formFinished");
- };
-
- $scope.result = function (success, result) {
- $scope.$emit("formFinished", success);
- };
- },
- templateUrl: "add-remote.html"
- };
- }
-])
-
-.controller("ChangeRepositoryCtrl", [
- "$q",
- "$scope",
- "$modalInstance",
- "dialogData",
- "remoteActions",
- function($q, $scope, instance, dialogData, remoteActions) {
- angular.extend($scope, dialogData);
-
- $scope.loading = true;
- $scope.loading_error = null;
- $scope.adding = false;
- $scope.editing = null;
- $scope.running = false;
-
- function refreshRemotes() {
- var tmp = $scope.remote;
- $scope.loading = true;
- $scope.remote = null;
- remoteActions.listRemotes()
- .done(function (l) {
- $scope.remotes = l;
- if (tmp && l && l.indexOf(tmp) > -1)
- $scope.remote = tmp;
- })
- .fail(function (ex) {
- console.warn(ex);
- $scope.remote = null;
- $scope.loading_error = cockpit.format(_("Error loading remotes: $0"), cockpit.message(ex));
- })
- .always(function () {
- $scope.loading = false;
- $scope.$applyAsync();
- });
- }
-
- $scope.$on("formRunning", function (ev) {
- $scope.running = true;
- });
-
- $scope.$on("formFinished", function (ev, success) {
- $scope.running = false;
- if (success) {
- $scope.adding = false;
- $scope.editing = false;
- refreshRemotes();
- }
- });
-
- $scope.toggleEdit = function (remote, $event) {
- $event.stopPropagation();
- $event.preventDefault();
-
- if ($scope.running)
- return;
-
- $scope.editing = remote;
- $scope.adding = false;
-
- };
-
- $scope.toggleSelected = function (remote) {
- if ($scope.running)
- return;
-
- $scope.adding = false;
- $scope.remote = remote;
- if ($scope.editing != remote)
- $scope.editing = null;
- };
-
- $scope.openAdd = function () {
- if ($scope.running)
- return;
-
- $scope.adding = true;
- $scope.editing = null;
- };
-
- $scope.canSubmit = function () {
- return $scope.remote && !$scope.editing && !$scope.adding;
- };
-
- $scope.update = function () {
- var result = {
- "remote": $scope.remote,
- "branch": $scope.branch,
- "branches": {
- "remote": $scope.remote
- }
- };
-
- return remoteActions.listBranches(result.remote)
- .then(function (data) {
- result.branches.list = data;
- // Current branch doesn't exist change
- // to the first listed branch
- if (data.indexOf(result.branch) < 0)
- result.branch = data[0];
- }, function (ex) {
- // Can't list branches use default branch
- result.branches.error = cockpit.message(ex);
- result.branch = null;
- })
- .then(function () {
- return client.cache_update_for($scope.os, result.remote,
- result.branch)
- .then(function () {
- return result;
- }, function () {
- return result;
- });
- });
- };
-
- refreshRemotes();
- }
-]);
diff --git a/pkg/ostree/sample.conf b/pkg/ostree/sample.conf
deleted file mode 100644
index aa05958731a..00000000000
--- a/pkg/ostree/sample.conf
+++ /dev/null
@@ -1,10 +0,0 @@
-key = value
-
-[section]
-key=section
- indented = commas, or spaces
-
-[ section2 ]
-key = section2
-not a value
-another=value
diff --git a/pkg/ostree/test-utils.js b/pkg/ostree/test-utils.js
deleted file mode 100644
index 45eeeece7ef..00000000000
--- a/pkg/ostree/test-utils.js
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * This file is part of Cockpit.
- *
- * Copyright (C) 2016 Red Hat, Inc.
- *
- * Cockpit 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.1 of the License, or
- * (at your option) any later version.
- *
- * Cockpit 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 Cockpit; If not, see .
- */
-
-var angular = require("angular");
-var QUnit = require("qunit-tests");
-
-require("./utils");
-var sample_config = require("raw-loader!./sample.conf");
-
-function suite() {
- "use strict";
-
- /* Filled in with a function */
- var inject;
- var assert = QUnit;
-
- var module = angular.module("ostree.utils.tests", [
- "ostree.utils",
- ]);
-
- function utilsTest(name, count, func) {
- QUnit.test(name, function() {
- assert.expect(count);
- inject(func);
- });
- }
-
- utilsTest("parseData", 5, [
- "config",
- function (config) {
- var expected = {
- "key": "value",
- "section": {
- "indented": "commas, or spaces",
- "key": "section",
- },
- "section2": {
- "key": "section2",
- "another": "value"
- }
- };
-
- assert.deepEqual(config.parseData(""), {}, "empty string");
- assert.deepEqual(config.parseData(null), {}, "null string");
- assert.deepEqual(config.parseData(), {}, "undefined string");
- assert.deepEqual(config.parseData("invalid"), {}, "invalid config");
- assert.deepEqual(config.parseData(sample_config), expected, "parse sample config");
- }
- ]);
-
- utilsTest("changeData", 3, [
- "config",
- function(config) {
- assert.deepEqual(config.changeData(null, "section", {
- "key": "value2",
- "bool1": true,
- "bool2": false,
- }),
- "\n[section]\nkey = value2\nbool1 = true\nbool2 = false\n\n",
- "new file");
- assert.deepEqual(config.changeData("[other-section]\ndata=data\nline", "section", {
- "key": "value2",
- "bool1": true,
- "bool2": false,
- }),
- "[other-section]\ndata=data\nline\n\n[section]\nkey = value2\nbool1 = true\nbool2 = false\n\n",
- "new section");
- assert.deepEqual(config.changeData("[other-section]\ndata=data\nline\nsome line\nmore lines\n[section]\nkey = old\ntodelete=value\nbool1 = true\nbool2 = false\n[more]\nkey=value", "section", {
- "key": "value2",
- "todelete": null,
- "bool1": false,
- "bool2": true,
- "new": "new"
- }),
- "[other-section]\ndata=data\nline\nsome line\nmore lines\n[section]\nkey = value2\nbool1 = false\nbool2 = true\nnew = new\n\n[more]\nkey=value",
- "change section");
- }
- ]);
-
- angular.module('exceptionOverride', []).factory('$exceptionHandler', function() {
- return function(exception, cause) {
- exception.message += ' (caused by "' + cause + '")';
- throw exception;
- };
- });
-
- module.run([
- '$injector',
- function($injector) {
- inject = function inject(func) {
- return $injector.invoke(func);
- };
- QUnit.start();
- }
- ]);
-
- angular.bootstrap(document, ['ostree.utils.tests']);
-}
-
-suite();
diff --git a/pkg/ostree/utils.js b/pkg/ostree/utils.js
deleted file mode 100644
index d4a93715fdd..00000000000
--- a/pkg/ostree/utils.js
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * This file is part of Cockpit.
- *
- * Copyright (C) 2016 Red Hat, Inc.
- *
- * Cockpit 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.1 of the License, or
- * (at your option) any later version.
- *
- * Cockpit 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 Cockpit; If not, see .
- */
-
-var angular = require('angular');
-
-angular.module('ostree.utils', [])
-
-.factory("config", [
- function() {
- var configRegex = {
- /* section headers, ei: [section] */
- section: /^\s*\[\s*([^\]]*)\s*\]\s*$/,
- /* parameters, ei: key=value */
- param: /^\s*([\w\.\-\_]+)\s*=\s*(.*?)\s*$/,
- /* new lines, used to split config data */
- lines: /\r\n|\r|\n/
- };
-
- function formatOption(key, value) {
- return key + " = " + value;
- }
-
- function formatOptions(options) {
- var output = [];
- angular.forEach(options, function (v, k) {
- if (v || v === false)
- output.push(formatOption(k, v));
- });
- return output.join("\n") + "\n\n";
- }
-
- function parseData(string) {
- var data = {};
- var lines = string ? string.split(configRegex.lines) : [];
- var section = null;
- var i;
-
- for (i = 0; i < lines.length; i++) {
- var line = lines[i];
- var m;
- if (configRegex.param.test(line)) {
- m = line.match(configRegex.param);
- if (section)
- data[section][m[1]] = m[2];
- else
- data[m[1]] = m[2];
- } else if (configRegex.section.test(line)) {
- m = line.match(configRegex.section);
- section = m[1].trim();
- data[section] = {};
- }
- }
-
- return data;
- }
-
- function changeData(string, section, options) {
- var lines = string ? string.split(configRegex.lines) : [];
- var i;
- var in_section = false;
- var remaining = options;
- var output = "";
-
- /* Find the section and set any existing options */
- for (i = 0; i < lines.length; i++) {
- var line = lines[i];
- var m, k;
- if (configRegex.section.test(line)) {
- /* Leaving section stop processing */
- if (in_section)
- break;
- m = line.match(configRegex.section);
- k = m[1].trim();
- in_section = section == k;
- } else if (in_section && configRegex.param.test(line)) {
- m = line.match(configRegex.param);
- k = m[1];
- /* null means remove option */
- if (remaining[k] === null)
- line = null;
- /* If present set it */
- else if (remaining[k] !== undefined)
- line = formatOption(k, remaining[k]);
-
- delete remaining[k];
- }
-
- if (line !== null)
- output += line + "\n";
- }
-
- /* Create the section if needed */
- if (!in_section)
- output += "\n[" + section + "]\n";
-
- /* Add any remaining options */
- output += formatOptions(remaining);
-
- /* Add any remaining lines */
- if (i < lines.length)
- output += lines.slice(i).join("\n");
-
- return output;
- }
-
- return {
- changeData: changeData,
- parseData: parseData,
- };
- }
-]);
diff --git a/test/verify/check-ostree b/test/verify/check-ostree
deleted file mode 100755
index 4ffee849376..00000000000
--- a/test/verify/check-ostree
+++ /dev/null
@@ -1,757 +0,0 @@
-#!/usr/bin/python3
-# -*- coding: utf-8 -*-
-
-# This file is part of Cockpit.
-#
-# Copyright (C) 2015 Red Hat, Inc.
-#
-# Cockpit 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.1 of the License, or
-# (at your option) any later version.
-#
-# Cockpit 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 Cockpit; If not, see .
-
-import parent
-from testlib import *
-import os
-import subprocess
-
-INSTALL_RPMS = [
- "empty-1-0.noarch",
- "cockpit-ostree-wip-0.1.noarch",
- "cockpit-machines-99999-2.noarch",
-]
-
-REPO_LOCATION = "/var/local-repo"
-CHECKOUT_LOCATION = "/var/local-tree"
-RPM_LOCATION = "/usr/share/rpm"
-KEY_ID = "95A8BA1754D0E95E2B3A98A7EE15015654780CBD"
-
-def get_os_name(m):
- if m.image == "rhel-atomic":
- return "rhel-atomic-host"
- elif 'continuous' in m.image:
- return 'centos-atomic-host'
- else:
- return "fedora-atomic"
-
-def ensure_remote_http_port (m, remote="local"):
- remote_spec = m.execute(["ostree", "remote", "show-url", remote])
- if remote_spec.startswith("http"):
- parts = remote_spec.strip().split(":")
- port = parts[-1]
- else:
- m.execute(["ostree", "remote", "delete", remote])
- m.execute(["ostree", "remote", "add", remote,
- "http://127.0.0.1:12345", "--no-gpg-verify"])
- m.execute("printf '\nmin-free-space-percent=0\n' >> /var/local-repo/config")
- try:
- m.execute(["rpm-ostree reload"])
- except subprocess.CalledProcessError:
- m.execute("systemctl restart rpm-ostreed")
- port = 12345
-
- return port
-
-def start_trivial_httpd(m, remote="local", location=REPO_LOCATION):
- port = ensure_remote_http_port (m, remote)
- script = "export PYTHONUNBUFFERED=1\ncd {0}\nexec python -m SimpleHTTPServer {1}".format(location, port)
- m.execute("echo '{}' > /tmp/trivial-httpd".format(script))
- m.execute("chmod +x /tmp/trivial-httpd")
- pid = m.spawn("/tmp/trivial-httpd", "trivial-httpd")
-
- m.execute(["ostree", "summary", "--repo={}".format(location), "-u"])
- m.wait_for_cockpit_running(port=port)
- return pid
-
-def stop_trivial_httpd(m, pid):
- if pid:
- m.execute(["kill", str(pid)])
-
-def generate_new_commit(m, pkg_to_remove):
- # Make one change of each type to a new rpm tree
- branch = m.execute("ostree refs --repo={0}".format(REPO_LOCATION))
-
- m.upload(["verify/files/{0}.rpm".format(k) for k in INSTALL_RPMS],
- "/home/admin/")
-
- # move /usr/etc to /etc, makes rpm installs easier
- rpm_etc = os.path.join(CHECKOUT_LOCATION, "etc")
- usr_etc = os.path.join(CHECKOUT_LOCATION, "usr", "etc")
- m.execute("mv {0} {1}".format(usr_etc, rpm_etc))
-
- # Remove a package
- rpm_args = [CHECKOUT_LOCATION, RPM_LOCATION, pkg_to_remove]
- m.execute("rpm -e --root {0} --dbpath {1} {2}".format(*rpm_args))
-
- # Install our dummy packages, dbonly
- rpm_args[-1] = ' '.join(["{0}.rpm".format(os.path.join("/home/admin", x)) \
- for x in INSTALL_RPMS])
- m.execute("rpm -U --oldpackage --root {0} --dbpath {1} --justdb {2}".format(*rpm_args))
-
- # move /etc back to /usr/etc to
- m.execute("mv {0} {1}".format(rpm_etc, usr_etc))
-
- # Upload a signing key
- m.upload(["verify/files/secring.gpg",
- "verify/files/pubring.gpg"], "/root/")
-
- commit_args = [REPO_LOCATION, branch.strip(), CHECKOUT_LOCATION, KEY_ID]
- command = "ostree commit -s cockpit-tree2 --repo {0} -b {1} --add-metadata-string version=cockpit-base.2 --tree=dir={2} --gpg-sign={3} --gpg-homedir=/root/"
- m.execute(command.format(*commit_args), timeout=600)
- m.execute(["ostree", "summary", "--repo={}".format(REPO_LOCATION), "-u"])
-
-def rhsmcertd_hack(m):
- # HACK: https://github.com/candlepin/subscription-manager/issues/1404
- m.execute("systemctl disable rhsmcertd || true")
- m.execute("systemctl stop rhsmcertd || true")
-
-
-@skipImage("No OSTree available", "centos-7", "debian-stable", "debian-testing", "fedora-27", "fedora-28", "fedora-testing", "fedora-i386", "rhel-7-5", "rhel-7-5-distropkg", "rhel-7-6", "rhel-7-6-distropkg", "rhel-x", "ubuntu-1604", "ubuntu-stable")
-class OstreeRestartCase(MachineCase):
- provision = {
- "machine1": { "address": "10.111.113.2/20", "dns": "10.111.113.2" }
- }
-
- def switch_to_packages(self, b, sel, required_classes):
- b.wait_not_visible("{0} div.packages".format(sel))
- b.wait_present('{0} ul'.format(sel))
- b.click('{0} ul li a:contains("Packages")'.format(sel))
- b.wait_visible("{0} div.packages".format(sel))
- for c in required_classes:
- b.wait_present("{0} div.packages dl.{1}".format(sel, c))
-
- def check_change_counts(self, b, sel):
- for k in ['adds', 'removes', 'updates', 'downgrades']:
- b.wait_present("{0} dd.{1}".format(sel, k))
- b.wait_text("{0} dd.{1}".format(sel, k),
- "1 package")
-
- def check_sig(self, b, sel):
- b.wait_not_visible("{0} div.signatures".format(sel))
- b.wait_present('{0} ul'.format(sel))
- b.click('{0} ul li a:contains("Signature")'.format(sel))
- b.wait_visible("{0} div.signatures".format(sel))
- b.wait_in_text("{0} div.signatures".format(sel), KEY_ID)
- b.wait_in_text("{0} div.signatures".format(sel), "RSA")
- b.wait_in_text("{0} div.signatures".format(sel), "Cockpit Tester ")
- b.wait_in_text("{0} div.signatures".format(sel), "Good Signature")
- b.wait_in_text("{0} div.signatures".format(sel), "When")
-
- def testOstree(self):
- b = self.browser
- m = self.machine
-
- # Delete local remote so we start clean, without a file based remote
- ensure_remote_http_port (m)
-
- docker_pkg = m.execute("rpm -qa | grep cockpit-docker").strip()
-
- rhsmcertd_hack(m)
-
- cockpit_shell = m.execute("rpm -qa | grep cockpit-ostree").strip()
- cockpit_machines = m.execute("rpm -qa | grep cockpit-machines | grep -v cockpit-machines-ovirt").strip()
-
- self.login_and_go("/updates")
- b.enter_page("/updates")
-
- name = get_os_name(m)
-
- # Check current and rollback target
- b.wait_present('table.listing-ct')
- b.wait_present('table.listing-ct tbody')
- b.wait_text('table.listing-ct tbody:nth-child(3) div.listing-ct-head h3', name + " cockpit-base.1")
- b.wait_present('table.listing-ct tbody:nth-child(3) i.fa-check-circle-o')
- b.wait_present('table.listing-ct tbody:nth-child(3).active')
- b.wait_in_text('table.listing-ct tbody:nth-child(3) div.listing-ct-status', "Running")
- b.wait_not_present("table.listing-ct tbody:nth-child(3) div.listing-ct-actions button")
-
- b.wait_visible("table.listing-ct tbody:nth-child(3) div.tree")
- b.wait_in_text("table.listing-ct tbody:nth-child(3) dd.os", name)
- b.wait_in_text("table.listing-ct tbody:nth-child(3) dd.version", "cockpit-base.1")
- self.switch_to_packages(b, "table.listing-ct tbody:nth-child(3)",
- ['rpms-col1', 'rpms-col2'])
- b.wait_in_text("table.listing-ct tbody:nth-child(3) div.packages", docker_pkg)
- for pkg in INSTALL_RPMS:
- b.wait_not_in_text("table.listing-ct tbody:nth-child(3) div.packages", pkg)
-
- b.wait_not_visible("table.listing-ct tbody:nth-child(3) div.signatures")
- b.wait_present('table.listing-ct tbody:nth-child(3) ul')
- b.click('table.listing-ct tbody:nth-child(3) ul li a:contains("Signature")')
- b.wait_visible("table.listing-ct tbody:nth-child(3) div.signatures")
- b.wait_in_text("table.listing-ct tbody:nth-child(3) div.signatures", "No signature avaliable")
-
- # Require signatures
- m.execute("sed -i /gpg-verify/d /etc/ostree/remotes.d/local.conf")
- # HACK: rpm-ostree doesn't reload remote settings properly
- # https://github.com/projectatomic/rpm-ostree/issues/401
- m.execute("systemctl restart rpm-ostreed")
-
- b.wait_not_in_text('table.listing-ct tbody:nth-child(4) div.listing-ct-head h3', "cockpit")
- b.wait_present('table.listing-ct tbody:nth-child(4) i.fa-circle')
- b.wait_in_text('table.listing-ct tbody:nth-child(4) div.listing-ct-status', "Available")
- b.wait_in_text("table.listing-ct tbody:nth-child(4) div.listing-ct-actions button", "Roll Back")
- b.wait_in_text("table.listing-ct tbody:nth-child(4) dd.os", name)
- b.wait_visible("table.listing-ct tbody:nth-child(4) div.tree")
- b.wait_not_visible("table.listing-ct tbody:nth-child(4) div.packages")
-
- # Check for new commit, get error
- b.wait_present('table.listing-ct tbody:nth-child(2) i.fa-caret-up')
- b.wait_in_text("table.listing-ct tbody:nth-child(2) div.listing-ct-actions button", "Check for Updates")
- b.wait_not_present('table.listing-ct tbody:nth-child(2) div.alert-warning')
- b.click("table.listing-ct tbody:nth-child(2) div.listing-ct-actions button")
- b.wait_present('table.listing-ct tbody:nth-child(2) div.alert-warning')
- b.wait_present("table.listing-ct tbody:nth-child(2) div.listing-ct-actions button.enabled")
-
- # Serve repo
- server_pid = start_trivial_httpd(m)
-
- # Check for new commit
- b.click("table.listing-ct tbody:nth-child(2) div.listing-ct-actions button")
- b.wait_present("table.listing-ct tbody:nth-child(2) div.listing-ct-actions button.disabled")
- b.wait_present("table.listing-ct tbody:nth-child(2) div.listing-ct-actions button.enabled")
-
- # Generate new commit
- generate_new_commit(m, docker_pkg)
-
- # Check again not trusted
- b.click("table.listing-ct tbody:nth-child(2) div.listing-ct-actions button")
- b.wait_present('table.listing-ct tbody:nth-child(2) div.alert-warning')
- b.wait_present("table.listing-ct tbody:nth-child(2) div.listing-ct-actions button.enabled")
- b.wait_in_text("table.listing-ct tbody:nth-child(2) div.alert-warning", "trusted keyring")
-
- m.upload(["verify/files/publickey.asc"], "/root/")
- m.execute("ostree remote gpg-import local -k /root/publickey.asc")
-
- # Check again have update data
- b.click("table.listing-ct tbody:nth-child(2) div.listing-ct-actions button")
- b.wait_present('table.listing-ct tbody:nth-child(3) i.fa-circle')
- b.wait_in_text('table.listing-ct tbody:nth-child(3) div.listing-ct-status', "Available")
- b.wait_in_text("table.listing-ct tbody:nth-child(3) div.listing-ct-actions button", "Update")
- b.wait_present('table.listing-ct tbody:nth-child(4) i.fa-check-circle-o')
-
- # Check update data
- b.wait_visible("table.listing-ct tbody:nth-child(3) div.tree")
- b.wait_in_text("table.listing-ct tbody:nth-child(3) dd.os", name)
- b.wait_in_text("table.listing-ct tbody:nth-child(3) dd.version", "cockpit-base.2")
- self.check_change_counts(b, "table.listing-ct tbody:nth-child(3)")
-
- self.switch_to_packages(b, "table.listing-ct tbody:nth-child(3)",
- ['upgrades', 'downgrades',
- 'additions', 'removals'])
-
- b.wait_text("table.listing-ct tbody:nth-child(3) dl.upgrades dd", "cockpit-machines-99999-2.noarch")
- b.wait_text("table.listing-ct tbody:nth-child(3) dl.downgrades dd", "cockpit-ostree-wip-0.1.noarch")
- b.wait_text("table.listing-ct tbody:nth-child(3) dl.additions dd", "empty-1-0.noarch")
- b.wait_text("table.listing-ct tbody:nth-child(3) dl.removals dd", docker_pkg)
-
- # Check signatures
- self.check_sig (b, "table.listing-ct tbody:nth-child(3)")
-
- # Force an error
- stop_trivial_httpd(m, server_pid)
- b.wait_not_present('table.listing-ct tbody:nth-child(3) div.listing-ct-error')
- b.click("table.listing-ct tbody:nth-child(3) div.listing-ct-actions button")
- b.wait_present("table.listing-ct tbody:nth-child(3) div.listing-ct-actions button.disabled")
- b.wait_present("table.listing-ct tbody:nth-child(3) div.listing-ct-actions button.enabled")
- b.wait_present('table.listing-ct tbody:nth-child(3) div.listing-ct-error')
- server_pid = start_trivial_httpd(m)
-
- # Apply update
- b.click("table.listing-ct tbody:nth-child(3) div.listing-ct-actions button")
- b.wait_present("table.listing-ct tbody:nth-child(3) div.ostree-progress")
- b.wait_not_present('table.listing-ct tbody:nth-child(3) div.listing-ct-error')
-
- b.switch_to_top()
- with b.wait_timeout(120):
- b.wait_visible(".curtains-ct")
-
- b.wait_in_text(".curtains-ct h1", "Disconnected")
- m.wait_reboot()
- m.start_cockpit()
- b.reload()
- b.login_and_go("/updates")
-
- # After reboot, check commit
- b.wait_present('table.listing-ct')
- b.wait_present('table.listing-ct tbody')
- b.wait_text('table.listing-ct tbody:nth-child(3) div.listing-ct-head h3', name + " cockpit-base.2")
- b.wait_present('table.listing-ct tbody:nth-child(3) i.fa-check-circle-o')
- b.wait_present('table.listing-ct tbody:nth-child(3) div.listing-ct-panel,active')
- b.wait_in_text('table.listing-ct tbody:nth-child(3) div.listing-ct-status', "Running")
- b.wait_not_present("table.listing-ct tbody:nth-child(3) div.listing-ct-actions button")
- self.switch_to_packages(b, "table.listing-ct tbody:nth-child(3)",
- ['rpms-col1', 'rpms-col2'])
- b.wait_not_in_text("table.listing-ct tbody:nth-child(3) div.packages", docker_pkg)
- for pkg in INSTALL_RPMS:
- b.wait_in_text("table.listing-ct tbody:nth-child(3) div.packages", pkg)
-
- # Check signatures
- self.check_sig (b, "table.listing-ct tbody:nth-child(3)")
-
- # Check rollback target
- b.wait_text('table.listing-ct tbody:nth-child(4) div.listing-ct-head h3', name + " cockpit-base.1")
- b.wait_present('table.listing-ct tbody:nth-child(4) i.fa-circle')
- b.wait_in_text('table.listing-ct tbody:nth-child(4) div.listing-ct-status', "Available")
- b.wait_in_text("table.listing-ct tbody:nth-child(4) div.listing-ct-actions button", "Roll Back")
- b.wait_in_text("table.listing-ct tbody:nth-child(4) dd.os", name)
- self.check_change_counts(b, "table.listing-ct tbody:nth-child(4)")
- self.switch_to_packages(b, "table.listing-ct tbody:nth-child(4)",
- ['upgrades', 'downgrades',
- 'additions', 'removals'])
-
- b.wait_text("table.listing-ct tbody:nth-child(4) dl.upgrades dd", cockpit_shell)
- b.wait_text("table.listing-ct tbody:nth-child(4) dl.downgrades dd", cockpit_machines)
- b.wait_text("table.listing-ct tbody:nth-child(4) dl.additions dd", docker_pkg)
- b.wait_text("table.listing-ct tbody:nth-child(4) dl.removals dd", "empty-1-0.noarch")
-
- # Rollback
- b.wait_present("button:contains('Roll Back')");
- b.click("table.listing-ct tbody:nth-child(4) div.listing-ct-actions button")
- b.wait_present("table.listing-ct tbody:nth-child(4) div.ostree-progress")
-
- b.switch_to_top()
- with b.wait_timeout(120):
- b.wait_visible(".curtains-ct")
-
- b.wait_in_text(".curtains-ct h1", "Disconnected")
- m.wait_reboot()
- m.start_cockpit()
- b.reload()
- b.login_and_go("/updates")
- b.wait_present('table.listing-ct')
- b.wait_present('table.listing-ct tbody')
-
- if m.image in ["rhel-atomic", "fedora-atomic"]:
- # newer rpm-ostree flips back and forth between the two latest releases with rollback
- b.wait_present('table.listing-ct tbody:nth-child(3) i.fa-check-circle-o')
- b.wait_text('table.listing-ct tbody:nth-child(3) div.listing-ct-head h3', name + " cockpit-base.1")
- b.wait_in_text("table.listing-ct tbody:nth-child(3) div.listing-ct-head", "Running")
-
- b.wait_present('table.listing-ct tbody:nth-child(4) i.fa-circle')
- b.wait_text('table.listing-ct tbody:nth-child(4) div.listing-ct-head h3', name + " cockpit-base.2")
- b.wait_present("table.listing-ct tbody:nth-child(4) div.listing-ct-head button")
- b.wait_in_text("table.listing-ct tbody:nth-child(4) div.listing-ct-head button", "Roll Back")
- else:
- # older rpm-ostree doesn't "roll back" forwards to the current release, it appears as regular update
- b.wait_present('table.listing-ct tbody:nth-child(3) i.fa-circle')
- b.wait_text('table.listing-ct tbody:nth-child(3) div.listing-ct-head h3', name + " cockpit-base.2")
- b.wait_in_text("table.listing-ct tbody:nth-child(3) div.listing-ct-actions button", "Update")
-
- b.wait_present('table.listing-ct tbody:nth-child(4) i.fa-check-circle-o')
- b.wait_text('table.listing-ct tbody:nth-child(4) div.listing-ct-head h3', name + " cockpit-base.1")
- b.wait_not_present("button:contains('Roll Back')");
-
- b.wait_not_present('table.listing-ct tbody:nth-child(5)')
-
- self.allow_restart_journal_messages()
-
- def testRebase(self):
- m = self.machine
- b = self.browser
-
- name = get_os_name(m)
-
- start_trivial_httpd(m)
- branch = m.execute("ostree refs --repo={0}".format(REPO_LOCATION)).strip()
-
- # Add a new branch to the default repo
- m.execute(["ostree", "commit", "--repo={}".format(REPO_LOCATION),
- "-b", "znew-branch", "--tree=ref={}".format(branch),
- "--add-metadata-string", "version=branch-version"], timeout=600)
- m.execute(["ostree", "summary", "--repo={}".format(REPO_LOCATION), "-u"])
-
- rhsmcertd_hack(m)
- self.login_and_go("/updates")
- b.enter_page("/updates")
-
- b.wait_present('table.listing-ct tbody:nth-child(2) i.fa-caret-up')
- b.wait_present('#change-repo')
- b.wait_text("#change-repo", "local")
- b.wait_present("#change-branch")
- b.wait_in_text("#change-branch", branch)
- b.wait_present("table.listing-ct tbody:nth-child(2) ul.dropdown-menu")
- b.wait_present("table.listing-ct tbody:nth-child(2) ul.dropdown-menu li")
- b.wait_not_present("table.listing-ct tbody:nth-child(2) ul.dropdown-menu li div.alert")
- b.wait_in_text("table.listing-ct tbody:nth-child(2) ul.dropdown-menu li:last", "znew-branch")
- b.call_js_func("ph_count_check", "table.listing-ct tbody:nth-child(2) ul.dropdown-menu li", 2)
- b.click("#change-branch")
- b.click("table.listing-ct tbody:nth-child(2) ul.dropdown-menu li:last a")
- b.wait_text('table.listing-ct tbody:nth-child(3) div.listing-ct-head h3', name + " cockpit-base.1")
- b.wait_present('table.listing-ct tbody:nth-child(3) i.fa-check-circle-o')
- b.wait_in_text("table.listing-ct tbody:nth-child(3) dd.origin", "local:{}".format(branch))
-
- b.wait_in_text("table.listing-ct tbody:nth-child(2) div.listing-ct-actions button", "Check for Updates")
- b.click("table.listing-ct tbody:nth-child(2) div.listing-ct-actions button")
- b.wait_present("table.listing-ct tbody:nth-child(2) div.listing-ct-actions button.enabled")
-
- b.wait_text('table.listing-ct tbody:nth-child(3) div.listing-ct-head h3', name + " branch-version")
- b.wait_present('table.listing-ct tbody:nth-child(3) i.fa-circle')
- b.wait_in_text('table.listing-ct tbody:nth-child(3) div.listing-ct-status', "Available")
- b.wait_in_text("table.listing-ct tbody:nth-child(3) div.listing-ct-actions button", "Rebase")
- b.wait_in_text("table.listing-ct tbody:nth-child(3) dd.os", name)
- b.wait_in_text("table.listing-ct tbody:nth-child(3) dd.origin", "local:znew-branch")
-
- b.wait_not_visible("table.listing-ct tbody:nth-child(3) div.packages")
- b.wait_present('table.listing-ct tbody:nth-child(3) ul')
- b.click('table.listing-ct tbody:nth-child(3) ul li a:contains("Packages")')
- b.wait_visible("table.listing-ct tbody:nth-child(3) div.packages")
- b.wait_in_text("table.listing-ct tbody:nth-child(3) div.packages", "contains the same packages as your currently booted")
-
- # Apply update
- b.wait_present("table.listing-ct tbody:nth-child(3) div.listing-ct-actions button") # wait to be rendered
- b.wait_not_present("table.listing-ct tbody:nth-child(3) div.listing-ct-actions button.disabled") # and enabled
- b.click("table.listing-ct tbody:nth-child(3) div.listing-ct-actions button")
- b.wait_present("table.listing-ct tbody:nth-child(3) div.ostree-progress")
- b.wait_not_present('table.listing-ct tbody:nth-child(3) div.listing-ct-error')
-
- b.switch_to_top()
- with b.wait_timeout(120):
- b.wait_visible(".curtains-ct")
-
- b.wait_in_text(".curtains-ct h1", "Disconnected")
- m.wait_reboot()
- m.start_cockpit()
- b.reload()
- b.login_and_go("/updates")
-
- # After reboot, check commit
- b.wait_present('table.listing-ct')
- b.wait_present('table.listing-ct tbody')
- b.wait_text('table.listing-ct tbody:nth-child(3) div.listing-ct-head h3', name + " branch-version")
- b.wait_present('table.listing-ct tbody:nth-child(3) i.fa-check-circle-o')
- b.wait_present('table.listing-ct tbody:nth-child(3) div.listing-ct-panel,active')
- b.wait_in_text("table.listing-ct tbody:nth-child(3) dd.origin", "local:znew-branch")
-
- self.allow_restart_journal_messages()
-
-@skipImage("No OSTree available", "centos-7", "debian-stable", "debian-testing", "fedora-27", "fedora-28", "fedora-testing", "fedora-i386", "rhel-7-5", "rhel-7-5-distropkg", "rhel-7-6", "rhel-7-6-distropkg", "rhel-x", "ubuntu-1604", "ubuntu-stable")
-class OstreeCase(MachineCase):
- provision = {
- "machine1": { "address": "10.111.113.2/20", "dns": "10.111.113.2" }
- }
-
- def testRemoteManagement(self):
- m = self.machine
- b = self.browser
-
- name = get_os_name(m)
-
- start_trivial_httpd(m)
- branch = m.execute("ostree refs --repo={0}".format(REPO_LOCATION)).strip()
-
- rhsmcertd_hack(m)
- self.login_and_go("/updates")
- b.enter_page("/updates")
-
- b.wait_present('table.listing-ct tbody:nth-child(2) i.fa-caret-up')
- b.wait_not_present('table.listing-ct tbody:nth-child(2) div.alert-warning')
- b.wait_present("#change-branch")
- b.wait_in_text("#change-branch", branch)
- b.wait_present("table.listing-ct tbody:nth-child(2) ul.dropdown-menu")
- b.wait_present("table.listing-ct tbody:nth-child(2) ul.dropdown-menu li")
- b.wait_not_present("table.listing-ct tbody:nth-child(2) ul.dropdown-menu li div.alert")
- b.call_js_func("ph_count_check", "table.listing-ct tbody:nth-child(2) ul.dropdown-menu li", 1)
- b.wait_in_text("table.listing-ct tbody:nth-child(2) ul.dropdown-menu li", branch)
- b.wait_present('#change-repo')
- b.wait_text("#change-repo", "local")
- b.click("#change-repo")
-
- b.wait_present("modal-dialog")
- b.wait_in_text("modal-dialog .modal-title", "Change Repository")
- b.wait_present("modal-dialog .modal-body .list-group")
- b.wait_in_text("modal-dialog .modal-body .list-group .active", "local")
- b.wait_in_text("modal-dialog .modal-body .list-group-item:last", "Add New Repository")
-
- b.wait_present("modal-dialog .modal-footer button.btn-primary")
-
- b.click("modal-dialog .modal-body .list-group-item:last")
- b.wait_present("modal-dialog .modal-footer button.disabled")
- b.wait_present("modal-dialog #remote-name")
- b.wait_present("modal-dialog #remote-url")
- b.wait_present("modal-dialog #gpg-verify")
- b.click("modal-dialog #gpg-verify")
- b.set_val("modal-dialog #remote-url", "http://localhost:12344")
- b.set_val("modal-dialog #remote-name", "zremote test")
- b.wait_present("modal-dialog .group-buttons button.btn-primary")
- b.wait_in_text("modal-dialog .group-buttons button.btn-primary", "Add")
- b.click("modal-dialog .group-buttons button.btn-primary")
- b.wait_present("modal-dialog .list-group-item:last div.dialog-error")
- b.set_val("modal-dialog #remote-name", "zremote-test1")
- b.click("modal-dialog .group-buttons button.btn-primary")
-
- b.wait_not_present ("modal-dialog #remote-name")
- b.wait_not_present ("modal-dialog .group-buttons")
- b.wait_not_present("modal-dialog .modal-footer button.disabled")
- b.wait_present("modal-dialog .modal-footer button.btn-primary")
- b.wait_in_text("modal-dialog .modal-body .list-group .active", "local")
- b.wait_present("modal-dialog .modal-body .list-group-item:contains('zremote-test1')")
- b.wait_in_text("modal-dialog .modal-body .list-group-item:last", "Add New Repository")
- b.click("modal-dialog .modal-body .list-group-item:contains('zremote-test1')")
-
- b.click("modal-dialog .modal-footer button.btn-primary")
- b.wait_not_present("modal-dialog")
-
- b.wait_present('#change-repo')
- b.wait_text("#change-repo", "zremote-test1")
- # Branch is still default
- b.wait_present("#change-branch")
- b.wait_in_text("#change-branch", branch)
- # But can't list
- b.click("#change-branch")
- b.wait_present("table.listing-ct tbody:nth-child(2) ul.dropdown-menu")
- b.wait_present("table.listing-ct tbody:nth-child(2) ul.dropdown-menu div.alert")
- # Actual error message changes between versions
- b.wait_present("table.listing-ct tbody:nth-child(2) ul.dropdown-menu div.alert span.pficon-warning-triangle-o")
-
- # Config created
- self.assertEqual(m.execute("cat /etc/ostree/remotes.d/zremote-test1.conf").strip(),
- '[remote "zremote-test1"]\nurl=http://localhost:12344\ngpg-verify=true')
- # No custom keyring
- self.assertFalse(m.execute("ls /sysroot/ostree/repo/zremote-test1.trustedkeys.gpg || true"))
-
- # Refresh goes back to default
- b.reload()
- b.enter_page("/updates")
- b.wait_present('table.listing-ct tbody:nth-child(2) i.fa-caret-up')
- b.wait_present('#change-repo')
- b.wait_text("#change-repo", "local")
- b.wait_present("#change-branch")
- b.wait_in_text("#change-branch", branch)
- b.wait_present("table.listing-ct tbody:nth-child(2) ul.dropdown-menu")
- b.wait_present("table.listing-ct tbody:nth-child(2) ul.dropdown-menu li")
- b.wait_not_present("table.listing-ct tbody:nth-child(2) ul.dropdown-menu div.alert")
-
- # Create a new remote with commits, just use the rpm dir
- zrepo = "/var/zrepo"
- m.execute("mkdir -p {}".format(zrepo))
- m.execute("mkdir -p /tmp/rpm-data/usr/share")
- m.execute("cp -r /usr/share/rpm /tmp/rpm-data/usr/share/")
- m.execute(["ostree", "init", "--repo", zrepo, "--mode", "archive-z2"])
- m.execute(["ostree", "commit", "--repo={}".format(zrepo),
- "-b", "zremote-branch1", "--orphan", "--tree=dir=/tmp/rpm-data",
- "--add-metadata-string", "version=zremote-branch1.1"], timeout=600)
- m.execute(["ostree", "commit", "--repo={}".format(zrepo),
- "-b", "zremote-branch2", "--orphan", "--tree=dir=/tmp/rpm-data",
- "--add-metadata-string", "version=zremote-branch2.1"], timeout=600)
- start_trivial_httpd(m, remote="zremote-test1", location=zrepo)
-
- # Add a new branch to the default repo
- m.execute(["ostree", "commit", "--repo={}".format(REPO_LOCATION),
- "-b", branch, "--tree=ref={}".format(branch),
- "--add-metadata-string", "version=bad-version"], timeout=600)
- m.execute(["ostree", "summary", "--repo={}".format(REPO_LOCATION), "-u"])
-
- # Edit
- b.wait_present('#change-repo')
- b.click("#change-repo")
- b.wait_present("modal-dialog")
- b.wait_present("modal-dialog .modal-body .list-group")
- b.wait_present("modal-dialog .modal-body .list-group-item:contains('zremote-test1')")
- b.wait_present("modal-dialog .modal-body .list-group-item:contains('zremote-test1') .listing-ct-actions button.pficon-edit")
- b.click("modal-dialog .modal-body .list-group-item:contains('zremote-test1') .listing-ct-actions button.pficon-edit")
- b.wait_present("modal-dialog .group-buttons")
- b.wait_present("modal-dialog .modal-footer button.disabled")
- b.wait_present("modal-dialog .group-buttons button.btn-primary")
- b.wait_in_text("modal-dialog .group-buttons", "zremote-test1")
- b.wait_present("modal-dialog .form-table-ct")
- b.wait_in_text("modal-dialog .form-table-ct", "http://localhost:12344")
- b.wait_present("modal-dialog .form-table-ct #gpg-verify:checked")
- b.wait_not_present("modal-dialog #gpg-data")
- b.wait_present("modal-dialog .form-table-ct button.btn-default")
- b.click("modal-dialog .form-table-ct button.btn-default")
- b.wait_present("modal-dialog #gpg-data")
- b.wait_not_present("modal-dialog .form-table-ct button.btn-default")
- b.set_val("modal-dialog #gpg-data", "bad")
- b.click("modal-dialog .group-buttons button.btn-primary")
- b.wait_present("modal-dialog .group-buttons div.dialog-error")
-
- with open(os.path.join(TEST_DIR, "verify", "files", "publickey.asc"), 'r') as fp:
- gpg_data = fp.read()
-
- b.set_val("modal-dialog #gpg-data", gpg_data)
- b.click("modal-dialog .group-buttons button.btn-primary")
- b.wait_not_present ("modal-dialog .group-buttons")
- b.wait_not_present("modal-dialog .form-table-ct")
- b.wait_not_present("modal-dialog .modal-footer button.disabled")
- m.execute("ls /sysroot/ostree/repo/zremote-test1.trustedkeys.gpg")
-
- b.wait_present("modal-dialog .modal-body .list-group-item:contains('zremote-test1') .listing-ct-actions button.pficon-edit")
- b.click("modal-dialog .modal-body .list-group-item:contains('zremote-test1') .listing-ct-actions button.pficon-edit")
- b.wait_present("modal-dialog .group-buttons")
- b.wait_present("modal-dialog .modal-footer button.disabled")
- b.wait_present("modal-dialog .group-buttons button.btn-primary")
- b.wait_present("modal-dialog .form-table-ct")
- b.wait_in_text("modal-dialog .form-table-ct", "http://localhost:12344")
- b.wait_present("modal-dialog .form-table-ct button.btn-default")
- b.wait_present("modal-dialog .form-table-ct #gpg-verify:checked")
- b.click("modal-dialog .form-table-ct #gpg-verify")
- b.click("modal-dialog .group-buttons button.btn-primary")
- b.wait_not_present("modal-dialog .form-table-ct")
- b.wait_not_present ("modal-dialog .group-buttons")
- b.wait_not_present("modal-dialog .modal-footer button.disabled")
- b.click("modal-dialog .modal-body .list-group-item:contains('zremote-test1')")
- b.click("modal-dialog .modal-footer button.btn-primary")
- b.wait_not_present("modal-dialog")
-
- b.wait_present('#change-repo')
- b.wait_text("#change-repo", "zremote-test1")
- b.wait_present("#change-branch")
- b.wait_in_text("#change-branch", "zremote-branch1")
- b.wait_present("table.listing-ct tbody:nth-child(2) ul.dropdown-menu")
- b.wait_present("table.listing-ct tbody:nth-child(2) ul.dropdown-menu li")
- b.wait_not_present("table.listing-ct tbody:nth-child(2) ul.dropdown-menu div.alert")
- b.wait_in_text("table.listing-ct tbody:nth-child(2) ul.dropdown-menu li:first", "zremote-branch1")
- b.wait_in_text("table.listing-ct tbody:nth-child(2) ul.dropdown-menu li:last", "zremote-branch2")
- b.call_js_func("ph_count_check", "table.listing-ct tbody:nth-child(2) ul.dropdown-menu li", 2)
-
- self.assertEqual(m.execute("cat /etc/ostree/remotes.d/zremote-test1.conf").strip(),
- '[remote "zremote-test1"]\nurl=http://localhost:12344\ngpg-verify = false')
-
- # Check updates display
- b.wait_present("table.listing-ct tbody:nth-child(3)")
- b.wait_text('table.listing-ct tbody:nth-child(3) div.listing-ct-head h3', name + " cockpit-base.1")
- b.wait_present('table.listing-ct tbody:nth-child(3) i.fa-check-circle-o')
- b.wait_in_text("table.listing-ct tbody:nth-child(3) dd.origin", "local:{}".format(branch))
-
-
- b.wait_in_text("table.listing-ct tbody:nth-child(2) div.listing-ct-actions button", "Check for Updates")
- b.click("table.listing-ct tbody:nth-child(2) div.listing-ct-actions button")
- b.wait_present("table.listing-ct tbody:nth-child(2) div.listing-ct-actions button.enabled")
-
- b.wait_text('table.listing-ct tbody:nth-child(3) div.listing-ct-head h3', name + " zremote-branch1.1")
- b.wait_present('table.listing-ct tbody:nth-child(3) i.fa-circle')
- b.wait_in_text('table.listing-ct tbody:nth-child(3) div.listing-ct-status', "Available")
- b.wait_in_text("table.listing-ct tbody:nth-child(3) div.listing-ct-actions button", "Rebase")
- b.wait_in_text("table.listing-ct tbody:nth-child(3) dd.os", name)
- b.wait_in_text("table.listing-ct tbody:nth-child(3) dd.origin", "zremote-test1:zremote-branch1")
-
- b.wait_not_visible("table.listing-ct tbody:nth-child(3) div.packages")
- b.wait_present('table.listing-ct tbody:nth-child(3) ul')
- b.click('table.listing-ct tbody:nth-child(3) ul li a:contains("Packages")')
- b.wait_visible("table.listing-ct tbody:nth-child(3) div.packages")
- b.wait_in_text("table.listing-ct tbody:nth-child(3) div.packages", "contains the same packages as your currently booted")
-
- # Switching branch hides other
- b.click("#change-branch")
- b.wait_visible("table.listing-ct tbody:nth-child(2) ul.dropdown-menu")
- b.wait_in_text("table.listing-ct tbody:nth-child(2) ul.dropdown-menu li:last", "zremote-branch2")
- b.click("table.listing-ct tbody:nth-child(2) ul.dropdown-menu li:last a")
- b.wait_text('table.listing-ct tbody:nth-child(3) div.listing-ct-head h3', name + " cockpit-base.1")
- b.wait_present('table.listing-ct tbody:nth-child(3) i.fa-check-circle-o')
-
- # Switching back shows pulled
- b.wait_present('#change-branch')
- b.click("#change-branch")
- b.wait_visible("table.listing-ct tbody:nth-child(2) ul.dropdown-menu")
- b.wait_in_text("table.listing-ct tbody:nth-child(2) ul.dropdown-menu li:first", "zremote-branch1")
- b.click("table.listing-ct tbody:nth-child(2) ul.dropdown-menu li:first a")
- b.wait_text('table.listing-ct tbody:nth-child(3) div.listing-ct-head h3', name + " zremote-branch1.1")
- b.wait_present('table.listing-ct tbody:nth-child(3) i.fa-circle')
-
- # Refresh, back to local, pull in update
- b.reload()
- b.enter_page("/updates")
- b.wait_present('table.listing-ct tbody:nth-child(2) i.fa-caret-up')
- b.wait_present("#change-branch")
- b.wait_in_text("#change-branch", branch)
- b.wait_in_text("table.listing-ct tbody:nth-child(2) div.listing-ct-actions button", "Check for Updates")
- b.click("table.listing-ct tbody:nth-child(2) div.listing-ct-actions button")
- b.wait_present("table.listing-ct tbody:nth-child(2) div.listing-ct-actions button.enabled")
- b.wait_text('table.listing-ct tbody:nth-child(3) div.listing-ct-head h3', name + " bad-version")
- b.wait_present('table.listing-ct tbody:nth-child(3) i.fa-circle')
-
- # Switching to branch shows pulled
- b.wait_present('#change-repo')
- b.wait_text("#change-repo", "local")
- b.click("#change-repo")
- b.wait_present("modal-dialog")
- b.wait_present("modal-dialog .modal-body .list-group")
- b.wait_in_text("modal-dialog .modal-body .list-group-item:contains('zremote-test1')", "zremote-test1")
- b.click("modal-dialog .modal-body .list-group-item:contains('zremote-test1')")
- b.click("modal-dialog .modal-footer button.btn-primary")
- b.wait_not_present("modal-dialog")
-
- b.wait_present('#change-repo')
- b.wait_text("#change-repo", "zremote-test1")
- b.wait_present("#change-branch")
- b.wait_in_text("#change-branch", "zremote-branch1")
- b.wait_text('table.listing-ct tbody:nth-child(3) div.listing-ct-head h3', name + " zremote-branch1.1")
- b.wait_present('table.listing-ct tbody:nth-child(3) i.fa-circle')
- b.wait_not_in_text('table.listing-ct', name + " bad-version")
-
- # delete
- b.wait_present('#change-repo')
- b.click("#change-repo")
- b.wait_present("modal-dialog")
- b.wait_present("modal-dialog .modal-body .list-group")
- b.wait_in_text("modal-dialog .modal-body .list-group-item:contains('zremote-test1')", "zremote-test1")
- b.wait_present("modal-dialog .modal-body .list-group-item:contains('zremote-test1') .listing-ct-actions button.pficon-edit")
- b.click("modal-dialog .modal-body .list-group-item:contains('zremote-test1') .listing-ct-actions button.pficon-edit")
- b.wait_present("modal-dialog .group-buttons")
- b.wait_present("modal-dialog .group-buttons button.btn-danger")
- b.wait_present("modal-dialog .modal-footer button.disabled")
- b.wait_present("modal-dialog .form-table-ct")
- b.wait_in_text("modal-dialog .form-table-ct", "http://localhost:12344")
- b.wait_present("#gpg-verify")
- b.wait_present("modal-dialog .form-table-ct #gpg-verify:not(:checked)")
- b.click("modal-dialog .group-buttons button.btn-danger")
- b.wait_not_present("modal-dialog .form-table-ct")
- b.wait_not_present("modal-dialog .group-buttons")
-
- b.wait_present("modal-dialog .modal-body .list-group")
- b.wait_not_in_text("modal-dialog .modal-body .list-group", "zremote-test1")
- b.wait_in_text("modal-dialog .modal-body .list-group", "local")
- b.wait_not_present("modal-dialog .modal-body .list-group .active")
- b.wait_present("modal-dialog .modal-footer button.disabled")
- b.click("modal-dialog .modal-body .list-group-item:contains('local')")
- b.wait_present("modal-dialog .modal-body .list-group .active")
- b.click("modal-dialog .modal-footer button.btn-primary")
- b.wait_not_present("modal-dialog")
- b.wait_present('#change-repo')
- b.wait_text("#change-repo", "local")
- b.wait_present("#change-branch")
- b.wait_in_text("#change-branch", branch)
- b.wait_present("table.listing-ct tbody:nth-child(2) ul.dropdown-menu")
- b.wait_present("table.listing-ct tbody:nth-child(2) ul.dropdown-menu li")
- b.wait_not_present("table.listing-ct tbody:nth-child(2) ul.dropdown-menu li div.alert")
- b.call_js_func("ph_count_check", "table.listing-ct tbody:nth-child(2) ul.dropdown-menu li", 1)
- b.wait_text('table.listing-ct tbody:nth-child(3) div.listing-ct-head h3', name + " bad-version")
- b.wait_present('table.listing-ct tbody:nth-child(3) i.fa-circle')
- b.wait_in_text("table.listing-ct tbody:nth-child(3) dd.origin", "local:{}".format(branch))
-
- def testPermission(self):
- m = self.machine
- b = self.browser
-
- rhsmcertd_hack(m)
-
- # Create a user
- m.execute("useradd user -c 'User' || true")
- m.execute("echo foobar | passwd --stdin user")
-
- # login
- m.start_cockpit()
- b.open("/updates")
- b.wait_visible("#login")
- b.set_val("#login-user-input", "user")
- b.set_val("#login-password-input", "foobar")
- b.click('#login-button')
- b.expect_load()
-
- b.enter_page("/updates")
-
- b.wait_present(".curtains-ct")
- b.wait_in_text(".curtains-ct", "Not authorized")
- self.assertIn("Reconnect", b.text(".blank-slate-pf-main-action button"))
- self.allow_authorize_journal_messages()
-
-if __name__ == "__main__":
- test_main()
diff --git a/test/verify/files/cockpit-machines-99999-2.noarch.rpm b/test/verify/files/cockpit-machines-99999-2.noarch.rpm
deleted file mode 100644
index 966875d43ff..00000000000
Binary files a/test/verify/files/cockpit-machines-99999-2.noarch.rpm and /dev/null differ
diff --git a/test/verify/files/cockpit-machines.spec b/test/verify/files/cockpit-machines.spec
deleted file mode 100644
index 577edf3f588..00000000000
--- a/test/verify/files/cockpit-machines.spec
+++ /dev/null
@@ -1,10 +0,0 @@
-Summary: Empty Cockpit Machines
-Name: cockpit-machines
-Version: 99999
-Release: 2
-License: Public
-Group: Applications/System
-BuildArch: noarch
-%description
-Empty cockpit-machines RPM
-%files
diff --git a/test/verify/files/cockpit-ostree-wip-0.1.noarch.rpm b/test/verify/files/cockpit-ostree-wip-0.1.noarch.rpm
deleted file mode 100644
index 154bcf1354e..00000000000
Binary files a/test/verify/files/cockpit-ostree-wip-0.1.noarch.rpm and /dev/null differ
diff --git a/test/verify/files/empty-1-0.noarch.rpm b/test/verify/files/empty-1-0.noarch.rpm
deleted file mode 100644
index e6a4081f73c..00000000000
Binary files a/test/verify/files/empty-1-0.noarch.rpm and /dev/null differ
diff --git a/test/verify/files/pubring.gpg b/test/verify/files/pubring.gpg
deleted file mode 100644
index 4d14e2e9a69..00000000000
Binary files a/test/verify/files/pubring.gpg and /dev/null differ
diff --git a/test/verify/files/secring.gpg b/test/verify/files/secring.gpg
deleted file mode 100644
index 56e227da1a8..00000000000
Binary files a/test/verify/files/secring.gpg and /dev/null differ
diff --git a/tools/cockpit.spec b/tools/cockpit.spec
index 4ff37c7a8e5..011d50a15c4 100644
--- a/tools/cockpit.spec
+++ b/tools/cockpit.spec
@@ -251,9 +251,6 @@ find %{buildroot}%{_datadir}/cockpit/storaged -type f >> storaged.list
echo '%dir %{_datadir}/cockpit/networkmanager' > networkmanager.list
find %{buildroot}%{_datadir}/cockpit/networkmanager -type f >> networkmanager.list
-echo '%dir %{_datadir}/cockpit/ostree' > ostree.list
-find %{buildroot}%{_datadir}/cockpit/ostree -type f >> ostree.list
-
echo '%dir %{_datadir}/cockpit/packagekit' >> packagekit.list
find %{buildroot}%{_datadir}/cockpit/packagekit -type f >> packagekit.list
@@ -323,7 +320,7 @@ rm -f %{buildroot}%{_libexecdir}/cockpit-ssh
# when not building optional packages, remove their files
%if 0%{?build_optional} == 0
-for pkg in apps dashboard docker kubernetes machines ostree ovirt packagekit pcp playground storaged; do
+for pkg in apps dashboard docker kubernetes machines ovirt packagekit pcp playground storaged; do
rm -rf %{buildroot}/%{_datadir}/cockpit/$pkg
done
# files from -tests
@@ -710,23 +707,6 @@ The Cockpit components for managing oVirt virtual machines.
%files -n cockpit-machines-ovirt -f ovirt.list
-%package -n cockpit-ostree
-BuildArch: noarch
-Summary: Cockpit user interface for rpm-ostree
-# Requires: Uses new translations functionality
-Requires: cockpit-bridge >= %{required_base}
-Requires: cockpit-system >= %{required_base}
-%if 0%{?fedora} > 0 && 0%{?fedora} < 24
-Requires: rpm-ostree >= 2015.10-1
-%else
-Requires: /usr/libexec/rpm-ostreed
-%endif
-
-%description -n cockpit-ostree
-The Cockpit components for managing software updates for ostree based systems.
-
-%files -n cockpit-ostree -f ostree.list
-
%package -n cockpit-pcp
Summary: Cockpit PCP integration
Requires: cockpit-bridge >= %{required_base}
diff --git a/tools/debian/rules b/tools/debian/rules
index 5792356c2b3..4d7270c6eda 100755
--- a/tools/debian/rules
+++ b/tools/debian/rules
@@ -61,7 +61,7 @@ override_dh_install:
dpkg-vendor --derives-from ubuntu || rm -r debian/tmp/usr/share/cockpit/branding/ubuntu
# unpackaged modules
- for m in kdump kubernetes ostree selinux sosreport subscriptions ovirt; do rm -r debian/tmp/usr/share/cockpit/$$m; done
+ for m in kdump kubernetes selinux sosreport subscriptions ovirt; do rm -r debian/tmp/usr/share/cockpit/$$m; done
rm debian/tmp/usr/share/metainfo/org.cockpit-project.cockpit-sosreport.metainfo.xml
rm debian/tmp/usr/share/pixmaps/cockpit-sosreport.png
rm debian/tmp/usr/share/metainfo/org.cockpit-project.cockpit-kdump.metainfo.xml
diff --git a/webpack.config.js b/webpack.config.js
index 7a190576060..c4964d74f42 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -55,10 +55,6 @@ var info = {
"networkmanager/firewall.jsx"
],
- "ostree/ostree": [
- "ostree/app.js",
- "ostree/ostree.less",
- ],
"ovirt/ovirt": [
"ovirt/index.js",
@@ -188,8 +184,6 @@ var info = {
"kubernetes/scripts/test-connection",
"kubernetes/scripts/test-volumes",
- "ostree/test-utils",
-
"machines/test-machines",
],
@@ -218,8 +212,6 @@ var info = {
"networkmanager/firewall.html",
"networkmanager/manifest.json",
- "ostree/index.html",
-
"ovirt/index.html",
"ovirt/vnc.html",
"ovirt/vnc.css",