Skip to content
This repository has been archived by the owner on Jul 13, 2021. It is now read-only.

Build XCCDF only from module.ini and group.ini files #352

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

pirat89
Copy link
Collaborator

@pirat89 pirat89 commented Feb 11, 2018

Previously building of module set has been corrupted when directory
with the module contained more than one file with the ".ini"
extentions. Build of the module set shouldn't be affected by various
INI files, that are not related to the module set structure.

So the scan is now read only group.ini and module.ini files whose
names are reserved for PA purposes. In addition we expect only one
of those files in each directory, so the ModuleSetFormatError
exception is raised when both are detected in the same directory.

Additionaly:

  • removed unused import of ModuleSetUtils
  • modified tests

Resolves #310

Previously building of module set has been corrupted when directory
with the module contained more than one file with the ".ini"
extentions. Build of the module set shouldn't be affected by various
INI files, that are not related to the module set structure.

So the scan is now read only group.ini and module.ini files whose
names are reserved for PA purposes. In addition we expect only one
of those files in each directory, so the ModuleSetFormatError
exception is raised when both are detected in the same directory.

- removed unused import of ModuleSetUtils

Resolves #310
Use settings.module_ini and settings.group_ini in tests.

Related #310
@pirat89
Copy link
Collaborator Author

pirat89 commented Feb 11, 2018

This is more like nice to have now, but I have good mood on Sunday. So set milestone and merge it just in case you want to resolve it now.

@pirat89 pirat89 self-assigned this Feb 11, 2018
@pirat89 pirat89 added the bug label Feb 11, 2018
@bocekm bocekm added this to the el69toel75b0 milestone Feb 12, 2018
@bocekm bocekm added the on_qe label Feb 12, 2018
@AloisMahdal
Copy link
Collaborator

AloisMahdal commented Feb 12, 2018

CASES

Legend

  • INPUT: tree - contents of directories above; each character is for one
    level, p is for properties.ini, g is for group.ini and . is for
    empty

    E.g. pg.g means that the tree structure is something like:

    RHEL6_7
     |- properties.ini
     '- foo
         |- group.ini
         '- bar
             '- baz
                 |- group.ini
                 '- testdir
    

    where the fields gini, mini and fini relate to contents of the testdir
    directory.

  • INPUT: gini - group.ini present?

  • INPUT: mini - module.ini present?

  • INPUT: fini - foo.ini present?

  • BEHAVIOR: result - effect in result.xml

  • ~ - does not matter

Table

INPUT                      || BEHAVIOR
------.------.------.------||----------------------------
 tree | gini | mini | fini || result
======|======|======|======||============================
 p    |   no |   no |   no || none (no relevant file)
 p    |   no |   no |  yes || none (no relevant file)
 p    |   no |  yes |   no || none (no group)
 p    |   no |  yes |  yes || none (no group)
 p    |  yes |   no |   no || none (empty group)
 p    |  yes |   no |  yes || none (empty group)
 p    |  yes |  yes |   no || error
 p    |  yes |  yes |  yes || error
------|------|------|------||----------------------------
 pg   |   no |   no |   no || none (empty group)
 pg   |   no |   no |  yes || none (empty group)
 pg   |   no |  yes |   no || normal result
 pg   |   no |  yes |  yes || normal result
 pg   |  yes |   no |   no || none (empty group)
 pg   |  yes |   no |  yes || none (empty group)
 pg   |  yes |  yes |   no || error
 pg   |  yes |  yes |  yes || error
------|------|------|------||----------------------------
 p.g  |    ~ |    ~ |    ~ || none (chain interrupted)
------|------|------|------||----------------------------

@AloisMahdal
Copy link
Collaborator

qa_ack: add and run test for module discovery according to case table above.

@bocekm
Copy link
Collaborator

bocekm commented Feb 16, 2018

@pirat89, I did some code cleanup, please take a look. The code now looks for just one ini file (either module.ini or group.ini) instead of multiple. If there's no one of these two in a folder, it's a failure.

- fail if there's no INI in a dir
- rename functions and variables so the name better suits their purpose
@pirat89
Copy link
Collaborator Author

pirat89 commented Feb 19, 2018

If there's no one of these two in a folder, it's a failure.

In my testing it is not true. But as we agreed, this could be probably removed at all.

@bocekm
Copy link
Collaborator

bocekm commented Feb 19, 2018

@pirat89 has found issues with the code. These are my notes that may not make much sense to others:
It does not yell when there's no INI in a folder. Which should not actually - there may be folder under module storing just some data. But the code tells to die when there's no INI in any folder (recursive search through all RHEL6_7 module set folder).

@bocekm bocekm removed the on_qe label Feb 19, 2018
@bocekm bocekm changed the title Build XCCDF only from module.ini and group.ini files WIP: Build XCCDF only from module.ini and group.ini files Feb 19, 2018
@pirat89
Copy link
Collaborator Author

pirat89 commented Feb 19, 2018

Correct. If I hadn't known about the issues, I would not be able to decrypt notes above :-D

@bocekm bocekm removed this from the el69toel75b0 milestone Mar 12, 2018
@pirat89 pirat89 changed the title WIP: Build XCCDF only from module.ini and group.ini files Build XCCDF only from module.ini and group.ini files Mar 26, 2018
@AloisMahdal AloisMahdal removed the qa_ack label Apr 4, 2018
@AloisMahdal
Copy link
Collaborator

Cleaning up qa_ack from last milestone.

@pirat89 pirat89 added this to the el610toel75b0 milestone Apr 5, 2018
@AloisMahdal
Copy link
Collaborator

qa_ack: same as above: add and run test for module discovery according to case table above.

I think I have test in making somewhere; couldn't find it right now, though.

@bocekm bocekm added the on_qe label May 31, 2018
@bocekm
Copy link
Collaborator

bocekm commented May 31, 2018

@AloisMahdal ready to be verified.

bocekm
bocekm previously approved these changes Jun 4, 2018
@bocekm
Copy link
Collaborator

bocekm commented Jun 5, 2018

That's strange, our Jenkins jobs for CD has started by themself, again, 5 days after the last commit, and failed because they weren't started properly. I'm gonna push force causing another rebuild.

bocekm
bocekm previously approved these changes Jun 5, 2018
@pirat89
Copy link
Collaborator Author

pirat89 commented Oct 5, 2018

Just rebased to run the build. without any other changes.

Copy link
Collaborator

@bocekm bocekm left a comment

Choose a reason for hiding this comment

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

Rereviewed after rebase. @AloisMahdal, this PR awaits QE verification.

@pirat89
Copy link
Collaborator Author

pirat89 commented Nov 1, 2018

@bocekm If I remember well, @AloisMahdal found there probably an issue (or was it something else?) but it is just not documented here as the complete testing has not been finished because we postponed that to the next milestone.

@pirat89 pirat89 modified the milestones: el610toel76b0, el610toel76b2 Nov 1, 2018
@pirat89
Copy link
Collaborator Author

pirat89 commented Mar 27, 2019

--test--

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants