|
BSL v2.0.1 - 13.gad0cb52
AMMOS Bundle Protocol Security Library (BSL)
|
Specific low-level tests of the Sample Policy Provider. More...
#include "DefaultScUtils.h"#include <bsl/BPSecLib_Private.h>#include <bsl/sample_pp/SamplePolicyProvider.h>#include <bsl/mock_bpa/MockBPA.h>#include <unity.h>
Include dependency graph for test_SamplePolicyProvider.c:Functions | |
| void | suiteSetUp (void) |
| int | suiteTearDown (int failures) |
| void | setUp (void) |
| void | tearDown (void) |
| void | test_SamplePolicyProvider_GetRuleById (void) |
| void | test_SamplePolicyProvider_RejectsDuplicateRuleId (void) |
| void | test_SamplePolicyProvider_RemoveRuleById (void) |
| void | test_SamplePolicyProvider_ClearRules (void) |
| void | test_SamplePolicyProvider_ReplaceRuleById (void) |
| void | test_SamplePolicyProvider_WildcardPolicyRuleVerifiesBIB (void) |
| Purpose: Exercise the Rule and Predicate primitives to for BIB in a given bundle. | |
Variables | |
| static BSL_TestContext_t | LocalTestCtx |
Specific low-level tests of the Sample Policy Provider.
Notes:
| void setUp | ( | void | ) |
References BSL_TestContext_Init(), LocalTestCtx, and TEST_ASSERT_EQUAL().
| void suiteSetUp | ( | void | ) |
| int suiteTearDown | ( | int | failures | ) |
References BSL_HostDescriptors_Clear(), and mock_bpa_LogClose().
| void tearDown | ( | void | ) |
References BSL_TestContext_Deinit(), LocalTestCtx, and TEST_ASSERT_EQUAL().
| void test_SamplePolicyProvider_ClearRules | ( | void | ) |
References BSL_BLOCK_TYPE_PAYLOAD, BSL_BLOCK_TYPE_PRIMARY, BSL_POLICYACTION_DROP_BUNDLE, BSL_POLICYACTION_NOTHING, BSL_POLICYLOCATION_APPIN, BSL_POLICYLOCATION_CLOUT, BSL_SECBLOCKTYPE_BCB, BSL_SECBLOCKTYPE_BIB, BSL_SECROLE_ACCEPTOR, BSL_SECROLE_VERIFIER, BSL_SUCCESS, BSLP_PolicyPredicate_InitFrom(), BSLP_PolicyProvider_AddRule(), BSLP_PolicyProvider_ClearRules(), BSLP_PolicyProvider_Destroy(), BSLP_PolicyProvider_GetRuleById(), BSLP_PolicyProvider_New(), BSLP_PolicyProvider_RuleCount(), BSLP_PolicyRule_InitFrom(), and TEST_ASSERT_EQUAL().
| void test_SamplePolicyProvider_GetRuleById | ( | void | ) |
References BSL_BLOCK_TYPE_PAYLOAD, BSL_POLICYACTION_DROP_BUNDLE, BSL_POLICYLOCATION_APPIN, BSL_SECBLOCKTYPE_BIB, BSL_SECROLE_VERIFIER, BSL_SUCCESS, BSLP_PolicyPredicate_InitFrom(), BSLP_PolicyProvider_AddRule(), BSLP_PolicyProvider_Destroy(), BSLP_PolicyProvider_GetRuleById(), BSLP_PolicyProvider_New(), BSLP_PolicyRule_InitFrom(), BSLP_PolicyRule_t::description, BSLP_PolicyRule_t::rule_id, and TEST_ASSERT_EQUAL().
| void test_SamplePolicyProvider_RejectsDuplicateRuleId | ( | void | ) |
References BSL_BLOCK_TYPE_PAYLOAD, BSL_ERR_POLICY_CONFIG, BSL_POLICYACTION_DROP_BUNDLE, BSL_POLICYLOCATION_APPIN, BSL_SECBLOCKTYPE_BIB, BSL_SECROLE_VERIFIER, BSL_SUCCESS, BSLP_PolicyPredicate_Deinit(), BSLP_PolicyPredicate_InitFrom(), BSLP_PolicyProvider_AddRule(), BSLP_PolicyProvider_Destroy(), BSLP_PolicyProvider_GetRuleById(), BSLP_PolicyProvider_New(), BSLP_PolicyProvider_RuleCount(), BSLP_PolicyRule_Deinit(), BSLP_PolicyRule_InitFrom(), and TEST_ASSERT_EQUAL().
| void test_SamplePolicyProvider_RemoveRuleById | ( | void | ) |
References BSL_BLOCK_TYPE_PAYLOAD, BSL_ERR_POLICY_CONFIG, BSL_POLICYACTION_DROP_BUNDLE, BSL_POLICYLOCATION_APPIN, BSL_SECBLOCKTYPE_BIB, BSL_SECROLE_VERIFIER, BSL_SUCCESS, BSLP_PolicyPredicate_InitFrom(), BSLP_PolicyProvider_AddRule(), BSLP_PolicyProvider_Destroy(), BSLP_PolicyProvider_GetRuleById(), BSLP_PolicyProvider_New(), BSLP_PolicyProvider_RemoveRuleById(), BSLP_PolicyProvider_RuleCount(), BSLP_PolicyRule_InitFrom(), and TEST_ASSERT_EQUAL().
| void test_SamplePolicyProvider_ReplaceRuleById | ( | void | ) |
References action_set, BSL_BLOCK_TYPE_PAYLOAD, BSL_BLOCK_TYPE_PRIMARY, BSL_ERR_POLICY_CONFIG, BSL_POLICYACTION_DROP_BUNDLE, BSL_POLICYACTION_NOTHING, BSL_POLICYLOCATION_APPIN, BSL_POLICYLOCATION_CLOUT, BSL_SECBLOCKTYPE_BCB, BSL_SECBLOCKTYPE_BIB, BSL_SECROLE_ACCEPTOR, BSL_SECROLE_VERIFIER, BSL_SecurityAction_CountSecOpers(), BSL_SecurityActionSet_CountActions(), BSL_SecurityActionSet_Deinit(), BSL_SecurityActionSet_GetActionAtIndex(), BSL_SecurityActionSet_Init(), BSL_SUCCESS, BSL_TestUtils_LoadBundleFromCBOR(), BSLP_PolicyPredicate_Deinit(), BSLP_PolicyPredicate_InitFrom(), BSLP_PolicyProvider_AddRule(), BSLP_PolicyProvider_Destroy(), BSLP_PolicyProvider_GetRuleById(), BSLP_PolicyProvider_New(), BSLP_PolicyProvider_ReplaceRuleById(), BSLP_PolicyProvider_RuleCount(), BSLP_PolicyRule_Deinit(), BSLP_PolicyRule_InitFrom(), BSLP_QueryPolicy(), mock_bpa_ctr_t::bundle_ref, BSLP_PolicyRule_t::context_id, BSLP_PolicyRule_t::description, BSLP_PolicyPredicate_t::dst_eid_pattern, BSL_HostEIDPattern_t::handle, RFC9173_TestVectors_AppendixA1::hex_bundle_bib, LocalTestCtx, BSL_TestContext_t::mock_bpa_ctr, BSLP_PolicyRule_t::role, BSLP_PolicyRule_t::rule_id, BSLP_PolicyRule_t::sec_block_type, BSLP_PolicyPredicate_t::secsrc_eid_pattern, BSLP_PolicyPredicate_t::src_eid_pattern, and TEST_ASSERT_EQUAL().
| void test_SamplePolicyProvider_WildcardPolicyRuleVerifiesBIB | ( | void | ) |
Purpose: Exercise the Rule and Predicate primitives to for BIB in a given bundle.
Creates a rule: At location "APPIN", Bundles FROM anywhere, Bundles TO anywhere, must contain a BIB block covering the payload.
Steps:
Notes:
References BSL_BLOCK_TYPE_PAYLOAD, BSL_POLICYACTION_DROP_BUNDLE, BSL_POLICYLOCATION_APPIN, BSL_SECBLOCKTYPE_BIB, BSL_SecOper_CountOptions(), BSL_SecOper_Deinit(), BSL_SecOper_GetPolicyAction(), BSL_SecOper_Init(), BSL_SecOper_IsBIB(), BSL_SECROLE_VERIFIER, BSL_TestUtils_LoadBundleFromCBOR(), BSLP_PolicyPredicate_Deinit(), BSLP_PolicyPredicate_InitFrom(), BSLP_PolicyRule_Deinit(), BSLP_PolicyRule_EvaluateAsSecOper(), BSLP_PolicyRule_InitFrom(), mock_bpa_ctr_t::bundle_ref, RFC9173_TestVectors_AppendixA1::hex_bundle_bib, LocalTestCtx, BSL_TestContext_t::mock_bpa_ctr, and TEST_ASSERT_EQUAL().
|
static |