def testVol(self): basename = "pool-dir-vol" infile = "tests/xmlparse-xml/%s-in.xml" % basename outfile = "tests/xmlparse-xml/%s-out.xml" % basename vol = virtinst.StorageVolume(conn, parsexml=file(infile).read()) check = self._make_checker(vol) check("key", None, "fookey") check("capacity", 10737418240, 2000) check("allocation", 5368709120, 1000) check("format", "raw", "qcow2") check("target_path", None, "/foo/bar") check("backing_store", "/foo/bar/baz", "/my/backing") check("lazy_refcounts", False, True) check = self._make_checker(vol.permissions) check("mode", "0700", "0744") check("owner", "10736", "10000") check("group", "10736", "10000") check("label", None, "foo.label") utils.diff_compare(vol.get_xml_config(), outfile)
def testVol(): conn = utils.URIs.open_testdefault_cached() basename = "pool-dir-vol" infile = DATADIR + "%s-in.xml" % basename outfile = DATADIR + "%s-out.xml" % basename vol = virtinst.StorageVolume(conn, parsexml=open(infile).read()) check = _make_checker(vol) check("type", None, "file") check("key", None, "fookey") check("capacity", 10737418240, 2000) check("allocation", 5368709120, 1000) check("format", "raw", "qcow2") check("target_path", None, "/foo/bar") check("backing_store", "/foo/bar/baz", "/my/backing") check("lazy_refcounts", False, True) check = _make_checker(vol.permissions) check("mode", "0700", "0744") check("owner", "10736", "10000") check("group", "10736", "10000") check("label", None, "foo.label") utils.diff_compare(vol.get_xml(), outfile)