示例#1
0
 def setUp(self, **kwargs):
   super(HintDefinitionTests, self).setUp(**kwargs)
   if not self.configs:
     config_file = os.path.join(CHECKS_DIR, "sw.yaml")
     cfg = yaml.ReadFromPath(config_file)
   chk = checks.Check(**cfg)
   self.lin_method, self.win_method, self.foo_method = list(chk.method)
示例#2
0
def GetWMIData():
  if WMI_SW:
    return WMI_SW

  # Load some wmi data
  parser = wmi_parser.WMIInstalledSoftwareParser()
  test_data = os.path.join(CHECKS_DIR, "data/wmi_sw.yaml")
  wmi = yaml.ReadFromPath(test_data)
  for sw in wmi:
    WMI_SW.extend(parser.Parse(sw))

  return WMI_SW
示例#3
0
 def setUp(self, **kwargs):
   super(CheckTest, self).setUp(**kwargs)
   if not self.cfg:
     config_file = os.path.join(CHECKS_DIR, "sw.yaml")
     self.cfg = yaml.ReadFromPath(config_file)
     self.host_data = {
         "DebianPackagesStatus": {
             "ANOMALY": [],
             "PARSER": GetDPKGData(),
             "RAW": []
         },
         "WMIInstalledSoftware": {
             "ANOMALY": [],
             "PARSER": GetWMIData(),
             "RAW": []
         }
     }
示例#4
0
 def setUp(self, **kwargs):
   super(MethodTest, self).setUp(**kwargs)
   if not self.configs:
     config_file = os.path.join(CHECKS_DIR, "sw.yaml")
     check_def = yaml.ReadFromPath(config_file)
     self.configs = check_def["method"]