grr/core/grr_response_core/lib/parsers/linux_cmd_parser_test.py
def testYumListCmdParser(self):
    """Ensure we can extract packages from yum output."""
    parser = linux_cmd_parser.YumListCmdParser()
    content = open(os.path.join(self.base_path, "yum.out"), "rb").read()
    out = list(
        parser.Parse("/usr/bin/yum", ["list installed -q"], content, "", 0, 5,
                     None))
    self.assertLen(out, 2)
    self.assertIsInstance(out[0], rdf_client.SoftwarePackage)
    self.assertEqual(out[0].name, "ConsoleKit")
    self.assertEqual(out[0].architecture, "x86_64")
    self.assertEqual(out[0].publisher, "@base")
Ensure we can extract packages from yum output.
Ensure we can extract packages from yum output.
Ensure we can extract packages from yum output .
def testYumListCmdParser(self):
    parser = linux_cmd_parser.YumListCmdParser()
    content = open(os.path.join(self.base_path, "yum.out"), "rb").read()
    out = list(
        parser.Parse("/usr/bin/yum", ["list installed -q"], content, "", 0, 5,
                     None))
    self.assertLen(out, 2)
    self.assertIsInstance(out[0], rdf_client.SoftwarePackage)
    self.assertEqual(out[0].name, "ConsoleKit")
    self.assertEqual(out[0].architecture, "x86_64")
    self.assertEqual(out[0].publisher, "@base")
def testYumListCmdParser ( self ) : parser = linux_cmd_parser . YumListCmdParser ( ) content = open ( os . path . join ( self . base_path , "yum.out" ) , "rb" ) . read ( ) out = list ( parser . Parse ( "/usr/bin/yum" , [ "list installed -q" ] , content , "" , 0 , 5 , None ) ) self . assertLen ( out , 2 ) self . assertIsInstance ( out [ 0 ] , rdf_client . SoftwarePackage ) self . assertEqual ( out [ 0 ] . name , "ConsoleKit" ) self . assertEqual ( out [ 0 ] . architecture , "x86_64" ) self . assertEqual ( out [ 0 ] . publisher , "@base" )
Ensure we can extract packages from yum output.
Ensure we can extract packages from yum output .
"""Ensure we can extract packages from yum output."""
self