Summary: | Add unit tests to Policy Kit | ||
---|---|---|---|
Product: | PolicyKit | Reporter: | Nikki VonHollen <vonhollen> |
Component: | daemon | Assignee: | David Zeuthen (not reading bugmail) <zeuthen> |
Status: | RESOLVED FIXED | QA Contact: | David Zeuthen (not reading bugmail) <zeuthen> |
Severity: | enhancement | ||
Priority: | medium | ||
Version: | unspecified | ||
Hardware: | Other | ||
OS: | All | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: |
Added netgroup support, added MockLibc support for mocking NSS calls in unit tests, expanded previous unit tests to include new mock users/groups.
Basic unittest support and a few tests |
Description
Nikki VonHollen
2011-12-07 17:15:56 UTC
Created attachment 54449 [details] [review] Added netgroup support, added MockLibc support for mocking NSS calls in unit tests, expanded previous unit tests to include new mock users/groups. This patch relies on 'policykit-unittest.patch' from bug #43608. There are a few issues I ran into implementing netgroups: 1. Netgroups can't support glob syntax like other identities do in *.pkla files. 2. A netgroup with a wildcard entry like (,,), which means any user/host/domain, will be ignored in the admin identities list. 3. I use git submodules to include the MockLibc source code, but I'm not sure if that's what we should stick with. I can include code Since I'm using submodules, the first commit with the submodule needs to run 'git submodule add' to put special metadata in the repo which can't happen via patch AFAIK. For eaxmple: cd PolicyKit patch -p1 < ~/policykit-unittest.patch patch -p1 < ~/policykit-netgroup.patch git submodule add -b v1 https://code.google.com/p/mocklibc/ noinst/mocklibc Created attachment 54451 [details] [review] Basic unittest support and a few tests Please ignore the previous comment/attachment. I got the two bug numbers mixed up. Adds basic unit tests for: PolkitIdentity, PolkitUnixUser, PolkitUnixGroup, PolkitBackendLocalAuthorizationStore, and PolkitBackendLocalAuthority. Patch looks great, I've committed it here http://cgit.freedesktop.org/PolicyKit/commit/?id=15d2e90a54009efb31300d8b59292d71ce98a5b2 Thanks! |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.