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

« back to all changes in this revision

Viewing changes to tests/clonetest.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:
15
15
# MA 02110-1301 USA.
16
16
 
17
17
import unittest
18
 
import os, os.path
 
18
import os
19
19
import logging
20
 
import tests
 
20
 
 
21
import utils
21
22
 
22
23
from virtinst import CloneManager
23
24
CloneDesign = CloneManager.CloneDesign
50
51
        if tmpf not in clone_files and tmpf not in black_list:
51
52
            clone_files.append(tmpf)
52
53
 
53
 
conn = tests.open_testdriver()
 
54
conn = utils.open_testdriver()
54
55
 
55
56
def fake_is_uri_remote(ignore):
56
57
    return True
69
70
                      skip_list=None, compare=True):
70
71
        """Helper for comparing clone input/output from 2 xml files"""
71
72
        infile = os.path.join(clonexml_dir, filebase + "-in.xml")
72
 
        in_content = tests.read_file(infile)
 
73
        in_content = utils.read_file(infile)
73
74
 
74
75
        cloneobj = CloneDesign(connection=conn)
75
76
        cloneobj.original_xml = in_content
113
114
 
114
115
        cloneobj.setup()
115
116
 
116
 
        tests.diff_compare(cloneobj.clone_xml, outfile)
 
117
        utils.diff_compare(cloneobj.clone_xml, outfile)
117
118
 
118
119
    def _clone_define(self, filebase):
119
120
        """Take the valid output xml and attempt to define it on the
120
121
           connection to ensure we don't get any errors"""
121
122
        outfile = os.path.join(clonexml_dir, filebase + "-out.xml")
122
 
        outxml = tests.read_file(outfile)
 
123
        outxml = utils.read_file(outfile)
123
124
 
124
125
        vm = None
125
126
        try:
137
138
 
138
139
            vm = None
139
140
            try:
140
 
                vm = conn.defineXML(tests.read_file(infile))
 
141
                vm = conn.defineXML(utils.read_file(infile))
141
142
 
142
143
                cloneobj = CloneDesign(connection=conn)
143
144
                cloneobj.original_guest = ORIG_NAME
234
235
                                 "failure.")
235
236
        except (ValueError, RuntimeError), e:
236
237
            logging.debug("Received expected exception: %s" % str(e))
237