Ejemplo n.º 1
0
    def testChangeSnapshot(self):
        basename = "change-snapshot"
        infile = "tests/xmlparse-xml/%s-in.xml" % basename
        outfile = "tests/xmlparse-xml/%s-out.xml" % basename
        snap = virtinst.DomainSnapshot(conn, parsexml=file(infile).read())

        check = self._make_checker(snap)
        check("name", "offline-root-child1", "name-foo")
        check("state", "shutoff", "somestate")
        check("description", "offline desk", "foo\nnewline\n   indent")
        check("parent", "offline-root", "newparent")
        check("creationTime", 1375905916, 1234)
        check("memory_type", "no", "internal")

        check = self._make_checker(snap.disks[0])
        check("name", "hda", "hdb")
        check("snapshot", "internal", "no")

        utils.diff_compare(snap.get_xml_config(), outfile)
Ejemplo n.º 2
0
def testChangeSnapshot():
    conn = utils.URIs.open_testdefault_cached()
    basename = "change-snapshot"
    infile = DATADIR + "%s-in.xml" % basename
    outfile = DATADIR + "%s-out.xml" % basename
    snap = virtinst.DomainSnapshot(conn, parsexml=open(infile).read())

    check = _make_checker(snap)
    check("name", "offline-root-child1", "name-foo")
    check("state", "shutoff", "somestate")
    check("description", "offline desk", "foo\nnewline\n   indent")
    check("parent", "offline-root", "newparent")
    check("creationTime", 1375905916, 1234)
    check("memory_type", "no", "internal")

    check = _make_checker(snap.disks[0])
    check("name", "hda", "hdb")
    check("snapshot", "internal", "no")

    utils.diff_compare(snap.get_xml(), outfile)