Re: [libvirt-designer][PATCH] test: Add new SimpleDisk test

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
> ---
> 
> 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

Attachment: pgpYzbQ0s5kQ1.pgp
Description: PGP signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]