

def test_gbp_pr_pc_pa_shared_func_3(self):
    self._log.info('\n############################################################\nTESTCASE_GBP_PR_PC_PA_SHARED_INTEG_3: TO CREATE/VERIFY//VERIFY a POLICY RULE with POLICY ACTION & CLASSIFIER\nTEST_STEP::\nCreate Policy Action with shared=False, while Policy Classifier with shared=True\nCreate Policy Rule with PA & PC and shared=True and verify it failed to create\nRetry Create Policy Rule with above PA,PC and shared=False and verify it success\nUpdate the Policy Action with shared=True \nCreate Policy Rule with shared=True with above PA+PC and verify it success\n##############################################################\n')
    self._log.info('\n## Step 1A: Create a PC with shared=True ##')
    obj_uuid = {
        
    }
    self.cls_uuid = self.gbpcfg.gbp_policy_cfg_all(1, 'classifier', 'cls_true', shared=True)
    if (self.cls_uuid == 0):
        self._log.info('\n Creation of Policy Classifier with shared=False, Failed\n')
        return 0
    obj_uuid['classifier'] = self.cls_uuid
    self._log.info('\n## Step 1B: Create a PA with shared=False ##')
    self.act_uuid = self.gbpcfg.gbp_policy_cfg_all(1, 'action', 'act_false')
    if (self.act_uuid == 0):
        self._log.info('\n Creation of Policy Action with shared=False, Failed\n')
        return 0
    obj_uuid['action'] = self.act_uuid
    self._log.info('\n## Step 2A: Create Policy Rule(shared=True) with PA(shared=False) & PC(shared=True) ##')
    if (self.gbpcfg.gbp_policy_cfg_all(1, 'rule', 'true_pr', classifier=obj_uuid['classifier'], action=obj_uuid['action'], shared=True) != 0):
        self._log.info('# Step 2A: Creation of Policy Rule with shared=True using attributes PA(shared=False)+PC(shared=True) did NOT Fail')
        return 0
    self._log.info('\n## Step 2B: Create Policy Rule(shared=False) with PA(shared=False) & PC(shared=True)& Verify ##')
    rule_uuid = self.gbpcfg.gbp_policy_cfg_all(1, 'rule', 'true_pr', classifier=obj_uuid['classifier'], action=obj_uuid['action'])
    if (rule_uuid == 0):
        self._log.info('# Step 2B: Creation of Policy Rule with shared=False(default) using attributes PA(shared=False)+PC(shared=True), Failed')
        return 0
    if (self.gbpverify.gbp_policy_verify_all(1, 'rule', rule_uuid, policy_classifier_id=obj_uuid['classifier'], enabled='True', policy_actions=obj_uuid['action'], shared=False) == 0):
        self._log.info('# Step 2C: Verify Policy Rule with shared=False, Failed')
        return 0
    self._log.info('\n## Step 3: Update the Policy Action with shared=True\n')
    if (self.gbpcfg.gbp_policy_cfg_all(2, 'action', self.act_uuid, shared=True) == 0):
        self._log.info('# Step 3A: Update of Policy Action shared=True, Failed')
        return 0
    self._log.info('\n## Step 4: Create and Verify a PR with shared=True using above PA+PC(shared=True)\n')
    true_rule_uuid = self.gbpcfg.gbp_policy_cfg_all(1, 'rule', 'true_pr', classifier=obj_uuid['classifier'], action=obj_uuid['action'], shared=True)
    if (true_rule_uuid == 0):
        self._log.info('# Step : Creation of Policy Rule with shared=True using attributes PA+PC(shared=True), Failed')
        return 0
    if (self.gbpverify.gbp_policy_verify_all(1, 'rule', true_rule_uuid, policy_classifier_id=obj_uuid['classifier'], enabled='True', policy_actions=obj_uuid['action'], shared=True) == 0):
        self._log.info('# Step 4B: Verify Policy Rule with shared=True, Failed')
        return 0
    self._log.info('\n## TESTCASE_GBP_PR_PC_PA_SHARED_INTEG_3: PASSED')
    self.cleanup()
    return 1

dataset/ETHPy150Open openstack/group-based-policy/gbpservice/tests/contrib/gbpfunctests/testcases/tc_gbp_pr_pc_pa_shared_func.py test_gbp_pr_pc_pa_shared_func.test_gbp_pr_pc_pa_shared_func_3/original