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

tests: add distro tags to FCOS only tests #1322

Merged
merged 3 commits into from
Nov 17, 2021

Conversation

miabbott
Copy link
Member

@miabbott miabbott commented Nov 2, 2021

This is a first pass at categorizing the existing external tests using
the distros tag to indicate that the tests are only supported on
FCOS. This should allow better sharing of tests with RHCOS.

Note: some of these tests may be able to be adapted for RHCOS; will
investigate in a follow-up PR.

See: openshift/os#661
See: coreos/coreos-assembler#2521

miabbott added a commit to miabbott/os that referenced this pull request Nov 2, 2021
This removes the individually symlinked tests in favor of a symlink to
the entire FCOS external tests directory.  With the external tests
properly categorized with the `distros` tag, only tests that are
applicable to both FCOS + RHCOS should run from the `shared`
directory.

Requires: coreos/fedora-coreos-config#1322
miabbott added a commit to miabbott/os that referenced this pull request Nov 2, 2021
This removes the individually symlinked tests in favor of a symlink to
the entire FCOS external tests directory.  With the external tests
properly categorized with the `distros` tag, only tests that are
applicable to both FCOS + RHCOS should run from the `shared`
directory.

Requires: coreos/fedora-coreos-config#1322
miabbott added a commit to miabbott/os that referenced this pull request Nov 2, 2021
This removes the individually symlinked tests in favor of a symlink to
the entire FCOS external tests directory.  With the external tests
properly categorized with the `distros` tag, only tests that are
applicable to both FCOS + RHCOS should run from the `shared`
directory.

Requires: coreos/fedora-coreos-config#1322
@HuijingHei
Copy link
Member

Looks good to me

tests/kola/README.md Outdated Show resolved Hide resolved
tests/kola/README.md Outdated Show resolved Hide resolved
Copy link
Member

@dustymabe dustymabe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing this work @miabbott.

A few suggestions.. Mostly LGTM, but I'd like to advocate for adding reasons why tests only apply to FCOS even if it's blatantly obvious. I really do feel that stating the obvious is a good thing sometimes especially when new people stumble onto the code and might not know the history.

@miabbott
Copy link
Member Author

miabbott commented Nov 4, 2021

Thanks for doing this work @miabbott.

A few suggestions.. Mostly LGTM, but I'd like to advocate for adding reasons why tests only apply to FCOS even if it's blatantly obvious. I really do feel that stating the obvious is a good thing sometimes especially when new people stumble onto the code and might not know the history.

Great suggestion, Dusty! I'll work that into the next revision.

saqibali-2k
saqibali-2k previously approved these changes Nov 5, 2021
Copy link
Member

@saqibali-2k saqibali-2k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I second Dusty's idea of adding a short description of why is test is limited to FCOS. Besides that changes look good overall!

@@ -13,7 +13,8 @@

# Only run on QEMU to reduce CI costs as nothing is platform specific here.
# Toolbox container is currently available only for x86_64 and aarch64 in Fedora
# kola: { "tags": "needs-internet", "platforms": "qemu-unpriv", "architectures": "x86_64 aarch64" }
# This test only runs on FCOS because RHCOS is missing the `machinectl` command.
Copy link
Member

@dustymabe dustymabe Nov 8, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this might be able to be improved. While technically accurate that RHCOS might be missing the machinectl command I think there are other reasons that we would only want this test to run on FCOS. i.e. I imagine the default container they pull should be different and the test we want to validate is probably different. So we'd either need to adapt the test to work on both or just state that this test is targeted at FCOS and we should create a RHCOS specific toolbox test in the future.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Side note: remember soon "RHCOS" will be ambiguous. It'd be more accurate to say "RHCOS8" for example, because perhaps we do choose to pull in machinectl in RHCOS9.

This is actually another reason why longer term these distro tags are going to be less sustainable than doing e.g. feature detection. IOW skipping the test if machinectl doesn't exist.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the current practice is probably most efficient. Basically what we have been doing typically is using feature detection if it's easy. Sometimes this is easily done by querying a program other times not. Sometimes it can also be done by querying a version of a particular software (i.e. systemd or NetworkManager). Other times it's not so easy and kind of complex. In those cases I think we should basically switch off RHCOS/FCOS and then do "version detection" (i.e. F34, F35, RHEL 8.X, RHEL 9.X) within the embedded logic.

dustymabe
dustymabe previously approved these changes Nov 8, 2021
Copy link
Member

@dustymabe dustymabe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - I just had one suggestion for improvement, but that's optional.

@jlebon
Copy link
Member

jlebon commented Nov 10, 2021

Are we planning to hold this until #1325? Otherwise I think this will need an additional pass for all the tests split out of misc-ro.

@miabbott
Copy link
Member Author

miabbott commented Nov 12, 2021

Rebased after #1325 landed, but now I see #1337, so might be another rebase in my future.

I tweaked three tests as separate commits to make them work seamlessly across FCOS/RHCOS. (@dustymabe interested in any feedback re: the networking test I changed)

There are other tests in there that could be modified for the same outcome, but require a little more investigation.

@miabbott
Copy link
Member Author

Rebased again on top of #1337.

Added additional comments (grep for TODO-RHCOS) to indicate which tests may be able to be adapted for RHCOS.

tests/kola/files/rpmdb-sqlite Outdated Show resolved Hide resolved
tests/kola/firewall/iptables-legacy Outdated Show resolved Hide resolved
tests/kola/networking/stub-resolve.sh Outdated Show resolved Hide resolved
tests/kola/root-reprovision/luks/test.sh Show resolved Hide resolved
tests/kola/ignition/systemd-unmasking/test.sh Outdated Show resolved Hide resolved
@dustymabe
Copy link
Member

Thank you so much for working on this @miabbott!

@miabbott
Copy link
Member Author

Rebased one more time and dropped the commit to change the network test that was covered by #1339

dustymabe
dustymabe previously approved these changes Nov 16, 2021
Copy link
Member

@dustymabe dustymabe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - one spelling fix suggestion

@@ -1,5 +1,8 @@
#!/bin/bash
# kola: { "exclusive": false }
# This test only runs on FCOS because RHCOS does not currently support cgroupsv2
# by defaulr.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# by defaulr.
# by default.

@dustymabe
Copy link
Member

Hurry up and merge before anything else lands!

This is a first pass at categorizing the existing external tests using
the `distros` tag to indicate that the tests are only supported on
FCOS.  This should allow better sharing of tests with RHCOS.

Note: some of these tests may be able to be adapted for RHCOS; will
investigate in a follow-up PR.

See: openshift/os#661
See: coreos/coreos-assembler#2521
Omitting the "." from the `jq` expression on RHCOS causes the command
to fail. By including the ".", the test can run on FCOS + RHCOS.
The version of `find` on RHCOS does not accept a comma-separated list
of file types to the `-type` argument. Splitting it into multiple args
should allow the test to work with FCOS/RHCOS.
@miabbott miabbott merged commit dac1f68 into coreos:testing-devel Nov 17, 2021
miabbott added a commit to miabbott/os that referenced this pull request Nov 17, 2021
This removes the individually symlinked tests in favor of a symlink to
the entire FCOS external tests directory.  With the external tests
properly categorized with the `distros` tag, only tests that are
applicable to both FCOS + RHCOS should run from the `shared`
directory.

Requires: coreos/fedora-coreos-config#1322
miabbott added a commit to miabbott/fedora-coreos-config that referenced this pull request Nov 17, 2021
The version of `systemd-udev` on RHCOS does not include the
`systemd-repart` service.

Missed this test as part of coreos#1322.
miabbott added a commit to miabbott/fedora-coreos-config that referenced this pull request Nov 18, 2021
The version of `systemd-udev` on RHCOS does not include the
`systemd-repart` service.

Missed this test as part of coreos#1322.
miabbott added a commit that referenced this pull request Nov 18, 2021
The version of `systemd-udev` on RHCOS does not include the
`systemd-repart` service.

Missed this test as part of #1322.
miabbott added a commit to miabbott/os that referenced this pull request Nov 18, 2021
This removes the individually symlinked tests in favor of a symlink to
the entire FCOS external tests directory.  With the external tests
properly categorized with the `distros` tag, only tests that are
applicable to both FCOS + RHCOS should run from the `shared`
directory.

Requires: coreos/fedora-coreos-config#1322
miabbott added a commit to miabbott/os that referenced this pull request Nov 18, 2021
With the work related to coreos/fedora-coreos-config#1322, we can now
share the external tests from FCOS more sanely with RHCOS. This
introduces a 'shared' directory under `tests/kola` that symlinks to
the FOCS external tests. Those external tests are currently
categorized to run only on the supported distros, so including the
whole directory is safe to do.
miabbott added a commit to miabbott/os that referenced this pull request Nov 19, 2021
With the work related to coreos/fedora-coreos-config#1322, we can now
share the external tests from FCOS more sanely with RHCOS. This
introduces a 'shared' directory under `tests/kola` that symlinks to
the FOCS external tests. Those external tests are currently
categorized to run only on the supported distros, so including the
whole directory is safe to do.

Additionally, any duplicated tests have been removed from this
directory; we should default to writing tests that support both
FCOS/RHCOS and only stray from that default when absolutely necessary.
miabbott added a commit to miabbott/os that referenced this pull request Nov 29, 2021
With the work related to coreos/fedora-coreos-config#1322, we can now
share the external tests from FCOS more sanely with RHCOS. This
introduces a 'shared' directory under `tests/kola` that symlinks to
the FOCS external tests. Those external tests are currently
categorized to run only on the supported distros, so including the
whole directory is safe to do.

Additionally, any duplicated tests have been removed from this
directory; we should default to writing tests that support both
FCOS/RHCOS and only stray from that default when absolutely necessary.
miabbott added a commit to miabbott/os that referenced this pull request Nov 30, 2021
With the work related to coreos/fedora-coreos-config#1322, we can now
share the external tests from FCOS more sanely with RHCOS. This
introduces a 'shared' directory under `tests/kola` that symlinks to
the FOCS external tests. Those external tests are currently
categorized to run only on the supported distros, so including the
whole directory is safe to do.

Additionally, any duplicated tests have been removed from this
directory; we should default to writing tests that support both
FCOS/RHCOS and only stray from that default when absolutely necessary.
HuijingHei pushed a commit to HuijingHei/fedora-coreos-config that referenced this pull request Oct 10, 2023
The version of `systemd-udev` on RHCOS does not include the
`systemd-repart` service.

Missed this test as part of coreos#1322.
HuijingHei pushed a commit to HuijingHei/fedora-coreos-config that referenced this pull request Oct 10, 2023
The version of `systemd-udev` on RHCOS does not include the
`systemd-repart` service.

Missed this test as part of coreos#1322.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants