grr/core/grr_response_core/lib/parsers/linux_cmd_parser_test.py
def testDmidecodeParser(self):
    """Test to see if we can get data from dmidecode output."""
    parser = linux_cmd_parser.DmidecodeCmdParser()
    content = open(os.path.join(self.base_path, "dmidecode.out"), "rb").read()
    parse_result = list(
        parser.Parse("/usr/sbin/dmidecode", ["-q"], content, "", 0, 5, None))
    self.assertLen(parse_result, 1)
    hardware = parse_result[0]

    self.assertIsInstance(hardware, rdf_client.HardwareInfo)

    self.assertEqual(hardware.serial_number, "2UA25107BB")
    self.assertEqual(hardware.system_manufacturer, "Hewlett-Packard")
    self.assertEqual(hardware.system_product_name, "HP Z420 Workstation")
    self.assertEqual(hardware.system_uuid,
                     "4596BF80-41F0-11E2-A3B4-10604B5C7F38")
    self.assertEqual(hardware.system_sku_number, "C2R51UC#ABA")
    self.assertEqual(hardware.system_family, "103C_53335X G=D")

    self.assertEqual(hardware.bios_vendor, "Hewlett-Packard")
    self.assertEqual(hardware.bios_version, "J61 v02.08")
    self.assertEqual(hardware.bios_release_date, "10/17/2012")
    self.assertEqual(hardware.bios_rom_size, "16384 kB")
    self.assertEqual(hardware.bios_revision, "2.8")
Test to see if we can get data from dmidecode output.
Test to see if we can get data from dmidecode output.
Test to see if we can get data from dmidecode output .
def testDmidecodeParser(self):
    parser = linux_cmd_parser.DmidecodeCmdParser()
    content = open(os.path.join(self.base_path, "dmidecode.out"), "rb").read()
    parse_result = list(
        parser.Parse("/usr/sbin/dmidecode", ["-q"], content, "", 0, 5, None))
    self.assertLen(parse_result, 1)
    hardware = parse_result[0]
    self.assertIsInstance(hardware, rdf_client.HardwareInfo)
    self.assertEqual(hardware.serial_number, "2UA25107BB")
    self.assertEqual(hardware.system_manufacturer, "Hewlett-Packard")
    self.assertEqual(hardware.system_product_name, "HP Z420 Workstation")
    self.assertEqual(hardware.system_uuid,
                     "4596BF80-41F0-11E2-A3B4-10604B5C7F38")
    self.assertEqual(hardware.system_sku_number, "C2R51UC#ABA")
    self.assertEqual(hardware.system_family, "103C_53335X G=D")
    self.assertEqual(hardware.bios_vendor, "Hewlett-Packard")
    self.assertEqual(hardware.bios_version, "J61 v02.08")
    self.assertEqual(hardware.bios_release_date, "10/17/2012")
    self.assertEqual(hardware.bios_rom_size, "16384 kB")
    self.assertEqual(hardware.bios_revision, "2.8")
def testDmidecodeParser ( self ) : parser = linux_cmd_parser . DmidecodeCmdParser ( ) content = open ( os . path . join ( self . base_path , "dmidecode.out" ) , "rb" ) . read ( ) parse_result = list ( parser . Parse ( "/usr/sbin/dmidecode" , [ "-q" ] , content , "" , 0 , 5 , None ) ) self . assertLen ( parse_result , 1 ) hardware = parse_result [ 0 ] self . assertIsInstance ( hardware , rdf_client . HardwareInfo ) self . assertEqual ( hardware . serial_number , "2UA25107BB" ) self . assertEqual ( hardware . system_manufacturer , "Hewlett-Packard" ) self . assertEqual ( hardware . system_product_name , "HP Z420 Workstation" ) self . assertEqual ( hardware . system_uuid , "4596BF80-41F0-11E2-A3B4-10604B5C7F38" ) self . assertEqual ( hardware . system_sku_number , "C2R51UC#ABA" ) self . assertEqual ( hardware . system_family , "103C_53335X G=D" ) self . assertEqual ( hardware . bios_vendor , "Hewlett-Packard" ) self . assertEqual ( hardware . bios_version , "J61 v02.08" ) self . assertEqual ( hardware . bios_release_date , "10/17/2012" ) self . assertEqual ( hardware . bios_rom_size , "16384 kB" ) self . assertEqual ( hardware . bios_revision , "2.8" )
Test to see if we can get data from dmidecode output.
Test to see if we can get data from dmidecode output .
"""Test to see if we can get data from dmidecode output."""
self