Пример #1
0
 def test_pinned_single(self):
     request = make_requested_machine(pinned_cores=[4])
     definition = lxd_module.get_lxd_machine_definition(
         request,
         "maas-profile",
     )
     self.assertEqual(definition["config"]["limits.cpu"], "4-4")
Пример #2
0
 def test_hugepages(self):
     request = make_requested_machine(hugepages_backed=True)
     definition = lxd_module.get_lxd_machine_definition(
         request,
         "maas-profile",
     )
     self.assertEqual(definition["config"]["limits.memory.hugepages"],
                      "true")
Пример #3
0
 def test_definition(self):
     request = make_requested_machine()
     definition = lxd_module.get_lxd_machine_definition(
         request,
         "maas-profile",
     )
     self.assertEqual(
         definition,
         {
             "architecture": "x86_64",
             "config": {
                 "limits.cpu": str(request.cores),
                 "limits.memory": str(request.memory * 1024 * 1024),
                 "limits.memory.hugepages": "false",
                 "security.secureboot": "false",
             },
             "name": request.hostname,
             "profiles": ["maas-profile"],
             "source": {"type": "none"},
         },
     )