コード例 #1
0
 def test_prepare_scan_region_folder_plan(self):
     scan_plan = ScanPlan(SCAN_REGION_FOLDER_PLAN_TO_BE_PREPARED)
     plan = self.scan_controller.prepare_scan_plan(scan_plan)
     self.check_plan_values(plan, SCANNER_CLASS_FOR_REGION_FOLDER,
                            OBJ_ID_FOR_REGION_FOLDER,
                            CHILD_TYPE_FOR_REGION_FOLDER,
                            CHILD_ID_FOR_REGION_FOLDER)
コード例 #2
0
    def test_scan_with_cliques_only(self):
        self.scan_controller.get_args = MagicMock()
        scan_plan = ScanPlan(SCAN_ENV_CLIQUES_ONLY_PLAN_TO_BE_PREPARED)
        plan = self.scan_controller.prepare_scan_plan(scan_plan)
        self.scan_controller.get_scan_plan = MagicMock(return_value=plan)
        self.prepare_scan_mocks()

        self.scan_controller.run()
        self.check_scan_counts(0, 0, 1, 0)
        self.reset_methods()
コード例 #3
0
    def test_scan_with_monitoring_setup(self):
        self.scan_controller.get_args = MagicMock()
        InventoryMgr.is_feature_supported = MagicMock(return_value=True)
        plan = self.scan_controller.prepare_scan_plan(
            ScanPlan(SCAN_ENV_PLAN_TO_BE_PREPARED))
        self.scan_controller.get_scan_plan = MagicMock(return_value=plan)
        self.prepare_scan_mocks()

        self.scan_controller.run()
        self.check_scan_counts(1, 1, 1, 1)
        self.reset_methods()
コード例 #4
0
    def test_prepare_scan_region_plan(self):
        original_get_by_id = self.inv.get_by_id
        self.inv.get_by_id = MagicMock(return_value=REGIONS_FOLDER)

        self.scan_controller.inv = self.inv
        scan_plan = ScanPlan(SCAN_REGION_PLAN_TO_BE_PREPARED)
        plan = self.scan_controller.prepare_scan_plan(scan_plan)

        self.check_plan_values(plan, SCANNER_TYPE_FOR_REGION,
                               OBJ_ID_FOR_REGION, CHILD_TYPE_FOR_REGION,
                               CHILD_ID_FOR_REGION)
        self.inv.get_by_id = original_get_by_id
コード例 #5
0
 def test_prepare_scan_plan(self):
     scan_plan = ScanPlan(SCAN_ENV_PLAN_TO_BE_PREPARED)
     plan = self.scan_controller.prepare_scan_plan(scan_plan)
     self.check_plan_values(plan, SCANNER_TYPE_FOR_ENV, OBJ_ID_FOR_ENV,
                            CHILD_TYPE_FOR_ENV, CHILD_ID_FOR_ENV)