Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tests to make CI usable again #21

Merged
merged 2 commits into from
Dec 12, 2018
Merged

Fix tests to make CI usable again #21

merged 2 commits into from
Dec 12, 2018

Conversation

pirat89
Copy link
Member

@pirat89 pirat89 commented Dec 11, 2018

Regarding to the recent PR #3, the tests are broken as these do not reflect the change.

  • Fix tests of these actors:
    checkbtrfs
    checkosrelease
    checkselinux

  • Disable tests for the peseventscanner actor
    Issue: Create tests for peseventscanner #22

  • Make variant and variant_id fields of the OSReleaseFacts
    model Nullable as for some systems these fields are not specified
    (e.g. Fedora) and modify the osreleasecollector actor to set None
    object when values are not specified

  • Improper fix of tests and model related to SELinux. The model and
    the systemfacts actor generating the object of this model doesn't
    reflect situation with disabled selinux correctly, so systems with
    disabled selinux cannot be upgraded now
    Issue: Invalid SELinux model and provided information in case of disabled selinux #20

@pirat89 pirat89 self-assigned this Dec 11, 2018
@pirat89 pirat89 requested a review from a team December 11, 2018 17:51
@pirat89 pirat89 added the bug Something isn't working label Dec 11, 2018
@pirat89 pirat89 removed the request for review from a team December 11, 2018 17:53
@pirat89 pirat89 requested a review from a team December 11, 2018 18:34
@pirat89 pirat89 force-pushed the fix_tests branch 2 times, most recently from b24a0a0 to 5bdba35 Compare December 11, 2018 19:04
@bocekm
Copy link
Member

bocekm commented Dec 12, 2018

Running the tests on my machine does not end well:
https://gist.github.com/bocekm/fc30c4b680467ed2cc98b0a9e0f8d560

- Fix tests of these actors:
    checkbtrfs
    checkosrelease
    checkselinux

- Disable tests for the peseventscanner actor
  Issue: oamg#22

- Make `variant` and `variant_id` fields of the OSReleaseFacts
  model Nullable as for some systems these fields are not specified
  (e.g. Fedora) and modify the osreleasecollector actor to set None
  object when values are not specified

- Improper fix of tests and model related to SELinux. The model and
  the systemfacts actor generating the object of this model doesn't
  reflect situation with disabled selinux correctly, so systems with
  disabled selinux cannot be upgraded now
  Issue: oamg#20
@bocekm bocekm merged commit 5da992b into oamg:master Dec 12, 2018
@pirat89 pirat89 deleted the fix_tests branch December 14, 2018 14:48
dkubek pushed a commit to dkubek/leapp-repository that referenced this pull request May 24, 2023
# This is the 1st commit message:

Fix dead link in checkipaserver actor

# This is the commit message oamg#2:

checkhybridimage: Fix the produce of the report

The actor can produce the report, however the report is never
stored / accepted by the leapp framework as the Report has not been
set in the `produces` tuple. Fixing the actor.

Signed-off-by: Petr Stodulka <[email protected]>

# This is the commit message oamg#3:

Upgrade packit.yaml config to have integration tests

This commit introduces the execution of leapp-repository integration tests as
a packit job.

Signed-off-by: Rodolfo Olivieri <[email protected]>

# This is the commit message oamg#4:

Update packit config to match the leapp-repositoyr tests

Signed-off-by: Rodolfo Olivieri <[email protected]>

# This is the commit message oamg#5:

Add new environment variable to 8.8to9.2

Signed-off-by: Rodolfo Olivieri <[email protected]>

# This is the commit message oamg#6:

Stop mentioning the "releasever" file removal

Do not mention the "releasever" file removal in order to not confuse
users.

# This is the commit message oamg#7:

Fix trace with impossible LEAPP_DEVEL_TARGET_RELEASE

With this change the (pre)upgrade will correctly handle
impossible target release version, no more ugly trace will
be shown.

OAMG-8651

# This is the commit message oamg#8:

Make copr-build functioning again

After some unknown changes around COPR, the building
command and the used COPR configuration file needs to be
updated.

OAMG-8876

# This is the commit message oamg#9:

Add tag in packit.yaml to enable cost metrics collection

Now all tft tests run by packit should be marked accordingly
with a sst-upgrades tag.

OAMG-8892

# This is the commit message oamg#10:

Workaround packit#2010 issue

Looks like tf_post_install_script and environment override does
not play nice together yet, so let's workaround it for now.

OAMG-8892

# This is the commit message oamg#11:

Improve the "checkgrubcore" report message

No action is needed in case Leapp is able to detect the GRUB2 device

# This is the commit message oamg#12:

Update pr-welcome-msg with packit tests info

Let's mention the big leap for leapp officially together with
a command to (re-)trigger tests.

# This is the commit message oamg#13:

Further tune welcome-bot message

- Do not use master, use latest upstream
- Add precise command to request review from oamg-developers

# This is the commit message oamg#14:

Remove note about leapp-ci build

As leapp packages are built by packit now, this is not used
anymore.

# This is the commit message oamg#15:

Fix false positive non-utf symlinks reported

Because of botched up check for python2 valid utf symlinks were reported
as non-utf ones.

OAMG-8629

# This is the commit message oamg#16:

Refactor rootscanner to use library

Also introduce tests for the nonutf symlinks

# This is the commit message oamg#17:

update .pylintrc

# This is the commit message oamg#18:

Set encoding for tests

# This is the commit message oamg#19:

Introduce leapp data in the RPM & repository

In the past it was needed to obtain the data by
* automatic download of data files from RH Insights
  (cloud.redhat.com)
  - which required access to the server & have the system registered
* manual download from the article:
    https://access.redhat.com/articles/3664871
  which required to login to the portal, download the archive
  and install its content manually on the system

Additional problem was with the syncing of data, as because of the
separation of data from the code, people had ensure they are
using the right combination of data and SW manually - in case the
data has not been downloaded automatically from RH Insights.

Having the data in the RPM makes our lives easier so let's install
them to `/etc/leapp/files/` via the package directly.
Set /etc/leapp/files/* as configuration files to ensure that
modified files will be backed up with *.rpmsave suffix as
expected for configuration files. This could be important in case
users manually updated e.g. repomap.json file to reflect their
internal settings of the satellite server.

The complete table how the configuration files are handled during
rpm installation/upgrade/... is here:
    https://www.cl.cam.ac.uk/~jw35/docs/rpm_config.html

Keeping original functionality still available, so if people remove
the files from the system, data can be still downloaded from the
server automatically. It seems it does not make sense, but we could
still use the possibility to download more up-to-date data from
RH Insights.

Configure codespell to ignore .etc/leapp/files

# This is the commit message oamg#20:

Add el8toel9 actor to handle directory -> symlink with ruby IRB.

The `/usr/share/ruby/irb/` directory is a symlink in RHEL 9.

Simply remove the directory to then let the RPM mechanism create the
correct symlink on update.

Users should not expect to ever retain anything in this directory.

# This is the commit message oamg#21:

Enable 8>9 upgrades with FIPS enabled (oamg#1053)

Short story long:
==============

FIPS refers to a set of security standards governing many aspects of how information should be handled by computers and by people. FIPS in context of RHEL typically means FIPS 140, a single document defining rules for the use of encryption and cryptographic services. In essence, it defines requirements for cryptographic modules (e.g. what algorithms can be used, thus preventing the use of insecure ones) manipulating sensitive information.

From the point of view of upgrades there are 5 components that are certified under FIPS: kernel, OpenSSL, GnuTLS, NSS, and libgcrypt. As for the kernel, fips=1 needs to be present on the cmdline in order to enable FIPS in the kernel. Kernel offers a /proc/sys/crypto/fips_enabled virtual file containing the information about whether the kernel has booted with FIPS enabled.

According to FIPS, the userspace components need to verify that they were not tampered with, and thus they have to have some sort of checksum either in a special section of a binary, or in a separate file. The components read /proc/sys/crypto/fips_enabled to know when to switch into the FIPS enabled mode. OpenSSL does things a bit differently, by not including support for FIPS directly but via a special fips.so module. Furthermore, for OpenSSL to check whether FIPS is enabled a configuration file must be present at /etc/pki/tls/openssl.cnf, because the code checking for FIPS is a part of configuration parsing.

As every userspace component has different implementation of FIPS-mode, and a different way for the user to check whether the component believes that the system it is running on has FIPS enabled, there is no straightforward way for us to make really sure that all of the components run in FIPS enabled inside the target userspace container.

Brief summary of changes in the code:
* scanfips: split scanning for fips into a separate actor
* checkfips: inhibit the IPU only on 7>8
* in case of FIPS for IPU 8 -> 9, copy related files into the target container to be able to generate FIPS compliant initramfs
* checkfipsenabled: check for fips in upgrade initramfs (LastTestsPhase); interrupt the upgrade if FIPS is not enabled in the upgrade environment 
* upgradeinitramfsgenerator: refactor library and tests due to FIPS
* create upgrade kernel hmac unconditionallly
---------

Co-authored-by: Michal Hecko <[email protected]>
# This is the commit message oamg#22:

Change the upgrade paths for SAP HANA

 - Drop 7.9 to 8.2
 - Add 7.9 to 8.8, but keep 7.9 to 8.6 as default
 - Add 8.8 to 9.2
 - Drop SAP HANA version check for the target releases >=8.8 and >=9.2
 - Correct actor.py docstring to support ppc64le for 8to9 upgrade (see PR1042)

# This is the commit message oamg#23:

Inhibit unsupported x86-64 microarchitecture RHEL9

As per [x86-64-ABI][1] In addition to the AMD64 baseline architecture,
several micro-architecture levels implemented by later CPU modules have
been defined, starting at level ``x86-64-v2``.

RHEL9 has a higher CPU requirement than older versions, it now requires
a CPU compatible with ``x86-64-v2`` instruction set or higher. Until
now, there was no check for this and the upgrade crashed unexpectedly.
This commit handles this issue and provides the user with a report
explaining the problem.

The CPU Features are gathered using the ``lscpu`` command by way of
using the ``ScanCPU`` actor. The ``ScanCPU`` actor had to be also
modified to provide the required flags. The mapping of CPU Features to
flags provided by ``lscpu`` has been determined by using the
``/arch/x86/include/asm/cpufeatures.h`` file from the linux kernel.

[1]: https://gitlab.com/x86-psABIs/x86-64-ABI.git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants