~andreserl/maas/qa-lab-tests

« back to all changes in this revision

Viewing changes to common.py

  • Committer: Andres Rodriguez
  • Date: 2019-05-08 23:07:57 UTC
  • Revision ID: andreserl@ubuntu.com-20190508230757-9g3wbtm6w2stw33p
common.py,integration-suite: Test composing KVMs per pod on 2.6+

Show diffs side-by-side

added added

removed removed

Lines of Context:
2002
2002
        ]
2003
2003
        return pods
2004
2004
 
2005
 
    @skipUnless(TEST_PERFORMANCE, "Not testing performance.")
 
2005
    @skipUnless(
 
2006
        TEST_PERFORMANCE or StrictVersion(get_maas_version()[:3]) < StrictVersion('2.6'),
 
2007
        'Skipping... KVM composition is tested on 2.6+ or when testing performance')
 
2008
    @timeout(30 * 60)
2006
2009
    def test_compose_machines_per_pod(self):
2007
2010
        pods = self._get_pods()
2008
2011
        for pod in pods:
2010
2013
            pod_name = pod['name']
2011
2014
            pod_cores = int(pod['available']['cores'])
2012
2015
            cores_per_machine = 2
2013
 
            number_of_machines = pod_cores / cores_per_machine
 
2016
            # Always compose 1 machines unless we are testing performance.
 
2017
            number_of_machines = 1
 
2018
            if TEST_PERFORMANCE:
 
2019
                number_of_machines = pod_cores / cores_per_machine
2014
2020
            for vm in range(0, int(number_of_machines)):
2015
2021
                hostname = "%s-%s" % (pod_name, vm)
2016
2022
                output, _ = self._run_maas_cli([
2017
2023
                    'pod', 'compose', str(pod_id), 'hostname=%s' % hostname,
2018
2024
                    'cores=%s' % cores_per_machine, 'memory=2048'])
 
2025
        # If we are not testing performance, then wait for machines to finish
 
2026
        # commissioning
 
2027
        if not TEST_PERFORMANCE:
 
2028
            # Wait for 1 VM per pod to be in 'READY' state.
 
2029
            self._wait_machines(NODE_STATUS.READY, num_expected=len(pods))
2019
2030
 
2020
2031
    def test_read_installation_results(self):
2021
2032
        # Get details about the installed machines so we can check