Ejemplo n.º 1
0
    def cpu_models_to_test():
        """Return the list of CPU models to be tested, based on the
        cpu_models and cpu_model config options.

        Config option "cpu_model" may be used to ask a single CPU model
        to be tested. Config option "cpu_models" may be used to ask
        multiple CPU models to be tested.

        If cpu_models is "*", all CPU models reported by QEMU will be tested.
        """
        models_opt = params.get("cpu_models")
        model_opt = params.get("cpu_model")

        if (models_opt is None and model_opt is None):
            raise error.TestError("No cpu_models or cpu_model option is set")

        cpu_models = set()

        if models_opt == '*':
            cpu_models.update(utils_misc.get_qemu_cpu_models(qemu_binary))
        elif models_opt:
            cpu_models.update(models_opt.split())

        if model_opt:
            cpu_models.add(model_opt)

        return cpu_models
Ejemplo n.º 2
0
    def cpu_models_to_test():
        """Return the list of CPU models to be tested, based on the
        cpu_models and cpu_model config options.

        Config option "cpu_model" may be used to ask a single CPU model
        to be tested. Config option "cpu_models" may be used to ask
        multiple CPU models to be tested.

        If cpu_models is "*", all CPU models reported by QEMU will be tested.
        """
        models_opt = params.get("cpu_models")
        model_opt = params.get("cpu_model")

        if (models_opt is None and model_opt is None):
            test.error("No cpu_models or cpu_model option is set")

        cpu_models = set()

        if models_opt == '*':
            cpu_models.update(utils_misc.get_qemu_cpu_models(qemu_binary))
        elif models_opt:
            cpu_models.update(models_opt.split())

        if model_opt:
            cpu_models.add(model_opt)

        return cpu_models
Ejemplo n.º 3
0
 def test(self):
     """
     test method
     """
     cpu_models = cpu_models_to_test()
     qemu_models = utils_misc.get_qemu_cpu_models(qemu_binary)
     missing = set(cpu_models) - set(qemu_models)
     if missing:
         raise error.TestFail("Some CPU models not in QEMU CPU model list: %s")
     added = set(qemu_models) - set(cpu_models)
     if added:
         logging.info("Extra CPU models in QEMU CPU listing: %s", added)
Ejemplo n.º 4
0
 def test(self):
     """
     test method
     """
     cpu_models = cpu_models_to_test()
     qemu_models = utils_misc.get_qemu_cpu_models(qemu_binary)
     missing = set(cpu_models) - set(qemu_models)
     if missing:
         raise error.TestFail("Some CPU models not in QEMU CPU model list: %s")
     added = set(qemu_models) - set(cpu_models)
     if added:
         logging.info("Extra CPU models in QEMU CPU listing: %s", added)
Ejemplo n.º 5
0
 def test_qemu_cpu_models_list(self):
     """
     check CPU models returned by <qemu> -cpu '?' are what is expected
     """
     """
     test method
     """
     cpu_models = cpu_models_to_test()
     qemu_models = utils_misc.get_qemu_cpu_models(qemu_binary)
     missing = set(cpu_models) - set(qemu_models)
     if missing:
         raise error.TestFail("Some CPU models not in QEMU CPU model list: %r" % (missing))
     added = set(qemu_models) - set(cpu_models)
     if added:
         logging.info("Extra CPU models in QEMU CPU listing: %s", added)
Ejemplo n.º 6
0
 def test_qemu_cpu_models_list(self):
     """
     check CPU models returned by <qemu> -cpu '?' are what is expected
     """
     """
     test method
     """
     cpu_models = cpu_models_to_test()
     qemu_models = utils_misc.get_qemu_cpu_models(qemu_binary)
     missing = set(cpu_models) - set(qemu_models)
     if missing:
         test.fail("Some CPU models not in QEMU CPU model list: %r" %
                   (missing))
     added = set(qemu_models) - set(cpu_models)
     if added:
         logging.info("Extra CPU models in QEMU CPU listing: %s", added)