Python 3.11 changed it's unittest internals for the Outcome class and no
longer calls testPartExecutor with isTest as it used too. The Outcome
class now has a TestResult attribute which records failures, errors and
successful tests different.
Merely waiting for a VM to appear in `virsh list` is a race condition:
virt-install has two phases, and it un- and redefines the VM in
between. This races with the explicit deletion in the UI: If that
happens while virt-install is still running, the second phase would
re-define VM, and the test times out waiting for the VM to be gone.
Current cockpit-machine's assertDomainDefined() is much more thorough:
it waits for the VM to have the expected properties. Backport that.
This line doesn't actually remove all of those modules — as soon as one
of them fails, the others will fail as well, silently.
Merge them into a single command, and replace a `( || true) &&` with a
simplified `|| true;`.
We were adding a disk and using `dd if=/dev/sda of=/dev/sda` to simulate
disk activity for testing the metrics backends. We never actually
waited to make sure the disk came online.
This is an existing issue that was revealed by a timing change: the new
way we run scripts via Machine.execute() is apparently a bit faster.
The `pkill -f` killed the SSH connection as well. `-f` is not necessary
there, drop it. Also actually wait for the process to be gone.
Drop the second cockpit-ws as well.
This is a backport of 6c830af22d.
scp is deprecated, and in Fedora 36 you can't scp something to a ~user
directory any more:
scp: server expand-path extension is required for ~user paths in SFTP mode
Specify an absolute path instead.
Cherry-picked from main commit 588163c862
Fedora-36/CentOS/RHEL 9 switched to OpenSSL 3, which does not support
the `md4` hash any more. webpack hardcodes that in a lot of places, so
monkey-patch `crypto.createHash()` to substitute sha256 for md4.
Hack to work around https://github.com/webpack/webpack/issues/13572
Cherry-picked from https://github.com/cockpit-project/starter-kit/commit/3220617fec508
This is solved in current webpack 5 versions, but we don't want to
update this old stable branch to that.
Use `image-customize --build` for building and installing the packages
on all operating systems except CoreOS.
CoreOS still conceptually needs the "build rpms on Fedora" step
(image-customize can't copy out files), and installation is really
special as well. Copy bot's images/scripts/fedora-coreos.install with
minor adjustments.
Adjust and adopt bots' images/scripts/lib/containers.install for the
bastion test.
Move the remaining setup and OS specific hacks to test/vm.install.
This brings cockpit in line with how starter-kit and derivatives prepare
their test images, and gets rid of a lot of redundancy. In particular,
this gets rid of the last cockpit specific *.install files in the bots
repository.
Drop the following CLI options:
- `--overlay`, `--install-only`: Nobody ever uses this; we have faster
tools to hack existing images.
- `--build-image`: The test image determines the build image, there is only
one correct value anyway
- `--build-only`, `--sit`, not currently supported by image-customize
Adjust atomiclib.py to the changed path of the built binaries.
Ported from main commit e060058027, with a few changes:
- Replace the usage of make_dist.py (which does not yet exist in this
branch, and is overkill) with a copy of its `make_dist()` function,
and drop the jumpstart part. Also copy test/common/parent.py, as
that's harmless, and helps to keep the image-prepare code in sync
with main.
- Drop fedora-coreos and RHEL 8 split package build support; this
branch does not yet know about it, and we don't test it.
- Drop the Debian/Ubuntu/RHEL 8 hacks from test/vm.install, not used on
this branch.
- Add a simple `sed` to put a correct version number into the .spec.
This avoids backporting multiple intrusive changes that moved
cockpit.spec to *.in and added the create-spec tool.
- Port the `--define="centos 0"` hack as additional build option from
bots `lib/fedora.install --rhel`. This ensures cockpit-subscriptions
gets built for RHEL, but not CentOS.
Go 1.16 now defaults to `GO111MODULE=on` [1], which breaks our build, with a
*really* unhelpful error message, too:
package cockpit-kube-auth is not in GOROOT (/usr/lib/golang/src/cockpit-kube-auth)
Switch back to the old behaviour.
[1] https://go.dev/doc/go1.16Fixes#16920
See https://bugzilla.redhat.com/show_bug.cgi?id=2050088
Until version 6, the `author` field was an object with `name` and
`email` properties. Now it is a plain "Name <email>" string. Adjust the
copyright detection fallback to get along with both.
npm 7 (as in Fedora 35) has stricter module resolution, which makes the
build of the stable rhel-7.9 branch fail in multiple ways. Enforce the
legacy method, to minimize the potential impact and keep the package
buildable.
npm 7 more carefully checks peer dependencies, and discovers that our
current less-loader is not marked as compatible with our current less
version:
```
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: CockpitDevelopmentDependencies@undefined
npm ERR! Found: less@3.0.4
npm ERR! node_modules/less
npm ERR! dev less@"~3.0.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer less@"^2.3.1" from less-loader@4.0.6
npm ERR! node_modules/less-loader
npm ERR! dev less-loader@"~4.0.6" from the root project
```
Bump less-loader to major version 5 to fix that.
Latest insights-client dropped the `insecure_connection` option and only
accepts TLS. Change mock-insights to serve TLS, and re-use our "alice"
certificate for it.
Disable certificate verification, as apparently there is no way to
convince the later stages of insights-client to accept a locally added
CA.
Backported from main commit 12850afd86. src/tls/ is not a thing yet
in this branch, so add the alice certificate to test/verify/files/
instead.
The POOL_COMMAND on recent candlepin versions now finds two pools with
almost exactly the same properties. Ensure that we only pick the first
matching one, to avoid building a broken multi-line command.
This makes the test stricter, and also makes them work on OSes that
don't set a host name by default (like fedora-coreos). The new Overview
page doesn't render `#system_information_hostname_text` at all without a
host name.
Cherry-picked from master commit 1cfa5787b6
https://github.com/cockpit-project/bots/pull/1768 moves the services
image from CentOS 7 to Fedora CoreOS and containerizes the candlepin
server. Adjust tests accordingly.
Cherry-picked from master commit d2c9f0c269
Changes:
- Completely sync over pkg/realmd/README.md from current master, as the
information here was heavily out of date (e.g. the "ipa" image has
not existed for some time).
- Replace the JSON filtering in Python with `jq`, as there is no Python
on Fedora CoreOS.
cockpit-machines-ovirt has been an evolutionary dead end. The code in
this branch is frozen, and in the unlikely chance that we'll ever have
to touch it again, it will have to be tested manually anyway -- our
ovirt image is many years old and has been unbuildable for almost as
long (and thus has an ovirt version which is long out of support).
Relying on that will not increase any confidence in code adjustments.
TestKerberos.testNegotiate() is using an undocumented feature of
m.execute() by passing the individual arguments of curl as a list rather
than a string. This feature has long been broken: ssh just concatenates
the arguments back together anyway. This is plainly illustrated by the
fact that this test has been calling m.execute() with
'/usr/bin/curl -v -s'
as the first argument, and it's been working.
Split that out properly in preparation for an upcoming change to the
bots to make this function properly.
Cherry-picked from master commits 426bd42b3 and a2c78179fe.
This allows us to remove the various --insecure and insecure=0 options
when contacting Candlepin.
More importantly, it allows insights-client to perform its performance
metric upload to Candlepin, something that can't be configured to be
done insecurely.
The default "Referrer-Policy" for chromium is now
strict-origin-when-cross-origin, which caused the previous version of
the test to fail as js from the local embed-cockpit.html file to the
iframe was considered cross-origin.
By making the embed file the default shell, it is no longer
cross-origin.
Cherry-picked from master commit f5985b36Closes#14743
The test was expecting the "Login failed" error message in the
curtain, for unknown reasons. It actually appears in the dialog, and
always has, I think.
Closes#14656
Recently krb5 started to be stricter about unrecognized enctypes [1],
and that commit is now in Fedora Rawhide. This broke test-kerberos with
cockpit-ws:ERROR:src/ws/test-kerberos.c:301:test_authenticate:
assertion failed (GSS_S_CONTINUE_NEEDED == status): (1 == 851968): Unspecified GSS failure.
Minor code may provide more information (Decrypt integrity check failed)
Between Fedora 33 and CentOS 8 there is no set of encryption types that
is supported everywhere; also, we don't particularly care about the
encryption type for this unit test, so just use whatever kerberos
considers a good default [2].
[1] https://github.com/krb5/krb5/commit/be5396ada0e8dab
[2] https://web.mit.edu/kerberos/krb5-latest/doc/admin/conf_files/kdc_conf.html#encryption-types
Cherry-picked from master commit 8eed6e7Closes#14531
This method is deprecated since Python version 3.3 and is removed in Python version 3.8.
Fedora 32 ships by default Python 3.8
Cherry-picked from master commit e0badffCloses#14530
Previously we were correctly calling the getDefaultVolumeFormat when
opening the dialog, thus the default format for the preselected pool was
correctly detected. However, when a user changed so some other pool,
we didn't re-detect the default format, which was problematic if the
user didn't change the preseleted format afterwards.
This commit also adjusts the relevant test which didn't fail before
because the problematic pool was first on the list so the
getDefaultVolumeFormat was correctly called in the dialog constructor.
Relevant to https://bugzilla.redhat.com/show_bug.cgi?id=1833198Closes#14201
Cherry-picked from master commit 2cd9bf.
We are going to eliminate `$TEST_DATA`, it currently influences too many
things which really don't belong together. There is little reason to put
the built rpms into some user-controlled path -- in particular, we
*don't* want to put them into some persistent and possibly remote
storage if `$TEST_DATA` points to a container volume.
get_temp_dir() is too unspecific to be used as public API, so let's
eliminate it. This is the only consumer outside of bots itself.
Cherry-picked from master commit acd4f87ed7.
Cockpit should always use the maximum privileges it has. Otherwise
actions might be rejected that are actually allowed.
Cherry-picked from master commit 168f819ebd, restricted to a safe and
non-intrusive subset.
https://bugzilla.redhat.com/show_bug.cgi?id=1841559Closes#14184
Don't try to set the disk driver type to something which is neither
qcow2 or raw.
Volumes on some pool types can have different format types though.
In that case, just omit settings the disk driver type, and let QEMU
autoset the default.
Relevant to https://bugzilla.redhat.com/show_bug.cgi?id=1833198
Cherry-picked from master commit 5e5a243.
Closes#14154