[libvirt] [libvirt-designer][PATCH] test: Add new SimpleDisk test
Christophe Fergeau
cfergeau at redhat.com
Wed Mar 4 12:34:47 UTC 2015
On Wed, Mar 04, 2015 at 10:50:57AM +0100, Michal Privoznik wrote:
> This test is meant for adding CDROM, floppy and disk to a domain.
> For now, each method has _file and _device variant, which are
> tested for now.
>
> Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
> ---
>
> Funny, when reviewing Chritophe's patches, I've found one forgotten branch too.
>
> libvirt-designer/test-designer-domain.c | 101 ++++++++++++++++++++++++++++++++
> 1 file changed, 101 insertions(+)
>
> diff --git a/libvirt-designer/test-designer-domain.c b/libvirt-designer/test-designer-domain.c
> index bbd5a28..90f7e68 100644
> --- a/libvirt-designer/test-designer-domain.c
> +++ b/libvirt-designer/test-designer-domain.c
> @@ -125,6 +125,41 @@ static const gchar *capslxcxml =
> " </guest>"
> "</capabilities>";
>
> +static const gchar *domain_machine_simple_iso_result =
> + "<domain>\n"
> + " <devices>\n"
> + " <disk type=\"file\">\n"
> + " <source file=\"/foo/bar1\"/>\n"
> + " <driver name=\"qemu\" type=\"raw\"/>\n"
> + " <target bus=\"ide\" dev=\"hda\"/>\n"
> + " </disk>\n"
> + " <disk type=\"block\">\n"
> + " <source dev=\"/foo/bar2\"/>\n"
> + " <driver name=\"qemu\" type=\"raw\"/>\n"
> + " <target bus=\"ide\" dev=\"hdb\"/>\n"
> + " </disk>\n"
> + " <disk type=\"file\">\n"
> + " <source file=\"/foo/bar3\"/>\n"
> + " <driver name=\"qemu\" type=\"qcow2\"/>\n"
> + " <target bus=\"ide\" dev=\"hdc\"/>\n"
> + " </disk>\n"
> + " <disk type=\"block\">\n"
> + " <source dev=\"/foo/bar4\"/>\n"
> + " <driver name=\"qemu\" type=\"raw\"/>\n"
> + " <target bus=\"ide\" dev=\"hdd\"/>\n"
> + " </disk>\n"
> + " <disk type=\"file\">\n"
> + " <source file=\"/foo/bar5\"/>\n"
> + " <driver name=\"qemu\" type=\"bochs\"/>\n"
> + " <target bus=\"ide\" dev=\"hde\"/>\n"
> + " </disk>\n"
> + " <disk type=\"block\">\n"
> + " <source dev=\"/foo/bar6\"/>\n"
> + " <driver name=\"qemu\" type=\"raw\"/>\n"
> + " <target bus=\"ide\" dev=\"hdf\"/>\n"
> + " </disk>\n"
> + " </devices>\n"
> + "</domain>";
>
> static void test_domain_machine_setup(GVirDesignerDomain **design, gconstpointer opaque)
> {
> @@ -142,6 +177,49 @@ static void test_domain_machine_setup(GVirDesignerDomain **design, gconstpointer
> }
>
>
> +static void test_domain_machine_simple_disk_setup(GVirDesignerDomain **design, gconstpointer opaque)
> +{
> + GError *error = NULL;
> + GVirConfigDomainDisk *disk;
> + OsinfoOs *os = osinfo_os_new("http://myoperatingsystem/amazing/4.2");
> + OsinfoDb *db = osinfo_db_new();
> + OsinfoPlatform *platform = osinfo_platform_new("http://myhypervisor.org/awesome/6.6.6");
> + GVirConfigCapabilities *caps = gvir_config_capabilities_new_from_xml(capsqemuxml, NULL);
> +
> + *design = gvir_designer_domain_new(db, os, platform, caps);
You could calll test_domain_machine_setup() here to save a bit of
typing/c&p
ACK without or with that change.
Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20150304/0731cbfa/attachment-0001.sig>
More information about the libvir-list
mailing list