Add tests for cynara_admin_check function 74/27974/3
authorLukasz Wojciechowski <l.wojciechow@partner.samsung.com>
Tue, 23 Sep 2014 15:56:03 +0000 (17:56 +0200)
committerLukasz Wojciechowski <l.wojciechow@partner.samsung.com>
Mon, 6 Oct 2014 06:32:19 +0000 (08:32 +0200)
commitd2eb84fbc263255accb52730dde316f5b3b571c7
tree331ba8fd59aa4aaad7da66d5f76a62feb5afb735
parenta58d78479064e7e903f029b4811ab9acf118abf8
Add tests for cynara_admin_check function

cynara_admin_check() function provides simmilar functionality to
cynara_check() from client's API. Differences between those two are:
* admin version can start check search in any given bucket;
* admin version can constrain search to single bucket (no recursion);
* in admin version policy types are returned without being interpreted
  by plugins in cynara service (e.g. no UI popups are launched).

There are 4 tests added:
* tc16_admin_check_single_bucket - for trivial single bucket checks;
* tc17_admin_check_nested_bucket - for testing proper check search
  scope (recursion and start bucket);
* tc18_admin_check_multiple_matches - for testing if minimum policy
  is found, when there is more than a single policy matching;
* tc19_admin_check_none_bucket - for testing proper behaviour, when
  default and only matching policy in bucket is of type NONE.

Verification:
After cynara patch https://review.tizen.org/gerrit/27971 is applied
test should pass. They can fail before due to policy types enumeration
inconsistency between external and internal caynara layers.

Change-Id: Ia37df3491fbc31beb9c638daa515ce5a6b92eb59
tests/cynara-tests/test_cases.cpp