~andreserl/maas/python3_qa_lab_tests

« back to all changes in this revision

Viewing changes to common.py

  • Committer: Andres Rodriguez
  • Date: 2017-12-09 14:17:42 UTC
  • mfrom: (505.1.9 qa-custom-images)
  • Revision ID: andreserl@ubuntu.com-20171209141742-s6kt2nc3t43x5n09
Add support to test custom image repository.

Show diffs side-by-side

added added

removed removed

Lines of Context:
66
66
    GIGABYTE_PASS,
67
67
    TEST_JUJU,
68
68
    TEST_CUSTOM_IMAGES,
 
69
    CUSTOM_IMAGES_SOURCE,
69
70
    TEST_WINDOWS,
70
71
    HTTP_PROXY,
71
72
    LAB_DNS_CONFIG,
996
997
 
997
998
    @skipUnless(TEST_CUSTOM_IMAGES, "Not testing custom images")
998
999
    def test_set_custom_boot_source(self):
999
 
        boot_source_url = "http://10.55.32.203/proposed/streams/v1/index.json"
1000
1000
        output, _ = self._run_maas_cli([
1001
1001
            "boot-source", "update", "1",
1002
 
            "url=" + boot_source_url,
 
1002
            "url=" + CUSTOM_IMAGES_SOURCE,
1003
1003
        ])
1004
1004
        boot_source = loads(output)
1005
 
        self.assertThat(boot_source['url'], Equals(boot_source_url))
 
1005
        self.assertThat(boot_source['url'], Equals(CUSTOM_IMAGES_SOURCE))
1006
1006
 
1007
1007
    @timeout(60 * 30)
1008
1008
    def test_stop_image_import(self):
1068
1068
                    updated_selection["arches"], Equals(new_arches)
1069
1069
                )
1070
1070
 
 
1071
    @skipIf(TEST_CUSTOM_IMAGES, "Not testing CentOS. Testing custom images repository.")
1071
1072
    def test_add_boot_source_selection_centos(self):
1072
1073
        output, _ = self._run_maas_cli(["boot-sources", "read"])
1073
1074
        boot_sources = loads(output)
1154
1155
                (osystem_series, 'amd64/hwe-16.04-lowlatency'),
1155
1156
                (osystem_series, 'amd64/ga-16.04'),
1156
1157
                (osystem_series, 'amd64/ga-16.04-lowlatency'),
1157
 
                (u'centos/centos70', 'amd64/generic'),
1158
1158
            ])
 
1159
            # TEST_CUSTOM_IMAGES avoids testing CentOS. As such, if not
 
1160
            # testing custom images, add centos the the expected images.
 
1161
            if not TEST_CUSTOM_IMAGES:
 
1162
                expected_resources.update([
 
1163
                    (u'centos/centos70', 'amd64/generic'),
 
1164
                    ])
1159
1165
            if USE_ARM64_NODES:
1160
1166
                expected_resources.update([
1161
1167
                    (osystem_series, 'arm64/ga-16.04'),
1484
1490
 
1485
1491
    @timeout(10*60)
1486
1492
    @skipIf(TEST_JUJU, "Tested allocation/deployment with Juju.")
 
1493
    @skipIf(TEST_CUSTOM_IMAGES, "Not testing CentOS. Testing custom images repository.")
1487
1494
    def test_deploy_machine_with_centos(self):
1488
1495
        self._deploy_alternative_os('centos70')
1489
1496
 
1511
1518
        expected = []
1512
1519
        if not USE_DELL_R630_SYSTEMS:
1513
1520
            expected = [get_config_value(self, 'default_osystem')]
1514
 
        if not TEST_JUJU:
 
1521
        if not TEST_JUJU and not TEST_CUSTOM_IMAGES:
1515
1522
            expected.append('centos')
1516
1523
        if TEST_WINDOWS and not TEST_JUJU:
1517
1524
            expected.append('windows')
1522
1529
        expected = []
1523
1530
        if not USE_DELL_R630_SYSTEMS:
1524
1531
            expected = [get_config_value(self, 'default_distro_series')]
1525
 
        if not TEST_JUJU:
 
1532
        if not TEST_JUJU and not TEST_CUSTOM_IMAGES:
1526
1533
            expected.append('centos70')
1527
1534
        if TEST_WINDOWS and not TEST_JUJU:
1528
1535
            expected.append('win2012hvr2')