-
Notifications
You must be signed in to change notification settings - Fork 684
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
SSGTS-specific Jinja templates #7295
SSGTS-specific Jinja templates #7295
Conversation
I have some problem that it can't find the new macro:
|
Ah sorry @jan-cerny, this actually depends on #7211 -- where we added a new commit to switch from |
054e053
to
4638f4e
Compare
@jan-cerny This should be ready for review now. |
/retest |
1 similar comment
/retest |
@@ -1,5 +1,5 @@ | |||
#!/bin/bash | |||
# packages = avahi | |||
# packages = {{{- ssgts_package("avahi") -}}} |
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.
To actually make this work, I had to remove the '-'. So something like:
# packages = {{{ ssgts_package("avahi") }}}
Not truly sure why, since the '-' seems to be related to whitespace. Could it be a difference in jinja versions?
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.
@dodys Yes, {{{- -}}}
is supposed to remove whitespace before/after the macro expansion. Otherwise, I'd get results like:
...
# packages =
avahi-daemon
...
(on two separate lines) and the test suite wouldn't run. What Jinja version are you using?
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.
2.10
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.
@dodys Did you ever get this working? I've gone ahead and rebased the PR. :-)
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.
only worked without the '-'
I haven't done anything else
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.
The dash at the end is wrong - it results in concatenation of the first line of the test scenario with the package list. Just removing that dash should work just fine.
This introduces ssgts_package(...) to get the correct package name for a specific product. Signed-off-by: Alexander Scheel <alex.scheel@canonical.com>
Signed-off-by: Alexander Scheel <alex.scheel@canonical.com>
Also introduces Ubuntu-specific package name and uses shared Jinja template for this. Signed-off-by: Alexander Scheel <alex.scheel@canonical.com>
Ubuntu calls the audit package auditd, reflecting its status as a daemon. Update the tests installing the audit package to use the new Jinja macro to handle the differences. Signed-off-by: Alexander Scheel <alex.scheel@canonical.com>
4638f4e
to
ce1db14
Compare
This datastream diff is auto generated by the check Click here to see the full diffRule 'xccdf_org.ssgproject.content_rule_security_patches_up_to_date' points to 'security-data-oval-com.redhat.rhsa-RHEL8.xml' which isn't a part of the old datastream |
@cipherboy: The following tests failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
@cipherboy: PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@matejak @Mab879 @jan-cerny I'm inclined to close this; feel free to pick it up if it is still of interest to you, I'll keep my branch around :-) |
Thanks for the update. I think that this is not the best approach - packages overrides should be handled on the level of the test framework, so the package metadata remains clean, without weird macros. We could rebrand the |
Description:
Introduces the infrastructure to have a SSGTS-specific file for jinja templates. As we get more usage of Jinja macros in SSGTS cases, we'll probably want this. For now, we introduce a single rule to get the package name, resolving for product specific differences.
Also updates Avahi to use this macro and then uses it in the various libpam-pwquality tests (which Ubuntu doesn't have installed by default).