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

Dev 4821/add a bundle to check if a package is installed implementation test case #51

Conversation

jooooooon
Copy link
Member

No description provided.

defaults:
"action" string => "immediate", if_match_regex => "add";
"action" string => "warn_only", if_match_regex => "verify|";
"policy" string => "addupdate", if_match_regex => "true";
Copy link
Member

Choose a reason for hiding this comment

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

policy is not a parameter of the bundle, so this will never evaluate

@jooooooon
Copy link
Member Author

Can you re-review please?

vars:
"suffix" slist => { "ok", "not_ok", "repaired", "kept", "error", "reached" };
classes:
"ok" expression => "package_check_installed_${init.c_package_name}_ok.package_check_installed_${init.c_package_name}_reached.!package_check_installed_${init.c_package_name}_not_ok.!package_check_installed_${init.c_package_name}_repaired";
Copy link
Member

Choose a reason for hiding this comment

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

i'd be much happier if the test also tested that the package was installed (dpkg -l, or equivalent, or checking the existence of a file on a file system), to test more than that the generic methods did return the correct class

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point! I'll add that, and also add a test to ensure that the package doesn't get changed by this method, which it shouldn't since it is a check only.

@ncharles
Copy link
Member

ncharles commented May 7, 2014

Appart from the test, it looks great to me !

@jooooooon
Copy link
Member Author

I've added the test you suggested, and rebased this PR on master. The change is in a separate commit, to ease your reviewing.

I tested this on Debian 7 and the test passes.

Please merge if this is OK!

@ncharles
Copy link
Member

ncharles commented May 8, 2014

Awesome ! thank you

ncharles added a commit that referenced this pull request May 8, 2014
…if_a_package_is_installed_implementation_test_case

Dev 4821/add a bundle to check if a package is installed implementation test case
@ncharles ncharles merged commit f0ff2a4 into Normation:master May 8, 2014
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.

2 participants