def test_gbp_pr_pc_pa_shared_func_2(self):

        self._log.info(
            "\n############################################################\n"
            "TESTCASE_GBP_PR_PC_PA_SHARED_INTEG_2: TO CREATE/UPDATE/ "
            "POLICY RULE with shared/non-shared PA & PCs\n"
            "TEST_STEP::\n"
            "Create Policy Classifier and Policy Action with "
            "shared=False(default)\n"
            "Create another set of Policy Classifier & Policy "
            "Action with shared=True\n"
            "Create Policy Rule using the 2nd set of PA & PC "
            "and shared=True\n"
            "Update the Policy Rule with 1st set of PA & PC "
            "and verify update failed\n"
            "Update the Policy Rule by setting shared=False "
            "and verify it passed\n"
            "##############################################################\n")

        # Testcase work-flow starts
        # Create PA,PC with shared=False
        self._log.info(
            '\n## Step 1A: Create a PC with shared=False(default) ##')
        obj_uuid_false = {}
        self.cls_uuid = self.gbpcfg.gbp_policy_cfg_all(
            1, 'classifier', 'cls_shared')
        if self.cls_uuid == 0:
            self._log.info(
                "\n Creation of Policy Classifier with shared=False, Failed\n")
            return 0
        obj_uuid_false['classifier'] = self.cls_uuid
        self._log.info(
            '\n## Step 1B: Create a PA with shared=False(default) ##')
        self.act_uuid = self.gbpcfg.gbp_policy_cfg_all(
            1, 'action', 'act_shared')
        if self.act_uuid == 0:
            self._log.info(
                "\n Creation of Policy Action with shared=False, Failed\n")
            return 0
        obj_uuid_false['action'] = self.act_uuid
        # Create PA,PC with shared=True
        self._log.info('\n## Step 2A: Create a PC with shared=True ##')
        obj_uuid_true = {}
        self.cls_uuid = self.gbpcfg.gbp_policy_cfg_all(
            1, 'classifier', self.cls_name, shared=True)
        if self.cls_uuid == 0:
            self._log.info(
                "\n Step 2A: Creation of Policy Classifier with "
                "shared=True, Failed\n")
            return 0
        obj_uuid_true['classifier'] = self.cls_uuid
        self._log.info('\n## Step 2B: Create a PA with shared=True ##')
        self.act_uuid = self.gbpcfg.gbp_policy_cfg_all(
            1, 'action', self.act_name, shared=True)
        if self.act_uuid == 0:
            self._log.info(
                "\n Step 2B: Creation of Policy Action with "
                "shared=True, Failed\n")
            return 0
        obj_uuid_true['action'] = self.act_uuid
        # Create PR(shared=True) with PA+PC(shared=True)
        self._log.info(
            "\n## Step 3: Create Policy Rule with PC & PA with shared=True ##")
        rule_uuid = self.gbpcfg.gbp_policy_cfg_all(
            1,
            'rule',
            'pr_true',
            classifier=obj_uuid_true['classifier'],
            action=obj_uuid_true['action'],
            shared=True)
        if rule_uuid == 0:
            self._log.info(
                "# Step 3: Creation of Policy Rule with shared=True "
                "using attributes PA+PC(shared=True), Failed")
            return 0
        # Update and Verify the PR(shared=True) with PA+PC(shared=False)
        self._log.info(
            "\n## Step 4A: Update the Policy Rule with PC & PA which "
            "are with shared=False ##")
        if self.gbpcfg.gbp_policy_cfg_all(
                2,
                'rule',
                rule_uuid,
                classifier=obj_uuid_false['classifier'],
                action=obj_uuid_false['action']) != 0:
            self._log.info(
                "# Step 4A: Updating Policy Rule(shared=True) by attributes "
                "PA+PC(shared=False) DID NOT Fail")
            return 0
        self._log.info(
            "\n## Step 4B: Verify the Policy Rule initial attributes "
            "PA,PC,shared=True ##")
        if self.gbpverify.gbp_policy_verify_all(
                1,
                'rule',
                'pr_true',
                id=rule_uuid,
                policy_classifier_id=obj_uuid_true['classifier'],
                enabled='True',
                policy_actions=obj_uuid_true['action'],
                shared=True) == 0:
            self._log.info(
                "# Step 4B: Verify Policy Rule with shared=True, Failed")
            return 0
        # Update and Verify the PR(shared=False) with PA+PC(shared=False)
        self._log.info(
            "\n## Step 5A: Update the Policy Rule's shared=False  along "
            "with PC+PA(shared=False) ##")
        if self.gbpcfg.gbp_policy_cfg_all(
                2,
                'rule',
                rule_uuid,
                classifier=obj_uuid_false['classifier'],
                action=obj_uuid_false['action'],
                shared=False) == 0:
            self._log.info(
                "# Step 5A: Updating Policy Rule(shared=False) by "
                "attributes PA+PC(shared=False), Failed")
            return 0
        self._log.info(
            "\n## Step 5B: Verify the Policy Rule attributes "
            "PA,PC,shared=False ##")
        if self.gbpverify.gbp_policy_verify_all(
                1,
                'rule',
                'pr_true',
                id=rule_uuid,
                policy_classifier_id=obj_uuid_false['classifier'],
                enabled='True',
                policy_actions=obj_uuid_false['action'],
                shared=False) == 0:
            self._log.info(
                "# Step 5B: Verify Policy Rule with shared=False, Failed")
            return 0
        self._log.info("\n## TESTCASE_GBP_PR_PC_PA_SHARED_INTEG_2: 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_2/original