-
Notifications
You must be signed in to change notification settings - Fork 54
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
blueprint: fix cacerts name for TOML #1076
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -1,4 +1,5 @@ | ||||||||||||||||||||||||||||
#!/usr/bin/env bash | ||||||||||||||||||||||||||||
# vim: sw=4:et | ||||||||||||||||||||||||||||
set -euo pipefail | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
running_wait() { | ||||||||||||||||||||||||||||
|
@@ -78,6 +79,22 @@ get_oscap_score() { | |||||||||||||||||||||||||||
fi | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
check_ca_cert() { | ||||||||||||||||||||||||||||
serial=$(jq -r '.blueprint.customizations.cacerts.pem_certs[0]' "${config}" | openssl x509 -noout -serial | cut -d= -f 2-) | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
echo "📗 Checking CA cert anchor file" | ||||||||||||||||||||||||||||
if ! [ -e "/etc/pki/ca-trust/source/anchors/${serial}.pem" ]; then | ||||||||||||||||||||||||||||
echo "Anchor CA file does not exist" | ||||||||||||||||||||||||||||
exit 1 | ||||||||||||||||||||||||||||
fi | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
echo "📗 Checking extracted CA cert file" | ||||||||||||||||||||||||||||
if ! [ -e "/etc/pki/ca-trust/source/extracted/pem/directory-hash/Test_CA_for_osbuild.pem.pem" ]; then | ||||||||||||||||||||||||||||
echo "Extracted CA file does not exist" | ||||||||||||||||||||||||||||
exit 1 | ||||||||||||||||||||||||||||
fi | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Out of curiousity, where do I see this output? I am unable to locate this job. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the manifest were not rebuilt during the CI run (because it didn't change), you'd find a link to the run in which it was tested in the job that generated it (e.g. https://gitlab.com/redhat/services/products/image-builder/ci/images/-/jobs/8565731980). Since the manifest didn't change and you added the test, it was not run at all. A complete manifest regeneration would be required. That can be achieved by bumping the Line 3 in 048c8c6
I did it in #1093 and if my comment about the potential typo from above is correct, it should fail 🤔 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The story continuous:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, apologies: #1096 |
||||||||||||||||||||||||||||
echo "❓ Checking system status" | ||||||||||||||||||||||||||||
if ! running_wait; then | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
|
@@ -114,4 +131,8 @@ if (( $# > 0 )); then | |||||||||||||||||||||||||||
if jq -e .blueprint.customizations.openscap "${config}"; then | ||||||||||||||||||||||||||||
get_oscap_score "${config}" | ||||||||||||||||||||||||||||
fi | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
if jq -e '.blueprint.customizations.cacerts.pem_certs[0]' "${config}"; then | ||||||||||||||||||||||||||||
check_ca_cert "${config}" | ||||||||||||||||||||||||||||
fi | ||||||||||||||||||||||||||||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lzap I just noticed a potential typo in the filename - note the double
.pem.pem
🤔There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this is curious, do we generate funky filenames here or is the test not running correctly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mvo5 see #1076 (comment). The
cacert
customization is not applied to any image we boot-test, so this code is never executed.