grr/core/grr_response_core/lib/parsers/linux_cmd_parser_test.py
def testDpkgCmdParserPrecise(self):
    """Ensure we can extract packages from dpkg output on ubuntu precise."""
    parser = linux_cmd_parser.DpkgCmdParser()
    content = open(
        os.path.join(self.base_path, "checks/data/dpkg.precise.out"),
        "rb").read()
    out = list(
        parser.Parse("/usr/bin/dpkg", ["--list"], content, "", 0, 5, None))
    self.assertLen(out, 30)
    self.assertIsInstance(out[1], rdf_client.SoftwarePackage)
    self.assertTrue(out[0].name, "adduser")
Ensure we can extract packages from dpkg output on ubuntu precise.
Ensure we can extract packages from dpkg output on ubuntu precise.
Ensure we can extract packages from dpkg output on ubuntu precise .
def testDpkgCmdParserPrecise(self):
    parser = linux_cmd_parser.DpkgCmdParser()
    content = open(
        os.path.join(self.base_path, "checks/data/dpkg.precise.out"),
        "rb").read()
    out = list(
        parser.Parse("/usr/bin/dpkg", ["--list"], content, "", 0, 5, None))
    self.assertLen(out, 30)
    self.assertIsInstance(out[1], rdf_client.SoftwarePackage)
    self.assertTrue(out[0].name, "adduser")
def testDpkgCmdParserPrecise ( self ) : parser = linux_cmd_parser . DpkgCmdParser ( ) content = open ( os . path . join ( self . base_path , "checks/data/dpkg.precise.out" ) , "rb" ) . read ( ) out = list ( parser . Parse ( "/usr/bin/dpkg" , [ "--list" ] , content , "" , 0 , 5 , None ) ) self . assertLen ( out , 30 ) self . assertIsInstance ( out [ 1 ] , rdf_client . SoftwarePackage ) self . assertTrue ( out [ 0 ] . name , "adduser" )
Ensure we can extract packages from dpkg output on ubuntu precise.
Ensure we can extract packages from dpkg output on ubuntu precise .
"""Ensure we can extract packages from dpkg output on ubuntu precise."""
self