~ubuntu-branches/ubuntu/quantal/virtinst/quantal-proposed

« back to all changes in this revision

Viewing changes to tests/urltest.py

  • Committer: Bazaar Package Importer
  • Author(s): Marc Deslauriers
  • Date: 2011-02-01 15:40:11 UTC
  • mfrom: (1.3.16 experimental)
  • Revision ID: james.westby@ubuntu.com-20110201154011-op0nusgc240xajvb
Tags: 0.500.5-1ubuntu1
* Merge from debian experimental. Remaining changes:
  - debian/patches/9001_Ubuntu.patch:
     + Updated to add maverick and natty to OS list and enable virtio
       for them.
  - debian/patches/9003-fix-path-to-hvmloader-in-testsuite.patch: adjust
    testsuite for 0001-fix-path-to-hvmloader.patch and
    0002-Fix-path-to-pygrub.patch. (refreshed)
  - debian/control: added acl package to depends.
  - Demote virt-viewer to Suggests, as it's in universe.
  - Recommends libvirt-bin
* Removed patches:
  - debian/patches/9002-libvirt_disk_format.patch: Upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
import re
30
30
import urlgrabber.progress
31
31
import platform
32
 
import tests
 
32
import utils
33
33
import libvirt
34
34
import virtinst
35
35
 
36
36
# Filters for including/excluding certain distros.
37
 
MATCH_FILTER=".*"
 
37
MATCH_FILTER = ".*"
38
38
 
39
39
# Variable used to store a local iso or dir path to check for a distro
40
40
# Specified via 'python setup.py test_urls --path"
47
47
OLD_OPENSUSE_BASEURL = "http://ftp5.gwdg.de/pub/opensuse/discontinued/distribution/%s/repo/oss"
48
48
 
49
49
# ISO Code specific URLs
50
 
UBUNTU_BASEURL="http://us.archive.ubuntu.com/ubuntu/dists/%s/main/installer-%s"
 
50
UBUNTU_BASEURL = "http://us.archive.ubuntu.com/ubuntu/dists/%s/main/installer-%s"
51
51
DEBIAN_BASEURL = "http://ftp.us.debian.org/debian/dists/%s/main/installer-%s/"
52
52
 
53
53
# Static URLs
57
57
SCIENTIFIC_BASEURL = "http://ftp.scientificlinux.org/linux/scientific/%s/%s/"
58
58
 
59
59
# Regex matching distro names that don't have xen kernels.
60
 
NOXEN_FILTER=".*ubuntu.*|.*etch.*|.*mandriva.*|.*lenny-64.*|.*centos-4.0.*|.*scientific-4.0.*"
 
60
NOXEN_FILTER = ".*ubuntu.*|.*etch.*|.*mandriva.*|.*lenny-64.*|.*centos-4.0.*|.*scientific-4.0.*"
61
61
 
62
62
# Doesn't appear to be a simple boot iso in newer suse trees
63
 
NOBOOTISO_FILTER=".*opensuse11.*|.*opensuse10.3.*|.*opensuse10.0.*"
 
63
NOBOOTISO_FILTER = ".*opensuse11.*|.*opensuse10.3.*|.*opensuse10.0.*"
64
64
 
65
65
# Opensuse < 10.3 (and some sles) require crazy rpm hacking to get a bootable
66
66
# kernel. We expect failure in this case since our test harness doesn't
67
67
# actually fetch anything
68
 
EXPECT_XEN_FAIL=".*opensuse10.2.*|.*opensuse10.0.*"
 
68
EXPECT_XEN_FAIL = ".*opensuse10.2.*|.*opensuse10.0.*"
69
69
 
70
70
# Return the expected Distro class for the passed distro label
71
71
def distroClass(distname):
89
89
urls = {
90
90
 
91
91
    # Fedora Distros
92
 
    "fedora7" : {
93
 
        'i386'  : FEDORA_BASEURL % ("7", "i386"),
94
 
        'x86_64': FEDORA_BASEURL % ("7", "x86_64"),
95
 
        'distro': ("linux", "fedora7")
96
 
    },
97
 
    "fedora8" : {
98
 
        'i386'  : FEDORA_BASEURL % ("8", "i386"),
99
 
        'x86_64': FEDORA_BASEURL % ("8", "x86_64"),
100
 
        'distro': ("linux", "fedora8")
101
 
    },
102
 
    "fedora9" : {
103
 
        'i386'  : FEDORA_BASEURL % ("9", "i386"),
104
 
        'x86_64': FEDORA_BASEURL % ("9", "x86_64"),
105
 
        'distro': ("linux", "fedora9")
106
 
    },
107
 
    "fedora10" : {
108
 
        'i386'  : FEDORA_BASEURL % ("10", "i386"),
109
 
        'x86_64': FEDORA_BASEURL % ("10", "x86_64"),
110
 
        'distro': ("linux", "fedora10")
111
 
    },
112
92
    "fedora11" : {
113
93
        'i386'  : FEDORA_BASEURL % ("11", "i386"),
114
94
        'x86_64': FEDORA_BASEURL % ("11", "x86_64"),
119
99
        'x86_64': FEDORA_BASEURL % ("12", "x86_64"),
120
100
        'distro': ("linux", "fedora12")
121
101
    },
 
102
    "fedora13" : {
 
103
        'i386'  : FEDORA_BASEURL % ("13", "i386"),
 
104
        'x86_64': FEDORA_BASEURL % ("13", "x86_64"),
 
105
        'distro': ("linux", "fedora13")
 
106
    },
122
107
    "fedora-rawhide" : {
123
108
        #'i386'  : FEDORA_RAWHIDE_BASEURL % ("i386"),
124
109
        #'x86_64': FEDORA_RAWHIDE_BASEURL % ("x86_64"),
256
241
 
257
242
    def setUp(self):
258
243
        self.meter = urlgrabber.progress.BaseMeter()
259
 
        if tests.debug:
 
244
        if utils.get_debug():
260
245
            self.meter = urlgrabber.progress.TextMeter()
261
246
 
262
247
    def _fetchLocalMedia(self, mediapath):
361
346
                logging.debug("Known lack of boot.iso in %s tree. Skipping." \
362
347
                              % distname)
363
348
            else:
364
 
                boot = hvmstore.acquireBootDisk(fetcher, self.meter)
 
349
                boot = hvmstore.acquireBootDisk(testguest, fetcher, self.meter)
365
350
                logging.debug("acquireBootDisk: %s" % str(boot))
366
351
 
367
352
                if boot != True:
430
415
                logging.debug("Excluding '%s' from exclude filter." % label)
431
416
                continue
432
417
 
433
 
            if urls[label].has_key("distro"):
 
418
            if "distro" in urls[label]:
434
419
                distro_info = urls[label]["distro"]
435
420
 
436
421
            for arch, url in urls[label].items():
460
445
                    assertions += 1
461
446
 
462
447
        if assertions != 0:
463
 
            raise AssertionError("Found %d errors in local fetch tests." %
 
448
            raise AssertionError("Found %d errors in local fetch utils." %
464
449
                                 assertions)