forked from saltstack/salt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixes saltstack#65220 add wildcard removal for aptpkg
- Loading branch information
1 parent
c5936f9
commit 8fe4892
Showing
5 changed files
with
65 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Add ability to remove packages by wildcard via apt execution module |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import pytest | ||
|
||
import salt.utils.pkg | ||
|
||
CURRENT_PKGS = { | ||
"acl": "2.2.53-4", | ||
"adduser": "3.118", | ||
"apparmor": "2.13.2-10", | ||
"apt": "1.8.2.3", | ||
"apt-listchanges": "3.19", | ||
"apt-transport-https": "1.8.2.3", | ||
"apt-utils": "1.8.2.3", | ||
"base-files": "10.3+deb10u13", | ||
"base-passwd": "3.5.46", | ||
"bash": "5.0-4", | ||
"bash-completion": "1:2.8-6", | ||
} | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"current_pkgs,pkg_params,expected", | ||
[ | ||
[CURRENT_PKGS, {"apt": ""}, {"apt": ""}], | ||
[CURRENT_PKGS, {"foo": ""}, {"foo": ""}], | ||
[CURRENT_PKGS, {"bash*": ""}, {"bash": "", "bash-completion": ""}], | ||
], | ||
) | ||
def test_match_wildcard(current_pkgs, pkg_params, expected): | ||
result = salt.utils.pkg.match_wildcard(current_pkgs, pkg_params) | ||
assert result == expected |