Ejemplo n.º 1
0
def parse_submission(args):
    # Extract the submission
    tmpdir = tempfile.mkdtemp()
    bugtool = inspector.find_in_tarball(args.filename,'tar.bz2')
    tar = tarfile.open(args.filename)
    t = tar.extract(bugtool, tmpdir)

    tarball_path = "%s/%s" % (tmpdir, bugtool)
    host = inspector.HostFromTarball(tarball_path)

    inspector.print_system_info(host, ['bios', 'cpu', 'nic', 'storage'])
    shutil.rmtree(tmpdir)

    json = get_json_from_test_run(args.filename)

    #Check for failures
    validate_test_run(json)

    if args.post:
        print post_json_to_mongodb(json)
Ejemplo n.º 2
0
def parse_submission(args):
    # Extract the submission
    tmpdir = tempfile.mkdtemp()
    bugtool = inspector.find_in_tarball(args.filename, 'tar.bz2')
    tar = tarfile.open(args.filename)
    t = tar.extract(bugtool, tmpdir)

    tarball_path = "%s/%s" % (tmpdir, bugtool)
    host = inspector.HostFromTarball(tarball_path)

    inspector.print_system_info(host, ['bios', 'cpu', 'nic', 'storage'])
    shutil.rmtree(tmpdir)

    json = get_json_from_test_run(args.filename)

    # Check for failures
    validate_test_run(json)

    if args.post:
        print post_json_to_mongodb(json)
Ejemplo n.º 3
0
 def test_print_bios(self, mprint_unit):
     mhost = mock.MagicMock()
     options = ['bios']
     inspector.print_system_info(mhost, options)
     self.assertEqual(len(mprint_unit.mock_calls), 1)
Ejemplo n.º 4
0
 def test_print_all(self, mprint_unit):
     mhost = mock.MagicMock()
     options = ['bios', 'nic', 'storage', 'gpu', 'cpu']
     inspector.print_system_info(mhost, options)
     # GPU is optionally shown only if devices exist
     self.assertEqual(len(mprint_unit.mock_calls), 4)
Ejemplo n.º 5
0
 def test_print_bios(self, mprint_unit):
     mhost = mock.MagicMock()
     options = ['bios']
     inspector.print_system_info(mhost, options)
     self.assertEqual(len(mprint_unit.mock_calls), 1)
Ejemplo n.º 6
0
 def test_print_all(self, mprint_unit):
     mhost = mock.MagicMock()
     options = ['bios', 'nic', 'storage', 'gpu', 'cpu']
     inspector.print_system_info(mhost, options)
     # GPU is optionally shown only if devices exist
     self.assertEqual(len(mprint_unit.mock_calls), 4)